| ... | @@ -5935,16 +5935,15 @@ fn airMemset(f: *Function, inst: Air.Inst.Index) !CValue { | ... | @@ -5935,16 +5935,15 @@ fn airMemset(f: *Function, inst: Air.Inst.Index) !CValue { |
| 5935 | const dest_ptr = try f.resolveInst(pl_op.operand); | 5935 | const dest_ptr = try f.resolveInst(pl_op.operand); |
| 5936 | const value = try f.resolveInst(extra.lhs); | 5936 | const value = try f.resolveInst(extra.lhs); |
| 5937 | const len = try f.resolveInst(extra.rhs); | 5937 | const len = try f.resolveInst(extra.rhs); |
| 5938 | try reap(f, inst, &.{ pl_op.operand, extra.lhs, extra.rhs }); | | |
| 5939 | | 5938 | |
| 5940 | const writer = f.object.writer(); | 5939 | const writer = f.object.writer(); |
| 5941 | if (dest_ty.isVolatilePtr()) { | 5940 | if (dest_ty.isVolatilePtr()) { |
| 5942 | var u8_ptr_pl = dest_ty.ptrInfo(); | 5941 | var u8_ptr_pl = dest_ty.ptrInfo(); |
| 5943 | u8_ptr_pl.data.pointee_type = Type.u8; | 5942 | u8_ptr_pl.data.pointee_type = Type.u8; |
| 5944 | const u8_ptr_ty = Type.initPayload(&u8_ptr_pl.base); | 5943 | const u8_ptr_ty = Type.initPayload(&u8_ptr_pl.base); |
| | 5944 | const index = try f.allocLocal(inst, Type.usize); |
| 5945 | | 5945 | |
| 5946 | try writer.writeAll("for ("); | 5946 | try writer.writeAll("for ("); |
| 5947 | const index = try f.allocLocal(inst, Type.usize); | | |
| 5948 | try f.writeCValue(writer, index, .Other); | 5947 | try f.writeCValue(writer, index, .Other); |
| 5949 | try writer.writeAll(" = "); | 5948 | try writer.writeAll(" = "); |
| 5950 | try f.object.dg.renderValue(writer, Type.usize, Value.zero, .Initializer); | 5949 | try f.object.dg.renderValue(writer, Type.usize, Value.zero, .Initializer); |
| ... | @@ -5966,11 +5965,13 @@ fn airMemset(f: *Function, inst: Air.Inst.Index) !CValue { | ... | @@ -5966,11 +5965,13 @@ fn airMemset(f: *Function, inst: Air.Inst.Index) !CValue { |
| 5966 | try f.writeCValue(writer, value, .FunctionArgument); | 5965 | try f.writeCValue(writer, value, .FunctionArgument); |
| 5967 | try writer.writeAll(";\n"); | 5966 | try writer.writeAll(";\n"); |
| 5968 | | 5967 | |
| | 5968 | try reap(f, inst, &.{ pl_op.operand, extra.lhs, extra.rhs }); |
| 5969 | try freeLocal(f, inst, index.local, 0); | 5969 | try freeLocal(f, inst, index.local, 0); |
| 5970 | | 5970 | |
| 5971 | return CValue.none; | 5971 | return CValue.none; |
| 5972 | } | 5972 | } |
| 5973 | | 5973 | |
| | 5974 | try reap(f, inst, &.{ pl_op.operand, extra.lhs, extra.rhs }); |
| 5974 | try writer.writeAll("memset("); | 5975 | try writer.writeAll("memset("); |
| 5975 | try f.writeCValue(writer, dest_ptr, .FunctionArgument); | 5976 | try f.writeCValue(writer, dest_ptr, .FunctionArgument); |
| 5976 | try writer.writeAll(", "); | 5977 | try writer.writeAll(", "); |