| ... | @@ -3235,6 +3235,7 @@ fn airMulDivBinOp(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -3235,6 +3235,7 @@ fn airMulDivBinOp(self: *Self, inst: Air.Inst.Index) !void { |
| 3235 | var callee_buf: ["__udiv?i3".len]u8 = undefined; | 3235 | var callee_buf: ["__udiv?i3".len]u8 = undefined; |
| 3236 | const signed_div_floor_state: struct { | 3236 | const signed_div_floor_state: struct { |
| 3237 | frame_index: FrameIndex, | 3237 | frame_index: FrameIndex, |
| | 3238 | state: State, |
| 3238 | reloc: Mir.Inst.Index, | 3239 | reloc: Mir.Inst.Index, |
| 3239 | } = if (signed and tag == .div_floor) state: { | 3240 | } = if (signed and tag == .div_floor) state: { |
| 3240 | const frame_index = try self.allocFrameIndex(FrameAlloc.initType(Type.usize, mod)); | 3241 | const frame_index = try self.allocFrameIndex(FrameAlloc.initType(Type.usize, mod)); |
| ... | @@ -3295,9 +3296,10 @@ fn airMulDivBinOp(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -3295,9 +3296,10 @@ fn airMulDivBinOp(self: *Self, inst: Air.Inst.Index) !void { |
| 3295 | tmp_reg, | 3296 | tmp_reg, |
| 3296 | mat_rhs_mcv.register_pair[1], | 3297 | mat_rhs_mcv.register_pair[1], |
| 3297 | ); | 3298 | ); |
| | 3299 | const state = try self.saveState(); |
| 3298 | const reloc = try self.asmJccReloc(.ns, undefined); | 3300 | const reloc = try self.asmJccReloc(.ns, undefined); |
| 3299 | | 3301 | |
| 3300 | break :state .{ .frame_index = frame_index, .reloc = reloc }; | 3302 | break :state .{ .frame_index = frame_index, .state = state, .reloc = reloc }; |
| 3301 | } else undefined; | 3303 | } else undefined; |
| 3302 | const call_mcv = try self.genCall( | 3304 | const call_mcv = try self.genCall( |
| 3303 | .{ .lib = .{ | 3305 | .{ .lib = .{ |
| ... | @@ -3328,6 +3330,12 @@ fn airMulDivBinOp(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -3328,6 +3330,12 @@ fn airMulDivBinOp(self: *Self, inst: Air.Inst.Index) !void { |
| 3328 | .base = .{ .frame = signed_div_floor_state.frame_index }, | 3330 | .base = .{ .frame = signed_div_floor_state.frame_index }, |
| 3329 | .mod = .{ .rm = .{ .size = .byte } }, | 3331 | .mod = .{ .rm = .{ .size = .byte } }, |
| 3330 | }); | 3332 | }); |
| | 3333 | try self.restoreState(signed_div_floor_state.state, &.{}, .{ |
| | 3334 | .emit_instructions = true, |
| | 3335 | .update_tracking = true, |
| | 3336 | .resurrect = true, |
| | 3337 | .close_scope = true, |
| | 3338 | }); |
| 3331 | try self.performReloc(signed_div_floor_state.reloc); | 3339 | try self.performReloc(signed_div_floor_state.reloc); |
| 3332 | const dst_mcv = try self.genCall( | 3340 | const dst_mcv = try self.genCall( |
| 3333 | .{ .lib = .{ | 3341 | .{ .lib = .{ |