From d84f3a058b23726afe83d314b87b06b8e1cfd1be Mon Sep 17 00:00:00 2001 From: Georg-Johann Lay Date: Mon, 5 Mar 2012 10:28:45 +0000 Subject: avr.md (*umaddqihi4.2): New insn-and-split. * config/avr/avr.md (*umaddqihi4.2): New insn-and-split. From-SVN: r184919 --- gcc/ChangeLog | 4 ++++ gcc/config/avr/avr.md | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5f1d679..06f8dcf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2012-03-05 Georg-Johann Lay + + * config/avr/avr.md (*umaddqihi4.2): New insn-and-split. + 2012-03-04 H.J. Lu * config/i386/i386.c (pro_epilogue_adjust_stack): Check Pmode diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md index 5cc3e3e..bcf21af 100644 --- a/gcc/config/avr/avr.md +++ b/gcc/config/avr/avr.md @@ -1692,6 +1692,29 @@ ;; Handle small constants +;; Special case of a += 2*b as frequently seen with accesses to int arrays. +;; This is shorter, faster than MUL and has lower register pressure. + +(define_insn_and_split "*umaddqihi4.2" + [(set (match_operand:HI 0 "register_operand" "=r") + (plus:HI (mult:HI (zero_extend:HI (match_operand:QI 1 "register_operand" "r")) + (const_int 2)) + (match_operand:HI 2 "register_operand" "r")))] + "!reload_completed + && !reg_overlap_mentioned_p (operands[0], operands[1])" + { gcc_unreachable(); } + "&& 1" + [(set (match_dup 0) + (match_dup 2)) + ; *addhi3_zero_extend + (set (match_dup 0) + (plus:HI (zero_extend:HI (match_dup 1)) + (match_dup 0))) + ; *addhi3_zero_extend + (set (match_dup 0) + (plus:HI (zero_extend:HI (match_dup 1)) + (match_dup 0)))]) + ;; "umaddqihi4.uconst" ;; "maddqihi4.sconst" (define_insn_and_split "*maddqihi4.const" -- cgit v1.1