diff options
author | Georg-Johann Lay <avr@gjlay.de> | 2011-10-28 17:47:56 +0000 |
---|---|---|
committer | Georg-Johann Lay <gjl@gcc.gnu.org> | 2011-10-28 17:47:56 +0000 |
commit | f89d6e77d72b81f2b5c6b2f591db7499df1189d1 (patch) | |
tree | 0fec04061b0c2d1ab43862a1abbbf1568013b936 | |
parent | 58a9e3c406cfb58bddba83cf9e74b8cd7a139471 (diff) | |
download | gcc-f89d6e77d72b81f2b5c6b2f591db7499df1189d1.zip gcc-f89d6e77d72b81f2b5c6b2f591db7499df1189d1.tar.gz gcc-f89d6e77d72b81f2b5c6b2f591db7499df1189d1.tar.bz2 |
re PR target/49313 (Inefficient libgcc implementations for avr)
PR target/49313
* config/avr/avr.md (parityhi2): Expand allowing pseudos.
(*parityhi2): New pre-reload insn-and-split to map 16-bit parity
to the libgcc insn.
(*parityqihi2): Same for 8-bit parity.
From-SVN: r180620
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/avr/avr.md | 36 |
2 files changed, 39 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ae569a8..33651a2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2011-10-28 Georg-Johann Lay <avr@gjlay.de> + + PR target/49313 + * config/avr/avr.md (parityhi2): Expand allowing pseudos. + (*parityhi2): New pre-reload insn-and-split to map 16-bit parity + to the libgcc insn. + (*parityqihi2): Same for 8-bit parity. + 2011-10-28 Julian Brown <julian@codesourcery.com> PR rtl-optimization/47918 diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md index 35d4bdc..064db2c 100644 --- a/gcc/config/avr/avr.md +++ b/gcc/config/avr/avr.md @@ -4288,15 +4288,41 @@ ;; Parity +;; Postpone expansion of 16-bit parity to libgcc call until after combine for +;; better 8-bit parity recognition. + (define_expand "parityhi2" + [(parallel [(set (match_operand:HI 0 "register_operand" "") + (parity:HI (match_operand:HI 1 "register_operand" ""))) + (clobber (reg:HI 24))])]) + +(define_insn_and_split "*parityhi2" + [(set (match_operand:HI 0 "register_operand" "=r") + (parity:HI (match_operand:HI 1 "register_operand" "r"))) + (clobber (reg:HI 24))] + "!reload_completed" + { gcc_unreachable(); } + "&& 1" [(set (reg:HI 24) - (match_operand:HI 1 "register_operand" "")) + (match_dup 1)) (set (reg:HI 24) (parity:HI (reg:HI 24))) - (set (match_operand:HI 0 "register_operand" "") - (reg:HI 24))] - "" - "") + (set (match_dup 0) + (reg:HI 24))]) + +(define_insn_and_split "*parityqihi2" + [(set (match_operand:HI 0 "register_operand" "=r") + (parity:HI (match_operand:QI 1 "register_operand" "r"))) + (clobber (reg:HI 24))] + "!reload_completed" + { gcc_unreachable(); } + "&& 1" + [(set (reg:QI 24) + (match_dup 1)) + (set (reg:HI 24) + (zero_extend:HI (parity:QI (reg:QI 24)))) + (set (match_dup 0) + (reg:HI 24))]) (define_expand "paritysi2" [(set (reg:SI 22) |