[llvm] [Mips] Fix missing sign extension in expansion of sub-word atomic max (PR #77072)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 17 00:04:38 PDT 2024
yingopq wrote:
> There's definitely an issue in this sequence
>
> ```
> ; MIPSEL-NEXT: srav $2, $2, $10
> ; MIPSEL-NEXT: srav $7, $7, $10
> ; MIPSEL-NEXT: seh $2, $2
> ; MIPSEL-NEXT: seh $7, $7
> ; MIPSEL-NEXT: slt $5, $2, $7
> ; MIPSEL-NEXT: move $3, $2
> ; MIPSEL-NEXT: movn $3, $7, $5
> ```
>
> The move and movn need to use the values in $2 and $7 before the srav and seh. The rest of the code expect the 16 bit value to be in the same place in the register as it was when it came out of the load.
@topperc Thanks so much for pointing out the key to the problem, and I have verified that this is indeed the problem. I would submit patch again.
https://github.com/llvm/llvm-project/pull/77072
More information about the llvm-commits
mailing list