re PR target/60205 (No ABI warning for AVX-512)
authorUros Bizjak <uros@gcc.gnu.org>
Tue, 18 Feb 2014 18:55:35 +0000 (19:55 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Tue, 18 Feb 2014 18:55:35 +0000 (19:55 +0100)
PR target/60205
* config/i386/i386.h (struct ix86_args): Add warn_avx512f.
* config/i386/i386.c (init_cumulative_args): Initialize warn_avx512f.
(type_natural_mode): Warn ABI change when %zmm register is not
available for AVX512F vector value passing.

testsuite/ChangeLog:

PR target/60205
* gcc.target/i386/pr60205-1.c: New test.
* gcc.target/i386/pr60205-2.c: Ditto.

From-SVN: r207851

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr60205-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr60205-2.c [new file with mode: 0644]

index 2c99044ae35c3353924837c333a4e0d41a00199d..663144a4781ca44d4942ddd6663cb3104e3e9adc 100644 (file)
@@ -1,9 +1,17 @@
+2014-02-18  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/60205
+       * config/i386/i386.h (struct ix86_args): Add warn_avx512f.
+       * config/i386/i386.c (init_cumulative_args): Initialize warn_avx512f.
+       (type_natural_mode): Warn ABI change when %zmm register is not
+       available for AVX512F vector value passing.
+
 2014-02-18  Kai Tietz  <ktietz@redhat.com>
 
        PR target/60193
-       * config/i386/i386.c (ix86_expand_prologue): Use
-       rax register as displacement for restoring %r10, %rax.
-       Additional fix wrong offset for restoring both-registers.
+       * config/i386/i386.c (ix86_expand_prologue): Use value in
+       rax register as displacement when restoring %r10 or %rax.
+       Fix wrong offset when restoring both registers.
 
 2014-02-18  Eric Botcazou  <ebotcazou@adacore.com>
 
@@ -59,8 +67,7 @@
 
 2014-02-16  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
-       * config/rs6000/altivec.md (p8_vmrgew): Handle little endian
-       targets.
+       * config/rs6000/altivec.md (p8_vmrgew): Handle little endian targets.
        (p8_vmrgow): Likewise.
 
 2014-02-16  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 2014-02-15  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/60183
-       * tree-ssa-phiprop.c (propagate_with_phi): Avoid speculating
-       loads.
+       * tree-ssa-phiprop.c (propagate_with_phi): Avoid speculating loads.
        (tree_ssa_phiprop): Calculate and free post-dominators.
 
 2014-02-14  Jeff Law  <law@redhat.com>
 
        PR rtl-optimization/60131
        * ree.c (get_extended_src_reg): New function.
-       (combine_reaching_defs): Use it rather than assuming location
-       of REG.
+       (combine_reaching_defs): Use it rather than assuming location of REG.
        (find_and_remove_re): Verify first operand of extension is
        a REG before adding the insns to the copy list.
 
        DECL_FUNCTION_SPECIFIC_TARGET.
        (hash_tree): Do not hash DECL_FUNCTION_SPECIFIC_TARGET.
        * tree-streamer-out.c (pack_ts_target_option): Remove.
-       (streamer_pack_tree_bitfields): Do not stream
-       TS_TARGET_OPTION.
+       (streamer_pack_tree_bitfields): Do not stream TS_TARGET_OPTION.
        (write_ts_function_decl_tree_pointers): Do not stream
        DECL_FUNCTION_SPECIFIC_TARGET.
        * tree-streamer-in.c (unpack_ts_target_option): Remove.
 
 2014-02-14  Jakub Jelinek  <jakub@redhat.com>
 
-       * tree-vect-loop.c (vect_is_slp_reduction): Don't set
-       use_stmt twice.
+       * tree-vect-loop.c (vect_is_slp_reduction): Don't set use_stmt twice.
        (get_initial_def_for_induction, vectorizable_induction): Ignore
        debug stmts when looking for exit_phi.
        (vectorizable_live_operation): Fix up condition.
index 8433fad65aee890fad680dca5cd0e420a096a73a..acfc021aea3d9a1884679179cfa575f310aa70b3 100644 (file)
@@ -6129,6 +6129,7 @@ init_cumulative_args (CUMULATIVE_ARGS *cum,  /* Argument info to initialize */
     }
   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,  /* Argument info to initialize */
          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 CUMULATIVE_ARGS *cum,
   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,7 +6229,29 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum,
            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;
index b605ae22aba556d7bfdfb310d713a9c2abcba20c..1b6460a0468acab2f69ec03bac3582a0b447b416 100644 (file)
@@ -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.  */
index 337472ee37a12caec1ed5fbfc9ad9828dba01779..430ea451da07f4dbe219d4047fdf80b94f992f35 100644 (file)
@@ -1,3 +1,9 @@
+2014-02-18  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/60205
+       * gcc.target/i386/pr60205-1.c: New test.
+       * gcc.target/i386/pr60205-2.c: Ditto.
+
 2014-02-18  Kai Tietz  <ktietz@redhat.com>
 
        PR target/60193
diff --git a/gcc/testsuite/gcc.target/i386/pr60205-1.c b/gcc/testsuite/gcc.target/i386/pr60205-1.c
new file mode 100644 (file)
index 0000000..9ae1212
--- /dev/null
@@ -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" } */
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr60205-2.c b/gcc/testsuite/gcc.target/i386/pr60205-2.c
new file mode 100644 (file)
index 0000000..8a65587
--- /dev/null
@@ -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;
+}