| ... | @@ -4119,12 +4119,19 @@ fn airBreakpoint(self: *Self) !void { | ... | @@ -4119,12 +4119,19 @@ fn airBreakpoint(self: *Self) !void { |
| 4119 | } | 4119 | } |
| 4120 | | 4120 | |
| 4121 | fn airRetAddr(self: *Self, inst: Air.Inst.Index) !void { | 4121 | fn airRetAddr(self: *Self, inst: Air.Inst.Index) !void { |
| 4122 | const result: MCValue = if (self.liveness.isUnused(inst)) .dead else return self.fail("TODO implement airRetAddr for x86_64", .{}); | 4122 | const result: MCValue = if (self.liveness.isUnused(inst)) |
| | 4123 | .dead |
| | 4124 | else |
| | 4125 | .{ .stack_offset = -@as(i32, @divExact(self.target.cpu.arch.ptrBitWidth(), 8)) }; |
| 4123 | return self.finishAir(inst, result, .{ .none, .none, .none }); | 4126 | return self.finishAir(inst, result, .{ .none, .none, .none }); |
| 4124 | } | 4127 | } |
| 4125 | | 4128 | |
| 4126 | fn airFrameAddress(self: *Self, inst: Air.Inst.Index) !void { | 4129 | fn airFrameAddress(self: *Self, inst: Air.Inst.Index) !void { |
| 4127 | const result: MCValue = if (self.liveness.isUnused(inst)) .dead else return self.fail("TODO implement airFrameAddress for x86_64", .{}); | 4130 | const result = if (self.liveness.isUnused(inst)) .dead else result: { |
| | 4131 | const dst_mcv = try self.allocRegOrMem(inst, true); |
| | 4132 | try self.genBinOpMir(.mov, Type.usize, dst_mcv, .{ .register = .rbp }); |
| | 4133 | break :result dst_mcv; |
| | 4134 | }; |
| 4128 | return self.finishAir(inst, result, .{ .none, .none, .none }); | 4135 | return self.finishAir(inst, result, .{ .none, .none, .none }); |
| 4129 | } | 4136 | } |
| 4130 | | 4137 | |