===================================================================
@@ -6129,6 +6129,7 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Ar
}
if (TARGET_MMX)
cum->mmx_nregs = MMX_REGPARM_MAX;
+ cum->warn_avx512f = true;
cum->warn_avx = true;
cum->warn_sse = true;
cum->warn_mmx = true;
@@ -6154,6 +6155,7 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Ar
cum->nregs = 0;
cum->sse_nregs = 0;
cum->mmx_nregs = 0;
+ cum->warn_avx512f = 0;
cum->warn_avx = 0;
cum->warn_sse = 0;
cum->warn_mmx = 0;
@@ -6211,7 +6213,7 @@ type_natural_mode (const_tree type, const CUMULATI
if (TREE_CODE (type) == VECTOR_TYPE && !VECTOR_MODE_P (mode))
{
HOST_WIDE_INT size = int_size_in_bytes (type);
- if ((size == 8 || size == 16 || size == 32)
+ if ((size == 8 || size == 16 || size == 32 || size == 64)
/* ??? Generic code allows us to create width 1 vectors. Ignore. */
&& TYPE_VECTOR_SUBPARTS (type) > 1)
{
@@ -6227,8 +6229,30 @@ type_natural_mode (const_tree type, const CUMULATI
if (GET_MODE_NUNITS (mode) == TYPE_VECTOR_SUBPARTS (type)
&& GET_MODE_INNER (mode) == innermode)
{
- if (size == 32 && !TARGET_AVX)
+ if (size == 64 && !TARGET_AVX512F)
{
+ static bool warnedavx512f;
+ static bool warnedavx512f_ret;
+
+ if (cum
+ && !warnedavx512f
+ && cum->warn_avx512f)
+ {
+ warnedavx512f = true;
+ warning (0, "AVX512F vector argument without AVX512F "
+ "enabled changes the ABI");
+ }
+ else if (in_return & !warnedavx512f_ret)
+ {
+ warnedavx512f_ret = true;
+ warning (0, "AVX512F vector return without AVX512F "
+ "enabled changes the ABI");
+ }
+
+ return TYPE_MODE (type);
+ }
+ else if (size == 32 && !TARGET_AVX)
+ {
static bool warnedavx;
static bool warnedavx_ret;
===================================================================
@@ -1606,6 +1606,8 @@ typedef struct ix86_args {
is used */
int sse_words; /* # sse words passed so far */
int sse_nregs; /* # sse registers available for passing */
+ int warn_avx512f; /* True when we want to warn
+ about AVX512F ABI. */
int warn_avx; /* True when we want to warn about AVX ABI. */
int warn_sse; /* True when we want to warn about SSE ABI. */
int warn_mmx; /* True when we want to warn about MMX ABI. */
===================================================================
@@ -0,0 +1,14 @@
+/* PR target/60205 */
+/* { dg-options "-O2 -mno-avx512f -Wno-psabi" } */
+/* { dg-skip-if "no AVX512F vector" { *-*-mingw* } } */
+
+typedef int __v16si __attribute__ ((__vector_size__ (64)));
+
+extern __v16si x;
+
+extern void bar (__v16si);
+void
+foo (void)
+{
+ bar (x); /* { dg-message "warning: AVX512F vector argument without AVX512F enabled changes the ABI" } */
+}
===================================================================
@@ -0,0 +1,13 @@
+/* PR target/60205 */
+/* { dg-options "-O2 -mno-avx512f" } */
+/* { dg-skip-if "no AVX512F vector" { *-*-mingw* } } */
+
+typedef int __v16si __attribute__ ((__vector_size__ (64)));
+
+extern __v16si x;
+
+__v16si
+foo (void)
+{ /* { dg-warning "AVX512F vector return without AVX512F enabled changes the ABI" } */
+ return x;
+}