From dc271dbeb914928da2cc0bf682d66f51e991a75a Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 24 Jan 2002 05:02:35 +0000 Subject: [PATCH] h8300.md: Fix xorqi and xorqi so that they will accept to accept 0x80 as operands[2]. * config/h8300/h8300.md: Fix xorqi and xorqi so that they will accept to accept 0x80 as operands[2]. From-SVN: r49168 --- gcc/ChangeLog | 5 +++++ gcc/config/h8300/h8300.md | 44 ++++++++++++++++++++++++++++++++++---------- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5266fc0..374324c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-01-23 Kazu Hirata + + * config/h8300/h8300.md: Fix xorqi and xorqi so that they will + accept to accept 0x80 as operands[2]. + 2002-01-24 Alexandre Oliva * config/sparc/sparc.md (fix_trunctfdi2): Correct typo in mode. diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index ab05d49..d4937bf 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -1109,11 +1109,23 @@ (define_insn "" [(set (match_operand:QI 0 "bit_operand" "=r,U") (ior:QI (match_operand:QI 1 "bit_operand" "%0,0") - (match_operand:QI 2 "nonmemory_operand" "rn,P")))] - "register_operand (operands[0], QImode) || p_operand (operands[2], QImode)" - "@ - or %X2,%X0 - bset %V2,%R0" + (match_operand:QI 2 "nonmemory_operand" "rn,n")))] + "register_operand (operands[0], QImode) + || (GET_CODE (operands[2]) == CONST_INT + && exact_log2 (INTVAL (operands[2]) & 0xff) != -1)" + "* +{ + switch (which_alternative) + { + case 0: + return \"or\t%X2,%X0\"; + case 1: + operands[2] = GEN_INT (INTVAL (operands[2]) & 0xff); + return \"bset\t%V2,%R0\"; + default: + abort (); + } +}" [(set_attr "length" "2,8") (set_attr "adjust_length" "no") (set_attr "cc" "set_znv,none_0hit")]) @@ -1186,11 +1198,23 @@ (define_insn "" [(set (match_operand:QI 0 "bit_operand" "=r,U") (xor:QI (match_operand:QI 1 "bit_operand" "%0,0") - (match_operand:QI 2 "nonmemory_operand" "rn,P")))] - "register_operand (operands[0], QImode) || p_operand (operands[2], QImode)" - "@ - xor %X2,%X0 - bnot %V2,%R0" + (match_operand:QI 2 "nonmemory_operand" "rn,n")))] + "register_operand (operands[0], QImode) + || (GET_CODE (operands[2]) == CONST_INT + && exact_log2 (INTVAL (operands[2]) & 0xff) != -1)" + "* +{ + switch (which_alternative) + { + case 0: + return \"xor\t%X2,%X0\"; + case 1: + operands[2] = GEN_INT (INTVAL (operands[2]) & 0xff); + return \"bnot\t%V2,%R0\"; + default: + abort (); + } +}" [(set_attr "length" "2,8") (set_attr "adjust_length" "no") (set_attr "cc" "set_znv,none_0hit")]) -- 2.7.4