mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-11-19 14:45:29 +00:00
Do not require AVX-512 VBMI2 for the AVX-512 SIMD code
VBMI2 was only used by the AVX-512 UTF-8 decoder, which has been removed, so CPUs with AVX-512 F, BW and VL but not VBMI2, such as Skylake-X, can now use the AVX-512 implementations of the remaining functions.
This commit is contained in:
parent
fd22b77241
commit
be7bc4d212
2 changed files with 6 additions and 7 deletions
|
|
@ -347,12 +347,11 @@ init_simd(void *x) {
|
|||
Py_INCREF(Py_##val); \
|
||||
if (0 != PyModule_AddObject(module, #x, Py_##val)) return false; \
|
||||
}
|
||||
#define do_check() \
|
||||
{ \
|
||||
has_sse4_2 = __builtin_cpu_supports("sse4.2") != 0; \
|
||||
has_avx2 = __builtin_cpu_supports("avx2") != 0; \
|
||||
has_avx512 = __builtin_cpu_supports("avx512f") && __builtin_cpu_supports("avx512bw") && __builtin_cpu_supports("avx512vl") && \
|
||||
__builtin_cpu_supports("avx512vbmi2"); \
|
||||
#define do_check() \
|
||||
{ \
|
||||
has_sse4_2 = __builtin_cpu_supports("sse4.2") != 0; \
|
||||
has_avx2 = __builtin_cpu_supports("avx2") != 0; \
|
||||
has_avx512 = __builtin_cpu_supports("avx512f") && __builtin_cpu_supports("avx512bw") && __builtin_cpu_supports("avx512vl"); \
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -979,7 +979,7 @@ def get_source_specific_cflags(env: Env, src: str) -> List[str]:
|
|||
elif src == 'kitty/simd-string-512.c':
|
||||
# uses native AVX-512 intrinsics, only compiled on x86-64, selected at runtime only when the CPU supports these features
|
||||
if env.binary_arch.isa is ISA.AMD64:
|
||||
ans.extend(('-mavx512f', '-mavx512bw', '-mavx512vl', '-mavx512vbmi2'))
|
||||
ans.extend(('-mavx512f', '-mavx512bw', '-mavx512vl'))
|
||||
# We have manual vzeroupper so prevent compiler from emitting it causing duplicates
|
||||
if env.compiler_type is CompilerType.clang:
|
||||
ans.append('-mllvm')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue