i386.c (ix86_expand_call): Generate MS->SYSV extra clobbered registers using clobber_reg.
authorUros Bizjak <ubizjak@gmail.com>
Sun, 21 Sep 2014 15:13:14 +0000 (17:13 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Sun, 21 Sep 2014 15:13:14 +0000 (17:13 +0200)
* config/i386/i386.c (ix86_expand_call): Generate MS->SYSV extra
clobbered registers using clobber_reg.  Remove UNSPEC decoration.
* config/i386/i386.md (unspec) <UNSPEC_MS_TO_SYSV_CALL>: Remove.
(*call_rex64_ms_sysv): Remove.
(*call_value_rex64_ms_sysv): Ditto.
* config/i386/predicates.md (call_rex64_ms_sysv_operation): Remove.

testsuite/ChangeLog:

* gcc.target/i386/avx-vzeroupper-16.c (dg-final): Remove check
for call_value_rex64_ms_sysv.
* gcc.target/i386/avx-vzeroupper-17.c (dg-final): Ditto.
* gcc.target/i386/avx-vzeroupper-18.c (dg-final): Remove check
for call_rex64_ms_sysv.

From-SVN: r215428

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.md
gcc/config/i386/predicates.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/avx-vzeroupper-16.c
gcc/testsuite/gcc.target/i386/avx-vzeroupper-17.c
gcc/testsuite/gcc.target/i386/avx-vzeroupper-18.c

index cb70297a8233e7615e60695f2976343e3dbac91d..b60797c077522f321f000193a63e2c6730386397 100644 (file)
@@ -1,3 +1,12 @@
+2014-09-21  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.c (ix86_expand_call): Generate MS->SYSV extra
+       clobbered registers using clobber_reg.  Remove UNSPEC decoration.
+       * config/i386/i386.md (unspec) <UNSPEC_MS_TO_SYSV_CALL>: Remove.
+       (*call_rex64_ms_sysv): Remove.
+       (*call_value_rex64_ms_sysv): Ditto.
+       * config/i386/predicates.md (call_rex64_ms_sysv_operation): Remove.
+
 2014-09-20  Joern Rennecke  <joern.rennecke@embecosm.com>
 
        * config/epiphany/epiphany.md (sub_f_add_imm): Change constraint of
index 6337aa5b43b0e009f89305c8fb1a5b4996e54d89..c9324367c2b0ef3f831b325f320eae93a1595faa 100644 (file)
@@ -24865,9 +24865,7 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1,
                  rtx callarg2,
                  rtx pop, bool sibcall)
 {
-  unsigned int const cregs_size
-    = ARRAY_SIZE (x86_64_ms_sysv_extra_clobbered_registers);
-  rtx vec[3 + cregs_size];
+  rtx vec[3];
   rtx use = NULL, call;
   unsigned int vec_len = 0;
 
@@ -24930,18 +24928,16 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1,
   if (TARGET_64BIT_MS_ABI
       && (!callarg2 || INTVAL (callarg2) != -2))
     {
-      unsigned i;
-
-      vec[vec_len++] = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, const0_rtx),
-                                      UNSPEC_MS_TO_SYSV_CALL);
+      int const cregs_size
+       = ARRAY_SIZE (x86_64_ms_sysv_extra_clobbered_registers);
+      int i;
 
       for (i = 0; i < cregs_size; i++)
        {
          int regno = x86_64_ms_sysv_extra_clobbered_registers[i];
          enum machine_mode mode = SSE_REGNO_P (regno) ? TImode : DImode;
 
-         vec[vec_len++]
-           = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (mode, regno));
+         clobber_reg (&use, gen_rtx_REG (mode, regno));
        }
     }
 
index d5588c80b2ac33771318cbcc04b00b2e411d4e6f..004302df4f0b1b7c2885869ec67a613c5feab5a0 100644 (file)
   UNSPEC_LD_MPIC       ; load_macho_picbase
   UNSPEC_TRUNC_NOOP
   UNSPEC_DIV_ALREADY_SPLIT
-  UNSPEC_MS_TO_SYSV_CALL
   UNSPEC_PAUSE
   UNSPEC_LEA_ADDR
   UNSPEC_XBEGIN_ABORT
   "* return ix86_output_call_insn (insn, operands[0]);"
   [(set_attr "type" "call")])
 
-(define_insn "*call_rex64_ms_sysv"
-  [(match_parallel 2 "call_rex64_ms_sysv_operation"
-    [(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rBwBz"))
-          (match_operand 1))
-     (unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL)])]
-  "TARGET_64BIT && !SIBLING_CALL_P (insn)"
-  "* return ix86_output_call_insn (insn, operands[0]);"
-  [(set_attr "type" "call")])
-
 (define_insn "*sibcall"
   [(call (mem:QI (match_operand:W 0 "sibcall_insn_operand" "UBsBz"))
         (match_operand 1))]
                         (match_dup 3)))
              (unspec [(const_int 0)] UNSPEC_PEEPSIB)])])
 
-(define_insn "*call_value_rex64_ms_sysv"
-  [(match_parallel 3 "call_rex64_ms_sysv_operation"
-    [(set (match_operand 0)
-         (call (mem:QI (match_operand:DI 1 "call_insn_operand" "rBwBz"))
-               (match_operand 2)))
-     (unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL)])]
- "TARGET_64BIT && !SIBLING_CALL_P (insn)"
-  "* return ix86_output_call_insn (insn, operands[1]);"
-  [(set_attr "type" "callv")])
-
 (define_expand "call_value_pop"
   [(parallel [(set (match_operand 0)
                   (call (match_operand:QI 1)
index 62970bea8c44a89f7bd1e4841c2013c68b5cac2f..690bed5f70b3286c2fefeb94e60fd6b4ad6f0b8d 100644 (file)
        (and (not (match_test "TARGET_X32"))
            (match_operand 0 "sibcall_memory_operand"))))
 
-;; Return true if OP is a call from MS ABI to SYSV ABI function.
-(define_predicate "call_rex64_ms_sysv_operation"
-  (match_code "parallel")
-{
-  unsigned creg_size = ARRAY_SIZE (x86_64_ms_sysv_extra_clobbered_registers);
-  unsigned i;
-
-  if ((unsigned) XVECLEN (op, 0) != creg_size + 2)
-    return false;
-
-  for (i = 0; i < creg_size; i++)
-    {
-      rtx elt = XVECEXP (op, 0, i+2);
-      enum machine_mode mode;
-      unsigned regno;
-
-      if (GET_CODE (elt) != CLOBBER
-          || GET_CODE (SET_DEST (elt)) != REG)
-        return false;
-
-      regno = x86_64_ms_sysv_extra_clobbered_registers[i];
-      mode = SSE_REGNO_P (regno) ? TImode : DImode;
-
-      if (GET_MODE (SET_DEST (elt)) != mode
-         || REGNO (SET_DEST (elt)) != regno)
-       return false;
-    }
-  return true;
-})
-
 ;; Match exactly zero.
 (define_predicate "const0_operand"
   (match_code "const_int,const_double,const_vector")
index 0ec7ad7ffa9e8e9ee97f202019ba635a5dd41d98..61b15e087576e7b0c8bf910ac3779099dbf8c780 100644 (file)
@@ -1,3 +1,11 @@
+2014-09-21  Uros Bizjak  <ubizjak@gmail.com>
+
+       * gcc.target/i386/avx-vzeroupper-16.c (dg-final): Remove check
+       for call_value_rex64_ms_sysv.
+       * gcc.target/i386/avx-vzeroupper-17.c (dg-final): Ditto.
+       * gcc.target/i386/avx-vzeroupper-18.c (dg-final): Remove check
+       for call_rex64_ms_sysv.
+
 2014-09-20  Alessandro Fanfarillo  <fanfarillo.gcc@gmail.com>
            Tobias Burnus  <burnus@net-b.de>
 
index 66c8446686cf718b227214e760160a3c1dab96ac..f445a6910b2f264d0143e8effaa01492b1f08d9b 100644 (file)
@@ -14,4 +14,3 @@ foo (void)
 }
 
 /* { dg-final { scan-assembler-times "avx_vzeroupper" 1 } } */
-/* { dg-final { scan-assembler-times "\\*call_value_rex64_ms_sysv" 1 } } */
index acb432945ec1cb782df828ff8eaf5614675dc75b..6dc0dc053214768acb2c07d4ceeec67efdd64556 100644 (file)
@@ -14,4 +14,3 @@ foo (void)
 }
 
 /* { dg-final { scan-assembler-times "avx_vzeroupper" 1 } } */
-/* { dg-final { scan-assembler-times "\\*call_value_rex64_ms_sysv" 1 } } */
index 6f67f3ee322fa7d696a5ed4891955d6d6a62cbfc..0749181fd2b3171e481e52502361ead87441c6e3 100644 (file)
@@ -14,4 +14,3 @@ foo (void)
 }
 
 /* { dg-final { scan-assembler-not "avx_vzeroupper" } } */
-/* { dg-final { scan-assembler-times "\\*call_rex64_ms_sysv" 1 } } */