Blame SOURCES/gcc12-detect-sapphirerapids.patch

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