| ... | @@ -3703,7 +3703,6 @@ fn airBitcast(f: *Function, inst: Air.Inst.Index) !CValue { | ... | @@ -3703,7 +3703,6 @@ fn airBitcast(f: *Function, inst: Air.Inst.Index) !CValue { |
| 3703 | const local = try f.allocLocal(inst_ty, .Const); | 3703 | const local = try f.allocLocal(inst_ty, .Const); |
| 3704 | try writer.writeAll(" = ("); | 3704 | try writer.writeAll(" = ("); |
| 3705 | try f.renderTypecast(writer, inst_ty); | 3705 | try f.renderTypecast(writer, inst_ty); |
| 3706 | | | |
| 3707 | try writer.writeByte(')'); | 3706 | try writer.writeByte(')'); |
| 3708 | try f.writeCValue(writer, operand, .Other); | 3707 | try f.writeCValue(writer, operand, .Other); |
| 3709 | try writer.writeAll(";\n"); | 3708 | try writer.writeAll(";\n"); |
| ... | @@ -3721,6 +3720,17 @@ fn airBitcast(f: *Function, inst: Air.Inst.Index) !CValue { | ... | @@ -3721,6 +3720,17 @@ fn airBitcast(f: *Function, inst: Air.Inst.Index) !CValue { |
| 3721 | try f.renderTypecast(writer, inst_ty); | 3720 | try f.renderTypecast(writer, inst_ty); |
| 3722 | try writer.writeAll("));\n"); | 3721 | try writer.writeAll("));\n"); |
| 3723 | | 3722 | |
| | 3723 | // Ensure padding bits have the expected value. |
| | 3724 | if (inst_ty.isAbiInt()) { |
| | 3725 | try f.writeCValue(writer, local, .Other); |
| | 3726 | try writer.writeAll(" = zig_wrap_"); |
| | 3727 | try f.object.dg.renderTypeForBuiltinFnName(writer, inst_ty); |
| | 3728 | try writer.writeByte('('); |
| | 3729 | try f.writeCValue(writer, local, .Other); |
| | 3730 | try f.object.dg.renderBuiltinInfo(writer, inst_ty, .Bits); |
| | 3731 | try writer.writeAll(");\n"); |
| | 3732 | } |
| | 3733 | |
| 3724 | return local; | 3734 | return local; |
| 3725 | } | 3735 | } |
| 3726 | | 3736 | |