[RISCV] Support vmsge.vx and vmsgeu.vx pseudo instructions in RVV.
authorHsiangkai Wang <kai.wang@sifive.com>
Tue, 28 Jul 2020 06:45:28 +0000 (14:45 +0800)
committerHsiangkai Wang <kai.wang@sifive.com>
Fri, 2 Oct 2020 09:20:34 +0000 (17:20 +0800)
commit067add7b5fd22c879bd2bbf5d55f4fb9b63047bf
treebe701e46ba883a40bfb078be25f93526a311bc55
parent17747d2ec8ec4471748197db54c8703f0c07c91c
[RISCV] Support vmsge.vx and vmsgeu.vx pseudo instructions in RVV.

Implement vmsge{u}.vx pseudo instruction.

According to RISC-V V specification, there are different scenarios for this
pseudo instruction. I list them below.

unmasked va >= x

  pseudoinstruction: vmsge{u}.vx vd, va, x
  expansion: vmslt{u}.vx vd, va, x; vmnand.mm vd, vd, vd

masked va >= x, vd != v0

  pseudoinstruction: vmsge{u}.vx vd, va, x, v0.t
  expansion: vmslt{u}.vx vd, va, x, v0.t; vmxor.mm vd, vd, v0

masked va >= x, vd == v0

  pseudoinstruction: vmsge{u}.vx vd, va, x, v0.t, vt
  expansion: vmslt{u}.vx vt, va, x;  vmandnot.mm vd, vd, vt

Use pseudo instruction to model vmsge{u}.vx. The pseudo instruction will convert
to different expansion according to the condition.

Differential Revision: https://reviews.llvm.org/D84732
llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp
llvm/lib/Target/RISCV/RISCVInstrInfoV.td
llvm/lib/Target/RISCV/RISCVRegisterInfo.td
llvm/test/MC/RISCV/rvv/compare.s
llvm/test/MC/RISCV/rvv/invalid.s