[Mesa-dev] [PATCH v2] meson: Enable SSE4.1 optimizations

Matt Turner mattst88 at gmail.com
Thu Nov 16 23:01:05 UTC 2017


On Thu, Nov 16, 2017 at 2:46 PM, Dylan Baker <dylan at pnwbakers.com> wrote:
> 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)
>
> Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com> (v1)
> ---
>  meson.build          | 15 ++++++++++++++-
>  src/mesa/meson.build | 14 +++++++++++---
>  2 files changed, 25 insertions(+), 4 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index 383ebb36662..2df4610a2fd 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 x64) with -msse* assumes a 16 byte aligned stack, but

Please s/x64/x86-64/ or s/x64/x86_64/ since you use .startswith('x86')
a few lines above (and I find x64 moniker annoying)


More information about the mesa-dev mailing list