diff options
| author | Koakuma <koachan@protonmail.com> | 2022-06-29 23:02:39 +0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-09-14 16:57:31 -0700 |
| commit | b6307144c011fab2114ccd33a7db91171eb501dd (patch) | |
| tree | aa073f3e087f62851408f7afbbcb118329de07e4 | |
| parent | 2c9ab03b0b9400d5e063d81fe6ff92a8fe4242f4 (diff) | |
| download | zig-b6307144c011fab2114ccd33a7db91171eb501dd.tar.gz zig-b6307144c011fab2114ccd33a7db91171eb501dd.zip | |
stage2: sparc64: Implement airPtrToInt
| -rw-r--r-- | src/arch/sparc64/CodeGen.zig | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/arch/sparc64/CodeGen.zig b/src/arch/sparc64/CodeGen.zig index d55f218eaa..c258d88419 100644 --- a/src/arch/sparc64/CodeGen.zig +++ b/src/arch/sparc64/CodeGen.zig @@ -584,7 +584,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { .load => try self.airLoad(inst), .loop => try self.airLoop(inst), .not => try self.airNot(inst), - .ptrtoint => @panic("TODO try self.airPtrToInt(inst)"), + .ptrtoint => try self.airPtrToInt(inst), .ret => try self.airRet(inst), .ret_load => try self.airRetLoad(inst), .store => try self.airStore(inst), @@ -1894,6 +1894,12 @@ fn airPtrElemPtr(self: *Self, inst: Air.Inst.Index) !void { return self.finishAir(inst, result, .{ extra.lhs, extra.rhs, .none }); } +fn airPtrToInt(self: *Self, inst: Air.Inst.Index) !void { + const un_op = self.air.instructions.items(.data)[inst].un_op; + const result = try self.resolveInst(un_op); + return self.finishAir(inst, result, .{ un_op, .none, .none }); +} + fn airRem(self: *Self, inst: Air.Inst.Index) !void { const bin_op = self.air.instructions.items(.data)[inst].bin_op; const lhs = try self.resolveInst(bin_op.lhs); |
