| ... | @@ -6070,17 +6070,15 @@ fn airAtomicRmw(f: *Function, inst: Air.Inst.Index) !CValue { | ... | @@ -6070,17 +6070,15 @@ fn airAtomicRmw(f: *Function, inst: Air.Inst.Index) !CValue { |
| 6070 | try writer.writeByte('('); | 6070 | try writer.writeByte('('); |
| 6071 | try f.writeCValue(writer, local, .Other); | 6071 | try f.writeCValue(writer, local, .Other); |
| 6072 | try writer.writeAll(", ("); | 6072 | try writer.writeAll(", ("); |
| 6073 | switch (extra.op()) { | 6073 | const use_atomic = switch (extra.op()) { |
| 6074 | else => { | 6074 | else => true, |
| 6075 | try writer.writeAll("zig_atomic("); | 6075 | // These are missing from stdatomic.h, so no atomic types for now. |
| 6076 | try f.renderType(writer, ty); | 6076 | .Nand => false, |
| 6077 | try writer.writeByte(')'); | 6077 | .Min, .Max => is_float, |
| 6078 | }, | 6078 | }; |
| 6079 | .Nand, .Min, .Max => { | 6079 | if (use_atomic) try writer.writeAll("zig_atomic("); |
| 6080 | // These are missing from stdatomic.h, so no atomic types for now. | 6080 | try f.renderType(writer, ty); |
| 6081 | try f.renderType(writer, ty); | 6081 | if (use_atomic) try writer.writeByte(')'); |
| 6082 | }, | | |
| 6083 | } | | |
| 6084 | if (ptr_ty.isVolatilePtr()) try writer.writeAll(" volatile"); | 6082 | if (ptr_ty.isVolatilePtr()) try writer.writeAll(" volatile"); |
| 6085 | try writer.writeAll(" *)"); | 6083 | try writer.writeAll(" *)"); |
| 6086 | try f.writeCValue(writer, ptr, .Other); | 6084 | try f.writeCValue(writer, ptr, .Other); |