]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386.md (peephole2s for operations with memory inputs): Use SWI mode iterator.
authorUros Bizjak <ubizjak@gmail.com>
Thu, 28 Apr 2016 19:11:25 +0000 (21:11 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 28 Apr 2016 19:11:25 +0000 (21:11 +0200)
* config/i386/i386.md (peephole2s for operations with memory inputs):
Use SWI mode iterator.
(peephole2s for operations with memory outputs): Ditto.
Do not check for stack checking probe.

(probe_stack): Remove expander.

From-SVN: r235601

gcc/ChangeLog
gcc/config/i386/i386.md

index e65e0eaf46ba7e6a1e681d95dd821f7e4e3cf9a7..873856b61efdc4c4acaf8456f4cb2306d2e39dbe 100644 (file)
@@ -1,3 +1,12 @@
+2016-04-28  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.md (peephole2s for operations with memory inputs):
+       Use SWI mode iterator.
+       (peephole2s for operations with memory outputs): Ditto.
+       Do not check for stack checking probe.
+
+       (probe_stack): Remove expander.
+
 2016-04-28  Joern Rennecke  <joern.rennecke@embecosm.com>
            Andrew Burgess  <andrew.burgess@embecosm.com>
 
index 30c0997a5232daf721c761bc0df7a119d6715c0b..6dfb240a25e5abeef6332e25173c596e3cae619e 100644 (file)
   DONE;
 })
 
-;; Use IOR for stack probes, this is shorter.
-(define_expand "probe_stack"
-  [(match_operand 0 "memory_operand")]
-  ""
-{
-  rtx (*gen_ior3) (rtx, rtx, rtx);
-
-  gen_ior3 = (GET_MODE (operands[0]) == DImode
-             ? gen_iordi3 : gen_iorsi3);
-
-  emit_insn (gen_ior3 (operands[0], operands[0], const0_rtx));
-  DONE;
-})
-
 (define_insn "adjust_stack_and_probe<mode>"
   [(set (match_operand:P 0 "register_operand" "=r")
        (unspec_volatile:P [(match_operand:P 1 "register_operand" "0")]
 
 ;; Don't do logical operations with memory inputs.
 (define_peephole2
-  [(match_scratch:SI 2 "r")
-   (parallel [(set (match_operand:SI 0 "register_operand")
-                   (match_operator:SI 3 "arith_or_logical_operator"
-                     [(match_dup 0)
-                      (match_operand:SI 1 "memory_operand")]))
-              (clobber (reg:CC FLAGS_REG))])]
+  [(match_scratch:SWI 2 "<r>")
+   (parallel [(set (match_operand:SWI 0 "register_operand")
+                  (match_operator:SWI 3 "arith_or_logical_operator"
+                    [(match_dup 0)
+                     (match_operand:SWI 1 "memory_operand")]))
+             (clobber (reg:CC FLAGS_REG))])]
   "!(TARGET_READ_MODIFY || optimize_insn_for_size_p ())"
   [(set (match_dup 2) (match_dup 1))
    (parallel [(set (match_dup 0)
-                   (match_op_dup 3 [(match_dup 0) (match_dup 2)]))
-              (clobber (reg:CC FLAGS_REG))])])
+                  (match_op_dup 3 [(match_dup 0) (match_dup 2)]))
+             (clobber (reg:CC FLAGS_REG))])])
 
 (define_peephole2
-  [(match_scratch:SI 2 "r")
-   (parallel [(set (match_operand:SI 0 "register_operand")
-                   (match_operator:SI 3 "arith_or_logical_operator"
-                     [(match_operand:SI 1 "memory_operand")
-                      (match_dup 0)]))
-              (clobber (reg:CC FLAGS_REG))])]
+  [(match_scratch:SWI 2 "<r>")
+   (parallel [(set (match_operand:SWI 0 "register_operand")
+                  (match_operator:SWI 3 "arith_or_logical_operator"
+                    [(match_operand:SWI 1 "memory_operand")
+                     (match_dup 0)]))
+             (clobber (reg:CC FLAGS_REG))])]
   "!(TARGET_READ_MODIFY || optimize_insn_for_size_p ())"
   [(set (match_dup 2) (match_dup 1))
    (parallel [(set (match_dup 0)
-                   (match_op_dup 3 [(match_dup 2) (match_dup 0)]))
-              (clobber (reg:CC FLAGS_REG))])])
+                  (match_op_dup 3 [(match_dup 2) (match_dup 0)]))
+             (clobber (reg:CC FLAGS_REG))])])
 
 ;; Prefer Load+RegOp to Mov+MemOp.  Watch out for cases when the memory address
 ;; refers to the destination of the load!
 ; the same decoder scheduling characteristics as the original.
 
 (define_peephole2
-  [(match_scratch:SI 2 "r")
-   (parallel [(set (match_operand:SI 0 "memory_operand")
-                   (match_operator:SI 3 "arith_or_logical_operator"
-                     [(match_dup 0)
-                      (match_operand:SI 1 "nonmemory_operand")]))
-              (clobber (reg:CC FLAGS_REG))])]
-  "!(TARGET_READ_MODIFY_WRITE || optimize_insn_for_size_p ())
-   /* Do not split stack checking probes.  */
-   && GET_CODE (operands[3]) != IOR && operands[1] != const0_rtx"
+  [(match_scratch:SWI 2 "<r>")
+   (parallel [(set (match_operand:SWI 0 "memory_operand")
+                  (match_operator:SWI 3 "arith_or_logical_operator"
+                    [(match_dup 0)
+                     (match_operand:SWI 1 "<nonmemory_operand>")]))
+             (clobber (reg:CC FLAGS_REG))])]
+  "!(TARGET_READ_MODIFY_WRITE || optimize_insn_for_size_p ())"
   [(set (match_dup 2) (match_dup 0))
    (parallel [(set (match_dup 2)
-                   (match_op_dup 3 [(match_dup 2) (match_dup 1)]))
-              (clobber (reg:CC FLAGS_REG))])
+                  (match_op_dup 3 [(match_dup 2) (match_dup 1)]))
+             (clobber (reg:CC FLAGS_REG))])
    (set (match_dup 0) (match_dup 2))])
 
 (define_peephole2
-  [(match_scratch:SI 2 "r")
-   (parallel [(set (match_operand:SI 0 "memory_operand")
-                   (match_operator:SI 3 "arith_or_logical_operator"
-                     [(match_operand:SI 1 "nonmemory_operand")
-                      (match_dup 0)]))
-              (clobber (reg:CC FLAGS_REG))])]
-  "!(TARGET_READ_MODIFY_WRITE || optimize_insn_for_size_p ())
-   /* Do not split stack checking probes.  */
-   && GET_CODE (operands[3]) != IOR && operands[1] != const0_rtx"
+  [(match_scratch:SWI 2 "<r>")
+   (parallel [(set (match_operand:SWI 0 "memory_operand")
+                  (match_operator:SWI 3 "arith_or_logical_operator"
+                    [(match_operand:SWI 1 "<nonmemory_operand>")
+                     (match_dup 0)]))
+             (clobber (reg:CC FLAGS_REG))])]
+  "!(TARGET_READ_MODIFY_WRITE || optimize_insn_for_size_p ())"
   [(set (match_dup 2) (match_dup 0))
    (parallel [(set (match_dup 2)
-                   (match_op_dup 3 [(match_dup 1) (match_dup 2)]))
-              (clobber (reg:CC FLAGS_REG))])
+                  (match_op_dup 3 [(match_dup 1) (match_dup 2)]))
+             (clobber (reg:CC FLAGS_REG))])
    (set (match_dup 0) (match_dup 2))])
 
 ;; Attempt to use arith or logical operations with memory outputs with