Blame SOURCES/gcc12-detect-sapphirerapids.patch

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