aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.h
diff options
context:
space:
mode:
authorKito Cheng <kito.cheng@sifive.com>2024-02-28 16:01:52 +0800
committerKito Cheng <kito.cheng@sifive.com>2024-02-29 11:05:21 +0800
commitfd07a29e39f5347d6cef3e7042a32306f97a1719 (patch)
tree9d8de21d93e2ce4157969f8e10885e83fbb870e1 /gcc/function.h
parent5ff49272bf4eb6a030739cc24ba001f206305e08 (diff)
downloadgcc-fd07a29e39f5347d6cef3e7042a32306f97a1719.zip
gcc-fd07a29e39f5347d6cef3e7042a32306f97a1719.tar.gz
gcc-fd07a29e39f5347d6cef3e7042a32306f97a1719.tar.bz2
RISC-V: Fix __atomic_compare_exchange with 32 bit value on RV64
atomic_compare_and_swapsi will use lr.w to do obtain the original value, which sign extends to DI. RV64 only has DI comparisons, so we also need to sign extend the expected value to DI as otherwise the comparison will fail when the expected value has the 32nd bit set. gcc/ChangeLog: PR target/114130 * config/riscv/sync.md (atomic_compare_and_swap<mode>): Sign extend the expected value if needed. gcc/testsuite/ChangeLog: * gcc.target/riscv/pr114130.c: New. Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'gcc/function.h')
0 files changed, 0 insertions, 0 deletions