-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
llvm: stop generating FPU code if there is no FPU #15938
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
Conversation
0d0f3d1 to
594d728
Compare
594d728 to
e4b29c1
Compare
src/codegen/llvm.zig
Outdated
| fn backendSupportsF128(target: std.Target) bool { | ||
| return switch (target.cpu.arch) { | ||
| .amdgcn => false, | ||
| .x86_64, .x86 => !std.Target.x86.featureSetHas(target.cpu.features, .soft_float), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is soft_float support relevant for f16 as well? I see that this line already exist for f80.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably. This is the only problem we hit currently though, but #15939 is for cleaning this up in the future.
Have you also confirmed that the x86/x86_64 related change fixed something? What exactly does it fix? The original issue and commit message only mention aarch64... |
|
We hit nothing broken on x86, I think that was just to make the logic more consistent. |
|
Ok, could we please keep this PR limited to the obviously correct aarch64 fixes then? I don't think we need to block merging those on figuring out what the correct path is for x86. |
Fixes ziglang#14465 For aarch64, LLVM was crashing because Zig commands it to generate FPU code even when there is no FPU present. This commit implements the necessary checks to avoid this undesired situation and aarch64 can be compiled again with no FPU.
e4b29c1 to
a78f191
Compare
|
Done. Thanks for reviewing :) |
ifreund
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thanks!
Fixes #14465
For aarch64, LLVM was crashing because Zig commands it to generate FPU code even when there is no FPU present. This commit implements the necessary checks to avoid this undesired situation and aarch64 can be compiled again with no FPU.