-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__builtin_cpu_supports doesn't understand x86-64 micro-architecture levels #59961
Comments
@llvm/issue-subscribers-backend-x86 |
@llvm/issue-subscribers-clang-frontend |
GCC 12 (https://gcc.gnu.org/PR101696) allows `arch=x86-64` `arch=x86-64-v2` `arch=x86-64-v3` `arch=x86-64-v4` in the target_clones function attribute. This patch ports the feature. * Set KeyFeature to `x86-64{,-v2,-v3,-v4}` in `Processors[]`, to be used by X86TargetInfo::multiVersionSortPriority * builtins: change `__cpu_features2` to an array like libgcc. Define `FEATURE_X86_64_{BASELINE,V2,V3,V4}` and depended ISA feature bits. * CGBuiltin.cpp: update EmitX86CpuSupports to handle `arch=x86-64*`. Close #55830 Reviewed By: pengfei Differential Revision: https://reviews.llvm.org/D158329
This PR appears to imply that llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp Lines 2686 to 2689 in 27da153
However this is not tested, and current trunk does not accept:
This appears to be rejected at llvm-project/clang/lib/Sema/SemaDecl.cpp Lines 11066 to 11068 in 966d564
|
This does not work:
__builtin_cpu_supports("x86-64-v2")
.The text was updated successfully, but these errors were encountered: