diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2002-09-07 20:21:43 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2002-09-07 20:21:43 +0000 |
commit | 5c102b484adc71da720b768b8f96386d23974a8f (patch) | |
tree | 433839e44522be4842ecb445bcd955f22bedc390 | |
parent | 902c7fdf7c6ad77e52961ed01bdb72784b977167 (diff) | |
download | gcc-5c102b484adc71da720b768b8f96386d23974a8f.zip gcc-5c102b484adc71da720b768b8f96386d23974a8f.tar.gz gcc-5c102b484adc71da720b768b8f96386d23974a8f.tar.bz2 |
h8300.md (udivmodqi4): Split the pattern into an expander and an anonymous pattern.
* config/h8300/h8300.md (udivmodqi4): Split the pattern into
an expander and an anonymous pattern. Zero out the upper half
of the dividend in the expander.
(udivmodqi4): Likewise.
From-SVN: r56923
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/h8300/h8300.md | 40 |
2 files changed, 45 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 74f035a..a5d97bf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2002-09-07 Kazu Hirata <kazu@cs.umass.edu> + * config/h8300/h8300.md (udivmodqi4): Split the pattern into + an expander and an anonymous pattern. Zero out the upper half + of the dividend in the expander. + (udivmodqi4): Likewise. + +2002-09-07 Kazu Hirata <kazu@cs.umass.edu> + * config/h8300/h8300.c: Fix formatting. * config/h8300/h8300.h: Likewise. * config/h8300/h8300.md: Likewise. diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index 822367d..50d3e4f 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -911,7 +911,25 @@ ;; DIVIDE/MOD INSTRUCTIONS ;; ---------------------------------------------------------------------- -(define_insn "udivmodqi4" +(define_expand "udivmodqi4" + [(set (match_operand:HI 1 "register_operand" "") + (and:HI (match_dup 1) + (const_int 255))) + (parallel [(set (match_operand:QI 0 "register_operand" "") + (truncate:QI + (udiv:HI + (match_dup 1) + (zero_extend:HI + (match_operand:QI 2 "register_operand" ""))))) + (set (match_operand:QI 3 "register_operand" "") + (truncate:QI + (umod:HI + (match_dup 1) + (zero_extend:HI (match_dup 2)))))])] + "TARGET_H8300H || TARGET_H8300S" + "") + +(define_insn "" [(set (match_operand:QI 0 "register_operand" "=r") (truncate:QI (udiv:HI @@ -955,7 +973,25 @@ [(set_attr "length" "6") (set_attr "cc" "clobber")]) -(define_insn "udivmodhi4" +(define_expand "udivmodhi4" + [(set (match_operand:SI 1 "register_operand" "") + (and:SI (match_dup 1) + (const_int 65535))) + (parallel [(set (match_operand:HI 0 "register_operand" "") + (truncate:HI + (udiv:SI + (match_dup 1) + (zero_extend:SI + (match_operand:HI 2 "register_operand" ""))))) + (set (match_operand:HI 3 "register_operand" "") + (truncate:HI + (umod:SI + (match_dup 1) + (zero_extend:SI (match_dup 2)))))])] + "TARGET_H8300H || TARGET_H8300S" + "") + +(define_insn "" [(set (match_operand:HI 0 "register_operand" "=r") (truncate:HI (udiv:SI |