You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[TargetLibraryInfo] Add libmvec support for risc-v
1. Rename LIBMVEC_X86 into LIBMVEC to support libmvec in risc-v.
2. Add RVVM1/2/4/8 in VFISAKind to distingusih the LMUL value.
3. Declare some RVV vector math functions in VecFuncs.def.
In VecFuncs.def, I add the LI_DEFINE_VECFUNC of LIBMVEC_RVV as follow:
```
TLI_DEFINE_VECFUNC("sin", "_ZGV1Nxv_sin", SCALABLE(1), "_ZGVr1Nxv")
TLI_DEFINE_VECFUNC("sin", "_ZGV2Nxv_sin", SCALABLE(2), "_ZGVr2Nxv")
TLI_DEFINE_VECFUNC("llvm.exp.f32", "_ZGV1Nxv_expf", SCALABLE(2), "_ZGVr1Nxv")
TLI_DEFINE_VECFUNC("llvm.exp.f32", "_ZGV2Nxv_expf", SCALABLE(4), "_ZGVr2Nxv")
```
The `VEC` of TLI_DEFINE_VECFUNC (e.g., `_ZGV2Nxv_sin`), its name mangling rules
defined in
riscv-non-isa/riscv-elf-psabi-doc#455
Now it's still under review.
The `VF` (e.g., `SCALABLE(2)`), it should be `vscale x (LMUL * 64 / sizeof(Type)`.
The `VABI_PREFIX` (e.g., `_ZGVr1Nxv`), `r` means RISC-V vector extension, `1` is
the LMUL value.
```
_ZGVr1Nxv --> RISC-V Vector Extension with LMUL=1
_ZGVr2Nxv --> RISC-V Vector Extension with LMUL=2
_ZGVr4Nxv --> RISC-V Vector Extension with LMUL=4
_ZGVr8Nxv --> RISC-V Vector Extension with LMUL=8
```
// CHECK-ENABLED-LAST: math errno enabled by '-ffp-model=strict' after it was implicitly disabled by '-fveclib=ArmPL', this may limit the utilization of the vector library [-Wmath-errno-enabled-with-veclib]
111
115
112
116
/* Verify no warning when math-errno is re-enabled for a different veclib (that does not imply -fno-math-errno). */
0 commit comments