compiler: base loongarch float abi on target.abi rather than cpu features

This commit is contained in:
Alex Rønne Petersen committed 2026-10-26 11:02:42 +01:00
1 parent 1b0ebcd8ab
commit 4cb76bab3f
2 files changed
+9 -11

No files matched your search

+5 -6
View File
@@ -49,12 +49,11 @@ const Classifier = struct {
.loongarch32 => 32,
.loongarch64 => 64,
},
.frlen = if (target.cpu.has(.loongarch, .d))
64
else if (target.cpu.has(.loongarch, .f))
32
else
0,
.frlen = switch (target.abi) {
.gnusf, .muslsf => 0,
.gnuf32, .muslf32 => 32,
else => 64,
},
};
}
+4 -5
View File
@@ -5704,11 +5704,10 @@ fn initHeaders(
ehdr.shoff = 0;
ehdr.flags = switch (machine) {
.LOONGARCH => .{ .loongarch = .{
.base_abi_modifier = mod: {
const cpu = comp.getTarget().cpu;
if (cpu.has(.loongarch, .d)) break :mod .d;
if (cpu.has(.loongarch, .f)) break :mod .f;
break :mod .s;
.base_abi_modifier = switch (comp.getTarget().abi) {
.gnusf, .muslsf => .s,
.gnuf32, .muslf32 => .f,
else => .d,
},
.abi_extension = .base,
.abi_version = 1,