-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
#[target_feature(..)]
no longer in effect in naked functions
#136280
Comments
This behavior is unfortunately expected, because of a bug in LLVM #80608 So basically LLVM just does not attach the target features to global assembly. There are some target-specific fixes that use directives to enable the target features within the global assembly (e.g. this one for arm). That may work, but should not be needed in the future when LLVM, hopefully, fixes this issue. |
This is a different issue than those you listed, which are related to global target feature ( |
ah, right. Then yeah we can at least do better (e.g. with |
AFAIK, in x86/x86_64 all instructions available without such a directive. Also, in powerpc/powerpc64 LLVM currently actually ignores (Of these directives, I have actually used only aarch64 |
That's extremely helpful, thanks! I think for the tier 2 targets, the ones I'm still missing are
Wasm does emit an error when you use inline assembly that requires a target feature https://godbolt.org/z/KaPqqM8Ez, while for loongarch I've not yet found an example where the target feature seems to matter. And then there is a bunch of tier 3 targets which I did not all check but I'd assume most are not (close) to stable inline assembly, so we can skip those on a first pass. |
Since #128004, target features enabled with
#[target_feature(..)]
are no longer in effect in naked functions. For example:I haven't seen this discussed in the pull request. Opening the issue to give a chance to review the behaviour before stabilization.
cc @folkertdev, @Amanieu
The text was updated successfully, but these errors were encountered: