Skip to content

Commit d11fd66

Browse files
authored
[X86] Remove WIDEKL feature from Pantherlake and Clearwaterforest (#148184)
According to Intel [SDM088](https://cdrdv2.intel.com/v1/dl/getContent/671200) Volume 1, Chapter 2.4, Key Locker will be removed from 2025 onwards products.
1 parent fe40358 commit d11fd66

File tree

3 files changed

+27
-23
lines changed

3 files changed

+27
-23
lines changed

clang/test/Preprocessor/predefined-arch-macros.c

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2556,25 +2556,25 @@
25562556

25572557
// RUN: %clang -march=sierraforest -m32 -E -dM %s -o - 2>&1 \
25582558
// RUN: --target=i386 \
2559-
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_SRF_M32
2559+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_SRF_M32,CHECK_KL_M32
25602560
// RUN: %clang -march=grandridge -m32 -E -dM %s -o - 2>&1 \
25612561
// RUN: --target=i386 \
2562-
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_SRF_M32
2562+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_SRF_M32,CHECK_KL_M32
25632563
// RUN: %clang -march=arrowlake -m32 -E -dM %s -o - 2>&1 \
25642564
// RUN: -target i386-unknown-linux \
2565-
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ARL_M32
2565+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_KL_M32
25662566
// RUN: %clang -march=arrowlake-s -m32 -E -dM %s -o - 2>&1 \
25672567
// RUN: -target i386-unknown-linux \
2568-
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_ARLS_M32
2568+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_ARLS_M32,CHECK_KL_M32
25692569
// RUN: %clang -march=lunarlake -m32 -E -dM %s -o - 2>&1 \
25702570
// RUN: -target i386-unknown-linux \
2571-
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_ARLS_M32
2571+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_ARLS_M32,CHECK_KL_M32
25722572
// RUN: %clang -march=pantherlake -m32 -E -dM %s -o - 2>&1 \
25732573
// RUN: -target i386-unknown-linux \
2574-
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_ARLS_M32,CHECK_PTL_M32
2574+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_ARLS_M32,CHECK_PTL_M32,CHECK_NKL_M32
25752575
// RUN: %clang -march=clearwaterforest -m32 -E -dM %s -o - 2>&1 \
25762576
// RUN: -target i386-unknown-linux \
2577-
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_SRF_M32,CHECK_ARLS_M32,CHECK_PTL_M32,CHECK_CWF_M32
2577+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_SRF_M32,CHECK_ARLS_M32,CHECK_PTL_M32,CHECK_CWF_M32,CHECK_NKL_M32
25782578
// CHECK_ARL_M32: #define __ADX__ 1
25792579
// CHECK_ARL_M32: #define __AES__ 1
25802580
// CHECK_ARL_M32: #define __AVX2__ 1
@@ -2601,7 +2601,8 @@
26012601
// CHECK_ARL_M32: #define __GFNI__ 1
26022602
// CHECK_ARL_M32: #define __HRESET__ 1
26032603
// CHECK_ARL_M32: #define __INVPCID__ 1
2604-
// CHECK_ARL_M32: #define __KL__ 1
2604+
// CHECK_KL_M32: #define __KL__ 1
2605+
// CHECK_NKL_M32-NOT: __KL__
26052606
// CHECK_ARL_M32: #define __LZCNT__ 1
26062607
// CHECK_ARL_M32: #define __MMX__ 1
26072608
// CHECK_ARL_M32: #define __MOVBE__ 1
@@ -2645,7 +2646,8 @@
26452646
// CHECK_ARL_M32: #define __VAES__ 1
26462647
// CHECK_ARL_M32: #define __VPCLMULQDQ__ 1
26472648
// CHECK_ARL_M32: #define __WAITPKG__ 1
2648-
// CHECK_ARL_M32: #define __WIDEKL__ 1
2649+
// CHECK_KL_M32: #define __WIDEKL__ 1
2650+
// CHECK_NKL_M32-NOT: __WIDEKL__
26492651
// CHECK_ARL_M32: #define __XSAVEC__ 1
26502652
// CHECK_ARL_M32: #define __XSAVEOPT__ 1
26512653
// CHECK_ARL_M32: #define __XSAVES__ 1
@@ -2659,25 +2661,25 @@
26592661

26602662
// RUN: %clang -march=sierraforest -m64 -E -dM %s -o - 2>&1 \
26612663
// RUN: --target=i386 \
2662-
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_SRF_M64
2664+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_SRF_M64,CHECK_KL_M64
26632665
// RUN: %clang -march=grandridge -m64 -E -dM %s -o - 2>&1 \
26642666
// RUN: --target=i386 \
2665-
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_SRF_M64
2667+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_SRF_M64,CHECK_KL_M64
26662668
// RUN: %clang -march=arrowlake -m64 -E -dM %s -o - 2>&1 \
26672669
// RUN: -target i386-unknown-linux \
2668-
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ARL_M64
2670+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_KL_M64
26692671
// RUN: %clang -march=arrowlake-s -m64 -E -dM %s -o - 2>&1 \
26702672
// RUN: -target i386-unknown-linux \
2671-
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_ARLS_M64
2673+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_ARLS_M64,CHECK_KL_M64
26722674
// RUN: %clang -march=lunarlake -m64 -E -dM %s -o - 2>&1 \
26732675
// RUN: -target i386-unknown-linux \
2674-
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_ARLS_M64
2676+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_ARLS_M64,CHECK_KL_M64
26752677
// RUN: %clang -march=pantherlake -m64 -E -dM %s -o - 2>&1 \
26762678
// RUN: -target i386-unknown-linux \
2677-
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_ARLS_M64,CHECK_PTL_M64
2679+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_ARLS_M64,CHECK_PTL_M64,CHECK_NKL_M64
26782680
// RUN: %clang -march=clearwaterforest -m64 -E -dM %s -o - 2>&1 \
26792681
// RUN: -target i386-unknown-linux \
2680-
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_SRF_M64,CHECK_ARLS_M64,CHECK_PTL_M64,CHECK_CWF_M64
2682+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_SRF_M64,CHECK_ARLS_M64,CHECK_PTL_M64,CHECK_CWF_M64,CHECK_NKL_M64
26812683
// CHECK_ARL_M64: #define __ADX__ 1
26822684
// CHECK_ARL_M64: #define __AES__ 1
26832685
// CHECK_ARL_M64: #define __AVX2__ 1
@@ -2704,7 +2706,8 @@
27042706
// CHECK_ARL_M64: #define __GFNI__ 1
27052707
// CHECK_ARL_M64: #define __HRESET__ 1
27062708
// CHECK_ARL_M64: #define __INVPCID__ 1
2707-
// CHECK_ARL_M64: #define __KL__ 1
2709+
// CHECK_KL_M64: #define __KL__ 1
2710+
// CHECK_NKL_M64-NOT: __KL__
27082711
// CHECK_ARL_M64: #define __LZCNT__ 1
27092712
// CHECK_ARL_M64: #define __MMX__ 1
27102713
// CHECK_ARL_M64: #define __MOVBE__ 1
@@ -2749,7 +2752,8 @@
27492752
// CHECK_ARL_M64: #define __VAES__ 1
27502753
// CHECK_ARL_M64: #define __VPCLMULQDQ__ 1
27512754
// CHECK_ARL_M64: #define __WAITPKG__ 1
2752-
// CHECK_ARL_M64: #define __WIDEKL__ 1
2755+
// CHECK_KL_M64: #define __WIDEKL__ 1
2756+
// CHECK_NKL_M64-NOT: __WIDEKL__
27532757
// CHECK_ARL_M64: #define __XSAVEC__ 1
27542758
// CHECK_ARL_M64: #define __XSAVEOPT__ 1
27552759
// CHECK_ARL_M64: #define __XSAVES__ 1

llvm/lib/Target/X86/X86.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,7 @@ def ProcessorFeatures {
13311331
// Pantherlake
13321332
list<SubtargetFeature> PTLAdditionalFeatures = [FeaturePREFETCHI];
13331333
list<SubtargetFeature> PTLFeatures =
1334-
!listconcat(ARLSFeatures, PTLAdditionalFeatures);
1334+
!listremove(!listconcat(ARLSFeatures, PTLAdditionalFeatures), [FeatureWIDEKL]);
13351335

13361336

13371337
// Clearwaterforest
@@ -1342,7 +1342,7 @@ def ProcessorFeatures {
13421342
FeatureSM4,
13431343
FeatureUSERMSR];
13441344
list<SubtargetFeature> CWFFeatures =
1345-
!listconcat(SRFFeatures, CWFAdditionalFeatures);
1345+
!listremove(!listconcat(SRFFeatures, CWFAdditionalFeatures), [FeatureWIDEKL]);
13461346

13471347
// Knights Landing
13481348
list<SubtargetFeature> KNLFeatures = [FeatureX87,

llvm/lib/TargetParser/X86TargetParser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ constexpr FeatureBitset FeaturesArrowlakeS =
176176
FeaturesArrowlake | FeatureAVXVNNIINT16 | FeatureSHA512 | FeatureSM3 |
177177
FeatureSM4;
178178
constexpr FeatureBitset FeaturesPantherlake =
179-
FeaturesArrowlakeS | FeaturePREFETCHI;
179+
FeaturesArrowlakeS ^ FeatureWIDEKL | FeaturePREFETCHI;
180180
constexpr FeatureBitset FeaturesClearwaterforest =
181-
FeaturesSierraforest | FeatureAVXVNNIINT16 | FeatureSHA512 | FeatureSM3 |
182-
FeatureSM4 | FeaturePREFETCHI | FeatureUSERMSR;
181+
FeaturesSierraforest ^ FeatureWIDEKL | FeatureAVXVNNIINT16 | FeatureSHA512 |
182+
FeatureSM3 | FeatureSM4 | FeaturePREFETCHI | FeatureUSERMSR;
183183

184184
// Geode Processor.
185185
constexpr FeatureBitset FeaturesGeode =

0 commit comments

Comments
 (0)