Commit 4f81fba1 by Stephane Carrez Committed by Stephane Carrez

m68hc11.md (peephole2): New peephole2 to optimize address computations.

	* config/m68hc11/m68hc11.md (peephole2): New peephole2 to optimize
	address computations.

From-SVN: r47323
parent 259ed6e2
2001-11-25 Stephane Carrez <Stephane.Carrez@worldnet.fr> 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 * config/m68hc11/m68hc11.c (d_register_operand): Must accept
register b (low part of d). register b (low part of d).
......
...@@ -6103,6 +6103,32 @@ ...@@ -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 ;; This peephole catches the address computations generated by the reload
;; pass. ;; pass.
(define_peephole (define_peephole
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment