Skip to content

Commit c16d4ab

Browse files
David Gonzalez Martinifreund
authored andcommitted
llvm: stop generating FPU code if there is no FPU
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.
1 parent 9ee0a70 commit c16d4ab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/codegen/llvm.zig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11165,6 +11165,7 @@ fn backendSupportsF16(target: std.Target) bool {
1116511165
.mips64,
1116611166
.mips64el,
1116711167
=> false,
11168+
.aarch64 => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8),
1116811169
else => true,
1116911170
};
1117011171
}
@@ -11175,6 +11176,7 @@ fn backendSupportsF16(target: std.Target) bool {
1117511176
fn backendSupportsF128(target: std.Target) bool {
1117611177
return switch (target.cpu.arch) {
1117711178
.amdgcn => false,
11179+
.aarch64 => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8),
1117811180
else => true,
1117911181
};
1118011182
}

0 commit comments

Comments
 (0)