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

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