From b68582b1c5b3b226a9ad88ac18a3fb21a81226e9 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Wed, 29 Mar 2023 23:30:44 -0700 Subject: [PATCH] meson: Check for the __builtin_ia32_clflushopt function Signed-off-by: Jordan Justen Reviewed-by: Lionel Landwerlin Part-of: --- meson.build | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/meson.build b/meson.build index 0aa07eb08d7..8aa133dbb2e 100644 --- a/meson.build +++ b/meson.build @@ -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