| ... | @@ -6335,26 +6335,18 @@ fn airMemset(f: *Function, inst: Air.Inst.Index, safety: bool) !CValue { | ... | @@ -6335,26 +6335,18 @@ fn airMemset(f: *Function, inst: Air.Inst.Index, safety: bool) !CValue { |
| 6335 | try writer.writeAll("; ++"); | 6335 | try writer.writeAll("; ++"); |
| 6336 | try f.writeCValue(writer, index, .Other); | 6336 | try f.writeCValue(writer, index, .Other); |
| 6337 | try writer.writeAll(") "); | 6337 | try writer.writeAll(") "); |
| 6338 | if (lowersToArray(elem_ty, target)) { | 6338 | |
| 6339 | // Arrays are not assignable, so we use memcpy here. | 6339 | const a = try Assignment.start(f, writer, elem_ty); |
| 6340 | try writer.writeAll("memcpy("); | 6340 | try writer.writeAll("(("); |
| 6341 | try writeSliceOrPtr(f, writer, dest_slice, dest_ty); | 6341 | try f.renderType(writer, elem_ptr_ty); |
| 6342 | try writer.writeAll("["); | 6342 | try writer.writeByte(')'); |
| 6343 | try f.writeCValue(writer, index, .Other); | 6343 | try writeSliceOrPtr(f, writer, dest_slice, dest_ty); |
| 6344 | try writer.writeAll("], "); | 6344 | try writer.writeAll(")["); |
| 6345 | try f.writeCValue(writer, value, .FunctionArgument); | 6345 | try f.writeCValue(writer, index, .Other); |
| 6346 | try writer.print(", {d});\n", .{elem_abi_size}); | 6346 | try writer.writeByte(']'); |
| 6347 | } else { | 6347 | try a.assign(f, writer); |
| 6348 | try writer.writeAll("(("); | 6348 | try f.writeCValue(writer, value, .Other); |
| 6349 | try f.renderType(writer, elem_ptr_ty); | 6349 | try a.end(f, writer); |
| 6350 | try writer.writeByte(')'); | | |
| 6351 | try writeSliceOrPtr(f, writer, dest_slice, dest_ty); | | |
| 6352 | try writer.writeAll(")["); | | |
| 6353 | try f.writeCValue(writer, index, .Other); | | |
| 6354 | try writer.writeAll("] = "); | | |
| 6355 | try f.writeCValue(writer, value, .FunctionArgument); | | |
| 6356 | try writer.writeAll(";\n"); | | |
| 6357 | } | | |
| 6358 | | 6350 | |
| 6359 | try reap(f, inst, &.{ bin_op.lhs, bin_op.rhs }); | 6351 | try reap(f, inst, &.{ bin_op.lhs, bin_op.rhs }); |
| 6360 | try freeLocal(f, inst, index.new_local, 0); | 6352 | try freeLocal(f, inst, index.new_local, 0); |