The immediate 16-bit operand of LOCHI (load halfword immediate on condition) is treated as an unsigned integer instead of a signed integer. This also applies to LOCHHI and LOCGHI.
Created attachment 115989 [details] Sign-extend immediate operand of LOCHI and friends This patch fixes the issue by offering only the non-overlapping vector registers to the register allocator.
(In reply to Andreas Arnez from comment #1) > Created attachment 115989 [details] > Sign-extend immediate operand of LOCHI and friends > > This patch fixes the issue by offering only the non-overlapping vector > registers to the register allocator. Oops, comment to wrong bug. The patch fixes the issue by sign-extending the operand.
(In reply to Andreas Arnez from comment #2) > Oops, comment to wrong bug. The patch fixes the issue by sign-extending the > operand. Ah, fabulous stacked casts! I think 3 levels is a new record for this code base. Seems fine. OK to land.
(In reply to Julian Seward from comment #3) > Ah, fabulous stacked casts! I think 3 levels is a new record for this > code base. Actually it's done this way in several places in this file already... > Seems fine. OK to land. Thanks, pushed as git commit 9545e9f96.