Skip to content

Commit bd576ac

Browse files
committed
[RISCV] Define vector vfsgnj/vfsgnjn/vfsgnjx intrinsics.
Define vector vfsgnj/vfsgnjn/vfsgnjx intrinsics and lower them to V instructions. We work with @rogfer01 from BSC to come out this patch. Authored-by: Roger Ferrer Ibanez <[email protected]> Co-Authored-by: Hsiangkai Wang <[email protected]> Differential Revision: https://reviews.llvm.org/D93581
1 parent 62c94f0 commit bd576ac

File tree

8 files changed

+6264
-0
lines changed

8 files changed

+6264
-0
lines changed

llvm/include/llvm/IR/IntrinsicsRISCV.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,4 +417,8 @@ let TargetPrefix = "riscv" in {
417417
defm vfmul : RISCVBinaryAAX;
418418
defm vfdiv : RISCVBinaryAAX;
419419
defm vfrdiv : RISCVBinaryAAX;
420+
421+
defm vfsgnj : RISCVBinaryAAX;
422+
defm vfsgnjn : RISCVBinaryAAX;
423+
defm vfsgnjx : RISCVBinaryAAX;
420424
} // TargetPrefix = "riscv"

llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,13 @@ defm PseudoVFMUL : VPseudoBinaryV_VV_VX</*IsFloat=*/1>;
15071507
defm PseudoVFDIV : VPseudoBinaryV_VV_VX</*IsFloat=*/1>;
15081508
defm PseudoVFRDIV : VPseudoBinaryV_VX</*IsFloat=*/1>;
15091509

1510+
//===----------------------------------------------------------------------===//
1511+
// 14.12. Vector Floating-Point Sign-Injection Instructions
1512+
//===----------------------------------------------------------------------===//
1513+
defm PseudoVFSGNJ : VPseudoBinaryV_VV_VX</*IsFloat=*/1>;
1514+
defm PseudoVFSGNJN : VPseudoBinaryV_VV_VX</*IsFloat=*/1>;
1515+
defm PseudoVFSGNJX : VPseudoBinaryV_VV_VX</*IsFloat=*/1>;
1516+
15101517
} // Predicates = [HasStdExtV, HasStdExtF]
15111518

15121519
//===----------------------------------------------------------------------===//
@@ -1778,6 +1785,13 @@ defm "" : VPatBinaryV_VV_VX<"int_riscv_vfmul", "PseudoVFMUL", AllFloatVectors>;
17781785
defm "" : VPatBinaryV_VV_VX<"int_riscv_vfdiv", "PseudoVFDIV", AllFloatVectors>;
17791786
defm "" : VPatBinaryV_VX<"int_riscv_vfrdiv", "PseudoVFRDIV", AllFloatVectors>;
17801787

1788+
//===----------------------------------------------------------------------===//
1789+
// 14.12. Vector Floating-Point Sign-Injection Instructions
1790+
//===----------------------------------------------------------------------===//
1791+
defm "" : VPatBinaryV_VV_VX<"int_riscv_vfsgnj", "PseudoVFSGNJ", AllFloatVectors>;
1792+
defm "" : VPatBinaryV_VV_VX<"int_riscv_vfsgnjn", "PseudoVFSGNJN", AllFloatVectors>;
1793+
defm "" : VPatBinaryV_VV_VX<"int_riscv_vfsgnjx", "PseudoVFSGNJX", AllFloatVectors>;
1794+
17811795
} // Predicates = [HasStdExtV, HasStdExtF]
17821796

17831797
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)