| ... | @@ -3761,28 +3761,7 @@ pub const Object = struct { | ... | @@ -3761,28 +3761,7 @@ pub const Object = struct { |
| 3761 | }, | 3761 | }, |
| 3762 | .ptr => return o.builder.convConst(try o.lowerPtr(arg_val, 0), llvm_int_ty), | 3762 | .ptr => return o.builder.convConst(try o.lowerPtr(arg_val, 0), llvm_int_ty), |
| 3763 | .aggregate => switch (ip.indexToKey(ty.toIntern())) { | 3763 | .aggregate => switch (ip.indexToKey(ty.toIntern())) { |
| 3764 | .struct_type => { | 3764 | .struct_type, .vector_type => {}, |
| 3765 | const struct_type = ip.loadStructType(ty.toIntern()); | | |
| 3766 | assert(struct_type.haveLayout(ip)); | | |
| 3767 | assert(struct_type.layout == .@"packed"); | | |
| 3768 | comptime assert(Type.packed_struct_layout_version == 2); | | |
| 3769 | var running_int = try o.builder.intConst(llvm_int_ty, 0); | | |
| 3770 | var running_bits: u16 = 0; | | |
| 3771 | for (struct_type.field_types.get(ip), 0..) |field_ty, field_index| { | | |
| 3772 | if (!Type.fromInterned(field_ty).hasRuntimeBitsIgnoreComptime(zcu)) continue; | | |
| 3773 | | | |
| 3774 | const shift_rhs = try o.builder.intConst(llvm_int_ty, running_bits); | | |
| 3775 | const field_val = try o.lowerValueToInt(llvm_int_ty, (try val.fieldValue(pt, field_index)).toIntern()); | | |
| 3776 | const shifted = try o.builder.binConst(.shl, field_val, shift_rhs); | | |
| 3777 | | | |
| 3778 | running_int = try o.builder.binConst(.xor, running_int, shifted); | | |
| 3779 | | | |
| 3780 | const ty_bit_size: u16 = @intCast(Type.fromInterned(field_ty).bitSize(zcu)); | | |
| 3781 | running_bits += ty_bit_size; | | |
| 3782 | } | | |
| 3783 | return running_int; | | |
| 3784 | }, | | |
| 3785 | .vector_type => {}, | | |
| 3786 | else => unreachable, | 3765 | else => unreachable, |
| 3787 | }, | 3766 | }, |
| 3788 | .un => |un| { | 3767 | .un => |un| { |