[0/5] RISC-V: Support vf and vx for autovec comparison of

Message ID 20240301062711.207137-1-demin.han@starfivetech.com
Headers
Series RISC-V: Support vf and vx for autovec comparison of |

Message

demin.han March 1, 2024, 6:27 a.m. UTC
  We expect:
    flw
    ...
    vmfxx.vf

For simplicity of supporting vx and vf, two refactors completed first.
1. remove eqne pattern; any special case or reason for eqne when first added?
2. refactor duplicate code.


demin.han (5):
  RISC-V: Remove float vector eqne pattern
  RISC-V: Refactor expand_vec_cmp
  RISC-V: Support vmfxx.vf for autovec comparison of vec and imm
  RISC-V: Remove integer vector eqne pattern
  RISC-V: Support vmsxx.vx for autovec comparison of vec and imm

 gcc/config/riscv/autovec.md                   |   2 +-
 gcc/config/riscv/predicates.md                |   4 +-
 gcc/config/riscv/riscv-protos.h               |   2 +-
 gcc/config/riscv/riscv-string.cc              |   4 +-
 gcc/config/riscv/riscv-v.cc                   |  94 ++---
 .../riscv/riscv-vector-builtins-bases.cc      |   7 -
 gcc/config/riscv/riscv.cc                     |   2 +-
 gcc/config/riscv/vector.md                    | 365 +-----------------
 .../riscv/rvv/autovec/cmp/vcond-1.c           |  48 ++-
 9 files changed, 105 insertions(+), 423 deletions(-)
  

Comments

demin.han March 1, 2024, 6:50 a.m. UTC | #1
Sorry for the unexpected truncation.

Hi,
vf and vx are not supported well when comparing vector and
immediate in current autovec.
For example, following insts generated for float type:
    flw
    vsetvli
    vfmv.v.f
    ...
    vmfxx.vv
Two issues:
  1. Additional vsetvl and vfmv instructions
  2. Occupy one vector register and may results in smaller lmul

We expect:
    flw
    ...
    vmfxx.vf

For simplicity of supporting vx and vf, two refactors completed first.
1. remove eqne pattern; any special case or reason for eqne when first added?
2. refactor duplicate code.