| ... | @@ -5966,7 +5966,7 @@ pub const FuncGen = struct { | ... | @@ -5966,7 +5966,7 @@ pub const FuncGen = struct { |
| 5966 | const shift_amt = containing_int.typeOf().constInt(bit_offset, .False); | 5966 | const shift_amt = containing_int.typeOf().constInt(bit_offset, .False); |
| 5967 | const shifted_value = self.builder.buildLShr(containing_int, shift_amt, ""); | 5967 | const shifted_value = self.builder.buildLShr(containing_int, shift_amt, ""); |
| 5968 | const elem_llvm_ty = try self.dg.lowerType(field_ty); | 5968 | const elem_llvm_ty = try self.dg.lowerType(field_ty); |
| 5969 | if (field_ty.zigTypeTag() == .Float) { | 5969 | if (field_ty.zigTypeTag() == .Float or field_ty.zigTypeTag() == .Vector) { |
| 5970 | const elem_bits = @intCast(c_uint, field_ty.bitSize(target)); | 5970 | const elem_bits = @intCast(c_uint, field_ty.bitSize(target)); |
| 5971 | const same_size_int = self.context.intType(elem_bits); | 5971 | const same_size_int = self.context.intType(elem_bits); |
| 5972 | const truncated_int = self.builder.buildTrunc(shifted_value, same_size_int, ""); | 5972 | const truncated_int = self.builder.buildTrunc(shifted_value, same_size_int, ""); |
| ... | @@ -5989,7 +5989,7 @@ pub const FuncGen = struct { | ... | @@ -5989,7 +5989,7 @@ pub const FuncGen = struct { |
| 5989 | assert(struct_ty.containerLayout() == .Packed); | 5989 | assert(struct_ty.containerLayout() == .Packed); |
| 5990 | const containing_int = struct_llvm_val; | 5990 | const containing_int = struct_llvm_val; |
| 5991 | const elem_llvm_ty = try self.dg.lowerType(field_ty); | 5991 | const elem_llvm_ty = try self.dg.lowerType(field_ty); |
| 5992 | if (field_ty.zigTypeTag() == .Float) { | 5992 | if (field_ty.zigTypeTag() == .Float or field_ty.zigTypeTag() == .Vector) { |
| 5993 | const elem_bits = @intCast(c_uint, field_ty.bitSize(target)); | 5993 | const elem_bits = @intCast(c_uint, field_ty.bitSize(target)); |
| 5994 | const same_size_int = self.context.intType(elem_bits); | 5994 | const same_size_int = self.context.intType(elem_bits); |
| 5995 | const truncated_int = self.builder.buildTrunc(containing_int, same_size_int, ""); | 5995 | const truncated_int = self.builder.buildTrunc(containing_int, same_size_int, ""); |
| ... | @@ -9889,7 +9889,7 @@ pub const FuncGen = struct { | ... | @@ -9889,7 +9889,7 @@ pub const FuncGen = struct { |
| 9889 | return result_ptr; | 9889 | return result_ptr; |
| 9890 | } | 9890 | } |
| 9891 | | 9891 | |
| 9892 | if (info.pointee_type.zigTypeTag() == .Float) { | 9892 | if (info.pointee_type.zigTypeTag() == .Float or info.pointee_type.zigTypeTag() == .Vector) { |
| 9893 | const same_size_int = self.context.intType(elem_bits); | 9893 | const same_size_int = self.context.intType(elem_bits); |
| 9894 | const truncated_int = self.builder.buildTrunc(shifted_value, same_size_int, ""); | 9894 | const truncated_int = self.builder.buildTrunc(shifted_value, same_size_int, ""); |
| 9895 | return self.builder.buildBitCast(truncated_int, elem_llvm_ty, ""); | 9895 | return self.builder.buildBitCast(truncated_int, elem_llvm_ty, ""); |