case " $x86_64_archs " in
*" ${val} "*)
# Disallow x86-64-v* for --with-cpu=/--with-tune=
- # or --with-arch= or --with-arch_32=
- # It can be only specified in --with-arch_64=
case "x$which$val" in
- xcpu*x86-64-v*|xtune*x86-64-v*|xarchx86-64-v*|xarch_32x86-64-v*)
+ xcpu*x86-64-v*|xtune*x86-64-v*)
echo "Unknown CPU given in --with-$which=$val." 1>&2
exit 1
;;
return false;
}
- /* The feature-only micro-architecture levels that use
- PTA_NO_TUNE are only defined for the x86-64 psABI. */
- if ((processor_alias_table[i].flags & PTA_NO_TUNE) != 0
- && (!TARGET_64BIT_P (opts->x_ix86_isa_flags)
- || opts->x_ix86_abi != SYSV_ABI))
- {
- error (G_("%qs architecture level is only defined"
- " for the x86-64 psABI"), opts->x_ix86_arch_string);
- return false;
- }
-
ix86_schedule = processor_alias_table[i].schedule;
ix86_arch = processor_alias_table[i].processor;
@itemx x86-64-v3
@itemx x86-64-v4
These choices for @var{cpu-type} select the corresponding
-micro-architecture level from the x86-64 psABI. They are only available
-when compiling for an x86-64 target that uses the System V psABI@.
+micro-architecture level from the x86-64 psABI. On ABIs other than
+the x86-64 psABI they select the same CPU features as the x86-64 psABI
+documents for the particular micro-architecture level.
Since these @var{cpu-type} values do not have a corresponding
@option{-mtune} setting, using @option{-march} with these values enables
--- /dev/null
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-mabi=ms -march=x86-64-v2" } */
+
+/* Verify -march=x86-64-v2 works even with -mabi=ms. */
+#include "x86-64-v2.c"
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-march=x86-64-v2" } */
+
+/* Verify -march=x86-64-v2 works even with -m32 or -mabi=ms. */
+#include "x86-64-v2.c"
#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
+#ifdef __x86_64__
+# ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
+# error __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 not defined
+# endif
#endif
#ifndef __LAHF_SAHF__
# error __LAHF_SAHF__ not defined
--- /dev/null
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-mabi=ms -march=x86-64-v3" } */
+
+/* Verify -march=x86-64-v3 works even with -mabi=ms. */
+#include "x86-64-v3.c"
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-march=x86-64-v3" } */
+
+/* Verify -march=x86-64-v3 works even with -m32 or -mabi=ms. */
+#include "x86-64-v3.c"
/* { dg-do compile { target { ! ia32 } } } */
/* { dg-options "-mabi=sysv -march=x86-64-v3" } */
-/* Verify that the CPU features required by x86-64-v4 are enabled. */
+/* Verify that the CPU features required by x86-64-v3 are enabled. */
#ifndef __MMX__
# error __MMX__ not defined
#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
+#ifdef __x86_64__
+# ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
+# error __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 not defined
+# endif
#endif
#ifndef __LAHF_SAHF__
# error __LAHF_SAHF__ not defined
--- /dev/null
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-mabi=ms -march=x86-64-v4" } */
+
+/* Verify -march=x86-64-v4 works even with -mabi=ms. */
+#include "x86-64-v4.c"
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-march=x86-64-v4" } */
+
+/* Verify -march=x86-64-v4 works even with -m32 or -mabi=ms. */
+#include "x86-64-v4.c"
#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
+#ifdef __x86_64__
+# ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
+# error __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 not defined
+# endif
#endif
#ifndef __LAHF_SAHF__
# error __LAHF_SAHF__ not defined