Skip to content

Commit

Permalink
[X86] Fix test Clang::CodeGen/builtin-cpu-supports.c failure
Browse files Browse the repository at this point in the history
The test failed after
8ad32ce

In https://github.com/gcc-mirror/gcc/blob/master/gcc/common/config/i386/i386-cpuinfo.h

FEATURE_AVX512CD = 23 and FEATURE_AVX512VBMI = 26, we should only add 2
features between them. New features should be inserted at the end.
  • Loading branch information
KanRobert committed Jun 25, 2024
1 parent b0e9b00 commit 4e0a0ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/include/llvm/TargetParser/X86TargetParser.def
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ X86_FEATURE_COMPAT(AVX512DQ, "avx512dq", 22)
X86_FEATURE_COMPAT(AVX512CD, "avx512cd", 23)
X86_FEATURE (NF, "nf")
X86_FEATURE (CF, "cf")
X86_FEATURE (ZU, "zu")
X86_FEATURE_COMPAT(AVX512VBMI, "avx512vbmi", 24)
X86_FEATURE_COMPAT(AVX512IFMA, "avx512ifma", 25)
X86_FEATURE_COMPAT(AVX5124VNNIW, "avx5124vnniw", 26)
Expand Down Expand Up @@ -253,6 +252,7 @@ X86_FEATURE (EGPR, "egpr")
X86_FEATURE_COMPAT(USERMSR, "usermsr", 0)
X86_FEATURE_COMPAT(AVX10_1, "avx10.1-256", 36)
X86_FEATURE_COMPAT(AVX10_1_512, "avx10.1-512", 37)
X86_FEATURE (ZU, "zu")
// These features aren't really CPU features, but the frontend can set them.
X86_FEATURE (RETPOLINE_EXTERNAL_THUNK, "retpoline-external-thunk")
X86_FEATURE (RETPOLINE_INDIRECT_BRANCHES, "retpoline-indirect-branches")
Expand Down

3 comments on commit 4e0a0ea

@phoebewang
Copy link
Contributor

Choose a reason for hiding this comment

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

cc @FreddyLeaf . According to my understand, the number is position independent.

@KanRobert
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Offline talked with him before I made this change.

@FreddyLeaf
Copy link
Contributor

Choose a reason for hiding this comment

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

Two arbitrary X86_FEATURE need to be added between X86_FEATURE_COMPAT(AVX512CD, and X86_FEATURE_COMPAT(AVX512VBMI, to make their position fixed.

Please sign in to comment.