aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86_64/CodeGen.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2024-04-21 19:12:59 -0400
committerAndrew Kelley <andrew@ziglang.org>2024-04-22 15:24:29 -0700
commit5d745d94fbe30334ce0695cdf7118fb526313aed (patch)
tree315552d71d9eadb31d3de40c0910f590680f0267 /src/arch/x86_64/CodeGen.zig
parent6fd09f8d2d50525e3f58213e44f815ed577c2864 (diff)
downloadzig-5d745d94fbe30334ce0695cdf7118fb526313aed.tar.gz
zig-5d745d94fbe30334ce0695cdf7118fb526313aed.zip
x86_64: fix C abi for unions
Closes #19721
Diffstat (limited to 'src/arch/x86_64/CodeGen.zig')
-rw-r--r--src/arch/x86_64/CodeGen.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/arch/x86_64/CodeGen.zig b/src/arch/x86_64/CodeGen.zig
index 0681bc975d..7faf3d6d50 100644
--- a/src/arch/x86_64/CodeGen.zig
+++ b/src/arch/x86_64/CodeGen.zig
@@ -14316,7 +14316,7 @@ fn moveStrategy(self: *Self, ty: Type, class: Register.Class, aligned: bool) !Mo
.mmx => {},
.sse => switch (ty.zigTypeTag(mod)) {
else => {
- const classes = mem.sliceTo(&abi.classifySystemV(ty, mod, .other), .none);
+ const classes = mem.sliceTo(&abi.classifySystemV(ty, mod, self.target.*, .other), .none);
assert(std.mem.indexOfNone(abi.Class, classes, &.{
.integer, .sse, .memory, .float, .float_combine,
}) == null);
@@ -18450,7 +18450,7 @@ fn airVaArg(self: *Self, inst: Air.Inst.Index) !void {
const overflow_arg_area: MCValue = .{ .indirect = .{ .reg = ptr_arg_list_reg, .off = 8 } };
const reg_save_area: MCValue = .{ .indirect = .{ .reg = ptr_arg_list_reg, .off = 16 } };
- const classes = mem.sliceTo(&abi.classifySystemV(promote_ty, mod, .arg), .none);
+ const classes = mem.sliceTo(&abi.classifySystemV(promote_ty, mod, self.target.*, .arg), .none);
switch (classes[0]) {
.integer => {
assert(classes.len == 1);
@@ -18800,7 +18800,7 @@ fn resolveCallingConventionValues(
var ret_tracking_i: usize = 0;
const classes = switch (resolved_cc) {
- .SysV => mem.sliceTo(&abi.classifySystemV(ret_ty, mod, .ret), .none),
+ .SysV => mem.sliceTo(&abi.classifySystemV(ret_ty, mod, self.target.*, .ret), .none),
.Win64 => &.{abi.classifyWindows(ret_ty, mod)},
else => unreachable,
};
@@ -18875,7 +18875,7 @@ fn resolveCallingConventionValues(
var arg_mcv_i: usize = 0;
const classes = switch (resolved_cc) {
- .SysV => mem.sliceTo(&abi.classifySystemV(ty, mod, .arg), .none),
+ .SysV => mem.sliceTo(&abi.classifySystemV(ty, mod, self.target.*, .arg), .none),
.Win64 => &.{abi.classifyWindows(ty, mod)},
else => unreachable,
};
@@ -19090,7 +19090,7 @@ fn memSize(self: *Self, ty: Type) Memory.Size {
fn splitType(self: *Self, ty: Type) ![2]Type {
const mod = self.bin_file.comp.module.?;
- const classes = mem.sliceTo(&abi.classifySystemV(ty, mod, .other), .none);
+ const classes = mem.sliceTo(&abi.classifySystemV(ty, mod, self.target.*, .other), .none);
var parts: [2]Type = undefined;
if (classes.len == 2) for (&parts, classes, 0..) |*part, class, part_i| {
part.* = switch (class) {