Use more logicals to eliminate useless test/compare instructions
authorJeff Law <jeffreyalaw@gmail.com>
Tue, 22 Jun 2021 19:25:11 +0000 (15:25 -0400)
committerJeff Law <jeffreyalaw@gmail.com>
Wed, 23 Jun 2021 14:18:30 +0000 (10:18 -0400)
commit402c818ac0b19d168e9ffc0b3413344dd6020f6a
tree8e0bb68651a33f643a3abba12f8dec90d3e836b6
parent37e93925366676201b526624e9f8dc32d82b4ff2
Use more logicals to eliminate useless test/compare instructions

gcc/
* config/h8300/logical.md (<code><mode>3<ccnz>): Use <cczn>
so this pattern can be used for test/compare removal.  Pass
current insn to compute_logical_op_length and output_logical_op.
* config/h8300/h8300.c (compute_logical_op_cc): Remove.
(h8300_and_costs): Add argument to compute_logical_op_length.
(output_logical_op): Add new argument.  Use it to determine if the
condition codes are used and adjust the output accordingly.
(compute_logical_op_length): Add new argument and update length
computations when condition codes are used.
* config/h8300/h8300-protos.h (compute_logical_op_length): Update
prototype.
(output_logical_op): Likewise.
gcc/config/h8300/h8300-protos.h
gcc/config/h8300/h8300.c
gcc/config/h8300/logical.md