authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-02-16 15:24:04+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-02-16 15:24:04+01:00
logd3edf298d18ff89bb0e0a3bfcee84a9fb63b1c6b
tree86e79cce8ab05f6cb84cf62272cb7f77d3409a91
parent1b7ec44924ede3816438f9de4b4b5bc3b7705711

x64: fix signed truncate


1 files changed, 1 insertions(+), 2 deletions(-)

src/arch/x86_64/CodeGen.zig+1-2
......@@ -966,7 +966,7 @@ fn airTrunc(self: *Self, inst: Air.Inst.Index) !void {
966966 const reg: Register = blk: {
967967 if (operand.isRegister()) {
968968 if (self.reuseOperand(inst, ty_op.operand, 0, operand)) {
969 break :blk operand.register;
969 break :blk operand.register.to64();
970970 }
971971 }
972972 const mcv = try self.copyToNewRegister(inst, src_ty, operand);
......@@ -2300,7 +2300,6 @@ fn genBinMathOp(self: *Self, inst: Air.Inst.Index, op_lhs: Air.Inst.Ref, op_rhs:
23002300 const mcvs = try self.mcvsForBinMathOp(inst, op_lhs, op_rhs);
23012301 const dst_mcv = mcvs.dst;
23022302 const src_mcv = mcvs.src;
2303 log.warn("dst_mcv = {}, src_mcv = {}", .{ dst_mcv, src_mcv });
23042303 const tag = self.air.instructions.items(.tag)[inst];
23052304 switch (tag) {
23062305 .add, .addwrap => try self.genBinMathOpMir(.add, dst_ty, dst_mcv, src_mcv),