| ... | @@ -4108,6 +4108,8 @@ fn airAsm(f: *Function, inst: Air.Inst.Index) !CValue { | ... | @@ -4108,6 +4108,8 @@ fn airAsm(f: *Function, inst: Air.Inst.Index) !CValue { |
| 4108 | if (is_reg) { | 4108 | if (is_reg) { |
| 4109 | try f.writeCValue(writer, .{ .local = locals_index }, .Other); | 4109 | try f.writeCValue(writer, .{ .local = locals_index }, .Other); |
| 4110 | locals_index += 1; | 4110 | locals_index += 1; |
| | 4111 | } else if (output == .none) { |
| | 4112 | try f.writeCValue(writer, local, .FunctionArgument); |
| 4111 | } else { | 4113 | } else { |
| 4112 | try f.writeCValueDeref(writer, try f.resolveInst(output)); | 4114 | try f.writeCValueDeref(writer, try f.resolveInst(output)); |
| 4113 | } | 4115 | } |
| ... | @@ -4411,6 +4413,10 @@ fn structFieldPtr(f: *Function, inst: Air.Inst.Index, struct_ptr_ty: Type, struc | ... | @@ -4411,6 +4413,10 @@ fn structFieldPtr(f: *Function, inst: Air.Inst.Index, struct_ptr_ty: Type, struc |
| 4411 | u8_ptr_pl.data.pointee_type = Type.u8; | 4413 | u8_ptr_pl.data.pointee_type = Type.u8; |
| 4412 | const u8_ptr_ty = Type.initPayload(&u8_ptr_pl.base); | 4414 | const u8_ptr_ty = Type.initPayload(&u8_ptr_pl.base); |
| 4413 | | 4415 | |
| | 4416 | if (!std.mem.isAligned(byte_offset, field_ptr_ty.ptrAlignment(target))) { |
| | 4417 | return f.fail("TODO: CBE: unaligned packed struct field pointer", .{}); |
| | 4418 | } |
| | 4419 | |
| 4414 | try writer.writeAll("&(("); | 4420 | try writer.writeAll("&(("); |
| 4415 | try f.renderTypecast(writer, u8_ptr_ty); | 4421 | try f.renderTypecast(writer, u8_ptr_ty); |
| 4416 | try writer.writeByte(')'); | 4422 | try writer.writeByte(')'); |