meson: Split sse2_arg and sse2_args out of c_cpp_args

This is used to replace c_sse2_arg and c_sse2_args in latter commits

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21375>
This commit is contained in:
Yonggang Luo
2023-02-17 14:24:20 +08:00
committed by Marge Bot
parent 446630ab42
commit ddf708a1ff

View File

@@ -1104,6 +1104,8 @@ if host_machine.system() == 'windows'
endif
endif
sse2_arg = []
sse2_args = []
sse41_args = []
with_sse41 = false
if host_machine.cpu_family().startswith('x86')
@@ -1114,6 +1116,9 @@ if host_machine.cpu_family().startswith('x86')
sse41_args = ['-msse4.1']
if host_machine.cpu_family() == 'x86'
# x86_64 have sse2 by default, so sse2 args only for x86
sse2_arg = ['-msse2', '-mfpmath=sse']
sse2_args = [sse2_arg, '-mstackrealign']
if get_option('sse2')
# These settings make generated GCC code match MSVC and follow
# GCC advice on https://gcc.gnu.org/wiki/FloatingPointMath#x86note
@@ -1126,7 +1131,10 @@ if host_machine.cpu_family().startswith('x86')
# XXX: We could have SSE without -mstackrealign if we always used
# __attribute__((force_align_arg_pointer)), but that's not
# always the case.
c_cpp_args += ['-msse2', '-mfpmath=sse', '-mstackrealign']
c_cpp_args += sse2_args
# sse2_args are adopted into c_cpp_args to avoid duplicated sse2 command line args
sse2_arg = []
sse2_args = []
else
# GCC on x86 (not x86_64) with -msse* assumes a 16 byte aligned stack, but
# that's not guaranteed