5 Commits

Author SHA1 Message Date
Craig Topper
1aa9862df3 [RISCV] Add more XVentanaCondOps patterns.
Add patterns with seteq/setne conditions.

We don't have instructions for seteq/setne except for comparing
with zero and need to emit an ADDI or XOR before a seqz/snez to
compare other values.

The select ISD node takes a 0/1 value for the condition, but the
VT_MASKC(N) instructions check all XLen bits for zero or non-zero.
We can use this to avoid the seqz/snez in many cases.

This is pretty ridiculous number of patterns. I wonder if we could
use some ComplexPatterns to merge them, but I'd like to do that as
a follow up and focus on correctness of the result in this patch.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D140421
2023-01-06 08:29:23 -08:00
Craig Topper
88793a0478 [RISCV] Add XVentanaCondOps to RISCVSExtWRemoval. 2022-12-20 18:46:45 -08:00
Craig Topper
7f9dc7bf85 [RISCV] Add more XVentanaCondOps tests with icmp conditions. NFC
Most of our existing tests use i1 arguments for the conditions.
With icmp conditions there are opportunities for improving the
generated code.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D140403
2022-12-20 11:36:28 -08:00
Craig Topper
aa4252ec6f [RISCV] Add zeroext attribute to i1 arguments in xventanacondops.ll. NFC
Removes some extra andi instructions.
2022-12-19 19:12:38 -08:00
Kautuk Consul
6a907a41f4 [RISCV] Add codegen support for RISCV XVentanaCondOps Extension
This patch adds codegen support for part of XVentanaCondOps extension.
This extension is designed to reduce the number of branches in
the generated RISCV assembly by replacing branches with conditional
move instructions as defined by XVentanaCondOps specification.

The specification for XVentanaCondOps extension can be found at:
https://github.com/ventanamicro/ventana-custom-extensions/releases/download/v1.0.1/ventana-custom-extensions-v1.0.1.pdf

Co-authored-by: Mikhail Gudim <mgudim@ventanamicro.com>

Differential Revision: https://reviews.llvm.org/D139394
2022-12-19 09:56:06 -08:00