| ... | ... | @@ -3831,14 +3831,10 @@ static LLVMValueRef ir_render_load_ptr(CodeGen *g, Stage1Air *executable, |
| 3831 | 3831 | LLVMValueRef shift_amt_val = LLVMConstInt(LLVMTypeOf(containing_int), shift_amt, false); |
| 3832 | 3832 | LLVMValueRef shifted_value = LLVMBuildLShr(g->builder, containing_int, shift_amt_val, ""); |
| 3833 | 3833 | |
| 3834 | | LLVMTypeRef same_size_int = LLVMIntType(size_in_bits); |
| 3835 | | LLVMValueRef mask = LLVMConstAllOnes(LLVMIntType(size_in_bits)); |
| 3836 | | mask = LLVMConstZExt(mask, LLVMTypeOf(containing_int)); |
| 3837 | | LLVMValueRef masked_value = LLVMBuildAnd(g->builder, shifted_value, mask, ""); |
| 3838 | | |
| 3839 | 3834 | if (handle_is_ptr(g, child_type)) { |
| 3840 | 3835 | LLVMValueRef result_loc = ir_llvm_value(g, instruction->result_loc); |
| 3841 | | LLVMValueRef truncated_int = LLVMBuildTrunc(g->builder, masked_value, same_size_int, ""); |
| 3836 | LLVMTypeRef same_size_int = LLVMIntType(size_in_bits); |
| 3837 | LLVMValueRef truncated_int = LLVMBuildTrunc(g->builder, shifted_value, same_size_int, ""); |
| 3842 | 3838 | LLVMValueRef bitcasted_ptr = LLVMBuildBitCast(g->builder, result_loc, |
| 3843 | 3839 | LLVMPointerType(same_size_int, 0), ""); |
| 3844 | 3840 | LLVMBuildStore(g->builder, truncated_int, bitcasted_ptr); |
| ... | ... | @@ -3846,11 +3842,12 @@ static LLVMValueRef ir_render_load_ptr(CodeGen *g, Stage1Air *executable, |
| 3846 | 3842 | } |
| 3847 | 3843 | |
| 3848 | 3844 | if (child_type->id == ZigTypeIdFloat) { |
| 3849 | | LLVMValueRef truncated_int = LLVMBuildTrunc(g->builder, masked_value, same_size_int, ""); |
| 3845 | LLVMTypeRef same_size_int = LLVMIntType(size_in_bits); |
| 3846 | LLVMValueRef truncated_int = LLVMBuildTrunc(g->builder, shifted_value, same_size_int, ""); |
| 3850 | 3847 | return LLVMBuildBitCast(g->builder, truncated_int, get_llvm_type(g, child_type), ""); |
| 3851 | 3848 | } |
| 3852 | 3849 | |
| 3853 | | return LLVMBuildTrunc(g->builder, masked_value, get_llvm_type(g, child_type), ""); |
| 3850 | return LLVMBuildTrunc(g->builder, shifted_value, get_llvm_type(g, child_type), ""); |
| 3854 | 3851 | } |
| 3855 | 3852 | |
| 3856 | 3853 | static bool value_is_all_undef_array(CodeGen *g, ZigValue *const_val, size_t len) { |