OSDN Git Service

* config/h8300/h8300.md (*zero_extendqihi2_h8300): Make the
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 21 Dec 2002 17:47:32 +0000 (17:47 +0000)
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 21 Dec 2002 17:47:32 +0000 (17:47 +0000)
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
gcc/config/h8300/h8300.md

index 5896006..c5170cd 100644 (file)
@@ -1,5 +1,12 @@
 2002-12-21  Kazu Hirata  <kazu@cs.umass.edu>
 
+       * config/h8300/h8300.md (*zero_extendqihi2_h8300): Make the
+       second alternative "#".
+       (*zero_extendqihi2_h8300hs): Likewise.
+       (a define_split): New.
+
+2002-12-21  Kazu Hirata  <kazu@cs.umass.edu>
+
        * config/h8300/h8300-protos.h: Update the prototype for
        split_adds_subs.
        Add prototypes for const_le_2_operand and const_le_6_operand.
index 5eb0c74..b3b50fe 100644 (file)
   ""
   "")
 
-(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"