[PATCH] D95281: [RISCV] Add the `vfneg` alias

Evandro Menezes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 17:37:28 PST 2021


evandro created this revision.
evandro added reviewers: craig.topper, HsiangKai, khchen.
Herald added subscribers: frasercrmck, NickHung, luismarques, apazos, sameer.abuasal, pzheng, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya.
evandro requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.

Add the alias `vfneg.v vd, vs[, v0.t]` to `vfsgnjn.vv vd, vs, vs[, v0.t]`.

Per the RISC-V V extension spec v1.0-08a0b46.


https://reviews.llvm.org/D95281

Files:
  llvm/lib/Target/RISCV/RISCVInstrInfoV.td
  llvm/test/MC/RISCV/rvv/sign-injection.s


Index: llvm/test/MC/RISCV/rvv/sign-injection.s
===================================================================
--- llvm/test/MC/RISCV/rvv/sign-injection.s
+++ llvm/test/MC/RISCV/rvv/sign-injection.s
@@ -82,3 +82,16 @@
 # CHECK-ENCODING: [0x57,0x54,0x45,0x2a]
 # CHECK-ERROR: instruction requires the following: 'F'{{.*}}'V'
 # CHECK-UNKNOWN: 57 54 45 2a <unknown>
+
+vfneg.v v8, v4, v0.t
+# CHECK-INST: vfneg.v v8, v4, v0.t                    
+# CHECK-ENCODING: [0x57,0x14,0x42,0x24]
+# CHECK-ERROR: instruction requires the following: 'F'{{.*}}'V'
+# CHECK-UNKNOWN: 57 14 42 24 <unknown>
+
+vfneg.v v8, v4
+# CHECK-INST: vfsgnjn.vv v8, v4, v4
+# CHECK-ENCODING: [0x57,0x14,0x42,0x26]
+# CHECK-ERROR: instruction requires the following: 'F'{{.*}}'V'
+# CHECK-UNKNOWN: 57 14 42 26 <unknown>
+
Index: llvm/lib/Target/RISCV/RISCVInstrInfoV.td
===================================================================
--- llvm/lib/Target/RISCV/RISCVInstrInfoV.td
+++ llvm/lib/Target/RISCV/RISCVInstrInfoV.td
@@ -794,6 +794,9 @@
 defm VFSGNJN_V : VALU_FV_V_F<"vfsgnjn", 0b001001>;
 defm VFSGNJX_V : VALU_FV_V_F<"vfsgnjx", 0b001010>;
 
+def : InstAlias<"vfneg.v $vd, $vs$vm",
+                (VFSGNJN_VV VR:$vd, VR:$vs, VR:$vs, VMaskOp:$vm)>;
+
 // Vector Floating-Point Compare Instructions
 let RVVConstraint = NoConstraint in {
 defm VMFEQ_V : VALU_FV_V_F<"vmfeq", 0b011000>;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95281.318705.patch
Type: text/x-patch
Size: 1373 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210123/454976bf/attachment.bin>


More information about the llvm-commits mailing list