authorgravatar for xtex@astrafall.orgxtex <xtex@astrafall.org> 2026-10-16 09:18:27+08:00
committergravatar for xtex@astrafall.orgxtex <xtex@astrafall.org> 2026-10-17 10:26:20+08:00
log415bc9e8fe70c488db4298d9aa47751f6659dfb2
treefd7df98da67ad77915c44d5ae0669e000388a890
parentf039581a2d9c4072db3f5d97c238a1a02d027c00
signature Signed by SSH key SHA256:IEYEjkZlkUTr5U9GiDAmZU/4eZus2t2RsxusyhQqwao

loongarch: fix post-materialization sign-extend sequence


1 files changed, 7 insertions(+), 7 deletions(-)

src/codegen/loongarch/Select.zig+7-7
...@@ -2127,13 +2127,6 @@ pub const Value = struct {...@@ -2127,13 +2127,6 @@ pub const Value = struct {
2127 .large => value.location_payload.large.stack_slot = vi.allocStackSlot(isel),2127 .large => value.location_payload.large.stack_slot = vi.allocStackSlot(isel),
2128 }2128 }
2129 }2129 }
2130 switch (value.flags.location_tag) {
2131 .extreme => unreachable,
2132 .small => {},
2133 .large => {
2134 try vi.reextendAdvanced(isel, vi.bitSize(isel), mat.extension, vi.extension(isel));
2135 },
2136 }
2137 const vi_loc = vi.location(isel).?;2130 const vi_loc = vi.location(isel).?;
2138 const maybe_loc_reg = vi_loc.asRegister();2131 const maybe_loc_reg = vi_loc.asRegister();
2139 if (maybe_loc_reg) |loc_reg| {2132 if (maybe_loc_reg) |loc_reg| {
...@@ -2155,6 +2148,13 @@ pub const Value = struct {...@@ -2155,6 +2148,13 @@ pub const Value = struct {
2155 assert(loc_live.* == .allocating);2148 assert(loc_live.* == .allocating);
2156 loc_live.* = vi;2149 loc_live.* = vi;
2157 }2150 }
2151 switch (value.flags.location_tag) {
2152 .extreme => unreachable,
2153 .small => {},
2154 .large => {
2155 try vi.reextendAdvanced(isel, vi.bitSize(isel), mat.extension, vi.extension(isel));
2156 },
2157 }
2158 },2158 },
2159 .value => unreachable,2159 .value => unreachable,
2160 .address => |addr_vi| {2160 .address => |addr_vi| {