diff options
author | Xi Ruoyao <xry111@xry111.site> | 2025-03-01 11:46:49 +0800 |
---|---|---|
committer | Lulu Cheng <chenglulu@loongson.cn> | 2025-08-18 09:09:35 +0800 |
commit | 6d67bbce340351cfe7f30f1b17cba7635f18c8d5 (patch) | |
tree | a6771f49ded911abf0d60a0a44e93fa48247cd51 /gcc | |
parent | cff7790016b2d9c00b8675dc5428fc47d03aa9f2 (diff) | |
download | gcc-6d67bbce340351cfe7f30f1b17cba7635f18c8d5.zip gcc-6d67bbce340351cfe7f30f1b17cba7635f18c8d5.tar.gz gcc-6d67bbce340351cfe7f30f1b17cba7635f18c8d5.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/loongarch/sync.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/config/loongarch/sync.md b/gcc/config/loongarch/sync.md index b6acfff..6003825 100644 --- a/gcc/config/loongarch/sync.md +++ b/gcc/config/loongarch/sync.md @@ -661,7 +661,7 @@ (match_operand:SHORT 2 "reg_or_0_operand" "rJ")) (match_operand:SI 3 "const_int_operand")] ;; model UNSPEC_SYNC_OLD_OP))] - "" + "!ISA_HAS_LAM_BH" { union loongarch_gen_fn_ptrs generator; generator.fn_7 = gen_atomic_cas_value_sub_7_si; |