mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-10-28 10:45:48 +08:00
compiler: base loongarch float abi on target.abi rather than cpu features
This commit is contained in:
2 files changed
+9
-11
No files matched your search
@@ -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
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user