Only use SIMD if CPU supports it at runtime

This commit is contained in:
Kovid Goyal
2023-11-10 18:39:04 +05:30
parent 19a41b4d9a
commit b032313c45
4 changed files with 47 additions and 20 deletions

View File

@@ -491,8 +491,9 @@ def init_env(
cflags.append('-g3')
ldflags.append('-lprofiler')
if not native_optimizations:
cflags.append('-msse4.2')
# SIMD instructions
cflags.append('-msse4.2')
cflags.append('-mavx2')
library_paths: Dict[str, List[str]] = {}
def add_lpath(which: str, name: str, val: Optional[str]) -> None: