From 2b53fdd94457b8f6d508bceaa9fe3cb609013e4f Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 12 Dec 2002 21:19:57 +0000 Subject: * 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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@60079 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/config/h8300/h8300.h | 2 ++ gcc/config/h8300/h8300.md | 26 ++++++++++++++------------ 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 79def92e588..fd9b7425aa5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2002-12-12 Kazu Hirata + + * 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 * sh.c (reg_class_from_letter): No longer const. Add 'e' entry. diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index 902517d03dd..21f3eeb689b 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -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) diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index 051b81fa693..e68e702b257 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -762,32 +762,34 @@ "" "") -(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" "") -- cgit v1.2.3