aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorStephane Carrez <Stephane.Carrez@worldnet.fr>2001-11-25 17:45:22 +0100
committerStephane Carrez <ciceron@gcc.gnu.org>2001-11-25 17:45:22 +0100
commit4f81fba13e2c6e8a69618d9a27ceae482ebd954f (patch)
tree95c913ce93135e0e58a8f9b14c3fc3d92b02cdea /gcc
parent259ed6e2708ccb8f43c0089b11628a7d93048743 (diff)
downloadgcc-4f81fba13e2c6e8a69618d9a27ceae482ebd954f.zip
gcc-4f81fba13e2c6e8a69618d9a27ceae482ebd954f.tar.gz
gcc-4f81fba13e2c6e8a69618d9a27ceae482ebd954f.tar.bz2
m68hc11.md (peephole2): New peephole2 to optimize address computations.
* config/m68hc11/m68hc11.md (peephole2): New peephole2 to optimize address computations. From-SVN: r47323
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/m68hc11/m68hc11.md26
2 files changed, 31 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1b320b2..e6ec65b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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).
diff --git a/gcc/config/m68hc11/m68hc11.md b/gcc/config/m68hc11/m68hc11.md
index 10886d2..f201e74 100644
--- a/gcc/config/m68hc11/m68hc11.md
+++ b/gcc/config/m68hc11/m68hc11.md
@@ -6103,6 +6103,32 @@
;;--------------------------------------------------------------------
;;
+;; 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