From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: manos.pitsidianakis@linaro.org, zhao1.liu@intel.com,
junjie.mao@intel.com, pierrick.bouvier@linaro.org,
alex.bennee@linaro.org, qemu-stable@nongnu.org
Subject: [PULL 11/12] meson: define qemu_isa_flags
Date: Mon, 7 Oct 2024 13:03:39 +0200 [thread overview]
Message-ID: <20241007110342.1298598-12-pbonzini@redhat.com> (raw)
In-Reply-To: <20241007110342.1298598-1-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>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
meson.build | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/meson.build b/meson.build
index 76335bb2a51..bbb0f6d9bcf 100644
--- a/meson.build
+++ b/meson.build
@@ -335,6 +335,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
@@ -351,7 +355,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
@@ -367,29 +371,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'] + qemu_isa_flags
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
+ qemu_isa_flags = cc.get_supported_arguments('-mneeded') + qemu_isa_flags
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'] + qemu_isa_flags
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'] + qemu_isa_flags
elif get_option('x86_version') == '2'
- qemu_common_flags = ['-msse4.2'] + qemu_common_flags
+ qemu_isa_flags = ['-msse4.2'] + qemu_isa_flags
elif get_option('x86_version') == '3'
- qemu_common_flags = ['-mavx2'] + qemu_common_flags
+ qemu_isa_flags = ['-mavx2'] + qemu_isa_flags
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'] + qemu_isa_flags
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.46.1
next prev parent reply other threads:[~2024-10-07 11:05 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 11:03 [PULL 00/12] Rust initial PoC + meson changes for 2024-10-07 Paolo Bonzini
2024-10-07 11:03 ` [PULL 01/12] Require meson version 1.5.0 Paolo Bonzini
2024-10-07 11:03 ` [PULL 02/12] build-sys: Add rust feature option Paolo Bonzini
2024-10-07 11:03 ` [PULL 03/12] configure, meson: detect Rust toolchain Paolo Bonzini
2024-10-07 11:03 ` [PULL 04/12] rust: add bindgen step as a meson dependency Paolo Bonzini
2024-10-07 11:03 ` [PULL 05/12] .gitattributes: add Rust diff and merge attributes Paolo Bonzini
2024-10-07 11:03 ` [PULL 06/12] meson.build: add HAVE_GLIB_WITH_ALIGNED_ALLOC flag Paolo Bonzini
2024-10-07 11:03 ` [PULL 07/12] rust: add crate to expose bindings and interfaces Paolo Bonzini
2024-10-07 11:03 ` [PULL 08/12] rust: add utility procedural macro crate Paolo Bonzini
2024-10-07 11:03 ` [PULL 09/12] rust: add PL011 device model Paolo Bonzini
2024-10-07 11:03 ` [PULL 10/12] meson: fix machine option for x86_version Paolo Bonzini
2024-10-07 11:03 ` Paolo Bonzini [this message]
2024-10-07 11:03 ` [PULL 12/12] meson: ensure -mcx16 is passed when detecting ATOMIC128 Paolo Bonzini
2024-10-07 11:11 ` [PULL 00/12] Rust initial PoC + meson changes for 2024-10-07 Daniel P. Berrangé
2024-10-07 11:26 ` Paolo Bonzini
2024-10-07 11:47 ` Daniel P. Berrangé
2024-10-07 11:52 ` Daniel P. Berrangé
2024-10-07 15:51 ` Paolo Bonzini
2024-10-07 17:56 ` Brian Cain
2024-10-07 19:15 ` Paolo Bonzini
2024-10-08 3:27 ` Brian Cain
2024-10-08 3:39 ` Pierrick Bouvier
2024-10-08 10:01 ` Alex Bennée
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241007110342.1298598-12-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=junjie.mao@intel.com \
--cc=manos.pitsidianakis@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=zhao1.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).