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

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