[v2,0/2] Use Zbs with xori/ori/andi and polarity-reversed twobit-tests

Message ID 20221118111001.1488517-1-philipp.tomsich@vrull.eu
Headers
Series Use Zbs with xori/ori/andi and polarity-reversed twobit-tests |

Message

Philipp Tomsich Nov. 18, 2022, 11:09 a.m. UTC
  We had a few patches on the list that shared predicates (for extending
the reach of xori and ori -- and for the branches on two
polarity-reversed bits) and thus depended on each other.

These all had approval with requested changes, so these are now
collected together for v2.

Note that this adds the (a & ~C) case, so please take a look on that
part and OK the updated series.



Changes in v2:
- Collects already approved changes for v2 for (a | C) and (a ^ C).
- Pulls in the (already) approved branch on polarity-reversed bits
  for v2, as it shares predicates with the other changes.
- Newly adds support for the (a & ~C) case.

Philipp Tomsich (2):
  RISC-V: Use bseti/bclri/binvi to extend reach of ori/andi/xori
  RISC-V: Handle "(a & twobits) == singlebit" in branches using Zbs

 gcc/config/riscv/bitmanip.md                  | 79 +++++++++++++++++++
 gcc/config/riscv/iterators.md                 |  8 ++
 gcc/config/riscv/predicates.md                | 33 ++++++++
 gcc/config/riscv/riscv.h                      |  8 ++
 .../riscv/{zbs-bclri.c => zbs-bclri-01.c}     |  0
 gcc/testsuite/gcc.target/riscv/zbs-bclri-02.c | 27 +++++++
 gcc/testsuite/gcc.target/riscv/zbs-binvi.c    | 22 ++++++
 gcc/testsuite/gcc.target/riscv/zbs-bseti.c    | 27 +++++++
 .../gcc.target/riscv/zbs-if_then_else-01.c    | 20 +++++
 9 files changed, 224 insertions(+)
 rename gcc/testsuite/gcc.target/riscv/{zbs-bclri.c => zbs-bclri-01.c} (100%)
 create mode 100644 gcc/testsuite/gcc.target/riscv/zbs-bclri-02.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/zbs-binvi.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/zbs-bseti.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/zbs-if_then_else-01.c
  

Comments

Jeff Law Nov. 18, 2022, 7:13 p.m. UTC | #1
On 11/18/22 04:09, Philipp Tomsich wrote:
> We had a few patches on the list that shared predicates (for extending
> the reach of xori and ori -- and for the branches on two
> polarity-reversed bits) and thus depended on each other.
>
> These all had approval with requested changes, so these are now
> collected together for v2.
>
> Note that this adds the (a & ~C) case, so please take a look on that
> part and OK the updated series.
>
>
>
> Changes in v2:
> - Collects already approved changes for v2 for (a | C) and (a ^ C).
> - Pulls in the (already) approved branch on polarity-reversed bits
>    for v2, as it shares predicates with the other changes.
> - Newly adds support for the (a & ~C) case.
>
> Philipp Tomsich (2):
>    RISC-V: Use bseti/bclri/binvi to extend reach of ori/andi/xori
>    RISC-V: Handle "(a & twobits) == singlebit" in branches using Zbs
>
>   gcc/config/riscv/bitmanip.md                  | 79 +++++++++++++++++++
>   gcc/config/riscv/iterators.md                 |  8 ++
>   gcc/config/riscv/predicates.md                | 33 ++++++++
>   gcc/config/riscv/riscv.h                      |  8 ++
>   .../riscv/{zbs-bclri.c => zbs-bclri-01.c}     |  0
>   gcc/testsuite/gcc.target/riscv/zbs-bclri-02.c | 27 +++++++
>   gcc/testsuite/gcc.target/riscv/zbs-binvi.c    | 22 ++++++
>   gcc/testsuite/gcc.target/riscv/zbs-bseti.c    | 27 +++++++
>   .../gcc.target/riscv/zbs-if_then_else-01.c    | 20 +++++
>   9 files changed, 224 insertions(+)
>   rename gcc/testsuite/gcc.target/riscv/{zbs-bclri.c => zbs-bclri-01.c} (100%)
>   create mode 100644 gcc/testsuite/gcc.target/riscv/zbs-bclri-02.c
>   create mode 100644 gcc/testsuite/gcc.target/riscv/zbs-binvi.c
>   create mode 100644 gcc/testsuite/gcc.target/riscv/zbs-bseti.c
>   create mode 100644 gcc/testsuite/gcc.target/riscv/zbs-if_then_else-01.c

1/2 and 2/2 are both OK.

jeff
  
Philipp Tomsich Nov. 18, 2022, 8:04 p.m. UTC | #2
(Both) applied to master. Thanks!
--Philipp.

On Fri, 18 Nov 2022 at 20:13, Jeff Law <jeffreyalaw@gmail.com> wrote:

>
> On 11/18/22 04:09, Philipp Tomsich wrote:
> > We had a few patches on the list that shared predicates (for extending
> > the reach of xori and ori -- and for the branches on two
> > polarity-reversed bits) and thus depended on each other.
> >
> > These all had approval with requested changes, so these are now
> > collected together for v2.
> >
> > Note that this adds the (a & ~C) case, so please take a look on that
> > part and OK the updated series.
> >
> >
> >
> > Changes in v2:
> > - Collects already approved changes for v2 for (a | C) and (a ^ C).
> > - Pulls in the (already) approved branch on polarity-reversed bits
> >    for v2, as it shares predicates with the other changes.
> > - Newly adds support for the (a & ~C) case.
> >
> > Philipp Tomsich (2):
> >    RISC-V: Use bseti/bclri/binvi to extend reach of ori/andi/xori
> >    RISC-V: Handle "(a & twobits) == singlebit" in branches using Zbs
> >
> >   gcc/config/riscv/bitmanip.md                  | 79 +++++++++++++++++++
> >   gcc/config/riscv/iterators.md                 |  8 ++
> >   gcc/config/riscv/predicates.md                | 33 ++++++++
> >   gcc/config/riscv/riscv.h                      |  8 ++
> >   .../riscv/{zbs-bclri.c => zbs-bclri-01.c}     |  0
> >   gcc/testsuite/gcc.target/riscv/zbs-bclri-02.c | 27 +++++++
> >   gcc/testsuite/gcc.target/riscv/zbs-binvi.c    | 22 ++++++
> >   gcc/testsuite/gcc.target/riscv/zbs-bseti.c    | 27 +++++++
> >   .../gcc.target/riscv/zbs-if_then_else-01.c    | 20 +++++
> >   9 files changed, 224 insertions(+)
> >   rename gcc/testsuite/gcc.target/riscv/{zbs-bclri.c => zbs-bclri-01.c}
> (100%)
> >   create mode 100644 gcc/testsuite/gcc.target/riscv/zbs-bclri-02.c
> >   create mode 100644 gcc/testsuite/gcc.target/riscv/zbs-binvi.c
> >   create mode 100644 gcc/testsuite/gcc.target/riscv/zbs-bseti.c
> >   create mode 100644 gcc/testsuite/gcc.target/riscv/zbs-if_then_else-01.c
>
> 1/2 and 2/2 are both OK.
>
> jeff
>
>