This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

VIA C3-2 support.


The Nehemiah (model 9) core of the VIA C3 is significantly different
from the earlier C3s. It now has cmov (so we can generate i686
code for it now), and it dropped 3dnow, and implements SSE instead.
This means that the existing -march=c3 will generate code that the
C3-2 cannot run (and vice versa)

Simple benchmarks on the C3-2 show that scheduling for 686 offers greater
improvement than scheduling for 486 like on previous C3s.

I'm uncertain my choice to alias target_cpu_default2=TARGET_CPU_DEFAULT_pentium3
is correct, but it seems the closest match, with minimal code addition.

I've bootstrapped and tested this on i686-linux, and everything
seems to be as expected.

Patch below is based upon Jeff Garziks original that got merged.
As before with Jeff, I don't have a copyright assignment on file,
but I'm prepared to offer this patch into public domain and let
anyone do what they like with it.

Patch is against cvs HEAD.

		Dave

Index: ChangeLog
===================================================================
RCS file: /cvsroot/gcc/gcc/ChangeLog,v
retrieving revision 1.674
diff -u -p -u -r1.674 ChangeLog
--- ChangeLog	8 Feb 2003 10:52:39 -0000	1.674
+++ ChangeLog	9 Feb 2003 14:44:51 -0000
@@ -1,3 +1,9 @@
+2003-02-07  Dave Jones <davej@codemonkey.org.uk>
+
+	* config.gcc: Split C3 support into march=c3 and march=c3-2
+	* config/i386/i386.c: Define c3-2 as a 686 with SSE.
+	* doc/invoke.texi: Extra alias.
+
 2003-02-08  Laurynas Biveinis  <laurynas.biveinis@mif.vu.lt>
 
 	* MAINTAINERS: Update my email.
Index: gcc/config.gcc
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.282
diff -u -p -u -r1.282 config.gcc
--- gcc/config.gcc	6 Feb 2003 21:17:12 -0000	1.282
+++ gcc/config.gcc	9 Feb 2003 14:44:51 -0000
@@ -2730,7 +2730,7 @@ i686-*-* | i786-*-*)
 		pentium2-*)
 			target_cpu_default2=TARGET_CPU_DEFAULT_pentium2
 			;;
-		pentium3-*)
+		pentium3-*|c3-2-*)
 			target_cpu_default2=TARGET_CPU_DEFAULT_pentium3
 			;;
 		pentium4-*)
Index: gcc/config/i386/i386.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.531
diff -u -p -u -r1.531 i386.c
--- gcc/config/i386/i386.c	9 Feb 2003 12:35:27 -0000	1.531
+++ gcc/config/i386/i386.c	9 Feb 2003 14:44:56 -0000
@@ -1075,6 +1075,7 @@ override_options ()
       {"winchip-c6", PROCESSOR_I486, PTA_MMX},
       {"winchip2", PROCESSOR_I486, PTA_MMX | PTA_3DNOW},
       {"c3", PROCESSOR_I486, PTA_MMX | PTA_3DNOW},
+      {"c3-2", PROCESSOR_PENTIUMPRO, PTA_MMX | PTA_PREFETCH_SSE | PTA_SSE},
       {"i686", PROCESSOR_PENTIUMPRO, 0},
       {"pentiumpro", PROCESSOR_PENTIUMPRO, 0},
       {"pentium2", PROCESSOR_PENTIUMPRO, PTA_MMX},
Index: gcc/doc/invoke.texi
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/doc/invoke.texi,v
retrieving revision 1.235
diff -u -p -u -r1.235 invoke.texi
--- gcc/doc/invoke.texi	8 Feb 2003 14:51:05 -0000	1.235
+++ gcc/doc/invoke.texi	9 Feb 2003 14:45:01 -0000
@@ -7880,7 +7880,8 @@ for the ABI and the set of available ins
 @samp{pentium}, @samp{pentium-mmx}, @samp{pentiumpro}, @samp{pentium2},
 @samp{pentium3}, @samp{pentium4}, @samp{k6}, @samp{k6-2}, @samp{k6-3},
 @samp{athlon}, @samp{athlon-tbird}, @samp{athlon-4}, @samp{athlon-xp},
-@samp{athlon-mp}, @samp{winchip-c6}, @samp{winchip2}, @samp{k8} and @samp{c3}.
+@samp{athlon-mp}, @samp{winchip-c6}, @samp{winchip2}, @samp{k8}, @samp{c3}
+and @samp{c3-2}.
 
 While picking a specific @var{cpu-type} will schedule things appropriately
 for that particular chip, the compiler will not generate any code that
-- 
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]