mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 16:37:27 +00:00
Use -mtune=intel for SIMD files when building without native optimizations
This commit is contained in:
parent
da31db3212
commit
55c909c656
1 changed files with 5 additions and 1 deletions
6
setup.py
6
setup.py
|
|
@ -708,15 +708,19 @@ def get_source_specific_defines(env: Env, src: str) -> Tuple[str, List[str], Opt
|
|||
|
||||
def get_source_specific_cflags(env: Env, src: str) -> List[str]:
|
||||
ans = list(env.cflags)
|
||||
# SIMD specific flags, ignored for native optimizations as they give slightly better performance
|
||||
# SIMD specific flags
|
||||
if src in ('kitty/simd-string-128.c', 'kitty/simd-string-256.c'):
|
||||
if env.binary_arch.isa in (ISA.AMD64, ISA.X86):
|
||||
ans.append('-msse4.2' if '128' in src else '-mavx2')
|
||||
if not env.native_optimizations:
|
||||
ans.append('-mtune=intel')
|
||||
elif env.binary_arch.isa != ISA.ARM64:
|
||||
ans.append('-DKITTY_NO_SIMD')
|
||||
elif src.startswith('3rdparty/base64/lib/arch/'):
|
||||
if env.binary_arch.isa in (ISA.AMD64, ISA.X86):
|
||||
q = src.split(os.path.sep)
|
||||
if not env.native_optimizations:
|
||||
ans.append('-mtune=intel')
|
||||
if 'sse3' in q:
|
||||
ans.append('-msse3')
|
||||
elif 'sse41' in q:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue