Projects
home:shafeipaozi
highway
_service:tar_scm:c95cc0237d2f7a0f5ca5dc3fb4b596...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:c95cc0237d2f7a0f5ca5dc3fb4b5961b2b1dcdfc.patch of Package highway
From c95cc0237d2f7a0f5ca5dc3fb4b5961b2b1dcdfc Mon Sep 17 00:00:00 2001 From: Jan Wassenberg <janwas@google.com> Date: Mon, 3 Jun 2024 02:51:20 -0700 Subject: [PATCH] Disable RVV runtime dispatch. Fixes #2227 Public Clang <= 18 still appears to require compiler flags for RVV. GCC 13 also has an #error and 14 is missing mulh/mulhu. Also split HWY_HAVE_RUNTIME_DISPATCH into multiple macros to enable overriding parts of the logic. PiperOrigin-RevId: 639709709 --- hwy/detect_targets.h | 51 ++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/hwy/detect_targets.h b/hwy/detect_targets.h index db4c786489..8914638e67 100644 --- a/hwy/detect_targets.h +++ b/hwy/detect_targets.h @@ -596,23 +596,46 @@ #endif #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 +// 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 +#define HWY_HAVE_RUNTIME_DISPATCH_RVV 1 +#else +#define HWY_HAVE_RUNTIME_DISPATCH_RVV 0 +#endif +#endif // HWY_HAVE_RUNTIME_DISPATCH_RVV + +#ifndef HWY_HAVE_RUNTIME_DISPATCH_APPLE // allow override +#if HWY_ARCH_ARM_A64 && HWY_OS_APPLE && \ + (HWY_COMPILER_GCC_ACTUAL || HWY_COMPILER_CLANG >= 1700) +#define HWY_HAVE_RUNTIME_DISPATCH_APPLE 1 +#else +#define HWY_HAVE_RUNTIME_DISPATCH_APPLE 0 +#endif +#endif // HWY_HAVE_RUNTIME_DISPATCH_APPLE + +#ifndef HWY_HAVE_RUNTIME_DISPATCH_LINUX // allow override +#if (HWY_ARCH_ARM || HWY_ARCH_PPC || HWY_ARCH_S390X) && HWY_OS_LINUX && \ + (HWY_COMPILER_GCC_ACTUAL || HWY_COMPILER_CLANG >= 1700) && HWY_HAVE_AUXV +#define HWY_HAVE_RUNTIME_DISPATCH_LINUX 1 +#else +#define HWY_HAVE_RUNTIME_DISPATCH_LINUX 0 +#endif +#endif // HWY_HAVE_RUNTIME_DISPATCH_LINUX + // Allow opting out, and without a guarantee of success, opting-in. #ifndef HWY_HAVE_RUNTIME_DISPATCH -// Clang, GCC and MSVC allow runtime dispatch on x86. -#if HWY_ARCH_X86 -#define HWY_HAVE_RUNTIME_DISPATCH 1 -// On Arm, PPC, S390X, and RISC-V: GCC and Clang 17+ do, and we require Linux -// to detect CPU capabilities. -#elif (HWY_ARCH_ARM || HWY_ARCH_PPC || HWY_ARCH_S390X || HWY_ARCH_RISCV) && \ - (HWY_COMPILER_GCC_ACTUAL || HWY_COMPILER_CLANG >= 1700) && HWY_OS_LINUX && \ - HWY_HAVE_AUXV -#define HWY_HAVE_RUNTIME_DISPATCH 1 -#elif HWY_ARCH_ARM_A64 && HWY_OS_APPLE && \ - (HWY_COMPILER_GCC_ACTUAL || HWY_COMPILER_CLANG >= 1700) +// Clang, GCC and MSVC allow OS-independent runtime dispatch on x86. +#if HWY_ARCH_X86 || HWY_HAVE_RUNTIME_DISPATCH_RVV || \ + HWY_HAVE_RUNTIME_DISPATCH_APPLE || HWY_HAVE_RUNTIME_DISPATCH_LINUX #define HWY_HAVE_RUNTIME_DISPATCH 1 #else #define HWY_HAVE_RUNTIME_DISPATCH 0 -#endif // HWY_ARCH_* +#endif #endif // HWY_HAVE_RUNTIME_DISPATCH // AVX3_DL is not widely available yet. To reduce code size and compile time, @@ -675,9 +698,9 @@ #endif #if HWY_ARCH_RISCV && HWY_HAVE_RUNTIME_DISPATCH -#define HWY_ATTAINABLE_RISCV (HWY_RVV) +#define HWY_ATTAINABLE_RISCV HWY_RVV #else -#define HWY_ATTAINABLE_RISCV 0 +#define HWY_ATTAINABLE_RISCV HWY_BASELINE_RVV #endif // Attainable means enabled and the compiler allows intrinsics (even when not
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2