diff options
author | Xi Ruoyao <xry111@xry111.site> | 2025-03-01 11:46:48 +0800 |
---|---|---|
committer | Lulu Cheng <chenglulu@loongson.cn> | 2025-08-18 09:09:35 +0800 |
commit | cff7790016b2d9c00b8675dc5428fc47d03aa9f2 (patch) | |
tree | 1048a0d65a7139afdfeee28cdced9ec2fcf945f4 /libgfortran/generated | |
parent | 1f1ab36058abc80c306ad022540df1c4f835612f (diff) | |
download | gcc-cff7790016b2d9c00b8675dc5428fc47d03aa9f2.zip gcc-cff7790016b2d9c00b8675dc5428fc47d03aa9f2.tar.gz gcc-cff7790016b2d9c00b8675dc5428fc47d03aa9f2.tar.bz2 |
LoongArch: Implement subword atomic_fetch_{and, or, xor} with am*.w instructions
We can just shift the mask and fill the other bits with 0 (for ior/xor)
or 1 (for and), and use an am*.w instruction to perform the atomic
operation, instead of using a LL-SC loop.
gcc/ChangeLog:
* config/loongarch/sync.md (UNSPEC_COMPARE_AND_SWAP_AND):
Remove.
(UNSPEC_COMPARE_AND_SWAP_XOR): Remove.
(UNSPEC_COMPARE_AND_SWAP_OR): Remove.
(atomic_test_and_set): Rename to ...
(atomic_fetch_<any_bitwise:amop><SHORT:mode>): ... this, and
adapt the expansion to use it for any bitwise operations and any
val, instead of just ior 1.
(atomic_test_and_set): New define_expand.
Diffstat (limited to 'libgfortran/generated')
0 files changed, 0 insertions, 0 deletions