OSDN Git Service

* config/m68hc11/m68hc11.md (peephole2): New peephole2 to optimize
authorciceron <ciceron@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 25 Nov 2001 16:45:22 +0000 (16:45 +0000)
committerciceron <ciceron@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 25 Nov 2001 16:45:22 +0000 (16:45 +0000)
address computations.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47323 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/m68hc11/m68hc11.md

index 1b320b2..e6ec65b 100644 (file)
@@ -1,5 +1,10 @@
 2001-11-25  Stephane Carrez  <Stephane.Carrez@worldnet.fr>
 
+       * config/m68hc11/m68hc11.md (peephole2): New peephole2 to optimize
+       address computations.
+
+2001-11-25  Stephane Carrez  <Stephane.Carrez@worldnet.fr>
+
        * config/m68hc11/m68hc11.c (d_register_operand): Must accept
        register b (low part of d).
 
index 10886d2..f201e74 100644 (file)
 ;;--------------------------------------------------------------------
 
 ;;
+;; Reorganize to optimize address computations.
+;;
+(define_peephole2
+  [(set (match_operand:HI 0 "hard_reg_operand" "")
+       (match_operand:HI 1 "const_int_operand" ""))
+   (set (match_dup 0)
+       (plus:HI (match_dup 0)
+                (match_operand:HI 2 "general_operand" "")))]
+  "(INTVAL (operands[1]) >= -2 && INTVAL (operands[1]) <= 2)"
+  [(set (match_dup 0) (match_dup 2))
+   (set (match_dup 0) (plus:HI (match_dup 0) (match_dup 1)))]
+  "")
+
+;;
+;; Reorganize address computation based on stack pointer.
+;;
+(define_peephole2
+  [(set (match_operand:HI 0 "hard_reg_operand" "")
+        (match_operand:HI 1 "const_int_operand" ""))
+   (set (match_dup 0) (plus:HI (match_dup 0) (reg:HI SP_REGNUM)))]
+  ""
+  [(set (match_dup 0) (reg:HI SP_REGNUM))
+   (set (match_dup 0) (plus:HI (match_dup 0) (match_dup 1)))]
+  "")
+
+;;
 ;; This peephole catches the address computations generated by the reload
 ;; pass. 
 (define_peephole