Blame SOURCES/gcc32-i386-prefetch-sse.patch

6f1b0c
2004-07-09  Jakub Jelinek  <jakub@redhat.com>
6f1b0c
6f1b0c
	* Backport from mainline:
6f1b0c
	2004-07-08  Paolo Bonzini  <bonzini@gnu.org>
6f1b0c
		    Jakub Jelinek  <jakub@redhat.com>
6f1b0c
6f1b0c
	* config/i386/i386.c (override_options): Enable
6f1b0c
	SSE prefetches with -mtune, as long as we are
6f1b0c
	compiling for i686 or higher.  All i686 processors
6f1b0c
	accept SSE prefetches as NOPS, some i586's don't.
6f1b0c
6f1b0c
	2004-07-07  Jakub Jelinek  <jakub@redhat.com>
6f1b0c
6f1b0c
	* config/i386/i386.c (override_options): Don't set x86_prefetch_sse
6f1b0c
	from -mtune= option.
6f1b0c
6f1b0c
2004-07-08  Jakub Jelinek  <jakub@redhat.com>
6f1b0c
6f1b0c
	* gcc.mist-tests/i386-prefetch.exp (PREFETCH_SSE): Change all
6f1b0c
	-march=i386 into -march=i686.  Add -march=i686 -mcpu=prescott and
6f1b0c
	-march=prescott.
6f1b0c
6f1b0c
2003-08-04  Janis Johnson  <janis187@us.ibm.com>
6f1b0c
6f1b0c
	PR target/11739
6f1b0c
	* gcc.misc-tests/i386-prefetch.exp: Use -march=i386 when specifying
6f1b0c
	a value for -mcpu.
6f1b0c
6f1b0c
--- gcc/config/i386/i386.c.jj	2004-07-01 12:52:56.000000000 +0200
6f1b0c
+++ gcc/config/i386/i386.c	2004-08-12 14:26:55.039997547 +0200
6f1b0c
@@ -1064,11 +1064,17 @@ override_options ()
6f1b0c
 	ix86_cpu = processor_alias_table[i].processor;
6f1b0c
 	if (TARGET_64BIT && !(processor_alias_table[i].flags & PTA_64BIT))
6f1b0c
 	  error ("CPU you selected does not support x86-64 instruction set");
6f1b0c
+
6f1b0c
+	/* Intel CPUs have always interpreted SSE prefetch instructions as
6f1b0c
+	   NOPs; so, we can enable SSE prefetch instructions even when
6f1b0c
+	   -mtune (rather than -march) points us to a processor that has them.
6f1b0c
+	   However, the VIA C3 gives a SIGILL, so we only do that for i686 and
6f1b0c
+	   higher processors.  */
6f1b0c
+	if (TARGET_CMOVE && (processor_alias_table[i].flags & PTA_PREFETCH_SSE))
6f1b0c
+	  x86_prefetch_sse = true;
6f1b0c
 	break;
6f1b0c
       }
6f1b0c
 
6f1b0c
-  if (processor_alias_table[i].flags & PTA_PREFETCH_SSE)
6f1b0c
-    x86_prefetch_sse = true;
6f1b0c
   if (i == pta_size)
6f1b0c
     error ("bad value (%s) for -mcpu= switch", ix86_cpu_string);
6f1b0c
 
6f1b0c
--- gcc/testsuite/gcc.misc-tests/i386-prefetch.exp.jj	2002-01-18 19:41:41.000000000 +0100
6f1b0c
+++ gcc/testsuite/gcc.misc-tests/i386-prefetch.exp	2004-08-12 14:34:28.702060131 +0200
6f1b0c
@@ -24,14 +24,14 @@
6f1b0c
 # Do not generate prefetch instructions for the following options.
6f1b0c
 
6f1b0c
 set PREFETCH_NONE [list \
6f1b0c
-	{ -mcpu=i386 } \
6f1b0c
-	{ -mcpu=i486 } \
6f1b0c
-	{ -mcpu=i586 } \
6f1b0c
-	{ -mcpu=i686 } \
6f1b0c
-	{ -mcpu=pentium2 } \
6f1b0c
-	{ -mcpu=k6 } \
6f1b0c
-	{ -mcpu=k6-2 } \
6f1b0c
-	{ -mcpu=k6-3 } \
6f1b0c
+	{ -march=i386 -mcpu=i386 } \
6f1b0c
+	{ -march=i386 -mcpu=i486 } \
6f1b0c
+	{ -march=i386 -mcpu=i586 } \
6f1b0c
+	{ -march=i386 -mcpu=i686 } \
6f1b0c
+	{ -march=i386 -mcpu=pentium2 } \
6f1b0c
+	{ -march=i386 -mcpu=k6 } \
6f1b0c
+	{ -march=i386 -mcpu=k6-2 } \
6f1b0c
+	{ -march=i386 -mcpu=k6-3 } \
6f1b0c
 	{ -march=i386 } \
6f1b0c
 	{ -march=i486 } \
6f1b0c
 	{ -march=i586 } \
6f1b0c
@@ -44,12 +44,14 @@ set PREFETCH_NONE [list \
6f1b0c
 # instructions as nops.
6f1b0c
 
6f1b0c
 set PREFETCH_SSE [list \
6f1b0c
-	{ -mcpu=pentium3 } \
6f1b0c
-	{ -mcpu=pentium4 } \
6f1b0c
-	{ -mcpu=athlon } \
6f1b0c
-	{ -mcpu=athlon-4 } \
6f1b0c
+	{ -march=i686 -mcpu=pentium3 } \
6f1b0c
+	{ -march=i686 -mcpu=pentium4 } \
6f1b0c
+	{ -march=i686 -mcpu=prescott } \
6f1b0c
+	{ -march=i686 -mcpu=athlon } \
6f1b0c
+	{ -march=i686 -mcpu=athlon-4 } \
6f1b0c
 	{ -march=pentium3 } \
6f1b0c
-	{ -march=pentium4 } ]
6f1b0c
+	{ -march=pentium4 } \
6f1b0c
+	{ -march=prescott } ]
6f1b0c
 
6f1b0c
 # Generate 3DNow! prefetch instructions for the following.
6f1b0c