diff options
author | Jeff Law <jeffreyalaw@gmail.com> | 2021-06-10 09:57:51 -0400 |
---|---|---|
committer | Jeff Law <jeffreyalaw@gmail.com> | 2021-06-10 09:57:51 -0400 |
commit | 6fcba9ef23e4261a6279a76890b2c1488cc14d12 (patch) | |
tree | cb558d75d43b83f6139da512598cf861df8371ff | |
parent | 6961091b385c5c27c4a555aad0250d3390be05bf (diff) | |
download | gcc-6fcba9ef23e4261a6279a76890b2c1488cc14d12.zip gcc-6fcba9ef23e4261a6279a76890b2c1488cc14d12.tar.gz gcc-6fcba9ef23e4261a6279a76890b2c1488cc14d12.tar.bz2 |
Use memory loads and extensions to eliminate redundant test/compare insns
gcc/
* config/h8300/h8300.c (select_cc_mode): Handle MEM. Use
REG_P.
* config/h8300/extensions.md: Replace _clobber_flags patterns
with <cczn>.
-rw-r--r-- | gcc/config/h8300/extensions.md | 12 | ||||
-rw-r--r-- | gcc/config/h8300/h8300.c | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/gcc/config/h8300/extensions.md b/gcc/config/h8300/extensions.md index bc10179..74647c7 100644 --- a/gcc/config/h8300/extensions.md +++ b/gcc/config/h8300/extensions.md @@ -20,7 +20,7 @@ [(parallel [(set (match_dup 0) (zero_extend:HI (match_dup 1))) (clobber (reg:CC CC_REG))])]) -(define_insn "*zero_extendqihi2_clobber_flags" +(define_insn "*zero_extendqihi2<cczn>" [(set (match_operand:HI 0 "register_operand" "=r,r") (zero_extend:HI (match_operand:QI 1 "general_operand_src" "0,g>"))) (clobber (reg:CC CC_REG))] @@ -95,7 +95,7 @@ [(parallel [(set (match_dup 0) (zero_extend:SI (match_dup 1))) (clobber (reg:CC CC_REG))])]) -(define_insn "*zero_extendqisi2_h8sx_clobber_flags" +(define_insn "*zero_extendqisi2_h8sx<cczn>" [(set (match_operand:SI 0 "register_operand" "=r") (zero_extend:SI (match_operand:QI 1 "register_operand" "0"))) (clobber (reg:CC CC_REG))] @@ -118,7 +118,7 @@ [(parallel [(set (match_dup 0) (zero_extend:SI (match_dup 1))) (clobber (reg:CC CC_REG))])]) -(define_insn "*zero_extendhisi2_clobber_flags" +(define_insn "*zero_extendhisi2<cczn>" [(set (match_operand:SI 0 "register_operand" "=r") (zero_extend:SI (match_operand:HI 1 "register_operand" "0"))) (clobber (reg:CC CC_REG))] @@ -141,7 +141,7 @@ [(parallel [(set (match_dup 0) (sign_extend:HI (match_dup 1))) (clobber (reg:CC CC_REG))])]) -(define_insn "*extendqihi2_clobber_flags" +(define_insn "*extendqihi2<cczn>" [(set (match_operand:HI 0 "register_operand" "=r") (sign_extend:HI (match_operand:QI 1 "register_operand" "0"))) (clobber (reg:CC CC_REG))] @@ -176,7 +176,7 @@ [(parallel [(set (match_dup 0) (sign_extend:SI (match_dup 1))) (clobber (reg:CC CC_REG))])]) -(define_insn "*extendqisi2_h8sx_clobber_flags" +(define_insn "*extendqisi2_h8sx<cczn>" [(set (match_operand:SI 0 "register_operand" "=r") (sign_extend:SI (match_operand:QI 1 "register_operand" "0"))) (clobber (reg:CC CC_REG))] @@ -199,7 +199,7 @@ [(parallel [(set (match_dup 0) (sign_extend:SI (match_dup 1))) (clobber (reg:CC CC_REG))])]) -(define_insn "*extendhisi2_clobber_flags" +(define_insn "*extendhisi2<cczn>" [(set (match_operand:SI 0 "register_operand" "=r") (sign_extend:SI (match_operand:HI 1 "register_operand" "0"))) (clobber (reg:CC CC_REG))] diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index ef947aa..1077a2b 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -1950,7 +1950,9 @@ h8300_select_cc_mode (enum rtx_code cond, rtx op0, rtx op1) || GET_CODE (op0) == NEG || GET_CODE (op0) == AND || GET_CODE (op0) == IOR || GET_CODE (op0) == XOR || GET_CODE (op0) == NOT || GET_CODE (op0) == ASHIFT - || GET_CODE (op0) == REG || GET_CODE (op0) == MULT)) + || GET_CODE (op0) == MULT + || GET_CODE (op0) == SIGN_EXTEND || GET_CODE (op0) == ZERO_EXTEND + || REG_P (op0) || MEM_P (op0))) return CCZNmode; return CCmode; |