Module: Mesa
Branch: main
Commit: ddf708a1ff0992839f9fb5fd135690cd97175c75
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ddf708a1ff0992839f9fb5fd135690cd97175c75

Author: Yonggang Luo <[email protected]>
Date:   Fri Feb 17 14:24:20 2023 +0800

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 <[email protected]>
Reviewed-by: David Heidelberg <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21375>

---

 meson.build | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 36c1d0d7808..de030fbd04d 100644
--- a/meson.build
+++ b/meson.build
@@ -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

Reply via email to