Blame SOURCES/gcc12-detect-sapphirerapids.patch

91f6c7
commit d644dfe36d9733c767af62d37250253ced6efd8c
91f6c7
Author: Cui,Lili <lili.cui@intel.com>
91f6c7
Date:   Mon Nov 7 11:25:41 2022 +0800
91f6c7
91f6c7
    Remove AVX512_VP2INTERSECT from PTA_SAPPHIRERAPIDS
91f6c7
    
91f6c7
    gcc/ChangeLog:
91f6c7
    
91f6c7
            * config/i386/driver-i386.cc (host_detect_local_cpu):
91f6c7
            Move sapphirerapids out of AVX512_VP2INTERSECT.
91f6c7
            * config/i386/i386.h: Remove AVX512_VP2INTERSECT from PTA_SAPPHIRERAPIDS
91f6c7
            * doc/invoke.texi: Remove AVX512_VP2INTERSECT from SAPPHIRERAPIDS
91f6c7
    
91f6c7
    (cherry picked from commit d644dfe36d9733c767af62d37250253ced6efd8c)
91f6c7
91f6c7
diff --git a/gcc/config/i386/driver-i386.cc b/gcc/config/i386/driver-i386.cc
91f6c7
index 9e0ae0b2baa..fcf23fd921d 100644
91f6c7
--- a/gcc/config/i386/driver-i386.cc
91f6c7
+++ b/gcc/config/i386/driver-i386.cc
91f6c7
@@ -574,15 +574,12 @@ const char *host_detect_local_cpu (int argc, const char **argv)
91f6c7
 	      /* This is unknown family 0x6 CPU.  */
91f6c7
 	      if (has_feature (FEATURE_AVX))
91f6c7
 		{
91f6c7
+		  /* Assume Tiger Lake */
91f6c7
 		  if (has_feature (FEATURE_AVX512VP2INTERSECT))
91f6c7
-		    {
91f6c7
-		      if (has_feature (FEATURE_TSXLDTRK))
91f6c7
-			/* Assume Sapphire Rapids.  */
91f6c7
-			cpu = "sapphirerapids";
91f6c7
-		      else
91f6c7
-			/* Assume Tiger Lake */
91f6c7
-			cpu = "tigerlake";
91f6c7
-		    }
91f6c7
+		    cpu = "tigerlake";
91f6c7
+		  /* Assume Sapphire Rapids.  */
91f6c7
+		  else if (has_feature (FEATURE_TSXLDTRK))
91f6c7
+		    cpu = "sapphirerapids";
91f6c7
 		  /* Assume Cooper Lake */
91f6c7
 		  else if (has_feature (FEATURE_AVX512BF16))
91f6c7
 		    cpu = "cooperlake";
91f6c7
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
91f6c7
index 363082ba47b..a61c32b8957 100644
91f6c7
--- a/gcc/config/i386/i386.h
91f6c7
+++ b/gcc/config/i386/i386.h
91f6c7
@@ -2328,10 +2328,9 @@ constexpr wide_int_bitmask PTA_ICELAKE_SERVER = PTA_ICELAKE_CLIENT
91f6c7
 constexpr wide_int_bitmask PTA_TIGERLAKE = PTA_ICELAKE_CLIENT | PTA_MOVDIRI
91f6c7
   | PTA_MOVDIR64B | PTA_CLWB | PTA_AVX512VP2INTERSECT | PTA_KL | PTA_WIDEKL;
91f6c7
 constexpr wide_int_bitmask PTA_SAPPHIRERAPIDS = PTA_ICELAKE_SERVER | PTA_MOVDIRI
91f6c7
-  | PTA_MOVDIR64B | PTA_AVX512VP2INTERSECT | PTA_ENQCMD | PTA_CLDEMOTE
91f6c7
-  | PTA_PTWRITE | PTA_WAITPKG | PTA_SERIALIZE | PTA_TSXLDTRK | PTA_AMX_TILE
91f6c7
-  | PTA_AMX_INT8 | PTA_AMX_BF16 | PTA_UINTR | PTA_AVXVNNI | PTA_AVX512FP16
91f6c7
-  | PTA_AVX512BF16;
91f6c7
+  | PTA_MOVDIR64B | PTA_ENQCMD | PTA_CLDEMOTE | PTA_PTWRITE | PTA_WAITPKG
91f6c7
+  | PTA_SERIALIZE | PTA_TSXLDTRK | PTA_AMX_TILE | PTA_AMX_INT8 | PTA_AMX_BF16
91f6c7
+  | PTA_UINTR | PTA_AVXVNNI | PTA_AVX512FP16 | PTA_AVX512BF16;
91f6c7
 constexpr wide_int_bitmask PTA_KNL = PTA_BROADWELL | PTA_AVX512PF
91f6c7
   | PTA_AVX512ER | PTA_AVX512F | PTA_AVX512CD | PTA_PREFETCHWT1;
91f6c7
 constexpr wide_int_bitmask PTA_BONNELL = PTA_CORE2 | PTA_MOVBE;
91f6c7
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
91f6c7
index 3749e06f13e..cee057a70bf 100644
91f6c7
--- a/gcc/doc/invoke.texi
91f6c7
+++ b/gcc/doc/invoke.texi
91f6c7
@@ -31541,11 +31541,11 @@ Intel sapphirerapids CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
91f6c7
 SSSE3, SSE4.1, SSE4.2, POPCNT, CX16, SAHF, FXSR, AVX, XSAVE, PCLMUL, FSGSBASE,
91f6c7
 RDRND, F16C, AVX2, BMI, BMI2, LZCNT, FMA, MOVBE, HLE, RDSEED, ADCX, PREFETCHW,
91f6c7
 AES, CLFLUSHOPT, XSAVEC, XSAVES, SGX, AVX512F, AVX512VL, AVX512BW, AVX512DQ,
91f6c7
-AVX512CD, PKU, AVX512VBMI, AVX512IFMA, SHA, AVX512VNNI, GFNI, VAES, AVX512VBMI2
91f6c7
+AVX512CD, PKU, AVX512VBMI, AVX512IFMA, SHA, AVX512VNNI, GFNI, VAES, AVX512VBMI2,
91f6c7
 VPCLMULQDQ, AVX512BITALG, RDPID, AVX512VPOPCNTDQ, PCONFIG, WBNOINVD, CLWB,
91f6c7
-MOVDIRI, MOVDIR64B, AVX512VP2INTERSECT, ENQCMD, CLDEMOTE, PTWRITE, WAITPKG,
91f6c7
-SERIALIZE, TSXLDTRK, UINTR, AMX-BF16, AMX-TILE, AMX-INT8, AVX-VNNI, AVX512FP16
91f6c7
-and AVX512BF16 instruction set support.
91f6c7
+MOVDIRI, MOVDIR64B, ENQCMD, CLDEMOTE, PTWRITE, WAITPKG, SERIALIZE, TSXLDTRK,
91f6c7
+UINTR, AMX-BF16, AMX-TILE, AMX-INT8, AVX-VNNI, AVX512FP16 and AVX512BF16
91f6c7
+instruction set support.
91f6c7
 
91f6c7
 @item alderlake
91f6c7
 Intel Alderlake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,