| ... | @@ -170058,12 +170058,9 @@ fn airTrunc(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -170058,12 +170058,9 @@ fn airTrunc(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 170058 | }); | 170058 | }); |
| 170059 | const splat_abi_size: u32 = @intCast(splat_ty.abiSize(zcu)); | 170059 | const splat_abi_size: u32 = @intCast(splat_ty.abiSize(zcu)); |
| 170060 | | 170060 | |
| 170061 | const splat_val = try pt.intern(.{ .aggregate = .{ | 170061 | const splat_val = try pt.aggregateSplatValue(splat_ty, mask_val); |
| 170062 | .ty = splat_ty.ip_index, | | |
| 170063 | .storage = .{ .repeated_elem = mask_val.ip_index }, | | |
| 170064 | } }); | | |
| 170065 | | 170062 | |
| 170066 | const splat_mcv = try self.lowerValue(.fromInterned(splat_val)); | 170063 | const splat_mcv = try self.lowerValue(splat_val); |
| 170067 | const splat_addr_mcv: MCValue = switch (splat_mcv) { | 170064 | const splat_addr_mcv: MCValue = switch (splat_mcv) { |
| 170068 | .memory, .indirect, .load_frame => splat_mcv.address(), | 170065 | .memory, .indirect, .load_frame => splat_mcv.address(), |
| 170069 | else => .{ .register = try self.copyToTmpRegister(.usize, splat_mcv.address()) }, | 170066 | else => .{ .register = try self.copyToTmpRegister(.usize, splat_mcv.address()) }, |
| ... | @@ -171693,12 +171690,12 @@ fn airShlShrBinOp(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -171693,12 +171690,12 @@ fn airShlShrBinOp(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 171693 | defer self.register_manager.unlockReg(shift_lock); | 171690 | defer self.register_manager.unlockReg(shift_lock); |
| 171694 | | 171691 | |
| 171695 | const mask_ty = try pt.vectorType(.{ .len = 16, .child = .u8_type }); | 171692 | const mask_ty = try pt.vectorType(.{ .len = 16, .child = .u8_type }); |
| 171696 | const mask_mcv = try self.lowerValue(.fromInterned(try pt.intern(.{ .aggregate = .{ | 171693 | const mask_mcv = try self.lowerValue(try pt.aggregateValue( |
| 171697 | .ty = mask_ty.toIntern(), | 171694 | mask_ty, |
| 171698 | .storage = .{ .elems = &([1]InternPool.Index{ | 171695 | &([1]InternPool.Index{ |
| 171699 | (try rhs_ty.childType(zcu).maxIntScalar(pt, .u8)).toIntern(), | 171696 | (try rhs_ty.childType(zcu).maxIntScalar(pt, .u8)).toIntern(), |
| 171700 | } ++ [1]InternPool.Index{.zero_u8} ** 15) }, | 171697 | } ++ [1]InternPool.Index{.zero_u8} ** 15), |
| 171701 | } }))); | 171698 | )); |
| 171702 | const mask_addr_reg = try self.copyToTmpRegister(.usize, mask_mcv.address()); | 171699 | const mask_addr_reg = try self.copyToTmpRegister(.usize, mask_mcv.address()); |
| 171703 | const mask_addr_lock = self.register_manager.lockRegAssumeUnused(mask_addr_reg); | 171700 | const mask_addr_lock = self.register_manager.lockRegAssumeUnused(mask_addr_reg); |
| 171704 | defer self.register_manager.unlockReg(mask_addr_lock); | 171701 | defer self.register_manager.unlockReg(mask_addr_lock); |
| ... | @@ -181139,10 +181136,7 @@ fn genSetReg( | ... | @@ -181139,10 +181136,7 @@ fn genSetReg( |
| 181139 | .child = .u8_type, | 181136 | .child = .u8_type, |
| 181140 | }); | 181137 | }); |
| 181141 | try self.genSetReg(dst_reg, full_ty, try self.lowerValue( | 181138 | try self.genSetReg(dst_reg, full_ty, try self.lowerValue( |
| 181142 | .fromInterned(try pt.intern(.{ .aggregate = .{ | 181139 | try pt.aggregateSplatValue(full_ty, try pt.intValue(.u8, 0xaa)), |
| 181143 | .ty = full_ty.toIntern(), | | |
| 181144 | .storage = .{ .repeated_elem = (try pt.intValue(.u8, 0xaa)).toIntern() }, | | |
| 181145 | } })), | | |
| 181146 | ), opts); | 181140 | ), opts); |
| 181147 | }, | 181141 | }, |
| 181148 | .x87 => try self.genSetReg(dst_reg, .f80, try self.lowerValue( | 181142 | .x87 => try self.genSetReg(dst_reg, .f80, try self.lowerValue( |
| ... | @@ -183565,10 +183559,7 @@ fn airSelect(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -183565,10 +183559,7 @@ fn airSelect(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 183565 | mask_elem_ty, | 183559 | mask_elem_ty, |
| 183566 | @as(u8, 1) << @truncate(bit), | 183560 | @as(u8, 1) << @truncate(bit), |
| 183567 | )).toIntern(); | 183561 | )).toIntern(); |
| 183568 | const mask_mcv = try self.lowerValue(.fromInterned(try pt.intern(.{ .aggregate = .{ | 183562 | const mask_mcv = try self.lowerValue(try pt.aggregateValue(mask_ty, mask_elems)); |
| 183569 | .ty = mask_ty.toIntern(), | | |
| 183570 | .storage = .{ .elems = mask_elems }, | | |
| 183571 | } }))); | | |
| 183572 | const mask_mem: Memory = .{ | 183563 | const mask_mem: Memory = .{ |
| 183573 | .base = .{ .reg = try self.copyToTmpRegister(.usize, mask_mcv.address()) }, | 183564 | .base = .{ .reg = try self.copyToTmpRegister(.usize, mask_mcv.address()) }, |
| 183574 | .mod = .{ .rm = .{ .size = self.memSize(ty) } }, | 183565 | .mod = .{ .rm = .{ .size = self.memSize(ty) } }, |
| ... | @@ -184296,10 +184287,9 @@ fn airShuffle(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -184296,10 +184287,9 @@ fn airShuffle(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 184296 | else | 184287 | else |
| 184297 | try select_mask_elem_ty.minIntScalar(pt, select_mask_elem_ty)).toIntern(); | 184288 | try select_mask_elem_ty.minIntScalar(pt, select_mask_elem_ty)).toIntern(); |
| 184298 | } | 184289 | } |
| 184299 | const select_mask_mcv = try self.lowerValue(.fromInterned(try pt.intern(.{ .aggregate = .{ | 184290 | const select_mask_mcv = try self.lowerValue( |
| 184300 | .ty = select_mask_ty.toIntern(), | 184291 | try pt.aggregateValue(select_mask_ty, select_mask_elems[0..mask_elems.len]), |
| 184301 | .storage = .{ .elems = select_mask_elems[0..mask_elems.len] }, | 184292 | ); |
| 184302 | } }))); | | |
| 184303 | | 184293 | |
| 184304 | if (self.hasFeature(.sse4_1)) { | 184294 | if (self.hasFeature(.sse4_1)) { |
| 184305 | const mir_tag: Mir.Inst.FixedTag = .{ | 184295 | const mir_tag: Mir.Inst.FixedTag = .{ |
| ... | @@ -184441,10 +184431,9 @@ fn airShuffle(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -184441,10 +184431,9 @@ fn airShuffle(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 184441 | })).toIntern(); | 184431 | })).toIntern(); |
| 184442 | } | 184432 | } |
| 184443 | const lhs_mask_ty = try pt.vectorType(.{ .len = max_abi_size, .child = .u8_type }); | 184433 | const lhs_mask_ty = try pt.vectorType(.{ .len = max_abi_size, .child = .u8_type }); |
| 184444 | const lhs_mask_mcv = try self.lowerValue(.fromInterned(try pt.intern(.{ .aggregate = .{ | 184434 | const lhs_mask_mcv = try self.lowerValue( |
| 184445 | .ty = lhs_mask_ty.toIntern(), | 184435 | try pt.aggregateValue(lhs_mask_ty, lhs_mask_elems[0..max_abi_size]), |
| 184446 | .storage = .{ .elems = lhs_mask_elems[0..max_abi_size] }, | 184436 | ); |
| 184447 | } }))); | | |
| 184448 | const lhs_mask_mem: Memory = .{ | 184437 | const lhs_mask_mem: Memory = .{ |
| 184449 | .base = .{ .reg = try self.copyToTmpRegister(.usize, lhs_mask_mcv.address()) }, | 184438 | .base = .{ .reg = try self.copyToTmpRegister(.usize, lhs_mask_mcv.address()) }, |
| 184450 | .mod = .{ .rm = .{ .size = .fromSize(@max(max_abi_size, 16)) } }, | 184439 | .mod = .{ .rm = .{ .size = .fromSize(@max(max_abi_size, 16)) } }, |
| ... | @@ -184472,10 +184461,9 @@ fn airShuffle(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -184472,10 +184461,9 @@ fn airShuffle(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 184472 | })).toIntern(); | 184461 | })).toIntern(); |
| 184473 | } | 184462 | } |
| 184474 | const rhs_mask_ty = try pt.vectorType(.{ .len = max_abi_size, .child = .u8_type }); | 184463 | const rhs_mask_ty = try pt.vectorType(.{ .len = max_abi_size, .child = .u8_type }); |
| 184475 | const rhs_mask_mcv = try self.lowerValue(.fromInterned(try pt.intern(.{ .aggregate = .{ | 184464 | const rhs_mask_mcv = try self.lowerValue( |
| 184476 | .ty = rhs_mask_ty.toIntern(), | 184465 | try pt.aggregateValue(rhs_mask_ty, rhs_mask_elems[0..max_abi_size]), |
| 184477 | .storage = .{ .elems = rhs_mask_elems[0..max_abi_size] }, | 184466 | ); |
| 184478 | } }))); | | |
| 184479 | const rhs_mask_mem: Memory = .{ | 184467 | const rhs_mask_mem: Memory = .{ |
| 184480 | .base = .{ .reg = try self.copyToTmpRegister(.usize, rhs_mask_mcv.address()) }, | 184468 | .base = .{ .reg = try self.copyToTmpRegister(.usize, rhs_mask_mcv.address()) }, |
| 184481 | .mod = .{ .rm = .{ .size = .fromSize(@max(max_abi_size, 16)) } }, | 184469 | .mod = .{ .rm = .{ .size = .fromSize(@max(max_abi_size, 16)) } }, |
| ... | @@ -192924,36 +192912,30 @@ const Select = struct { | ... | @@ -192924,36 +192912,30 @@ const Select = struct { |
| 192924 | break :res_scalar .{ res_scalar_ty, try pt.intValue_big(res_scalar_ty, res_big_int.toConst()) }; | 192912 | break :res_scalar .{ res_scalar_ty, try pt.intValue_big(res_scalar_ty, res_big_int.toConst()) }; |
| 192925 | }, | 192913 | }, |
| 192926 | }; | 192914 | }; |
| 192927 | const res_val: Value = if (res_vector_len) |len| .fromInterned(try pt.intern(.{ .aggregate = .{ | 192915 | const res_val = if (res_vector_len) |len| try pt.aggregateSplatValue(try pt.vectorType(.{ |
| 192928 | .ty = (try pt.vectorType(.{ | 192916 | .len = len, |
| 192929 | .len = len, | 192917 | .child = res_scalar_ty.toIntern(), |
| 192930 | .child = res_scalar_ty.toIntern(), | 192918 | }), res_scalar_val) else res_scalar_val; |
| 192931 | })).toIntern(), | | |
| 192932 | .storage = .{ .repeated_elem = res_scalar_val.toIntern() }, | | |
| 192933 | } })) else res_scalar_val; | | |
| 192934 | return .{ try cg.tempMemFromValue(res_val), true }; | 192919 | return .{ try cg.tempMemFromValue(res_val), true }; |
| 192935 | }, | 192920 | }, |
| 192936 | .f64_0x1p52_0x1p84_mem => .{ try cg.tempMemFromValue(.fromInterned(try pt.intern(.{ .aggregate = .{ | 192921 | .f64_0x1p52_0x1p84_mem => .{ try cg.tempMemFromValue( |
| 192937 | .ty = (try pt.vectorType(.{ .len = 2, .child = .f64_type })).toIntern(), | 192922 | try pt.aggregateValue(try pt.vectorType(.{ .len = 2, .child = .f64_type }), &.{ |
| 192938 | .storage = .{ .elems = &.{ | | |
| 192939 | (try pt.floatValue(.f64, @as(f64, 0x1p52))).toIntern(), | 192923 | (try pt.floatValue(.f64, @as(f64, 0x1p52))).toIntern(), |
| 192940 | (try pt.floatValue(.f64, @as(f64, 0x1p84))).toIntern(), | 192924 | (try pt.floatValue(.f64, @as(f64, 0x1p84))).toIntern(), |
| 192941 | } }, | 192925 | }), |
| 192942 | } }))), true }, | 192926 | ), true }, |
| 192943 | .u32_0x1p52_hi_0x1p84_hi_0_0_mem => .{ try cg.tempMemFromValue(.fromInterned(try pt.intern(.{ .aggregate = .{ | 192927 | .u32_0x1p52_hi_0x1p84_hi_0_0_mem => .{ try cg.tempMemFromValue( |
| 192944 | .ty = (try pt.vectorType(.{ .len = 4, .child = .u32_type })).toIntern(), | 192928 | try pt.aggregateValue(try pt.vectorType(.{ .len = 4, .child = .u32_type }), &(.{ |
| 192945 | .storage = .{ .elems = &(.{ | | |
| 192946 | (try pt.intValue(.u32, @as(u64, @bitCast(@as(f64, 0x1p52))) >> 32)).toIntern(), | 192929 | (try pt.intValue(.u32, @as(u64, @bitCast(@as(f64, 0x1p52))) >> 32)).toIntern(), |
| 192947 | (try pt.intValue(.u32, @as(u64, @bitCast(@as(f64, 0x1p84))) >> 32)).toIntern(), | 192930 | (try pt.intValue(.u32, @as(u64, @bitCast(@as(f64, 0x1p84))) >> 32)).toIntern(), |
| 192948 | } ++ .{(try pt.intValue(.u32, 0)).toIntern()} ** 2) }, | 192931 | } ++ .{(try pt.intValue(.u32, 0)).toIntern()} ** 2)), |
| 192949 | } }))), true }, | 192932 | ), true }, |
| 192950 | .f32_0_0x1p64_mem => .{ try cg.tempMemFromValue(.fromInterned(try pt.intern(.{ .aggregate = .{ | 192933 | .f32_0_0x1p64_mem => .{ try cg.tempMemFromValue( |
| 192951 | .ty = (try pt.vectorType(.{ .len = 2, .child = .f32_type })).toIntern(), | 192934 | try pt.aggregateValue(try pt.vectorType(.{ .len = 2, .child = .f32_type }), &.{ |
| 192952 | .storage = .{ .elems = &.{ | | |
| 192953 | (try pt.floatValue(.f32, @as(f32, 0))).toIntern(), | 192935 | (try pt.floatValue(.f32, @as(f32, 0))).toIntern(), |
| 192954 | (try pt.floatValue(.f32, @as(f32, 0x1p64))).toIntern(), | 192936 | (try pt.floatValue(.f32, @as(f32, 0x1p64))).toIntern(), |
| 192955 | } }, | 192937 | }), |
| 192956 | } }))), true }, | 192938 | ), true }, |
| 192957 | .pshufb_splat_mem => |splat_spec| { | 192939 | .pshufb_splat_mem => |splat_spec| { |
| 192958 | const zcu = pt.zcu; | 192940 | const zcu = pt.zcu; |
| 192959 | assert(spec.type.isVector(zcu) and spec.type.childType(zcu).toIntern() == .u8_type); | 192941 | assert(spec.type.isVector(zcu) and spec.type.childType(zcu).toIntern() == .u8_type); |
| ... | @@ -193110,13 +193092,10 @@ const Select = struct { | ... | @@ -193110,13 +193092,10 @@ const Select = struct { |
| 193110 | const mem_size = cg.unalignedSize(spec.type); | 193092 | const mem_size = cg.unalignedSize(spec.type); |
| 193111 | return .{ try cg.tempMemFromAlignedValue( | 193093 | return .{ try cg.tempMemFromAlignedValue( |
| 193112 | if (mem_size < 16) .fromByteUnits(mem_size) else .none, | 193094 | if (mem_size < 16) .fromByteUnits(mem_size) else .none, |
| 193113 | .fromInterned(try pt.intern(.{ .aggregate = .{ | 193095 | try pt.aggregateValue(if (mem_size < 16) try pt.arrayType(.{ |
| 193114 | .ty = if (mem_size < 16) | 193096 | .len = elems.len, |
| 193115 | (try pt.arrayType(.{ .len = elems.len, .child = elem_ty.toIntern() })).toIntern() | 193097 | .child = elem_ty.toIntern(), |
| 193116 | else | 193098 | }) else spec.type, elems), |
| 193117 | spec.type.toIntern(), | | |
| 193118 | .storage = .{ .elems = elems }, | | |
| 193119 | } })), | | |
| 193120 | ), true }; | 193099 | ), true }; |
| 193121 | }, | 193100 | }, |
| 193122 | .splat_float_mem => |splat_spec| { | 193101 | .splat_float_mem => |splat_spec| { |
| ... | @@ -193133,10 +193112,7 @@ const Select = struct { | ... | @@ -193133,10 +193112,7 @@ const Select = struct { |
| 193133 | .zero => 0.0, | 193112 | .zero => 0.0, |
| 193134 | }))).toIntern()); | 193113 | }))).toIntern()); |
| 193135 | @memset(elems[inside_len..], (try pt.floatValue(elem_ty, splat_spec.outside)).toIntern()); | 193114 | @memset(elems[inside_len..], (try pt.floatValue(elem_ty, splat_spec.outside)).toIntern()); |
| 193136 | return .{ try cg.tempMemFromValue(.fromInterned(try pt.intern(.{ .aggregate = .{ | 193115 | return .{ try cg.tempMemFromValue(try pt.aggregateValue(spec.type, elems)), true }; |
| 193137 | .ty = spec.type.toIntern(), | | |
| 193138 | .storage = .{ .elems = elems }, | | |
| 193139 | } }))), true }; | | |
| 193140 | }, | 193116 | }, |
| 193141 | .frame => |frame_index| .{ try cg.tempInit(spec.type, .{ .load_frame = .{ | 193117 | .frame => |frame_index| .{ try cg.tempInit(spec.type, .{ .load_frame = .{ |
| 193142 | .index = frame_index, | 193118 | .index = frame_index, |