[clang] [llvm] [RISCV][SLEEF]: Support SLEEF vector library for RISC-V target. (PR #114014)

Mark Goncharov via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 11 22:35:30 PST 2024


mga-sc wrote:

> @mga-sc I'm trying to run some experiments with your PR and will post as soon as they are done, but can I ask you to add the following code to your PR? So that clang can accept -fveclib=SLEEF when building for riscv64
> 
> ```
> diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
> index 0952262c3601..04f4f0522618 100644
> --- a/clang/lib/Driver/ToolChains/Clang.cpp
> +++ b/clang/lib/Driver/ToolChains/Clang.cpp
> @@ -5804,7 +5804,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
>              << Name << Triple.getArchName();
>      } else if (Name == "SLEEF" || Name == "ArmPL") {
>        if (Triple.getArch() != llvm::Triple::aarch64 &&
> -          Triple.getArch() != llvm::Triple::aarch64_be)
> +          Triple.getArch() != llvm::Triple::aarch64_be &&
> +          Triple.getArch() != llvm::Triple::riscv64)
>          D.Diag(diag::err_drv_unsupported_opt_for_target)
>              << Name << Triple.getArchName();
>      }
> ```

Add clang support. Also add test to fveclib.c to check. 

https://github.com/llvm/llvm-project/pull/114014


More information about the cfe-commits mailing list