diff mbox series

x86-64: Check CMPXCHG16B for x86-64-v[234]

Message ID 20201009131731.1638131-1-hjl.tools@gmail.com
State New
Headers show
Series x86-64: Check CMPXCHG16B for x86-64-v[234] | expand

Commit Message

H.J. Lu Oct. 9, 2020, 1:17 p.m. UTC
x86-64-v2 includes CMPXCHG16B.  Since -mcx16 enables CMPXCHG16B and
defines __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16, check it in x86-64-v[234]
tests.

	PR target/97250
	* gcc.target/i386/x86-64-v2.c: Verify that
	__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 is defined.
	* gcc.target/i386/x86-64-v3.c: Likewise.
	* gcc.target/i386/x86-64-v4.c: Likewise.
---
 gcc/testsuite/gcc.target/i386/x86-64-v2.c | 3 +++
 gcc/testsuite/gcc.target/i386/x86-64-v3.c | 3 +++
 gcc/testsuite/gcc.target/i386/x86-64-v4.c | 3 +++
 3 files changed, 9 insertions(+)

Comments

H.J. Lu Oct. 10, 2020, 12:25 p.m. UTC | #1
On Fri, Oct 9, 2020 at 6:17 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> x86-64-v2 includes CMPXCHG16B.  Since -mcx16 enables CMPXCHG16B and
> defines __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16, check it in x86-64-v[234]
> tests.
>
>         PR target/97250
>         * gcc.target/i386/x86-64-v2.c: Verify that
>         __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 is defined.
>         * gcc.target/i386/x86-64-v3.c: Likewise.
>         * gcc.target/i386/x86-64-v4.c: Likewise.
> ---
>  gcc/testsuite/gcc.target/i386/x86-64-v2.c | 3 +++
>  gcc/testsuite/gcc.target/i386/x86-64-v3.c | 3 +++
>  gcc/testsuite/gcc.target/i386/x86-64-v4.c | 3 +++
>  3 files changed, 9 insertions(+)
>
> diff --git a/gcc/testsuite/gcc.target/i386/x86-64-v2.c b/gcc/testsuite/gcc.target/i386/x86-64-v2.c
> index 0f3df3605b5..f17a15de9b6 100644
> --- a/gcc/testsuite/gcc.target/i386/x86-64-v2.c
> +++ b/gcc/testsuite/gcc.target/i386/x86-64-v2.c
> @@ -12,6 +12,9 @@
>  #ifndef __SSE2__
>  # error __SSE2__ not defined
>  #endif
> +#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
> +# error __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 not defined
> +#endif
>  #ifndef __LAHF_SAHF__
>  # error __LAHF_SAHF__ not defined
>  #endif
> diff --git a/gcc/testsuite/gcc.target/i386/x86-64-v3.c b/gcc/testsuite/gcc.target/i386/x86-64-v3.c
> index 16a94b18021..784202fb26f 100644
> --- a/gcc/testsuite/gcc.target/i386/x86-64-v3.c
> +++ b/gcc/testsuite/gcc.target/i386/x86-64-v3.c
> @@ -12,6 +12,9 @@
>  #ifndef __SSE2__
>  # error __SSE2__ not defined
>  #endif
> +#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
> +# error __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 not defined
> +#endif
>  #ifndef __LAHF_SAHF__
>  # error __LAHF_SAHF__ not defined
>  #endif
> diff --git a/gcc/testsuite/gcc.target/i386/x86-64-v4.c b/gcc/testsuite/gcc.target/i386/x86-64-v4.c
> index 48e928c2955..7c202a42068 100644
> --- a/gcc/testsuite/gcc.target/i386/x86-64-v4.c
> +++ b/gcc/testsuite/gcc.target/i386/x86-64-v4.c
> @@ -12,6 +12,9 @@
>  #ifndef __SSE2__
>  # error __SSE2__ not defined
>  #endif
> +#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
> +# error __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 not defined
> +#endif
>  #ifndef __LAHF_SAHF__
>  # error __LAHF_SAHF__ not defined
>  #endif
> --
> 2.26.2
>

I am checking it in.
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.target/i386/x86-64-v2.c b/gcc/testsuite/gcc.target/i386/x86-64-v2.c
index 0f3df3605b5..f17a15de9b6 100644
--- a/gcc/testsuite/gcc.target/i386/x86-64-v2.c
+++ b/gcc/testsuite/gcc.target/i386/x86-64-v2.c
@@ -12,6 +12,9 @@ 
 #ifndef __SSE2__
 # error __SSE2__ not defined
 #endif
+#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
+# error __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 not defined
+#endif
 #ifndef __LAHF_SAHF__
 # error __LAHF_SAHF__ not defined
 #endif
diff --git a/gcc/testsuite/gcc.target/i386/x86-64-v3.c b/gcc/testsuite/gcc.target/i386/x86-64-v3.c
index 16a94b18021..784202fb26f 100644
--- a/gcc/testsuite/gcc.target/i386/x86-64-v3.c
+++ b/gcc/testsuite/gcc.target/i386/x86-64-v3.c
@@ -12,6 +12,9 @@ 
 #ifndef __SSE2__
 # error __SSE2__ not defined
 #endif
+#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
+# error __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 not defined
+#endif
 #ifndef __LAHF_SAHF__
 # error __LAHF_SAHF__ not defined
 #endif
diff --git a/gcc/testsuite/gcc.target/i386/x86-64-v4.c b/gcc/testsuite/gcc.target/i386/x86-64-v4.c
index 48e928c2955..7c202a42068 100644
--- a/gcc/testsuite/gcc.target/i386/x86-64-v4.c
+++ b/gcc/testsuite/gcc.target/i386/x86-64-v4.c
@@ -12,6 +12,9 @@ 
 #ifndef __SSE2__
 # error __SSE2__ not defined
 #endif
+#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
+# error __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 not defined
+#endif
 #ifndef __LAHF_SAHF__
 # error __LAHF_SAHF__ not defined
 #endif