| ... | @@ -3814,6 +3814,16 @@ fn airBitcast(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -3814,6 +3814,16 @@ fn airBitcast(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 3814 | const bitcast_result = try func.bitcast(wanted_ty, given_ty, operand); | 3814 | const bitcast_result = try func.bitcast(wanted_ty, given_ty, operand); |
| 3815 | break :result try bitcast_result.toLocal(func, wanted_ty); | 3815 | break :result try bitcast_result.toLocal(func, wanted_ty); |
| 3816 | } | 3816 | } |
| | 3817 | const mod = func.bin_file.base.options.module.?; |
| | 3818 | if (isByRef(given_ty, mod) and !isByRef(wanted_ty, mod)) { |
| | 3819 | const loaded_memory = try func.load(operand, wanted_ty, 0); |
| | 3820 | break :result try loaded_memory.toLocal(func, wanted_ty); |
| | 3821 | } |
| | 3822 | if (!isByRef(given_ty, mod) and isByRef(wanted_ty, mod)) { |
| | 3823 | const stack_memory = try func.allocStack(wanted_ty); |
| | 3824 | try func.store(stack_memory, operand, given_ty, 0); |
| | 3825 | break :result stack_memory; |
| | 3826 | } |
| 3817 | break :result func.reuseOperand(ty_op.operand, operand); | 3827 | break :result func.reuseOperand(ty_op.operand, operand); |
| 3818 | }; | 3828 | }; |
| 3819 | func.finishAir(inst, result, &.{ty_op.operand}); | 3829 | func.finishAir(inst, result, &.{ty_op.operand}); |