diff options
author | John David Anglin <danglin@gcc.gnu.org> | 2021-12-27 17:56:19 +0000 |
---|---|---|
committer | John David Anglin <danglin@gcc.gnu.org> | 2021-12-27 17:56:19 +0000 |
commit | ea8b5640551ee7cbecf5c3ce30f0268963de3039 (patch) | |
tree | a74fe47f5f105b6c0688cc5d06b81fad74a2e696 /gcc/config/pa/pa.md | |
parent | 916ec36d0a3ef3fe44c1657746922a5f18b60326 (diff) | |
download | gcc-ea8b5640551ee7cbecf5c3ce30f0268963de3039.zip gcc-ea8b5640551ee7cbecf5c3ce30f0268963de3039.tar.gz gcc-ea8b5640551ee7cbecf5c3ce30f0268963de3039.tar.bz2 |
Improve atomic store implementation on hppa-linux.
2021-12-27 John David Anglin <danglin@gcc.gnu.org>
gcc/ChangeLog:
* config/pa/pa-protos.h: Delete
pa_maybe_emit_compare_and_swap_exchange_loop() declaration.
* config/pa/pa.c (pa_expand_compare_and_swap_loop): Delete.
(pa_maybe_emit_compare_and_swap_exchange_loop): Delete.
* config/pa/pa.md (atomic_storeq): Use __sync_lock_test_and_set
instead of pa_maybe_emit_compare_and_swap_exchange_loop.
(atomic_storehi, atomic_storesi, atomic_storedi): Likewise.
Diffstat (limited to 'gcc/config/pa/pa.md')
-rw-r--r-- | gcc/config/pa/pa.md | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index f124c30..af5449a 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -10366,10 +10366,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" { if (TARGET_SYNC_LIBCALL) { - rtx mem = operands[0]; - rtx val = operands[1]; - if (pa_maybe_emit_compare_and_swap_exchange_loop (NULL_RTX, mem, val)) - DONE; + rtx libfunc = init_one_libfunc ("__sync_lock_test_and_set_1"); + + emit_library_call (libfunc, LCT_NORMAL, VOIDmode, + XEXP (operands[0], 0), Pmode, + operands[1], QImode); + DONE; } FAIL; }) @@ -10384,10 +10386,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" { if (TARGET_SYNC_LIBCALL) { - rtx mem = operands[0]; - rtx val = operands[1]; - if (pa_maybe_emit_compare_and_swap_exchange_loop (NULL_RTX, mem, val)) - DONE; + rtx libfunc = init_one_libfunc ("__sync_lock_test_and_set_2"); + + emit_library_call (libfunc, LCT_NORMAL, VOIDmode, + XEXP (operands[0], 0), Pmode, + operands[1], HImode); + DONE; } FAIL; }) @@ -10402,10 +10406,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" { if (TARGET_SYNC_LIBCALL) { - rtx mem = operands[0]; - rtx val = operands[1]; - if (pa_maybe_emit_compare_and_swap_exchange_loop (NULL_RTX, mem, val)) - DONE; + rtx libfunc = init_one_libfunc ("__sync_lock_test_and_set_4"); + + emit_library_call (libfunc, LCT_NORMAL, VOIDmode, + XEXP (operands[0], 0), Pmode, + operands[1], SImode); + DONE; } FAIL; }) @@ -10453,10 +10459,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" if (TARGET_SYNC_LIBCALL) { - rtx mem = operands[0]; - rtx val = operands[1]; - if (pa_maybe_emit_compare_and_swap_exchange_loop (NULL_RTX, mem, val)) - DONE; + rtx libfunc = init_one_libfunc ("__sync_lock_test_and_set_8"); + + emit_library_call (libfunc, LCT_NORMAL, VOIDmode, + XEXP (operands[0], 0), Pmode, + operands[1], DImode); + DONE; } if (TARGET_64BIT || TARGET_SOFT_FLOAT) |