From: Kazu Hirata Date: Thu, 3 Apr 2003 02:41:19 +0000 (+0000) Subject: h8300-protos.h: Add a prototype for gtle_operator. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9a2dd2dd026c67d30b0937aee6b22b2472e95673;p=gcc.git h8300-protos.h: Add a prototype for gtle_operator. * config/h8300/h8300-protos.h: Add a prototype for gtle_operator. * config/h8300/h8300.c (gtle_operator): New. * config/h8300/h8300.h (PREDICATE_CODES): Add an entry for gtle_operator. * config/h8300/h8300.md (a peephole2): Generalize to accept GT and LE. From-SVN: r65192 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 548f2249c41..7d50188e4bc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2003-04-02 Kazu Hirata + + * config/h8300/h8300-protos.h: Add a prototype for + gtle_operator. + * config/h8300/h8300.c (gtle_operator): New. + * config/h8300/h8300.h (PREDICATE_CODES): Add an entry for + gtle_operator. + * config/h8300/h8300.md (a peephole2): Generalize to accept GT + and LE. + 2003-04-02 Richard Henderson * libgcc-std.ver (_Unwind_GetCFA): New. diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h index c0b6ad31310..55ef2f5f0f2 100644 --- a/gcc/config/h8300/h8300-protos.h +++ b/gcc/config/h8300/h8300-protos.h @@ -68,6 +68,7 @@ extern int incdec_operand PARAMS ((rtx, enum machine_mode)); extern int bit_operator PARAMS ((rtx, enum machine_mode)); extern int nshift_operator PARAMS ((rtx, enum machine_mode)); extern int eqne_operator PARAMS ((rtx, enum machine_mode)); +extern int gtle_operator PARAMS ((rtx, enum machine_mode)); extern int gtuleu_operator PARAMS ((rtx, enum machine_mode)); extern int iorxor_operator PARAMS ((rtx, enum machine_mode)); diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index cfbb9590ea5..69f0b535cca 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -1912,6 +1912,18 @@ eqne_operator (x, mode) return (code == EQ || code == NE); } +/* Return nonzero if X is GT, LE, GTU, or LEU. */ + +int +gtle_operator (x, mode) + rtx x; + enum machine_mode mode ATTRIBUTE_UNUSED; +{ + enum rtx_code code = GET_CODE (x); + + return (code == GT || code == LE || code == GTU || code == LEU); +} + /* Return nonzero if X is either GTU or LEU. */ int diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index b1b57f352ec..dc86668bb7d 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -1292,6 +1292,7 @@ struct cum_arg {"bit_operator", {XOR, AND, IOR}}, \ {"nshift_operator", {ASHIFTRT, LSHIFTRT, ASHIFT}}, \ {"eqne_operator", {EQ, NE}}, \ + {"gtle_operator", {GT, LE, GTU, LEU}}, \ {"gtuleu_operator", {GTU, LEU}}, \ {"iorxor_operator", {IOR, XOR}}, diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index a4c76f97ba7..190980f6494 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -4324,7 +4324,7 @@ (compare (match_operand:SI 0 "register_operand" "") (match_operand:SI 1 "const_int_operand" ""))) (set (pc) - (if_then_else (match_operator 2 "gtuleu_operator" + (if_then_else (match_operator 2 "gtle_operator" [(cc0) (const_int 0)]) (label_ref (match_operand 3 "" "")) (pc)))] @@ -4346,9 +4346,18 @@ (if_then_else (match_dup 4) (label_ref (match_dup 3)) (pc)))] - "operands[4] = ((GET_CODE (operands[2]) == GTU) ? - gen_rtx_NE (VOIDmode, cc0_rtx, const0_rtx) : - gen_rtx_EQ (VOIDmode, cc0_rtx, const0_rtx)); + "switch (GET_CODE (operands[2])) + { + case GTU: + operands[4] = gen_rtx_NE (VOIDmode, cc0_rtx, const0_rtx); + break; + case LEU: + operands[4] = gen_rtx_EQ (VOIDmode, cc0_rtx, const0_rtx); + break; + default: + operands[4] = operands[2]; + break; + } operands[5] = GEN_INT (~INTVAL (operands[1]));") ;; Transform A <= 65535 to (A & 0xffff0000) == 0.