From bb38add7ab14a2f666f845fb7cd66a99e09831c4 Mon Sep 17 00:00:00 2001 From: kazu Date: Sat, 21 Dec 2002 17:47:32 +0000 Subject: * config/h8300/h8300.md (*zero_extendqihi2_h8300): Make the second alternative "#". (*zero_extendqihi2_h8300hs): Likewise. (a define_split): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60388 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/config/h8300/h8300.md | 23 +++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5896006ece7..c5170cd9f96 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2002-12-21 Kazu Hirata + + * config/h8300/h8300.md (*zero_extendqihi2_h8300): Make the + second alternative "#". + (*zero_extendqihi2_h8300hs): Likewise. + (a define_split): New. + 2002-12-21 Kazu Hirata * config/h8300/h8300-protos.h: Update the prototype for diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index 5eb0c74ee9c..b3b50febfd8 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -1802,26 +1802,41 @@ "" "") -(define_insn "" +(define_insn "*zero_extendqihi2_h8300" [(set (match_operand:HI 0 "register_operand" "=r,r") (zero_extend:HI (match_operand:QI 1 "general_operand_src" "0,g>")))] "TARGET_H8300" "@ mov.b #0,%t0 - mov.b %R1,%s0\;mov.b #0,%t0" + #" [(set_attr "length" "2,10") (set_attr "cc" "clobber,clobber")]) -(define_insn "" +(define_insn "*zero_extendqihi2_h8300hs" [(set (match_operand:HI 0 "register_operand" "=r,r") (zero_extend:HI (match_operand:QI 1 "general_operand_src" "0,g>")))] "TARGET_H8300H || TARGET_H8300S" "@ extu.w %T0 - mov.b %R1,%s0\;extu.w %T0" + #" [(set_attr "length" "2,10") (set_attr "cc" "set_znv,set_znv")]) +;; Split the zero extension of a general operand (actually a memory +;; operand) into a load of the operand and the actual zero extension +;; so that 1) the length will be accurate, and 2) the zero extensions +;; appearing at the end of basic blocks may be merged. + +(define_split + [(set (match_operand:HI 0 "register_operand" "") + (zero_extend:HI (match_operand:QI 1 "general_operand_src" "")))] + "reload_completed" + [(set (match_dup 2) + (match_dup 1)) + (set (match_dup 0) + (zero_extend:HI (match_dup 2)))] + "operands[2] = gen_rtx_REG (QImode, REGNO (operands[0]));") + ;; The compiler can synthesize a H8/300H variant of this which is ;; just as efficient as one that we'd create (define_insn "zero_extendqisi2" -- cgit v1.2.1