]> git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: Don't expand atomic_fetch_sub_{hi, qi} to LL-SC loop if -mlam-bh
authorXi Ruoyao <xry111@xry111.site>
Sat, 1 Mar 2025 03:46:49 +0000 (11:46 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Mon, 18 Aug 2025 01:09:35 +0000 (09:09 +0800)
commit6d67bbce340351cfe7f30f1b17cba7635f18c8d5
treea6771f49ded911abf0d60a0a44e93fa48247cd51
parentcff7790016b2d9c00b8675dc5428fc47d03aa9f2
LoongArch: Don't expand atomic_fetch_sub_{hi, qi} to LL-SC loop if -mlam-bh

With -mlam-bh, we should negate the addend first, and use an amadd
instruction.  Disabling the expander makes the compiler do it correctly.

gcc/ChangeLog:

* config/loongarch/sync.md (atomic_fetch_sub<SHORT:mode>):
Disable if ISA_HAS_LAM_BH.
gcc/config/loongarch/sync.md