nvptx: Add support for subword compare-and-swap
authorKwok Cheung Yeung <kcy@codesourcery.com>
Mon, 3 Aug 2020 15:38:13 +0000 (17:38 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 13 Aug 2020 09:11:55 +0000 (11:11 +0200)
commit17dc08edc28f4fc25f6cd7b71f0d0a0d1ec2f833
treea495d89e7e4224e222589aa3860869dac48711de
parentf91770216eade83f068528c1e4f00e2ac3b23044
nvptx: Add support for subword compare-and-swap

This adds support for __sync_val_compare_and_swap and
__sync_bool_compare_and_swap for 1-byte and 2-byte long
values, which are not natively supported on nvptx.

Build and reg-tested on nvptx.
Build and reg-tested libgomp on x86_64 with nvptx accelerator.

2020-07-16  Kwok Cheung Yeung  <kcy@codesourcery.com>

libgcc/
* config/nvptx/atomic.c: New.
* config/nvptx/t-nvptx (LIB2ADD): Add atomic.c.

gcc/testsuite/
* gcc.target/nvptx/ia64-sync-5.c: New.

libgomp/
* testsuite/libgomp.c-c++-common/reduction-16.c: New.
gcc/testsuite/gcc.target/nvptx/ia64-sync-5.c [new file with mode: 0644]
libgcc/config/nvptx/atomic.c [new file with mode: 0644]
libgcc/config/nvptx/t-nvptx
libgomp/testsuite/libgomp.c-c++-common/reduction-16.c [new file with mode: 0644]