Commit c16d4ab9e4

David Gonzalez Martin <davidgm94.work@protonmail.com>
2023-06-03 00:32:43
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.
1 parent 9ee0a70
Changed files (1)
src
codegen
src/codegen/llvm.zig
@@ -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,
     };
 }