diff options
author | Xi Ruoyao <xry111@xry111.site> | 2025-03-01 11:46:50 +0800 |
---|---|---|
committer | Lulu Cheng <chenglulu@loongson.cn> | 2025-08-18 09:09:35 +0800 |
commit | c9374dbf9d16b35886711a91993bcdec490722e7 (patch) | |
tree | c046ff15163bd6a1db0bedeca9fae84c80ba041f /libgfortran/generated/shape_i16.c | |
parent | 6d67bbce340351cfe7f30f1b17cba7635f18c8d5 (diff) | |
download | gcc-c9374dbf9d16b35886711a91993bcdec490722e7.zip gcc-c9374dbf9d16b35886711a91993bcdec490722e7.tar.gz gcc-c9374dbf9d16b35886711a91993bcdec490722e7.tar.bz2 |
LoongArch: Implement atomic_fetch_nand<GPR:mode>
Without atomic_fetch_nandsi and atomic_fetch_nanddi, __atomic_fetch_nand
is expanded to a loop containing a CAS in the body, and CAS itself is a
LL-SC loop so we have a nested loop. This is obviously not a good idea
as we just need one LL-SC loop in fact.
As ~(atom & mask) is (~mask) | (~atom), we can just invert the mask
first and the body of the LL-SC loop would be just one orn instruction.
gcc/ChangeLog:
* config/loongarch/sync.md
(atomic_fetch_nand_mask_inverted<GPR:mode>): New define_insn.
(atomic_fetch_nand<GPR:mode>): New define_expand.
Diffstat (limited to 'libgfortran/generated/shape_i16.c')
0 files changed, 0 insertions, 0 deletions