authorgravatar for david@vortan.devDavid Rubin <david@vortan.dev> 2024-07-05 23:00:55-07:00
committergravatar for david@vortan.devDavid Rubin <david@vortan.dev> 2024-07-26 04:05:40-07:00
logc78ebeb44ce078a165e3302b629432eeee6a656d
treea32c31f2c88173a0a5589f323359922b93aaf402
parent93e9c7a963a86f72cd7f603ee7e6d6af2ff3b0b5
signaturelock-open Commit is signed but in an unrecognized format.

riscv: implement `ptr_slice_ptr_ptr`

just one step closer to allocation

2 files changed, 8 insertions(+), 2 deletions(-)

lib/std/builtin.zig+1
......@@ -776,6 +776,7 @@ pub fn default_panic(msg: []const u8, error_return_trace: ?*StackTrace, ret_addr
776776
777777 if (builtin.zig_backend == .stage2_riscv64) {
778778 std.debug.print("panic: {s}\n", .{msg});
779 @breakpoint();
779780 std.posix.exit(127);
780781 }
781782
src/arch/riscv64/CodeGen.zig+7-2
......@@ -3433,8 +3433,13 @@ fn airPtrSliceLenPtr(func: *Func, inst: Air.Inst.Index) !void {
34333433
34343434fn airPtrSlicePtrPtr(func: *Func, inst: Air.Inst.Index) !void {
34353435 const ty_op = func.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
3436 const result: MCValue = if (func.liveness.isUnused(inst)) .unreach else return func.fail("TODO implement ptr_slice_ptr_ptr for {}", .{func.target.cpu.arch});
3437 return func.finishAir(inst, result, .{ ty_op.operand, .none, .none });
3436
3437 const opt_mcv = try func.resolveInst(ty_op.operand);
3438 const dst_mcv = if (func.reuseOperand(inst, ty_op.operand, 0, opt_mcv))
3439 opt_mcv
3440 else
3441 try func.copyToNewRegister(inst, opt_mcv);
3442 return func.finishAir(inst, dst_mcv, .{ ty_op.operand, .none, .none });
34383443}
34393444
34403445fn airSliceElemVal(func: *Func, inst: Air.Inst.Index) !void {