| ... | ... | @@ -5946,11 +5946,13 @@ fn airCmpxchg(f: *Function, inst: Air.Inst.Index, flavor: [*:0]const u8) !CValue |
| 5946 | 5946 | const ptr = try f.resolveInst(extra.ptr); |
| 5947 | 5947 | const expected_value = try f.resolveInst(extra.expected_value); |
| 5948 | 5948 | const new_value = try f.resolveInst(extra.new_value); |
| 5949 | | try reap(f, inst, &.{ extra.ptr, extra.expected_value, extra.new_value }); |
| 5950 | | const writer = f.object.writer(); |
| 5951 | 5949 | const ptr_ty = f.air.typeOf(extra.ptr); |
| 5952 | 5950 | const ty = ptr_ty.childType(); |
| 5953 | 5951 | |
| 5952 | const writer = f.object.writer(); |
| 5953 | const new_value_mat = try Materialize.start(f, inst, writer, ty, new_value); |
| 5954 | try reap(f, inst, &.{ extra.ptr, extra.expected_value, extra.new_value }); |
| 5955 | |
| 5954 | 5956 | const target = f.object.dg.module.getTarget(); |
| 5955 | 5957 | var repr_pl = Type.Payload.Bits{ |
| 5956 | 5958 | .base = .{ .tag = .int_unsigned }, |
| ... | ... | @@ -5958,7 +5960,6 @@ fn airCmpxchg(f: *Function, inst: Air.Inst.Index, flavor: [*:0]const u8) !CValue |
| 5958 | 5960 | }; |
| 5959 | 5961 | const repr_ty = if (ty.isRuntimeFloat()) Type.initPayload(&repr_pl.base) else ty; |
| 5960 | 5962 | |
| 5961 | | const new_value_mat = try Materialize.start(f, inst, writer, ty, new_value); |
| 5962 | 5963 | const local = try f.allocLocal(inst, inst_ty); |
| 5963 | 5964 | if (inst_ty.isPtrLikeOptional()) { |
| 5964 | 5965 | { |
| ... | ... | @@ -6052,9 +6053,10 @@ fn airAtomicRmw(f: *Function, inst: Air.Inst.Index) !CValue { |
| 6052 | 6053 | const ty = ptr_ty.childType(); |
| 6053 | 6054 | const ptr = try f.resolveInst(pl_op.operand); |
| 6054 | 6055 | const operand = try f.resolveInst(extra.operand); |
| 6055 | | try reap(f, inst, &.{ pl_op.operand, extra.operand }); |
| 6056 | |
| 6056 | 6057 | const writer = f.object.writer(); |
| 6057 | | const local = try f.allocLocal(inst, inst_ty); |
| 6058 | const operand_mat = try Materialize.start(f, inst, writer, ty, operand); |
| 6059 | try reap(f, inst, &.{ pl_op.operand, extra.operand }); |
| 6058 | 6060 | |
| 6059 | 6061 | const target = f.object.dg.module.getTarget(); |
| 6060 | 6062 | var repr_pl = Type.Payload.Bits{ |
| ... | ... | @@ -6065,7 +6067,7 @@ fn airAtomicRmw(f: *Function, inst: Air.Inst.Index) !CValue { |
| 6065 | 6067 | const is_128 = repr_pl.data == 128; |
| 6066 | 6068 | const repr_ty = if (is_float) Type.initPayload(&repr_pl.base) else ty; |
| 6067 | 6069 | |
| 6068 | | const operand_mat = try Materialize.start(f, inst, writer, ty, operand); |
| 6070 | const local = try f.allocLocal(inst, inst_ty); |
| 6069 | 6071 | try writer.print("zig_atomicrmw_{s}", .{toAtomicRmwSuffix(extra.op())}); |
| 6070 | 6072 | if (is_float) try writer.writeAll("_float") else if (is_128) try writer.writeAll("_int128"); |
| 6071 | 6073 | try writer.writeByte('('); |
| ... | ... | @@ -6144,8 +6146,10 @@ fn airAtomicStore(f: *Function, inst: Air.Inst.Index, order: [*:0]const u8) !CVa |
| 6144 | 6146 | const ty = ptr_ty.childType(); |
| 6145 | 6147 | const ptr = try f.resolveInst(bin_op.lhs); |
| 6146 | 6148 | const element = try f.resolveInst(bin_op.rhs); |
| 6147 | | try reap(f, inst, &.{ bin_op.lhs, bin_op.rhs }); |
| 6149 | |
| 6148 | 6150 | const writer = f.object.writer(); |
| 6151 | const element_mat = try Materialize.start(f, inst, writer, ty, element); |
| 6152 | try reap(f, inst, &.{ bin_op.lhs, bin_op.rhs }); |
| 6149 | 6153 | |
| 6150 | 6154 | const target = f.object.dg.module.getTarget(); |
| 6151 | 6155 | var repr_pl = Type.Payload.Bits{ |
| ... | ... | @@ -6154,7 +6158,6 @@ fn airAtomicStore(f: *Function, inst: Air.Inst.Index, order: [*:0]const u8) !CVa |
| 6154 | 6158 | }; |
| 6155 | 6159 | const repr_ty = if (ty.isRuntimeFloat()) Type.initPayload(&repr_pl.base) else ty; |
| 6156 | 6160 | |
| 6157 | | const element_mat = try Materialize.start(f, inst, writer, ty, element); |
| 6158 | 6161 | try writer.writeAll("zig_atomic_store((zig_atomic("); |
| 6159 | 6162 | try f.renderType(writer, ty); |
| 6160 | 6163 | try writer.writeByte(')'); |