[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 08:23:37 PDT 2024
wzssyqa wrote:
And I find that the current code cannot work with big-endian.
```
#include <stdio.h>
short test_max_16 (short *a, short b);
struct xx {
short a;
short b;
} s = {0x1234, 0x5678};
int main() {
short p = test_max_16 (&(s.b), 0x6789);
printf("%hx, %hx\n", s.b, p);
}
```
```
5678, 5678
```
https://github.com/llvm/llvm-project/pull/89246
More information about the llvm-commits
mailing list