diff options
author | Dimitar Dimitrov <dimitar@dinux.eu> | 2022-08-14 18:50:18 +0300 |
---|---|---|
committer | Dimitar Dimitrov <dimitar@dinux.eu> | 2022-08-22 22:28:58 +0300 |
commit | 10dd6dea95c5fc41c789c6506338e101e0590a02 (patch) | |
tree | 0b3ae70673e55ab658628ad13e8fb6b3c7eb6ac1 /gcc/gimple-predicate-analysis.cc | |
parent | 7e51df048ae849115e12bf12702bdf1b65893be7 (diff) | |
download | gcc-10dd6dea95c5fc41c789c6506338e101e0590a02.zip gcc-10dd6dea95c5fc41c789c6506338e101e0590a02.tar.gz gcc-10dd6dea95c5fc41c789c6506338e101e0590a02.tar.bz2 |
PR target/106564: pru: Optimize 64-bit sign- and zero-extend
Add new patterns to optimize 64-bit sign- and zero-extend operations for
the PRU target.
The new 64-bit zero-extend patterns are straightforward define_insns.
The old 16/32-bit sign-extend pattern has been rewritten from scratch
in order to add 64-bit support. The new pattern expands into several
optimized insns for filling bytes with zeros or ones, and for
conditional branching on bit-test. The bulk of this patch is to
implement the patterns for those new optimized insns.
PR target/106564
gcc/ChangeLog:
* config/pru/constraints.md (Um): New constraint for -1.
(Uf): New constraint for IOR fill-bytes constants.
(Uz): New constraint for AND zero-bytes constants.
* config/pru/predicates.md (const_fillbytes_operand): New
predicate for IOR fill-bytes constants.
(const_zerobytes_operand): New predicate for AND zero-bytes
constants.
* config/pru/pru-protos.h (pru_output_sign_extend): Remove.
(struct pru_byterange): New struct to describe a byte range.
(pru_calc_byterange): New declaration.
* config/pru/pru.cc (pru_rtx_costs): Add penalty for
64-bit zero-extend.
(pru_output_sign_extend): Remove.
(pru_calc_byterange): New helper function to extract byte
range info from a constant.
(pru_print_operand): Remove 'y' and 'z' print modifiers.
* config/pru/pru.md (zero_extendqidi2): New pattern.
(zero_extendhidi2): New pattern.
(zero_extendsidi2): New pattern.
(extend<EQS0:mode><EQD:mode>2): Rewrite as an expand.
(@pru_ior_fillbytes<mode>): New pattern.
(@pru_and_zerobytes<mode>): New pattern.
(<code>di3): Rewrite as an expand and handle ZERO and FILL
special cases.
(pru_<code>di3): New name for <code>di3.
(@cbranch_qbbx_const_<BIT_TEST:code><HIDI:mode>): New pattern to
handle bit-test for 64-bit registers.
gcc/testsuite/ChangeLog:
* gcc.target/pru/pr106564-1.c: New test.
* gcc.target/pru/pr106564-2.c: New test.
* gcc.target/pru/pr106564-3.c: New test.
* gcc.target/pru/pr106564-4.c: New test.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
Diffstat (limited to 'gcc/gimple-predicate-analysis.cc')
0 files changed, 0 insertions, 0 deletions