optimisation: use more conservative architecture flags

We can't enable SSE3 if we want to compile for our Atom test target, so
we explicitly disable this and a few future instruction sets that we
know won't be accessible.
This commit is contained in:
Danny Robson 2018-09-13 14:53:06 +10:00
parent e82c8b7d4a
commit 99c1ae6afd

View File

@ -65,9 +65,25 @@ canonical_host()
##-----------------------------------------------------------------------------
if (${host_cpu} STREQUAL "x86_64")
# Explicitly qualify the CPU as the minimum viable architecture, but tune
# for common platforms. This might prevent some invalid instructions being
# emitted.
append_compile_flag(-march=x86-64)
append_compile_flag(-mtune=generic)
append_compile_flag(-msse3)
append_compile_flag(-msahf)
append_compile_flag(-msse)
append_compile_flag(-msse2)
append_compile_flag(-mno-sse3)
append_compile_flag(-mssse3)
append_compile_flag(-mno-avx)
append_compile_flag(-mno-avx2)
# These instructions should always be available on reasonable platforms.
# They're almost 20 years old at this point.
#append_compile_flag(-msse)
#append_compile_flag(-msse2)
# append_compile_flag(-mssse3)
# append_compile_flag(-msahf)
elseif (${host_cpu} STREQUAL "i686")
append_compile_flag(-march=prescott)
append_compile_flag(-mtune=generic)