Skip to content

Conversation

@davidgmbb
Copy link
Contributor

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.

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),
Copy link
Member

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.

Copy link
Contributor

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.

@ifreund
Copy link
Member

ifreund commented Jun 6, 2023

This commit implements the necessary checks to avoid this undesired situation and aarch64 can be compiled again with no FPU.

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...

@N00byEdge
Copy link
Contributor

We hit nothing broken on x86, I think that was just to make the logic more consistent.

@ifreund
Copy link
Member

ifreund commented Jun 6, 2023

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.
@davidgmbb
Copy link
Contributor Author

Done. Thanks for reviewing :)

Copy link
Member

@ifreund ifreund left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks!

@ifreund ifreund enabled auto-merge (rebase) June 6, 2023 15:23
@ifreund ifreund merged commit c16d4ab into ziglang:master Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash targetting aarch64 without floating point and neon

4 participants