mirror of
https://github.com/ziglang/zig.git
synced 2026-01-21 06:45:24 +00:00
riscv: implement ptr_slice_ptr_ptr
just one step closer to allocation
This commit is contained in:
parent
93e9c7a963
commit
c78ebeb44c
@ -776,6 +776,7 @@ pub fn default_panic(msg: []const u8, error_return_trace: ?*StackTrace, ret_addr
|
||||
|
||||
if (builtin.zig_backend == .stage2_riscv64) {
|
||||
std.debug.print("panic: {s}\n", .{msg});
|
||||
@breakpoint();
|
||||
std.posix.exit(127);
|
||||
}
|
||||
|
||||
|
||||
@ -3433,8 +3433,13 @@ fn airPtrSliceLenPtr(func: *Func, inst: Air.Inst.Index) !void {
|
||||
|
||||
fn airPtrSlicePtrPtr(func: *Func, inst: Air.Inst.Index) !void {
|
||||
const ty_op = func.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
|
||||
const result: MCValue = if (func.liveness.isUnused(inst)) .unreach else return func.fail("TODO implement ptr_slice_ptr_ptr for {}", .{func.target.cpu.arch});
|
||||
return func.finishAir(inst, result, .{ ty_op.operand, .none, .none });
|
||||
|
||||
const opt_mcv = try func.resolveInst(ty_op.operand);
|
||||
const dst_mcv = if (func.reuseOperand(inst, ty_op.operand, 0, opt_mcv))
|
||||
opt_mcv
|
||||
else
|
||||
try func.copyToNewRegister(inst, opt_mcv);
|
||||
return func.finishAir(inst, dst_mcv, .{ ty_op.operand, .none, .none });
|
||||
}
|
||||
|
||||
fn airSliceElemVal(func: *Func, inst: Air.Inst.Index) !void {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user