qtest and misc patches
Hi Peter,
the following changes since commit dddb37495b844270088e68e3bf30b764d48d863f:
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-updates-20181015.0' into staging (2018-10-15 18:44:04 +0100)
are available in the git repository at:
https://gitlab.com/huth/qemu.git tags/pull-request-2018-10-17
for you to fetch changes up to 7fc527cdc9cfd139dee1d90e3220a884229a7698:
configure: remove glib_subprocess check (2018-10-17 09:01:41 +0200)
----------------------------------------------------------------
- Updates for qtest entries in test/Makefile.include
- Simple updates for some shell scripts
- Misc simple patches for files without regular subsystem pull requests
----------------------------------------------------------------
Eric Blake (1):
tests: Prevent more accidental test disabling
John Arbuckle (1):
qemu-common.h: update copyright date to 2018
Liu Yuan (1):
MAINTAINERS: update block/sheepdog maintainers
Mao Zhongyi (3):
archive-source.sh: Modern shell scripting (use $() instead of ``)
git-submodule.sh: Modern shell scripting (use $() instead of ``)
show-fixed-bugs.sh: Modern shell scripting (use $() instead of ``)Marc-André Lureau (1):
configure: remove glib_subprocess check
Paolo Bonzini (1):
tests: remove gcov-files- variables
Philippe Mathieu-Daudé (2):
gdbstub: Remove unused include
mailmap: Fix Reimar Döffinger name
Thomas Huth (5):
target/cris/translate: Get rid of qemu_log_separate() qemu/compiler: Wrap __attribute__((flatten)) in a macro hw/core/generic-loader: Set a category for the generic-loader device
cpu: Provide a proper prototype for target_words_bigendian() in a header hw/core/generic-loader: Compile only once, not for each target
.mailmap | 3 +- MAINTAINERS | 1 - configure | 6 -- docs/devel/testing.rst | 4 +- exec.c | 5 -- fpu/softfloat.c | 39 +++++-------- gdbstub.c | 1 - hw/core/Makefile.objs | 2 +- hw/core/generic-loader.c | 7 +-- hw/virtio/virtio.c | 1 - include/qemu-common.h | 2 +- include/qemu/compiler.h | 15 +++++ include/qom/cpu.h | 11 ++++ qom/cpu.c | 1 - scripts/archive-source.sh | 4 +- scripts/git-submodule.sh | 4 +- scripts/show-fixed-bugs.sh | 10 ++-- target/cris/translate.c | 6 +- tests/Makefile.include | 140 ++++----------------------------------------- 19 files changed, 69 insertions(+), 193 deletions(-)
[Qemu-devel] [PULL 01/15] qemu-common.h: update copyright date to 2018
From: John Arbuckle <[email protected]>
Currently the copyright date is set to 2017. Update the date to say 2018.
--- include/qemu-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/qemu-common.h +1 -1
@@ -17,7 +17,7 @@#define TFR (expr) do { if ((expr) != -1) break; } while (errno == EINTR)/* Copyright string for -version arguments, About dialogs, etc */ -#define QEMU_COPYRIGHT "Copyright (c) 2003-2017 " \ +#define QEMU_COPYRIGHT "Copyright (c) 2003-2018 " \ "Fabrice Bellard and the QEMU Project developers"/* Bug reporting information for --help arguments, About dialogs, etc */
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 02/15] target/cris/translate: Get rid of qemu_log_separate()
In reply to Thomas HuthThe gen_BUG() function calls already cpu_abort(), which prints the information to stderr and the log already. So instead of additionally printing the dc->pc via fprintf() and qemu_log here, too, we can simply pass this information to cpu_abort() instead.
--- target/cris/translate.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
target/cris/translate.c +1 -5
@@ -137,11 +137,7 @@ typedef struct DisasContext {static void gen_BUG (DisasContext *dc,const char *file,int line) { -fprintf (stderr,"BUG: pc=%x %s %d\n" , dc->pc, file, line); -if (qemu_log_separate ()) { -qemu_log ("BUG: pc=%x %s %d\n" , dc->pc, file, line); - } -cpu_abort (CPU (dc->cpu),"%s:%d\n" , file, line); +cpu_abort (CPU (dc->cpu),"%s:%d pc=%x\n" , file, line, dc->pc); } static const char *regnames_v32[] =
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 03/15] tests: Prevent more accidental test disabling
In reply to Thomas HuthFrom: Eric Blake <[email protected]>
GNU make is perfectly happy to use 'check-FOO-y += bar' to initialize check-FOO-y. (GNU Automake strictly insists that you cannot use += until after an initial = per variable, but thankfully we aren't using automake).
As we have had more than one instance where copy-and-paste of 'check-FOO-y = bar' from a first test under category FOO into an additional test, which ends up disabling the first (see commits 992159c7 and 4429532b), it's better to just always use the form that survives copy-and-paste, even for categories that don't currently add more than one test.
Done with s/^\(check-[a-z]*-y \)=/\1+=/g
--- tests/Makefile.include | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
tests/Makefile.include +11 -11
@@ -38,7 +38,7 @@ $(SRC_PATH)/scripts/qapi-gen.py SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \ $(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak))) -check-unit-y = tests/check-qdict$(EXESUF) +check-unit-y += tests/check-qdict$(EXESUF) gcov-files-check-qdict-y = qobject/qdict.c check-unit-y += tests/check-block-qdict$(EXESUF) gcov-files-check-block-qdict-y = qobject/block-qdict.c
@@ -181,7 +181,7 @@ check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh # All QTests for now are POSIX-only, but the dependencies are # really in libqtest, not in the testcases themselves. -check-qtest-generic-y = tests/qmp-test$(EXESUF) +check-qtest-generic-y += tests/qmp-test$(EXESUF) gcov-files-generic-y = monitor.c qapi/qmp-dispatch.c check-qtest-generic-y += tests/qmp-cmd-test$(EXESUF)
@@ -324,13 +324,13 @@ check-qtest-x86_64-$(CONFIG_SDHCI) += tests/sdhci-test$(EXESUF) gcov-files-i386-y += i386-softmmu/hw/timer/mc146818rtc.c gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y)) -check-qtest-alpha-y = tests/boot-serial-test$(EXESUF) +check-qtest-alpha-y += tests/boot-serial-test$(EXESUF) -check-qtest-hppa-y = tests/boot-serial-test$(EXESUF) +check-qtest-hppa-y += tests/boot-serial-test$(EXESUF) check-qtest-m68k-y = tests/boot-serial-test$(EXESUF) -check-qtest-microblaze-y = tests/boot-serial-test$(EXESUF) +check-qtest-microblaze-y += tests/boot-serial-test$(EXESUF) check-qtest-mips-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF)
@@ -338,7 +338,7 @@ check-qtest-mips64-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) check-qtest-mips64el-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) -check-qtest-moxie-y = tests/boot-serial-test$(EXESUF) +check-qtest-moxie-y += tests/boot-serial-test$(EXESUF) check-qtest-ppc-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) check-qtest-ppc-y += tests/boot-order-test$(EXESUF)
@@ -348,7 +348,7 @@ check-qtest-ppc-y += tests/boot-serial-test$(EXESUF) check-qtest-ppc-y += tests/m48t59-test$(EXESUF) gcov-files-ppc-y += hw/timer/m48t59.c -check-qtest-ppc64-y = $(check-qtest-ppc-y) +check-qtest-ppc64-y += $(check-qtest-ppc-y) gcov-files-ppc64-y = $(subst ppc-softmmu/,ppc64-softmmu/,$(gcov-files-ppc-y)) check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF) gcov-files-ppc64-y += ppc64-softmmu/hw/ppc/spapr_pci.c
@@ -377,7 +377,7 @@ check-qtest-sh4-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) check-qtest-sh4eb-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) -check-qtest-sparc-y = tests/prom-env-test$(EXESUF) +check-qtest-sparc-y += tests/prom-env-test$(EXESUF) check-qtest-sparc-y += tests/m48t59-test$(EXESUF) gcov-files-sparc-y = hw/timer/m48t59.c check-qtest-sparc-y += tests/boot-serial-test$(EXESUF)
@@ -386,7 +386,7 @@ check-qtest-sparc64-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) check-qtest-sparc64-y += tests/prom-env-test$(EXESUF) check-qtest-sparc64-y += tests/boot-serial-test$(EXESUF) -check-qtest-arm-y = tests/tmp105-test$(EXESUF) +check-qtest-arm-y += tests/tmp105-test$(EXESUF) check-qtest-arm-y += tests/pca9552-test$(EXESUF) check-qtest-arm-y += tests/ds1338-test$(EXESUF) check-qtest-arm-y += tests/m25p80-test$(EXESUF)
@@ -404,9 +404,9 @@ check-qtest-aarch64-$(CONFIG_SDHCI) += tests/sdhci-test$(EXESUF) check-qtest-aarch64-y += tests/boot-serial-test$(EXESUF) check-qtest-aarch64-y += tests/migration-test$(EXESUF) -check-qtest-microblazeel-y = $(check-qtest-microblaze-y) +check-qtest-microblazeel-y += $(check-qtest-microblaze-y) -check-qtest-xtensaeb-y = $(check-qtest-xtensa-y) +check-qtest-xtensaeb-y += $(check-qtest-xtensa-y) check-qtest-s390x-y = tests/boot-serial-test$(EXESUF) check-qtest-s390x-$(CONFIG_SLIRP) += tests/pxe-test$(EXESUF)
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 04/15] tests: remove gcov-files- variables
In reply to Thomas HuthFrom: Paolo Bonzini <[email protected]>
Commit 31d2dda ("build-system: remove per-test GCOV reporting", 2018-06-20) removed users of the variables, since those uses can be replaced by a simple overall report produced by gcovr. However, the variables were never removed. Do it now.
--- docs/devel/testing.rst | 4 +- tests/Makefile.include | 118 ------------------------------------------------- 2 files changed, 1 insertion(+), 121 deletions(-)
docs/devel/testing.rst +1 -3
@@ -43,15 +43,13 @@ add a new unit test: 3. Add the test to ``tests/Makefile.include``. First, name the unit test program and add it to ``$(check-unit-y)``; then add a rule to build the - executable. Optionally, you can add a magical variable to support ``gcov``. - For example: + executable. For example: .. code:: check-unit-y += tests/foo-test$(EXESUF) tests/foo-test$(EXESUF): tests/foo-test.o $(test-util-obj-y) ... - gcov-files-foo-test-y = util/foo.c Since unit tests don't require environment variables, the simplest way to debug a unit test failure is often directly invoking it or even running it under
tests/Makefile.include +0 -118
301 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 05/15] gdbstub: Remove unused include
In reply to Thomas HuthFrom: Philippe Mathieu-Daudé <[email protected]>
--- gdbstub.c | 1 - 1 file changed, 1 deletion(-)
gdbstub.c +0 -1
@@ -20,7 +20,6 @@#include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/cutils.h" -#include "cpu.h" #include "trace-root.h" #ifdef CONFIG_USER_ONLY #include "qemu.h"
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 10/15] mailmap: Fix Reimar Döffinger name
In reply to Thomas HuthFrom: Philippe Mathieu-Daudé <[email protected]>
This probably happened when interpreting the utf8 name as latin1.
Fixes dbbaaff6867 and f4e94dfefb6.
--- .mailmap | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
.mailmap +2 -1
@@ -33,5 +33,6 @@ Justin Terry (VM) <[email protected]> Justin Terry (VM) via Qemu-devel <qemu # Also list preferred name forms where people have changed their -# git author config +# git author config, or having utf8/latin1 encoding issues. Daniel P. Berrangé <[email protected]> +Reimar Döffinger <[email protected]>
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 09/15] show-fixed-bugs.sh: Modern shell scripting (use $() instead of ``)
In reply to Thomas HuthFrom: Mao Zhongyi <[email protected]>
Various shell files contain a mix between obsolete `` and modern $(); It would be nice to convert to using $() everywhere.
--- scripts/show-fixed-bugs.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
scripts/show-fixed-bugs.sh +5 -5
@@ -23,10 +23,10 @@ while getopts "s:e:cbh" opt; do done if [ "x$start" = "x" ]; then - start=`git tag -l 'v[0-9]*\.[0-9]*\.0' | tail -n 2 | head -n 1` + start=$(git tag -l 'v[0-9]*\.[0-9]*\.0' | tail -n 2 | head -n 1) fi if [ "x$end" = "x" ]; then - end=`git tag -l 'v[0-9]*\.[0-9]*\.0' | tail -n 1` + end=$(git tag -l 'v[0-9]*\.[0-9]*\.0' | tail -n 1) fi if [ "x$start" = "x" ] || [ "x$end" = "x" ]; then
@@ -38,9 +38,9 @@ fi echo "Searching git log for bugs in the range $start..$end" urlstr='https://bugs.launchpad.net/\(bugs\|qemu/+bug\)/' -bug_urls=`git log $start..$end \ +bug_urls=$(git log $start..$end \ | sed -n '\,'"$urlstr"', s,\(.*\)\('"$urlstr"'\)\([0-9]*\).*,\2\4,p' \ - | sort -u` + | sort -u) echo Found bug URLs: for i in $bug_urls ; do echo " $i" ; done
@@ -68,7 +68,7 @@ elif [ "x$show_in_browser" = "x1" ]; then bugbrowser=xdg-open elif command -v gnome-open >/dev/null 2>&1; then bugbrowser=gnome-open - elif [ "`uname`" = "Darwin" ]; then + elif [ "$(uname)" = "Darwin" ]; then bugbrowser=open elif command -v sensible-browser >/dev/null 2>&1; then bugbrowser=sensible-browser
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 14/15] hw/core/generic-loader: Compile only once, not for each target
In reply to Thomas HuthThe generic-loader is currently compiled target specific due to one single "#ifdef TARGET_WORDS_BIGENDIAN" in the file. We have already a function called target_words_bigendian() for this instead, so we can put the generic-loader into common-obj to save some compilation time.
--- hw/core/Makefile.objs | 2 +- hw/core/generic-loader.c | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-)
hw/core/Makefile.objs +1 -1
@@ -20,6 +20,6 @@ common-obj-$(CONFIG_SOFTMMU) += register.o common-obj-$(CONFIG_SOFTMMU) += or-irq.o common-obj-$(CONFIG_SOFTMMU) += split-irq.o common-obj-$(CONFIG_PLATFORM_BUS) += platform-bus.o +common-obj-$(CONFIG_SOFTMMU) += generic-loader.o -obj-$(CONFIG_SOFTMMU) += generic-loader.o obj-$(CONFIG_SOFTMMU) += null-machine.o
hw/core/generic-loader.c +1 -5
@@ -130,11 +130,7 @@ static void generic_loader_realize(DeviceState *dev, Error **errp) s->cpu = first_cpu; } -#ifdef TARGET_WORDS_BIGENDIAN - big_endian =1 ; -#else - big_endian =0 ; -#endif + big_endian =target_words_bigendian ();if (s->file) {AddressSpace *as = s->cpu ? s->cpu->as :NULL ;
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 15/15] configure: remove glib_subprocess check
In reply to Thomas HuthFrom: Marc-André Lureau <[email protected]>
This should have been removed as part of commit692fbdf9f4c6f6bafd0b3a4d4f94973effd3bbae.
--- configure | 6 ------ 1 file changed, 6 deletions(-)
configure +0 -6
@@ -3531,12 +3531,6 @@ if ! compile_prog "$CFLAGS" "$LIBS" ; then "build target" fi -# g_test_trap_subprocess added in 2.38. Used by some tests. -glib_subprocess=yes -if ! $pkg_config --atleast-version=2.38 glib-2.0; then - glib_subprocess=no -fi - # Silence clang 3.5.0 warnings about glib attribute __alloc_size__ usage cat > $TMPC << EOF #include <glib.h>
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 06/15] MAINTAINERS: update block/sheepdog maintainers
In reply to Thomas HuthFrom: Liu Yuan <[email protected]>
E-mail to one of block/sheepdog maintainers Mitake Hitoshi bounces
<[email protected]>: unknown user: "mitake.hitoshi"
and no current address is known. So just remove it.
--- MAINTAINERS | 1 - 1 file changed, 1 deletion(-)
MAINTAINERS +0 -1
@@ -2023,7 +2023,6 @@ F: block/rbd.c T: git git://github.com/codyprime/qemu-kvm-jtc.git block Sheepdog -M: Hitoshi Mitake <[email protected]> M: Liu Yuan <[email protected]> M: Jeff Cody <[email protected]> L: [email protected]
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 08/15] git-submodule.sh: Modern shell scripting (use $() instead of ``)
In reply to Thomas HuthFrom: Mao Zhongyi <[email protected]>
Various shell files contain a mix between obsolete `` and modern $(); It would be nice to convert to using $() everywhere.
--- scripts/git-submodule.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/git-submodule.sh +2 -2
@@ -59,8 +59,8 @@ status) fi test -f "$substat" || exit 1 - CURSTATUS=`$GIT submodule status $modules` - OLDSTATUS=`cat $substat` + CURSTATUS=$($GIT submodule status $modules) + OLDSTATUS=$(cat $substat) test "$CURSTATUS" = "$OLDSTATUS" exit $? ;;
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 13/15] cpu: Provide a proper prototype for target_words_bigendian() in a header
In reply to Thomas HuthWe've got three places already that provide a prototype for this function in a .c file - that's ugly. Let's provide a proper prototype in a header instead, with a proper description why this function should not be used in most cases.
--- exec.c | 5 ----- hw/virtio/virtio.c | 1 - include/qom/cpu.h | 11 +++++++++++ qom/cpu.c | 1 - 4 files changed, 11 insertions(+), 7 deletions(-)
exec.c +0 -5
@@ -3906,11 +3906,6 @@ int qemu_target_page_bits_min(void) }#endif -/* -* A helper function for the _utterly broken_ virtio device model to find out if -* it's running on a big endian machine. Don't do this at home kids! -*/ -bool target_words_bigendian (void );bool target_words_bigendian (void ) {#if defined(TARGET_WORDS_BIGENDIAN )
hw/virtio/virtio.c +0 -1
@@ -1169,7 +1169,6 @@ int virtio_set_status(VirtIODevice *vdev, uint8_t val)return 0 ; } -bool target_words_bigendian (void );static enum virtio_device_endian virtio_default_endian (void ) {if (target_words_bigendian ()) {
include/qom/cpu.h +11 -0
@@ -1085,6 +1085,17 @@ void cpu_exec_initfn(CPUState *cpu);void cpu_exec_realizefn (CPUState *cpu,Error **errp);void cpu_exec_unrealizefn (CPUState *cpu); +/** +* target_words_bigendian: +* Returns true if the (default) endianness of the target is big endian, +* false otherwise. Note that in target-specific code, you can use +* TARGET_WORDS_BIGENDIAN directly instead. On the other hand, common +* code should normally never need to know about the endianness of the +* target, so please do *not* use this function unless you know very well +* what you are doing! +*/ +bool target_words_bigendian (void ); +#ifdef NEED_CPU_H #ifdef CONFIG_SOFTMMU
qom/cpu.c +0 -1
@@ -194,7 +194,6 @@ static bool cpu_common_debug_check_watchpoint(CPUState *cpu, CPUWatchpoint *wp)return true; } -bool target_words_bigendian (void );static bool cpu_common_virtio_is_big_endian (CPUState *cpu) {return target_words_bigendian ();
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 07/15] archive-source.sh: Modern shell scripting (use $() instead of ``)
In reply to Thomas HuthFrom: Mao Zhongyi <[email protected]>
Various shell files contain a mix between obsolete `` and modern $(); It would be nice to convert to using $() everywhere.
--- scripts/archive-source.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/archive-source.sh +2 -2
@@ -18,7 +18,7 @@ if test $# -lt 1; then error "Usage: $0 <output tarball>" fi -tar_file=`realpath "$1"` +tar_file=$(realpath "$1") list_file="${tar_file}.list" vroot_dir="${tar_file}.vroot"
@@ -34,7 +34,7 @@ if git diff-index --quiet HEAD -- &>/dev/null then HEAD=HEAD else - HEAD=`git stash create` + HEAD=$(git stash create) fi git clone --shared . "$vroot_dir" test $? -ne 0 && error "failed to clone into '$vroot_dir'"
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 12/15] hw/core/generic-loader: Set a category for the generic-loader device
In reply to Thomas HuthEach device that is instantiatable by the users should be marked with a category. Since the generic-loader does not fit anywhere else, put it into the MISC category.
--- hw/core/generic-loader.c | 1 + 1 file changed, 1 insertion(+)
hw/core/generic-loader.c +1 -0
@@ -204,6 +204,7 @@ static void generic_loader_class_init(ObjectClass *klass, void *data) dc->unrealize = generic_loader_unrealize; dc->props = generic_loader_props; dc->desc ="Generic Loader" ; +set_bit (DEVICE_CATEGORY_MISC , dc->categories); }static TypeInfo generic_loader_info = {
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 11/15] qemu/compiler: Wrap __attribute__((flatten)) in a macro
In reply to Thomas HuthOlder versions of Clang (before 3.5) and GCC (before 4.1) do not support the "__attribute__((flatten))" yet. We don't care about such old versions of GCC anymore, but since Clang 3.4 is still used in EPEL for RHEL7 / CentOS 7, we should not use this attribute directly but with a wrapper macro instead.
--- fpu/softfloat.c | 39 +++++++++++++++------------------------ include/qemu/compiler.h | 15 +++++++++++++++ 2 files changed, 30 insertions(+), 24 deletions(-)
fpu/softfloat.c +15 -24
@@ -726,8 +726,7 @@ static FloatParts addsub_floats(FloatParts a, FloatParts b, bool subtract,* IEC/IEEE Standard for Binary Floating-Point Arithmetic. */ -float16 __attribute__((flatten))float16_add (float16 a,float16 b, -float_status *status) +float16 QEMU_FLATTEN float16_add(float16 a, float16 b, float_status *status) {FloatParts pa =float16_unpack_canonical (a, status);FloatParts pb =float16_unpack_canonical (b, status);
@@ -736,8 +735,7 @@ float16 __attribute__((flatten)) float16_add(float16 a, float16 b,return float16_round_pack_canonical (pr, status); } -float32 __attribute__((flatten))float32_add (float32 a,float32 b, -float_status *status) +float32 QEMU_FLATTEN float32_add(float32 a, float32 b, float_status *status) {FloatParts pa =float32_unpack_canonical (a, status);FloatParts pb =float32_unpack_canonical (b, status);
@@ -746,8 +744,7 @@ float32 __attribute__((flatten)) float32_add(float32 a, float32 b,return float32_round_pack_canonical (pr, status); } -float64 __attribute__((flatten))float64_add (float64 a,float64 b, -float_status *status) +float64 QEMU_FLATTEN float64_add(float64 a, float64 b, float_status *status) {FloatParts pa =float64_unpack_canonical (a, status);FloatParts pb =float64_unpack_canonical (b, status);
@@ -756,8 +753,7 @@ float64 __attribute__((flatten)) float64_add(float64 a, float64 b,return float64_round_pack_canonical (pr, status); } -float16 __attribute__((flatten))float16_sub (float16 a,float16 b, -float_status *status) +float16 QEMU_FLATTEN float16_sub(float16 a, float16 b, float_status *status) {FloatParts pa =float16_unpack_canonical (a, status);FloatParts pb =float16_unpack_canonical (b, status);
@@ -766,8 +762,7 @@ float16 __attribute__((flatten)) float16_sub(float16 a, float16 b,return float16_round_pack_canonical (pr, status); } -float32 __attribute__((flatten))float32_sub (float32 a,float32 b, -float_status *status) +float32 QEMU_FLATTEN float32_sub(float32 a, float32 b, float_status *status) {FloatParts pa =float32_unpack_canonical (a, status);FloatParts pb =float32_unpack_canonical (b, status);
@@ -776,8 +771,7 @@ float32 __attribute__((flatten)) float32_sub(float32 a, float32 b,return float32_round_pack_canonical (pr, status); } -float64 __attribute__((flatten))float64_sub (float64 a,float64 b, -float_status *status) +float64 QEMU_FLATTEN float64_sub(float64 a, float64 b, float_status *status) {FloatParts pa =float64_unpack_canonical (a, status);FloatParts pb =float64_unpack_canonical (b, status);
@@ -835,8 +829,7 @@ static FloatParts mul_floats(FloatParts a, FloatParts b, float_status *s)g_assert_not_reached (); } -float16 __attribute__((flatten))float16_mul (float16 a,float16 b, -float_status *status) +float16 QEMU_FLATTEN float16_mul(float16 a, float16 b, float_status *status) {FloatParts pa =float16_unpack_canonical (a, status);FloatParts pb =float16_unpack_canonical (b, status);
@@ -845,8 +838,7 @@ float16 __attribute__((flatten)) float16_mul(float16 a, float16 b,return float16_round_pack_canonical (pr, status); } -float32 __attribute__((flatten))float32_mul (float32 a,float32 b, -float_status *status) +float32 QEMU_FLATTEN float32_mul(float32 a, float32 b, float_status *status) {FloatParts pa =float32_unpack_canonical (a, status);FloatParts pb =float32_unpack_canonical (b, status);
@@ -855,8 +847,7 @@ float32 __attribute__((flatten)) float32_mul(float32 a, float32 b,return float32_round_pack_canonical (pr, status); } -float64 __attribute__((flatten))float64_mul (float64 a,float64 b, -float_status *status) +float64 QEMU_FLATTEN float64_mul(float64 a, float64 b, float_status *status) {FloatParts pa =float64_unpack_canonical (a, status);FloatParts pb =float64_unpack_canonical (b, status);
@@ -1068,7 +1059,7 @@ static FloatParts muladd_floats(FloatParts a, FloatParts b, FloatParts c,return a; } -float16 __attribute__((flatten))float16_muladd (float16 a,float16 b,float16 c, +float16 QEMU_FLATTEN float16_muladd(float16 a, float16 b, float16 c,int flags,float_status *status) {FloatParts pa =float16_unpack_canonical (a, status);
@@ -1079,7 +1070,7 @@ float16 __attribute__((flatten)) float16_muladd(float16 a, float16 b, float16 c,return float16_round_pack_canonical (pr, status); } -float32 __attribute__((flatten))float32_muladd (float32 a,float32 b,float32 c, +float32 QEMU_FLATTEN float32_muladd(float32 a, float32 b, float32 c,int flags,float_status *status) {FloatParts pa =float32_unpack_canonical (a, status);
@@ -1090,7 +1081,7 @@ float32 __attribute__((flatten)) float32_muladd(float32 a, float32 b, float32 c,return float32_round_pack_canonical (pr, status); } -float64 __attribute__((flatten))float64_muladd (float64 a,float64 b,float64 c, +float64 QEMU_FLATTEN float64_muladd(float64 a, float64 b, float64 c,int flags,float_status *status) {FloatParts pa =float64_unpack_canonical (a, status);
@@ -2414,21 +2405,21 @@ static FloatParts sqrt_float(FloatParts a, float_status *s, const FloatFmt *p)return a; } -float16 __attribute__((flatten))float16_sqrt (float16 a,float_status *status) +float16 QEMU_FLATTEN float16_sqrt(float16 a, float_status *status) {FloatParts pa =float16_unpack_canonical (a, status);FloatParts pr =sqrt_float (pa, status, &float16_params);return float16_round_pack_canonical (pr, status); } -float32 __attribute__((flatten))float32_sqrt (float32 a,float_status *status) +float32 QEMU_FLATTEN float32_sqrt(float32 a, float_status *status) {FloatParts pa =float32_unpack_canonical (a, status);FloatParts pr =sqrt_float (pa, status, &float32_params);return float32_round_pack_canonical (pr, status); } -float64 __attribute__((flatten))float64_sqrt (float64 a,float_status *status) +float64 QEMU_FLATTEN float64_sqrt(float64 a, float_status *status) {FloatParts pa =float64_unpack_canonical (a, status);FloatParts pr =sqrt_float (pa, status, &float64_params);
include/qemu/compiler.h +15 -0
@@ -131,6 +131,21 @@#define HAS_ASSUME_ALIGNED #endif +#ifndef __has_attribute +#define __has_attribute (x) 0/* compatibility with older GCC */ +#endif + +/* +* GCC doesn't provide __has_attribute() until GCC 5, but we know all the GCC +* versions we support have the "flatten" attribute. Clang may not have the +* "flatten" attribute but always has __has_attribute() to check for it. +*/ +#if __has_attribute (flatten) || !defined(__clang__) +# define QEMU_FLATTEN __attribute__((flatten)) +#else +# define QEMU_FLATTEN +#endif +/* Implement C11 _Generic via GCC builtins. Example: * * QEMU_GENERIC(x, (float, sinf), (long double, sinl), sin) (x)
Signature · 1 line
1.8.3.1
Peter Maydell
AppliedQuoted 12 lines · Thomas Huth
Hi Peter,
the following changes since commit
dddb37495b844270088e68e3bf30b764d48d863f:Merge remote-tracking branch 'remotes/awilliam/tags/vfio-updates-20181015.0' into staging (2018-10-15 18:44:04 +0100)
are available in the git repository at:
https://gitlab.com/huth/qemu.git tags/pull-request-2018-10-17
for you to fetch changes up to
7fc527cdc9cfd139dee1d90e3220a884229a7698:
Quoted 7 lines
configure: remove
glib_subprocesscheck (2018-10-17 09:01:41 +0200)----------------------------------------------------------------
- Updates for qtest entries in test/Makefile.include
- Simple updates for some shell scripts
- Misc simple patches for files without regular subsystem pull requests
----------------------------------------------------------------
Applied, thanks.
-- PMM