diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoV.td b/llvm/lib/Target/RISCV/RISCVInstrInfoV.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoV.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoV.td @@ -818,6 +818,8 @@ def : InstAlias<"vfneg.v $vd, $vs$vm", (VFSGNJN_VV VR:$vd, VR:$vs, VR:$vs, VMaskOp:$vm)>; +def : InstAlias<"vfabs.v $vd, $vs$vm", + (VFSGNJX_VV VR:$vd, VR:$vs, VR:$vs, VMaskOp:$vm)>; // Vector Floating-Point Compare Instructions let RVVConstraint = NoConstraint in { diff --git a/llvm/test/MC/RISCV/rvv/aliases.s b/llvm/test/MC/RISCV/rvv/aliases.s --- a/llvm/test/MC/RISCV/rvv/aliases.s +++ b/llvm/test/MC/RISCV/rvv/aliases.s @@ -75,3 +75,6 @@ # ALIAS: vfneg.v v2, v1, v0.t # encoding: [0x57,0x91,0x10,0x24] # NO-ALIAS: vfsgnjn.vv v2, v1, v1, v0.t # encoding: [0x57,0x91,0x10,0x24] vfneg.v v2, v1, v0.t +# ALIAS: vfabs.v v2, v1, v0.t # encoding: [0x57,0x91,0x10,0x28] +# NO-ALIAS: vfsgnjx.vv v2, v1, v1, v0.t # encoding: [0x57,0x91,0x10,0x28] +vfabs.v v2, v1, v0.t