authorgravatar for koachan@protonmail.comKoakuma <koachan@protonmail.com> 2022-06-29 23:02:39+07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-09-14 16:57:31-07:00
logb6307144c011fab2114ccd33a7db91171eb501dd
treeaa073f3e087f62851408f7afbbcb118329de07e4
parent2c9ab03b0b9400d5e063d81fe6ff92a8fe4242f4

stage2: sparc64: Implement airPtrToInt


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

src/arch/sparc64/CodeGen.zig+7-1
......@@ -584,7 +584,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {
584584 .load => try self.airLoad(inst),
585585 .loop => try self.airLoop(inst),
586586 .not => try self.airNot(inst),
587 .ptrtoint => @panic("TODO try self.airPtrToInt(inst)"),
587 .ptrtoint => try self.airPtrToInt(inst),
588588 .ret => try self.airRet(inst),
589589 .ret_load => try self.airRetLoad(inst),
590590 .store => try self.airStore(inst),
......@@ -1894,6 +1894,12 @@ fn airPtrElemPtr(self: *Self, inst: Air.Inst.Index) !void {
18941894 return self.finishAir(inst, result, .{ extra.lhs, extra.rhs, .none });
18951895}
18961896
1897fn airPtrToInt(self: *Self, inst: Air.Inst.Index) !void {
1898 const un_op = self.air.instructions.items(.data)[inst].un_op;
1899 const result = try self.resolveInst(un_op);
1900 return self.finishAir(inst, result, .{ un_op, .none, .none });
1901}
1902
18971903fn airRem(self: *Self, inst: Air.Inst.Index) !void {
18981904 const bin_op = self.air.instructions.items(.data)[inst].bin_op;
18991905 const lhs = try self.resolveInst(bin_op.lhs);