[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-9.1.1 39/49] meson: define qemu_isa_flags
From: |
Michael Tokarev |
Subject: |
[Stable-9.1.1 39/49] meson: define qemu_isa_flags |
Date: |
Wed, 16 Oct 2024 23:09:58 +0300 |
From: Paolo Bonzini <pbonzini@redhat.com>
Create a separate variable for compiler flags that enable
specific instruction set extensions, so that they can be used with
cc.compiles/cc.links.
Note that -mfpmath=sse is a code generation option but it does not
enable new instructions, therefore I did not make it part of
qemu_isa_flags.
Suggested-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 6ae8c5382b2396d394e135c2c6d3742d11c6d0c2)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/meson.build b/meson.build
index 6e467cbe7d..3031f37f45 100644
--- a/meson.build
+++ b/meson.build
@@ -322,6 +322,10 @@ elif host_os == 'windows'
endif
endif
+# Choose instruction set (currently x86-only)
+
+qemu_isa_flags = []
+
# __sync_fetch_and_and requires at least -march=i486. Many toolchains
# use i686 as default anyway, but for those that don't, an explicit
# specification is necessary
@@ -338,7 +342,7 @@ if host_arch == 'i386' and not cc.links('''
sfaa(&val);
return val;
}''')
- qemu_common_flags = ['-march=i486'] + qemu_common_flags
+ qemu_isa_flags += ['-march=i486']
endif
# Pick x86-64 baseline version
@@ -354,29 +358,31 @@ if host_arch in ['i386', 'x86_64']
else
# present on basically all processors but technically not part of
# x86-64-v1, so only include -mneeded for x86-64 version 2 and above
- qemu_common_flags = ['-mcx16'] + qemu_common_flags
+ qemu_isa_flags += ['-mcx16']
endif
endif
if get_option('x86_version') >= '2'
- qemu_common_flags = ['-mpopcnt'] + qemu_common_flags
- qemu_common_flags = cc.get_supported_arguments('-mneeded') +
qemu_common_flags
+ qemu_isa_flags += ['-mpopcnt']
+ qemu_isa_flags += cc.get_supported_arguments('-mneeded')
endif
if get_option('x86_version') >= '3'
- qemu_common_flags = ['-mmovbe', '-mabm', '-mbmi', '-mbmi2', '-mfma',
'-mf16c'] + qemu_common_flags
+ qemu_isa_flags += ['-mmovbe', '-mabm', '-mbmi', '-mbmi2', '-mfma',
'-mf16c']
endif
# add required vector instruction set (each level implies those below)
if get_option('x86_version') == '1'
- qemu_common_flags = ['-msse2'] + qemu_common_flags
+ qemu_isa_flags += ['-msse2']
elif get_option('x86_version') == '2'
- qemu_common_flags = ['-msse4.2'] + qemu_common_flags
+ qemu_isa_flags += ['-msse4.2']
elif get_option('x86_version') == '3'
- qemu_common_flags = ['-mavx2'] + qemu_common_flags
+ qemu_isa_flags += ['-mavx2']
elif get_option('x86_version') == '4'
- qemu_common_flags = ['-mavx512f', '-mavx512bw', '-mavx512cd',
'-mavx512dq', '-mavx512vl'] + qemu_common_flags
+ qemu_isa_flags += ['-mavx512f', '-mavx512bw', '-mavx512cd', '-mavx512dq',
'-mavx512vl']
endif
endif
+qemu_common_flags = qemu_isa_flags + qemu_common_flags
+
if get_option('prefer_static')
qemu_ldflags += get_option('b_pie') ? '-static-pie' : '-static'
endif
--
2.39.5
- [Stable-9.1.1 00/49] Patch Round-up for stable 9.1.1, freeze on 2024-10-16 (frozen), Michael Tokarev, 2024/10/16
- [Stable-9.1.1 33/49] linux-user/flatload: Take mmap_lock in load_flt_binary(), Michael Tokarev, 2024/10/16
- [Stable-9.1.1 34/49] linux-user: Fix parse_elf_properties GNU0_MAGIC check, Michael Tokarev, 2024/10/16
- [Stable-9.1.1 35/49] tcg/ppc: Use TCG_REG_TMP2 for scratch tcg_out_qemu_st, Michael Tokarev, 2024/10/16
- [Stable-9.1.1 36/49] tcg/ppc: Use TCG_REG_TMP2 for scratch index in prepare_host_addr, Michael Tokarev, 2024/10/16
- [Stable-9.1.1 37/49] target/m68k: Always return a temporary from gen_lea_mode, Michael Tokarev, 2024/10/16
- [Stable-9.1.1 38/49] meson: fix machine option for x86_version, Michael Tokarev, 2024/10/16
- [Stable-9.1.1 39/49] meson: define qemu_isa_flags,
Michael Tokarev <=
- [Stable-9.1.1 40/49] meson: ensure -mcx16 is passed when detecting ATOMIC128, Michael Tokarev, 2024/10/16
- [Stable-9.1.1 41/49] hw/intc/arm_gicv3: Add cast to match the documentation, Michael Tokarev, 2024/10/16
- [Stable-9.1.1 42/49] hw/intc/arm_gicv3: Add cast to match the documentation, Michael Tokarev, 2024/10/16
- [Stable-9.1.1 43/49] hw/intc/arm_gicv3_cpuif: Add cast to match the documentation, Michael Tokarev, 2024/10/16
- [Stable-9.1.1 44/49] hw/char/pl011: Use correct masks for IBRD and FBRD, Michael Tokarev, 2024/10/16
- [Stable-9.1.1 45/49] hw/audio/hda: free timer on exit, Michael Tokarev, 2024/10/16
- [Stable-9.1.1 46/49] hw/audio/hda: fix memory leak on audio setup, Michael Tokarev, 2024/10/16
- [Stable-9.1.1 47/49] ui/dbus: fix leak on message filtering, Michael Tokarev, 2024/10/16
- [Stable-9.1.1 48/49] ui/win32: fix potential use-after-free with dbus shared memory, Michael Tokarev, 2024/10/16
- [Stable-9.1.1 49/49] ui/dbus: fix filtering all update messages, Michael Tokarev, 2024/10/16