[RISCV] Define vector mul/div/rem intrinsics.
Define vector mul/div/rem intrinsics and lower them to V instructions. We work with @rogfer01 from BSC to come out this patch. Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com> Co-Authored-by: Hsiangkai Wang <kai.wang@sifive.com> Differential Revision: https://reviews.llvm.org/D93380
This commit is contained in:
parent
f03609b5c7
commit
dd5281e7cc
|
|
@ -237,6 +237,16 @@ let TargetPrefix = "riscv" in {
|
|||
defm vmaxu : RISCVBinaryAAX;
|
||||
defm vmax : RISCVBinaryAAX;
|
||||
|
||||
defm vmul : RISCVBinaryAAX;
|
||||
defm vmulh : RISCVBinaryAAX;
|
||||
defm vmulhu : RISCVBinaryAAX;
|
||||
defm vmulhsu : RISCVBinaryAAX;
|
||||
|
||||
defm vdivu : RISCVBinaryAAX;
|
||||
defm vdiv : RISCVBinaryAAX;
|
||||
defm vremu : RISCVBinaryAAX;
|
||||
defm vrem : RISCVBinaryAAX;
|
||||
|
||||
defm vfadd : RISCVBinaryAAX;
|
||||
defm vfsub : RISCVBinaryAAX;
|
||||
defm vfrsub : RISCVBinaryAAX;
|
||||
|
|
|
|||
|
|
@ -1140,6 +1140,22 @@ defm PseudoVMIN : VPseudoBinaryV_VV_VX;
|
|||
defm PseudoVMAXU : VPseudoBinaryV_VV_VX;
|
||||
defm PseudoVMAX : VPseudoBinaryV_VV_VX;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// 12.10. Vector Single-Width Integer Multiply Instructions
|
||||
//===----------------------------------------------------------------------===//
|
||||
defm PseudoVMUL : VPseudoBinaryV_VV_VX;
|
||||
defm PseudoVMULH : VPseudoBinaryV_VV_VX;
|
||||
defm PseudoVMULHU : VPseudoBinaryV_VV_VX;
|
||||
defm PseudoVMULHSU : VPseudoBinaryV_VV_VX;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// 12.11. Vector Integer Divide Instructions
|
||||
//===----------------------------------------------------------------------===//
|
||||
defm PseudoVDIVU : VPseudoBinaryV_VV_VX;
|
||||
defm PseudoVDIV : VPseudoBinaryV_VV_VX;
|
||||
defm PseudoVREMU : VPseudoBinaryV_VV_VX;
|
||||
defm PseudoVREM : VPseudoBinaryV_VV_VX;
|
||||
|
||||
} // Predicates = [HasStdExtV]
|
||||
|
||||
let Predicates = [HasStdExtV, HasStdExtF] in {
|
||||
|
|
@ -1242,6 +1258,22 @@ defm "" : VPatBinaryV_VV_VX<"int_riscv_vmin", "PseudoVMIN", AllIntegerVectors>;
|
|||
defm "" : VPatBinaryV_VV_VX<"int_riscv_vmaxu", "PseudoVMAXU", AllIntegerVectors>;
|
||||
defm "" : VPatBinaryV_VV_VX<"int_riscv_vmax", "PseudoVMAX", AllIntegerVectors>;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// 12.10. Vector Single-Width Integer Multiply Instructions
|
||||
//===----------------------------------------------------------------------===//
|
||||
defm "" : VPatBinaryV_VV_VX<"int_riscv_vmul", "PseudoVMUL", AllIntegerVectors>;
|
||||
defm "" : VPatBinaryV_VV_VX<"int_riscv_vmulh", "PseudoVMULH", AllIntegerVectors>;
|
||||
defm "" : VPatBinaryV_VV_VX<"int_riscv_vmulhu", "PseudoVMULHU", AllIntegerVectors>;
|
||||
defm "" : VPatBinaryV_VV_VX<"int_riscv_vmulhsu", "PseudoVMULHSU", AllIntegerVectors>;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// 12.11. Vector Integer Divide Instructions
|
||||
//===----------------------------------------------------------------------===//
|
||||
defm "" : VPatBinaryV_VV_VX<"int_riscv_vdivu", "PseudoVDIVU", AllIntegerVectors>;
|
||||
defm "" : VPatBinaryV_VV_VX<"int_riscv_vdiv", "PseudoVDIV", AllIntegerVectors>;
|
||||
defm "" : VPatBinaryV_VV_VX<"int_riscv_vremu", "PseudoVREMU", AllIntegerVectors>;
|
||||
defm "" : VPatBinaryV_VV_VX<"int_riscv_vrem", "PseudoVREM", AllIntegerVectors>;
|
||||
|
||||
} // Predicates = [HasStdExtV]
|
||||
|
||||
let Predicates = [HasStdExtV, HasStdExtF] in {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue