[llvm] [MIPS] Sign-extend subwords when expanding atomic max/min (PR #89246)
YunQiang Su via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 19 01:35:37 PDT 2024
================
@@ -1118,6 +1118,8 @@ define i16 @test_max_16(ptr nocapture %ptr, i16 signext %val) {
; MIPSEL-NEXT: srav $7, $7, $10
; MIPSEL-NEXT: seh $2, $2
; MIPSEL-NEXT: seh $7, $7
+; MIPSEL-NEXT: sllv $2, $2, $10
----------------
wzssyqa wrote:
I see. Thanks.
While it seems there is another problem introduced by the previous patch (not your current):
if `ptr` is something like
```
struct xx {
int16 a;
int16 b;
}
```
our code will overwrite another halfword.
https://github.com/llvm/llvm-project/pull/89246
More information about the llvm-commits
mailing list