h8300.h (CONST_OK_FOR_J): New.
authorKazu Hirata <kazu@cs.umass.edu>
Thu, 12 Dec 2002 21:19:57 +0000 (21:19 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Thu, 12 Dec 2002 21:19:57 +0000 (21:19 +0000)
* config/h8300/h8300.h (CONST_OK_FOR_J): New.
(CONST_OK_FOR_LETTER_P): Use CONST_OK_FOR_J.
* config/h8300/h8300.md (*addhi_h8300): Add a new alternative.
(*addhi_h8300hs): Likewise.

From-SVN: r60079

gcc/ChangeLog
gcc/config/h8300/h8300.h
gcc/config/h8300/h8300.md

index 79def92e588575db2bfa54db6b8e445ad14440c4..fd9b7425aa546fc8e79944980a5bdfcf7dd319d6 100644 (file)
@@ -1,3 +1,10 @@
+2002-12-12  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * config/h8300/h8300.h (CONST_OK_FOR_J): New.
+       (CONST_OK_FOR_LETTER_P): Use CONST_OK_FOR_J.
+       * config/h8300/h8300.md (*addhi_h8300): Add a new alternative.
+       (*addhi_h8300hs): Likewise.
+
 Thu Dec 12 16:24:59 2002  J"orn Rennecke <joern.rennecke@superh.com>
 
        * sh.c (reg_class_from_letter): No longer const.  Add 'e' entry.
index 902517d03dd64d52cc3d6d1ba603f4d228982274..21f3eeb689b20f66a9765346e88e5c01988cc9cf 100644 (file)
@@ -461,6 +461,7 @@ enum reg_class {
    Return 1 if VALUE is in the range specified by C.  */
 
 #define CONST_OK_FOR_I(VALUE) ((VALUE) == 0)
+#define CONST_OK_FOR_J(VALUE) (((VALUE) & 0xff) == 0)
 #define CONST_OK_FOR_L(VALUE)                          \
   (TARGET_H8300H || TARGET_H8300S                      \
    ? (VALUE) == 1 || (VALUE) == 2 || (VALUE) == 4      \
@@ -472,6 +473,7 @@ enum reg_class {
 
 #define CONST_OK_FOR_LETTER_P(VALUE, C)                \
   ((C) == 'I' ? CONST_OK_FOR_I (VALUE) :       \
+   (C) == 'J' ? CONST_OK_FOR_J (VALUE) :       \
    (C) == 'L' ? CONST_OK_FOR_L (VALUE) :       \
    (C) == 'N' ? CONST_OK_FOR_N (VALUE) :       \
    0)
index 051b81fa693601c6f98d138418f0bb867cb99520..e68e702b25731ff41db6eb201e8d0e2a85158ed8 100644 (file)
   ""
   "")
 
-(define_insn ""
-  [(set (match_operand:HI 0 "register_operand" "=r,r,r,r,&r")
-       (plus:HI (match_operand:HI 1 "register_operand" "%0,0,0,0,g")
-                (match_operand:HI 2 "nonmemory_operand" "L,N,n,r,r")))]
+(define_insn "*addhi3_h8300"
+  [(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r,&r")
+       (plus:HI (match_operand:HI 1 "register_operand" "%0,0,0,0,0,g")
+                (match_operand:HI 2 "nonmemory_operand" "L,N,J,n,r,r")))]
   "TARGET_H8300"
   "@
    adds        %2,%T0
    subs        %G2,%T0
+   add.b       %t2,%t0
    add.b       %s2,%s0\;addx   %t2,%t0
    add.w       %T2,%T0
    mov.w       %T1,%T0\;add.w  %T2,%T0"
-  [(set_attr "length" "2,2,4,2,6")
-   (set_attr "cc" "none_0hit,none_0hit,clobber,set_zn,set_zn")])
+  [(set_attr "length" "2,2,2,4,2,6")
+   (set_attr "cc" "none_0hit,none_0hit,clobber,clobber,set_zn,set_zn")])
 
-(define_insn ""
-  [(set (match_operand:HI 0 "register_operand" "=r,r,r,r")
-       (plus:HI (match_operand:HI 1 "register_operand" "%0,0,0,0")
-                (match_operand:HI 2 "nonmemory_operand" "L,N,n,r")))]
+(define_insn "*addhi3_h8300hs"
+  [(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r")
+       (plus:HI (match_operand:HI 1 "register_operand" "%0,0,0,0,0")
+                (match_operand:HI 2 "nonmemory_operand" "L,N,J,n,r")))]
   "TARGET_H8300H || TARGET_H8300S"
   "@
    adds        %2,%S0
    subs        %G2,%S0
+   add.b       %t2,%t0
    add.w       %T2,%T0
    add.w       %T2,%T0"
-  [(set_attr "length" "2,2,4,2")
-   (set_attr "cc" "none_0hit,none_0hit,set_zn,set_zn")])
+  [(set_attr "length" "2,2,2,4,2")
+   (set_attr "cc" "none_0hit,none_0hit,clobber,set_zn,set_zn")])
 
 (define_split
   [(set (match_operand:HI 0 "register_operand" "")