authorgravatar for koachan@protonmail.comKoakuma <koachan@protonmail.com> 2022-05-16 23:02:32+07:00
committergravatar for koachan@protonmail.comKoakuma <koachan@protonmail.com> 2022-05-16 23:17:11+07:00
loge4a725c597ee4a461ac8135e952f4093183c6c80
treee9892384a1de90e5d8e1f12829ee7a16d6a379d3
parent0c8ce9ed9d916599e9ec518ecced941bf0b37eff

stage2: sparc64: Implement airBitCast


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

src/arch/sparc64/CodeGen.zig+7-1
...@@ -541,7 +541,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {...@@ -541,7 +541,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {
541 .ret_ptr => try self.airRetPtr(inst),541 .ret_ptr => try self.airRetPtr(inst),
542 .arg => try self.airArg(inst),542 .arg => try self.airArg(inst),
543 .assembly => try self.airAsm(inst),543 .assembly => try self.airAsm(inst),
544 .bitcast => @panic("TODO try self.airBitCast(inst)"),544 .bitcast => try self.airBitCast(inst),
545 .block => try self.airBlock(inst),545 .block => try self.airBlock(inst),
546 .br => try self.airBr(inst),546 .br => try self.airBr(inst),
547 .breakpoint => try self.airBreakpoint(),547 .breakpoint => try self.airBreakpoint(),
...@@ -823,6 +823,12 @@ fn airArg(self: *Self, inst: Air.Inst.Index) !void {...@@ -823,6 +823,12 @@ fn airArg(self: *Self, inst: Air.Inst.Index) !void {
823 return self.finishAir(inst, mcv, .{ .none, .none, .none });823 return self.finishAir(inst, mcv, .{ .none, .none, .none });
824}824}
825825
826fn airBitCast(self: *Self, inst: Air.Inst.Index) !void {
827 const ty_op = self.air.instructions.items(.data)[inst].ty_op;
828 const result = try self.resolveInst(ty_op.operand);
829 return self.finishAir(inst, result, .{ ty_op.operand, .none, .none });
830}
831
826fn airBlock(self: *Self, inst: Air.Inst.Index) !void {832fn airBlock(self: *Self, inst: Air.Inst.Index) !void {
827 try self.blocks.putNoClobber(self.gpa, inst, .{833 try self.blocks.putNoClobber(self.gpa, inst, .{
828 // A block is a setup to be able to jump to the end.834 // A block is a setup to be able to jump to the end.