diff --git a/hwy/detect_targets.h b/hwy/detect_targets.h index 4c4e1dd75c..1b10de76a5 100644 --- a/hwy/detect_targets.h +++ b/hwy/detect_targets.h @@ -605,12 +605,11 @@ #endif // HWY_HAVE_AUXV #ifndef HWY_HAVE_RUNTIME_DISPATCH_RVV // allow override -// The riscv_vector.h in (at least) Clang 16-18 requires compiler flags, see +// The riscv_vector.h in Clang 16-18 requires compiler flags, see // https://github.com/llvm/llvm-project/issues/56592. GCC 13.3 also has an // #error check, whereas 14.1 fails with "argument type 'vuint16m8_t' requires // the V ISA extension": https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115325. -// Hence disable runtime dispatch for now. -#if HWY_ARCH_RISCV && 0 +#if HWY_ARCH_RISCV && HWY_COMPILER_CLANG >= 1900 #define HWY_HAVE_RUNTIME_DISPATCH_RVV 1 #else #define HWY_HAVE_RUNTIME_DISPATCH_RVV 0 diff --git a/hwy/ops/set_macros-inl.h b/hwy/ops/set_macros-inl.h index 467bbd2447..21c3a8fbc6 100644 --- a/hwy/ops/set_macros-inl.h +++ b/hwy/ops/set_macros-inl.h @@ -629,8 +629,12 @@ #define HWY_NAMESPACE N_RVV +#if HWY_COMPILER_CLANG >= 1900 +// https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#181-zvl-minimum-vector-length-standard-extensions +#define HWY_TARGET_STR "Zvl128b,Zve64d" +#else // HWY_TARGET_STR remains undefined so HWY_ATTR is a no-op. -// (rv64gcv is not a valid target) +#endif //----------------------------------------------------------------------------- // EMU128