diff options
| author | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-19 13:00:27 +0000 |
|---|---|---|
| committer | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-19 13:00:27 +0000 |
| commit | d16b96a9e14509ecfbee73b5a4882e30d4596e02 (patch) | |
| tree | 23c5b79743aad719a4478ecc73ac830ba2449882 | |
| parent | 90b024e546f9534180bd4424f29a98256e241f0f (diff) | |
| download | ppe42-gcc-d16b96a9e14509ecfbee73b5a4882e30d4596e02.tar.gz ppe42-gcc-d16b96a9e14509ecfbee73b5a4882e30d4596e02.zip | |
* config/h8300/h8300.md (extendqisi2): Change to an expander.
(*extendqisi2_h8300): New.
(*extendqisi2_h8300hs): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63104 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/config/h8300/h8300.md | 26 |
2 files changed, 29 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 405b081e432..7bd6a72ce27 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2003-02-19 Kazu Hirata <kazu@cs.umass.edu> + * config/h8300/h8300.md (extendqisi2): Change to an expander. + (*extendqisi2_h8300): New. + (*extendqisi2_h8300hs): Likewise. + +2003-02-19 Kazu Hirata <kazu@cs.umass.edu> + * config/h8300/h8300-protos.h: Update the prototype for split_adds_subs. Remove the prototypes for const_int_le_2_operand and const_int_le_6_operand. diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index 817b52d6f64..2332c4b64ac 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -2101,10 +2101,14 @@ [(set_attr "length" "2") (set_attr "cc" "set_znv")]) -;; The compiler can synthesize a H8/300H variant of this which is -;; just as efficient as one that we'd create -(define_insn "extendqisi2" +(define_expand "extendqisi2" [(set (match_operand:SI 0 "register_operand" "=r,r") + (sign_extend:SI (match_operand:QI 1 "register_operand" "")))] + "" + "") + +(define_insn "*extendqisi2_h8300" + [(set (match_operand:SI 0 "register_operand" "") (sign_extend:SI (match_operand:QI 1 "general_operand_src" "0,g>")))] "TARGET_H8300" "@ @@ -2113,6 +2117,22 @@ [(set_attr "length" "8,12") (set_attr "cc" "clobber,clobber")]) +;; The following pattern is needed because without the pattern, the +;; combiner would split (sign_extend:SI (reg:QI)) into into two 24-bit +;; shifts, one ashift and one ashiftrt. + +(define_insn_and_split "*extendqisi2_h8300hs" + [(set (match_operand:SI 0 "register_operand" "=r") + (sign_extend:SI (match_operand:QI 1 "register_operand" "0")))] + "(TARGET_H8300H || TARGET_H8300S)" + "#" + "&& reload_completed" + [(set (match_dup 2) + (sign_extend:HI (match_dup 1))) + (set (match_dup 0) + (sign_extend:SI (match_dup 2)))] + "operands[2] = gen_rtx_REG (HImode, REGNO (operands[0]));") + (define_expand "extendhisi2" [(set (match_operand:SI 0 "register_operand" "") (sign_extend:SI (match_operand:HI 1 "register_operand" "")))] |

