mirror of
https://github.com/ziglang/zig.git
synced 2026-01-10 09:25:11 +00:00
x86_64: fix overflow of extended multiply
This commit is contained in:
parent
08055f2942
commit
c03771e173
@ -2089,12 +2089,14 @@ fn airMulWithOverflow(self: *Self, inst: Air.Inst.Index) !void {
|
||||
else => {},
|
||||
}
|
||||
|
||||
// For now, this is the only supported multiply that doesn't fit in a register.
|
||||
assert(dst_info.bits == 128 and src_pl.data == 64);
|
||||
const dst_abi_size = @intCast(i32, dst_ty.abiSize(self.target.*));
|
||||
const dst_mcv = try self.allocRegOrMem(inst, false);
|
||||
try self.genSetStack(
|
||||
Type.u1,
|
||||
dst_mcv.stack_offset - dst_abi_size,
|
||||
.{ .eflags = cc },
|
||||
.{ .immediate = 0 }, // 64x64 -> 128 never overflows
|
||||
.{},
|
||||
);
|
||||
try self.genSetStack(dst_ty, dst_mcv.stack_offset, partial_mcv, .{});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user