diff options
author | Dylan Baker <[email protected]> | 2017-11-15 16:09:22 -0800 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2017-11-22 12:46:00 -0800 |
commit | 84486f64626ad2b51291b84965d1bc96f68d8127 (patch) | |
tree | 0f1c7ca332c750a11db9cb713dd621aed2fa4583 /meson.build | |
parent | 6a78416dabdf0b7b80471dd0c636164c8f4012e0 (diff) |
meson: Enable SSE4.1 optimizations
This patch checks for an and then enables sse4.1 optimizations if the
host machine will be x86/x86_64.
v2: - Don't compile code, it's unnecessary since we require a compiler
which always has SSE4.1 (Matt)
v3: - x64 -> x86_64 (Matt)
Signed-off-by: Dylan Baker <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/meson.build b/meson.build index 383ebb36662..049c9a24e4a 100644 --- a/meson.build +++ b/meson.build @@ -502,7 +502,20 @@ foreach a : ['-Wno-override-init', '-Wno-initializer-overrides'] endif endforeach -# TODO: SSE41 (which is only required for core mesa) +if host_machine.cpu_family().startswith('x86') + pre_args += '-DHAVE_SSE41' + with_sse41 = true + sse41_args = ['-msse4.1'] + + # GCC on x86 (not x86_64) with -msse* assumes a 16 byte aligned stack, but + # that's not guaranteed + if host_machine.cpu_family() == 'x86' + sse41_args += '-mstackrealign' + endif +else + with_sse41 = false + sse41_args = [] +endif # Check for GCC style atomics if cc.compiles('int main() { int n; return __atomic_load_n(&n, __ATOMIC_ACQUIRE); }', |