[PATCH] D84732: [RISCV] Support vmsge.vx and vmsgeu.vx pseudo instructions in RVV.

Hsiangkai Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 20:08:25 PDT 2020


HsiangKai created this revision.
HsiangKai added reviewers: rogfer01, fpallares, evandro.
Herald added subscribers: luismarques, apazos, sameer.abuasal, pzheng, s.egerton, lenary, Jim, benna, psnobl, jocewei, PkmX, rkruppe, the_o, brucehoult, MartinMosbeck, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya.
Herald added a project: LLVM.
Harbormaster failed remote builds in B65972: Diff 281134!
Harbormaster returned this revision to the author for changes because remote builds failed.
HsiangKai updated this revision to Diff 281139.
HsiangKai added a comment.
Harbormaster failed remote builds in B65973: Diff 281139!
Harbormaster returned this revision to the author for changes because remote builds failed.
HsiangKai updated this revision to Diff 281153.
Harbormaster failed remote builds in B65979: Diff 281153!
Harbormaster returned this revision to the author for changes because remote builds failed.
HsiangKai requested review of this revision.
Herald added a subscriber: MaskRay.

Fix problems when rebasing.


HsiangKai added a comment.

Apply clang-format.


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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84732

Files:
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp
  llvm/lib/Target/RISCV/RISCVInstrInfoV.td
  llvm/test/MC/RISCV/rvv/compare.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84732.281153.patch
Type: text/x-patch
Size: 10466 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200807/4081e503/attachment.bin>


More information about the llvm-commits mailing list