Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 22 additions & 18 deletions clang/test/Preprocessor/predefined-arch-macros.c
Original file line number Diff line number Diff line change
Expand Up @@ -2556,25 +2556,25 @@

// RUN: %clang -march=sierraforest -m32 -E -dM %s -o - 2>&1 \
// RUN: --target=i386 \
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_SRF_M32
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_SRF_M32,CHECK_KL_M32
// RUN: %clang -march=grandridge -m32 -E -dM %s -o - 2>&1 \
// RUN: --target=i386 \
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_SRF_M32
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_SRF_M32,CHECK_KL_M32
// RUN: %clang -march=arrowlake -m32 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ARL_M32
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_KL_M32
// RUN: %clang -march=arrowlake-s -m32 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_ARLS_M32
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_ARLS_M32,CHECK_KL_M32
// RUN: %clang -march=lunarlake -m32 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_ARLS_M32
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_ARLS_M32,CHECK_KL_M32
// RUN: %clang -march=pantherlake -m32 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_ARLS_M32,CHECK_PTL_M32
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_ARLS_M32,CHECK_PTL_M32,CHECK_NKL_M32
// RUN: %clang -march=clearwaterforest -m32 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_SRF_M32,CHECK_ARLS_M32,CHECK_PTL_M32,CHECK_CWF_M32
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_SRF_M32,CHECK_ARLS_M32,CHECK_PTL_M32,CHECK_CWF_M32,CHECK_NKL_M32
// CHECK_ARL_M32: #define __ADX__ 1
// CHECK_ARL_M32: #define __AES__ 1
// CHECK_ARL_M32: #define __AVX2__ 1
Expand All @@ -2601,7 +2601,8 @@
// CHECK_ARL_M32: #define __GFNI__ 1
// CHECK_ARL_M32: #define __HRESET__ 1
// CHECK_ARL_M32: #define __INVPCID__ 1
// CHECK_ARL_M32: #define __KL__ 1
// CHECK_KL_M32: #define __KL__ 1
// CHECK_NKL_M32-NOT: __KL__
// CHECK_ARL_M32: #define __LZCNT__ 1
// CHECK_ARL_M32: #define __MMX__ 1
// CHECK_ARL_M32: #define __MOVBE__ 1
Expand Down Expand Up @@ -2645,7 +2646,8 @@
// CHECK_ARL_M32: #define __VAES__ 1
// CHECK_ARL_M32: #define __VPCLMULQDQ__ 1
// CHECK_ARL_M32: #define __WAITPKG__ 1
// CHECK_ARL_M32: #define __WIDEKL__ 1
// CHECK_KL_M32: #define __WIDEKL__ 1
// CHECK_NKL_M32-NOT: __WIDEKL__
// CHECK_ARL_M32: #define __XSAVEC__ 1
// CHECK_ARL_M32: #define __XSAVEOPT__ 1
// CHECK_ARL_M32: #define __XSAVES__ 1
Expand All @@ -2659,25 +2661,25 @@

// RUN: %clang -march=sierraforest -m64 -E -dM %s -o - 2>&1 \
// RUN: --target=i386 \
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_SRF_M64
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_SRF_M64,CHECK_KL_M64
// RUN: %clang -march=grandridge -m64 -E -dM %s -o - 2>&1 \
// RUN: --target=i386 \
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_SRF_M64
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_SRF_M64,CHECK_KL_M64
// RUN: %clang -march=arrowlake -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ARL_M64
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_KL_M64
// RUN: %clang -march=arrowlake-s -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_ARLS_M64
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_ARLS_M64,CHECK_KL_M64
// RUN: %clang -march=lunarlake -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_ARLS_M64
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_ARLS_M64,CHECK_KL_M64
// RUN: %clang -march=pantherlake -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_ARLS_M64,CHECK_PTL_M64
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_ARLS_M64,CHECK_PTL_M64,CHECK_NKL_M64
// RUN: %clang -march=clearwaterforest -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_SRF_M64,CHECK_ARLS_M64,CHECK_PTL_M64,CHECK_CWF_M64
// 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
// CHECK_ARL_M64: #define __ADX__ 1
// CHECK_ARL_M64: #define __AES__ 1
// CHECK_ARL_M64: #define __AVX2__ 1
Expand All @@ -2704,7 +2706,8 @@
// CHECK_ARL_M64: #define __GFNI__ 1
// CHECK_ARL_M64: #define __HRESET__ 1
// CHECK_ARL_M64: #define __INVPCID__ 1
// CHECK_ARL_M64: #define __KL__ 1
// CHECK_KL_M64: #define __KL__ 1
// CHECK_NKL_M64-NOT: __KL__
// CHECK_ARL_M64: #define __LZCNT__ 1
// CHECK_ARL_M64: #define __MMX__ 1
// CHECK_ARL_M64: #define __MOVBE__ 1
Expand Down Expand Up @@ -2749,7 +2752,8 @@
// CHECK_ARL_M64: #define __VAES__ 1
// CHECK_ARL_M64: #define __VPCLMULQDQ__ 1
// CHECK_ARL_M64: #define __WAITPKG__ 1
// CHECK_ARL_M64: #define __WIDEKL__ 1
// CHECK_KL_M64: #define __WIDEKL__ 1
// CHECK_NKL_M64-NOT: __WIDEKL__
// CHECK_ARL_M64: #define __XSAVEC__ 1
// CHECK_ARL_M64: #define __XSAVEOPT__ 1
// CHECK_ARL_M64: #define __XSAVES__ 1
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/X86/X86.td
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ def ProcessorFeatures {
// Pantherlake
list<SubtargetFeature> PTLAdditionalFeatures = [FeaturePREFETCHI];
list<SubtargetFeature> PTLFeatures =
!listconcat(ARLSFeatures, PTLAdditionalFeatures);
!listremove(!listconcat(ARLSFeatures, PTLAdditionalFeatures), [FeatureWIDEKL]);


// Clearwaterforest
Expand All @@ -1342,7 +1342,7 @@ def ProcessorFeatures {
FeatureSM4,
FeatureUSERMSR];
list<SubtargetFeature> CWFFeatures =
!listconcat(SRFFeatures, CWFAdditionalFeatures);
!listremove(!listconcat(SRFFeatures, CWFAdditionalFeatures), [FeatureWIDEKL]);

// Knights Landing
list<SubtargetFeature> KNLFeatures = [FeatureX87,
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/TargetParser/X86TargetParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ constexpr FeatureBitset FeaturesArrowlakeS =
FeaturesArrowlake | FeatureAVXVNNIINT16 | FeatureSHA512 | FeatureSM3 |
FeatureSM4;
constexpr FeatureBitset FeaturesPantherlake =
FeaturesArrowlakeS | FeaturePREFETCHI;
FeaturesArrowlakeS ^ FeatureWIDEKL | FeaturePREFETCHI;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phoebewang I'm seeing gcc warnings:

/home/simon/LLVM/llvm-project/llvm/lib/TargetParser/X86TargetParser.cpp:179:24: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
  179 |     FeaturesArrowlakeS ^ FeatureWIDEKL | FeaturePREFETCHI;
/home/simon/LLVM/llvm-project/llvm/lib/TargetParser/X86TargetParser.cpp:181:26: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
  181 |     FeaturesSierraforest ^ FeatureWIDEKL | FeatureAVXVNNIINT16 | FeatureSHA512 |

Please can you add the appropriate parentheses?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, #149489. Thanks for the info.

constexpr FeatureBitset FeaturesClearwaterforest =
FeaturesSierraforest | FeatureAVXVNNIINT16 | FeatureSHA512 | FeatureSM3 |
FeatureSM4 | FeaturePREFETCHI | FeatureUSERMSR;
FeaturesSierraforest ^ FeatureWIDEKL | FeatureAVXVNNIINT16 | FeatureSHA512 |
FeatureSM3 | FeatureSM4 | FeaturePREFETCHI | FeatureUSERMSR;

// Geode Processor.
constexpr FeatureBitset FeaturesGeode =
Expand Down
Loading