llvm: stop generating FPU code if there is no FPU

Fixes https://github.com/ziglang/zig/issues/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.
This commit is contained in:
David Gonzalez Martin 2023-06-02 16:32:43 -06:00 committed by Isaac Freund
parent 9ee0a706da
commit c16d4ab9e4

View File

@ -11165,6 +11165,7 @@ fn backendSupportsF16(target: std.Target) bool {
.mips64,
.mips64el,
=> false,
.aarch64 => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8),
else => true,
};
}
@ -11175,6 +11176,7 @@ fn backendSupportsF16(target: std.Target) bool {
fn backendSupportsF128(target: std.Target) bool {
return switch (target.cpu.arch) {
.amdgcn => false,
.aarch64 => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8),
else => true,
};
}