This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 not defined on aarch64
- From: Richard Earnshaw <Richard dot Earnshaw at foss dot arm dot com>
- To: Toebs Douglass <toby at winterflaw dot net>, "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Tue, 27 Jun 2017 22:53:41 +0100
- Subject: Re: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 not defined on aarch64
- Authentication-results: sourceware.org; auth=none
- References: <4c0415ed-12a1-b736-0d33-86e38439e952@winterflaw.net>
On 26/06/17 08:37, Toebs Douglass wrote:
> Hej all.
>
> __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 is defined on x86_64 if and only if
> -mcx16 is given.
>
> gcc version 4.9.2 (Debian 4.9.2-10)
> winterflaw@localhost:~$ gcc -march=native -dM -E - < /dev/null | sort |
> grep SYNC
> #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
> #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 1
> #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
> #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
> #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
>
> __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 is not defined at all on aarch64, as
> far as I can tell.
>
> gcc version 4.9.2 (Debian/Linaro 4.9.2-10)
> debian@pine64:~$ gcc -march=armv8-a+crypto+crc -dM -E - < /dev/null |
> sort | grep SYNC
> #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
> #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
> #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
> #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
>
> Both are the OS provided GCCs (Debian 8 in both cases).
>
>
This is correct. AArch64 cannot do the 16-byte atomic compare and swap
and needs lock operations.
R.