[clang] [clang][RISCV] Enable RVV with function attribute __attribute__((target("arch=+v"))) (PR #83674)

Camel Coder via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 4 11:54:52 PDT 2024


camel-cdr wrote:

Ah, thanks, that works.

How can support for behavior be detected?
The intrinsic spec says:

> The `__riscv_v_intrinsic` macro is the C macro to test the compiler's support for the RISC-V "V" extension intrinsics.
and recommends using:
```c
#ifdef __riscv_v_intrinsic
#include <riscv_vector.h>
#endif /* __riscv_v_intrinsic */
```
But clang only defines `__riscv_v_intrinsic` when RVV is enabled by an march option, shouldn't it now always be enabled when it's possible to include `<riscv_vector.h>`?


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


More information about the cfe-commits mailing list