meson: Check for the __builtin_ia32_clflushopt function
authorJordan Justen <jordan.l.justen@intel.com>
Thu, 30 Mar 2023 06:30:44 +0000 (23:30 -0700)
committerMarge Bot <emma+marge@anholt.net>
Wed, 6 Sep 2023 01:39:53 +0000 (01:39 +0000)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22379>

meson.build

index 0aa07eb..8aa133d 100644 (file)
@@ -1170,6 +1170,16 @@ if host_machine.cpu_family().startswith('x86')
   endif
 endif
 
+# Detect __builtin_ia32_clflushopt support
+if cc.has_function('__builtin_ia32_clflushopt', args : '-mclflushopt')
+  pre_args += '-DHAVE___BUILTIN_IA32_CLFLUSHOPT'
+  clflushopt_args = ['-mclflushopt']
+  with_clflushopt = true
+else
+  clflushopt_args = []
+  with_clflushopt = false
+endif
+
 # Check for GCC style atomics
 dep_atomic = null_dep