[clang] [llvm] [ARM] Emit an error when the hard-float ABI is enabled but can't be used. (PR #111334)
Chris Copeland via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 22 00:45:56 PST 2024
chrisnc wrote:
> One use case I'd want to keep working is where we have two functions in the same object that are hardfp with hardware registers, and soft (with or without hardware registers). Something like:
>
> ```
> __attribute__((target("arch=cortex-m33"))) __attribute__((pcs("aapcs-vfp"))) float f1(float a, float b) {
> return a + b;
> }
>
> __attribute__((target("arch=cortex-m0"))) __attribute__((pcs("aapcs"))) float f2(float a, float b) {
> return a + b;
> }
> ```
>
> There are some source files that do run-time selection based on hardware detection.
I can confirm that this does not emit an error.
The way this change is implemented, each function will be checked for consistency of ABI + features, and both of these are fine, so there's no issue.
https://github.com/llvm/llvm-project/pull/111334
More information about the llvm-commits
mailing list