tests/tcg fixes
cover tests/tcg fixes
Hi,
With the tests/tcg rework that went in recently, we now see the results of make check-tcg tests as part of make check output, which is a nice addition so thank you for that! Of course, it did expose a few problems in the non-container environment that I'd like to consider here.
- Patch 1 addresses an endianness problem that shows up when running on a big-endian (s390) host. It's existed for a while, as I can recreate similar errors (if slightly different messages) at least back to 11.0.0. Just never noticed (or looked into it) before.
- Patches 2-4 addresses a change in behavior that occurs in the powerpc toolchain between power6 and power7 (based on experimentation with gcc -mcpu= settings). The tests as they currently are run fine for me on either an s390 or x86 host running Fedora, but fail on both hosts running Debian. I opted to disable the tests up front, and then add the problematic tests one at a time, since passing a cpu generation to the compiler changes the expected reference output.
Can't say I understand the details of the ppc64 compiler behavior, but this gets make check-tcg running cleanly in all my configs.
Eric Farman (4):
hw/i386: ELF endianness fixes
tests/tcg/ppc64: Skip float_conv* tests
tests/tcg/ppc64: Add float_convd test
tests/tcg/ppc64: Add float_convs test
hw/i386/x86-common.c | 6 +- include/hw/elf_ops.h.inc | 20 ++++- tests/tcg/ppc64/float_convd.ref | 144 ++++++++++++++++---------------- tests/tcg/ppc64/float_convs.ref | 80 +++++++++--------- tests/tcg/ppc64/meson.build | 11 +++ 5 files changed, 145 insertions(+), 116 deletions(-)
Signature · 1 line
2.53.0
PATCH 1/4 hw/i386: ELF endianness fixes
Running make check-tcg-x86_64 on a big-endian host (e.g., s390x) fails due to problems reading/parsing the ELF data:
qemu-system-x86_64: Error loading uncompressed kernel without PVH ELF Note
There already exists logic in include/hw/elf_ops.h.inc to handle byte-swaps where necessary, but it does not perform this logic for ELF notes itself.
Fixing that improves matters, but yields other errors: most of the tests timeout while some generate confusing assertions. Both appear to be related to the data addresses in those notes, which are incorrect when running on a big-endian host.
Adding tswap wrappers, which will conditionally swap if the host and target endianness don't match, fixes that such that check-tcg-x86_64 runs cleanly on an s390 host.
--- hw/i386/x86-common.c | 6 ++++-- include/hw/elf_ops.h.inc | 20 ++++++++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-)
hw/i386/x86-common.c +4 -2
@@ -45,6 +45,8 @@#include "kvm/kvm_i386.h" #include "kvm/tdx.h" +#include "exec/tswap.h" +#ifdef CONFIG_XEN_EMU #include "hw/xen/xen.h" #include "hw/i386/kvm/xen_evtchn.h"
@@ -573,7 +575,7 @@ static uint64_t read_pvh_start_addr(void *arg1, void *arg2, bool is64) ((void *)nhdr64) + nhdr_size64 +QEMU_ALIGN_UP (nhdr_namesz, phdr_align); - pvh_start_addr = *elf_note_data_addr; + pvh_start_addr =tswap64 (*elf_note_data_addr); }else {struct elf32_note *nhdr32 = (struct elf32_note *)arg1;uint32_t nhdr_size32 =sizeof (struct elf32_note );
@@ -584,7 +586,7 @@ static uint64_t read_pvh_start_addr(void *arg1, void *arg2, bool is64) ((void *)nhdr32) + nhdr_size32 +QEMU_ALIGN_UP (nhdr_namesz, phdr_align); - pvh_start_addr = *(uint32_t *)elf_note_data_addr; + pvh_start_addr =tswap32 (*(uint32_t *)elf_note_data_addr); }return pvh_start_addr;
include/hw/elf_ops.h.inc +18 -2
@@ -56,6 +56,13 @@ static void glue(bswap_rela, SZ)(struct elf_rela *rela) bswapSZs((elf_word *)&rela->r_addend); } +static void glue(bswap_note, SZ)(struct elf_note *note) +{ + bswap32s(¬e->n_namesz); + bswap32s(¬e->n_descsz); + bswap32s(¬e->n_type); +} + static struct elf_shdr *glue(find_section, SZ)(struct elf_shdr *shdr_table, int n, int type) {
@@ -275,7 +282,8 @@ fail: static struct elf_note *glue(get_elf_note_type, SZ)(struct elf_note *nhdr, elf_word note_size, elf_word phdr_align, - elf_word elf_note_type) + elf_word elf_note_type, + int must_swab) { elf_word nhdr_size = sizeof(struct elf_note); elf_word elf_note_entry_offset = 0;
@@ -287,6 +295,10 @@ static struct elf_note *glue(get_elf_note_type, SZ)(struct elf_note *nhdr, return NULL; } + if (must_swab) { + glue(bswap_note, SZ)(nhdr); + } + note_type = nhdr->n_type; while (note_type != elf_note_type) { nhdr_namesz = nhdr->n_namesz;
@@ -306,6 +318,9 @@ static struct elf_note *glue(get_elf_note_type, SZ)(struct elf_note *nhdr, /* skip to the next ELF Note entry */ nhdr = (void *)nhdr + elf_note_entry_offset; + if (must_swab) { + glue(bswap_note, SZ)(nhdr); + } note_type = nhdr->n_type; }
@@ -608,7 +623,8 @@ static ssize_t glue(load_elf, SZ)(const char *name, int fd, nhdr = (struct elf_note *)data; assert(translate_opaque != NULL); nhdr = glue(get_elf_note_type, SZ)(nhdr, file_size, ph->p_align, - *(uint64_t *)translate_opaque); + *(uint64_t *)translate_opaque, + must_swab); if (nhdr != NULL) { elf_note_fn((void *)nhdr, (void *)&ph->p_align, SZ == 64); }
Signature · 1 line
2.53.0
Re: [PATCH v1 1/4] hw/i386: ELF endianness fixes
Quoted 104 lines · Eric Farman
Running make check-tcg-x86_64 on a big-endian host (e.g., s390x) fails due to problems reading/parsing the ELF data:
qemu-system-x86_64: Error loading uncompressed kernel without PVH ELF Note
There already exists logic in
include/hw/elf_ops.h.incto handle byte-swaps where necessary, but it does not perform this logic for ELF notes itself.Fixing that improves matters, but yields other errors: most of the tests timeout while some generate confusing assertions. Both appear to be related to the data addresses in those notes, which are incorrect when running on a big-endian host.
Adding tswap wrappers, which will conditionally swap if the host and target endianness don't match, fixes that such that check-tcg-x86_64 runs cleanly on an s390 host.
Signed-off-by Eric Farman <[email protected]>--- hw/i386/x86-common.c | 6 ++++-- include/hw/elf_ops.h.inc | 20 ++++++++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-)hw/i386/x86-common.c +4
-2@@ -45,6 +45,8 @@#include "kvm/kvm_i386.h" #include "kvm/tdx.h" +#include "exec/tswap.h" +#ifdef CONFIG_XEN_EMU #include "hw/xen/xen.h" #include "hw/i386/kvm/xen_evtchn.h" @@ -573,7 +575,7 @@ static uint64_t read_pvh_start_addr(void *arg1, void *arg2, bool is64) ((void *)nhdr64) + nhdr_size64 +QEMU_ALIGN_UP (nhdr_namesz, phdr_align); - pvh_start_addr = *elf_note_data_addr; + pvh_start_addr =tswap64 (*elf_note_data_addr); }else {struct elf32_note *nhdr32 = (struct elf32_note *)arg1;uint32_t nhdr_size32 =sizeof (struct elf32_note );@@ -584,7 +586,7 @@ static uint64_t read_pvh_start_addr(void *arg1, void *arg2, bool is64) ((void *)nhdr32) + nhdr_size32 +QEMU_ALIGN_UP (nhdr_namesz, phdr_align); - pvh_start_addr = *(uint32_t *)elf_note_data_addr; + pvh_start_addr =tswap32 (*(uint32_t *)elf_note_data_addr); }return pvh_start_addr;include/hw/elf_ops.h.inc +16
-1@@ -56,6 +56,13 @@ static void glue(bswap_rela, SZ)(struct elf_rela *rela) bswapSZs((elf_word *)&rela->r_addend); } +static void glue(bswap_note, SZ)(struct elf_note *note) +{ + bswap32s(¬e->n_namesz); + bswap32s(¬e->n_descsz); + bswap32s(¬e->n_type); +} + static struct elf_shdr *glue(find_section, SZ)(struct elf_shdr *shdr_table, int n, int type) {@@ -275,7 +282,8 @@ fail: static struct elf_note *glue(get_elf_note_type, SZ)(struct elf_note *nhdr, elf_word note_size, elf_word phdr_align, - elf_word elf_note_type) + elf_word elf_note_type, + int must_swab) { elf_word nhdr_size = sizeof(struct elf_note); elf_word elf_note_entry_offset = 0;@@ -287,6 +295,10 @@ static struct elf_note *glue(get_elf_note_type, SZ)(struct elf_note *nhdr, return NULL; } + if (must_swab) { + glue(bswap_note, SZ)(nhdr); + } + note_type = nhdr->n_type; while (note_type != elf_note_type) { nhdr_namesz = nhdr->n_namesz;@@ -306,6 +318,9 @@ static struct elf_note *glue(get_elf_note_type, SZ)(struct elf_note *nhdr, /* skip to the next ELF Note entry */ nhdr = (void *)nhdr + elf_note_entry_offset; + if (must_swab) { + glue(bswap_note, SZ)(nhdr); + } note_type = nhdr->n_type; }
include/hw/elf_ops.h.inc static ssize_t glue(load_elf, SZ)(const char *name, int fd, · line 630
Quoted 9 lines
include/hw/elf_ops.h.inc +2
-1@@ -608,7 +623,8 @@ static ssize_t glue(load_elf, SZ)(const char *name, int fd, nhdr = (struct elf_note *)data; assert(translate_opaque != NULL); nhdr = glue(get_elf_note_type, SZ)(nhdr, file_size, ph->p_align, - *(uint64_t *)translate_opaque); + *(uint64_t *)translate_opaque, + must_swab); if (nhdr != NULL) { elf_note_fn((void *)nhdr, (void *)&ph->p_align, SZ == 64); }
s/must_swab/must_swap?
For the rest,
Regards,
Pierrick
Re: [PATCH v1 1/4] hw/i386: ELF endianness fixes
Quoted 104 lines · Pierrick Bouvier
Quoted 103 lines · Eric Farman
Running make check-tcg-x86_64 on a big-endian host (e.g., s390x) fails due to problems reading/parsing the ELF data:
qemu-system-x86_64: Error loading uncompressed kernel without PVH ELF Note
There already exists logic in
include/hw/elf_ops.h.incto handle byte-swaps where necessary, but it does not perform this logic for ELF notes itself.Fixing that improves matters, but yields other errors: most of the tests timeout while some generate confusing assertions. Both appear to be related to the data addresses in those notes, which are incorrect when running on a big-endian host.
Adding tswap wrappers, which will conditionally swap if the host and target endianness don't match, fixes that such that check-tcg-x86_64 runs cleanly on an s390 host.
Signed-off-by Eric Farman <[email protected]>--- hw/i386/x86-common.c | 6 ++++-- include/hw/elf_ops.h.inc | 20 ++++++++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-)hw/i386/x86-common.c +4
-2@@ -45,6 +45,8 @@#include "kvm/kvm_i386.h" #include "kvm/tdx.h" +#include "exec/tswap.h" +#ifdef CONFIG_XEN_EMU #include "hw/xen/xen.h" #include "hw/i386/kvm/xen_evtchn.h" @@ -573,7 +575,7 @@ static uint64_t read_pvh_start_addr(void *arg1, void *arg2, bool is64) ((void *)nhdr64) + nhdr_size64 +QEMU_ALIGN_UP (nhdr_namesz, phdr_align); - pvh_start_addr = *elf_note_data_addr; + pvh_start_addr =tswap64 (*elf_note_data_addr); }else {struct elf32_note *nhdr32 = (struct elf32_note *)arg1;uint32_t nhdr_size32 =sizeof (struct elf32_note );@@ -584,7 +586,7 @@ static uint64_t read_pvh_start_addr(void *arg1, void *arg2, bool is64) ((void *)nhdr32) + nhdr_size32 +QEMU_ALIGN_UP (nhdr_namesz, phdr_align); - pvh_start_addr = *(uint32_t *)elf_note_data_addr; + pvh_start_addr =tswap32 (*(uint32_t *)elf_note_data_addr); }return pvh_start_addr;include/hw/elf_ops.h.inc +16
-1@@ -56,6 +56,13 @@ static void glue(bswap_rela, SZ)(struct elf_rela *rela) bswapSZs((elf_word *)&rela->r_addend); } +static void glue(bswap_note, SZ)(struct elf_note *note) +{ + bswap32s(¬e->n_namesz); + bswap32s(¬e->n_descsz); + bswap32s(¬e->n_type); +} + static struct elf_shdr *glue(find_section, SZ)(struct elf_shdr *shdr_table, int n, int type) {@@ -275,7 +282,8 @@ fail: static struct elf_note *glue(get_elf_note_type, SZ)(struct elf_note *nhdr, elf_word note_size, elf_word phdr_align, - elf_word elf_note_type) + elf_word elf_note_type, + int must_swab) { elf_word nhdr_size = sizeof(struct elf_note); elf_word elf_note_entry_offset = 0;@@ -287,6 +295,10 @@ static struct elf_note *glue(get_elf_note_type, SZ)(struct elf_note *nhdr, return NULL; } + if (must_swab) { + glue(bswap_note, SZ)(nhdr); + } + note_type = nhdr->n_type; while (note_type != elf_note_type) { nhdr_namesz = nhdr->n_namesz;@@ -306,6 +318,9 @@ static struct elf_note *glue(get_elf_note_type, SZ)(struct elf_note *nhdr, /* skip to the next ELF Note entry */ nhdr = (void *)nhdr + elf_note_entry_offset; + if (must_swab) { + glue(bswap_note, SZ)(nhdr); + } note_type = nhdr->n_type; }
Quoted 12 lines
include/hw/elf_ops.h.inc static ssize_t glue(load_elf, SZ)(const char *name, int fd, · line 630
Quoted 10 lines
include/hw/elf_ops.h.inc +2
-1@@ -608,7 +623,8 @@ static ssize_t glue(load_elf, SZ)(const char *name, int fd, nhdr = (struct elf_note *)data; assert(translate_opaque != NULL); nhdr = glue(get_elf_note_type, SZ)(nhdr, file_size, ph->p_align, - *(uint64_t *)translate_opaque); + *(uint64_t *)translate_opaque, + must_swab); if (nhdr != NULL) { elf_note_fn((void *)nhdr, (void *)&ph->p_align, SZ == 64); }s/must_swab/must_swap?
It's already must_swab in the other routines that do swapping (e.g., passed to glue(load_elf, SZ) itself), so I followed that convention.
Quoted 3 lines
For the rest,
Acked-by Pierrick Bouvier <[email protected]>
Thanks!
Eric
Quoted 3 lines
Regards,
Pierrick
Re: [PATCH v1 1/4] hw/i386: ELF endianness fixes
In reply to Eric FarmanQuoted 17 lines · Eric Farman
Running make check-tcg-x86_64 on a big-endian host (e.g., s390x) fails due to problems reading/parsing the ELF data:
qemu-system-x86_64: Error loading uncompressed kernel without PVH ELF Note
There already exists logic in
include/hw/elf_ops.h.incto handle byte-swaps where necessary, but it does not perform this logic for ELF notes itself.Fixing that improves matters, but yields other errors: most of the tests timeout while some generate confusing assertions. Both appear to be related to the data addresses in those notes, which are incorrect when running on a big-endian host.
Adding tswap wrappers, which will conditionally swap if the host and target endianness don't match, fixes that such that check-tcg-x86_64 runs cleanly on an s390 host.
Quoted 5 lines
Signed-off-by Eric Farman <[email protected]>--- hw/i386/x86-common.c | 6 ++++-- include/hw/elf_ops.h.inc | 20 ++++++++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-)
This looks similar to [1], which I've been desperately pinging for a while.
Re: [PATCH v1 1/4] hw/i386: ELF endianness fixes
Quoted 33 lines · Ilya Leoshkevich
Quoted 24 lines · Eric Farman
Running make check-tcg-x86_64 on a big-endian host (e.g., s390x) fails due
to problems reading/parsing the ELF data:qemu-system-x86_64: Error loading uncompressed kernel without PVH ELF Note
There already exists logic in
include/hw/elf_ops.h.incto handle byte- swaps
where necessary, but it does not perform this logic for ELF notes itself.Fixing that improves matters, but yields other errors: most of the tests timeout while some generate confusing assertions. Both appear to be related
to the data addresses in those notes, which are incorrect when running on a
big-endian host.Adding tswap wrappers, which will conditionally swap if the host and target
endianness don't match, fixes that such that check-tcg-x86_64 runs cleanly
on an s390 host.Quoted 5 lines
Signed-off-by Eric Farman <[email protected]>---
hw/i386/x86-common.c | 6 ++++--include/hw/elf_ops.h.inc| 20 ++++++++++++++++++--2 files changed, 22 insertions(+), 4 deletions(-)
Quoted 5 lines
This looks similar to [1], which I've been desperately pinging for a while.
[1] https://lore.kernel.org/qemu-devel/20240929180659.3598-1-
[email protected]/
I'm not sure if that's the reason, but I noticed that the (common) email workflow to add people in cc on an existing thread rarely works.
I suspect it's related to the fact that it's not possible to have an email filter/rule that modifies a whole (parent) thread from a given message.
In my case, I end up not seeing those cc most of the time, simply because they are drowned into the noise of series for which I am not a recipient from cover letter, and thus that I don't read/follow. Or maybe people at the time were just too busy.
Anyway, there is another chance to review this today, and Richard and Paolo are here also.
Regards,
Pierrick
Re: [PATCH v1 1/4] hw/i386: ELF endianness fixes
In reply to Ilya LeoshkevichQuoted 26 lines · Ilya Leoshkevich
Quoted 17 lines · Eric Farman
Running make check-tcg-x86_64 on a big-endian host (e.g., s390x) fails due to problems reading/parsing the ELF data:
qemu-system-x86_64: Error loading uncompressed kernel without PVH ELF Note
There already exists logic in
include/hw/elf_ops.h.incto handle byte- swaps where necessary, but it does not perform this logic for ELF notes itself.Fixing that improves matters, but yields other errors: most of the tests timeout while some generate confusing assertions. Both appear to be related to the data addresses in those notes, which are incorrect when running on a big-endian host.
Adding tswap wrappers, which will conditionally swap if the host and target endianness don't match, fixes that such that check-tcg-x86_64 runs cleanly on an s390 host.
Quoted 5 lines
Signed-off-by Eric Farman <[email protected]>---
hw/i386/x86-common.c | 6 ++++--include/hw/elf_ops.h.inc| 20 ++++++++++++++++++--2 files changed, 22 insertions(+), 4 deletions(-)
Quoted 4 lines
This looks similar to [1], which I've been desperately pinging for a while.
[1] https://lore.kernel.org/qemu-devel/20240929180659.3598-1- [email protected]/
That's pretty phenomenal, thanks for the tip. I didn't dig that far back, but either one should do the trick.
PATCH 2/4 tests/tcg/ppc64: Skip float_conv* tests
In reply to Eric FarmanThere is an oddity that turns up with the float_convd and float_convs tests, when running from different toolchains. As one example, the expectation at the start of tests/tcg/ppc64/float_conv*.ref is:
### Rounding to nearest
from double: f64(nan:0x007ff4000000000000)
to single: f32(nan:0x7fe00000) (INVALID)
to int32: -2147483648 (INVALID)
to int64: -9223372036854775808 (INVALID)
to uint32: 0 (INVALID)
to uint64: -9223372036854775808 (INVALID)But, other hosts offer a different response, e.g., this debian guest on a laptop:
### Rounding to nearest
from double: f64(nan:0x007ff4000000000000)
to single: f32(nan:0x7fe00000) (INVALID)
to int32: -2147483648 (INVALID)
to int64: -9223372036854775808 (INVALID)
to uint32: 0 (INVALID)
to uint64: 0 (INVALID)The explanation seems to be a behavior change when compiling to different versions of power hardware. Disable this for the time being, and it can be added back in manually with the correct responses.
--- tests/tcg/ppc64/meson.build | 3 +++ 1 file changed, 3 insertions(+)
tests/tcg/ppc64/meson.build +3 -0
@@ -13,6 +13,9 @@ foreach t: tcg_tests['multiarch-linux-user']['tests'] if fs.stem(src) == 'test-plugin-mem-access' and 'wrapper' in setup continue endif + if 'float_conv' in fs.stem(src) + continue + endif tests += {src: setup} endforeach endforeach
Signature · 1 line
2.53.0
Re: [PATCH v1 2/4] tests/tcg/ppc64: Skip float_conv* tests
Hi Eric,
Quoted 37 lines · Eric Farman
There is an oddity that turns up with the
float_convdandfloat_convstests, when running from different toolchains. As one example, the expectation at the start of tests/tcg/ppc64/float_conv*.ref is:### Rounding to nearest
from double: f64(nan:0x007ff4000000000000)to single: f32(nan:0x7fe00000) (INVALID) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) to uint64: -9223372036854775808 (INVALID)But, other hosts offer a different response, e.g., this debian guest on a laptop:
### Rounding to nearest
from double: f64(nan:0x007ff4000000000000)to single: f32(nan:0x7fe00000) (INVALID) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) to uint64: 0 (INVALID)The explanation seems to be a behavior change when compiling to different versions of power hardware. Disable this for the time being, and it can be added back in manually with the correct responses.
Signed-off-by Eric Farman <[email protected]>--- tests/tcg/ppc64/meson.build | 3 +++ 1 file changed, 3 insertions(+)tests/tcg/ppc64/meson.build +0
-0
tests/tcg/ppc64/meson.build foreach t: tcg_tests['multiarch-linux-user']['tests'] · line 21
Quoted 9 lines
tests/tcg/ppc64/meson.build +3
-0@@ -13,6 +13,9 @@ foreach t: tcg_tests['multiarch-linux-user']['tests'] if fs.stem(src) == 'test-plugin-mem-access' and 'wrapper' in setup continue endif + if 'float_conv' in fs.stem(src) + continue + endif tests += {src: setup} endforeach endforeach
could this be made deterministic by setting an explicit -march or -mcpu compiler option?
Regards,
Pierrick
Re: [PATCH v1 2/4] tests/tcg/ppc64: Skip float_conv* tests
Quoted 44 lines · Pierrick Bouvier
Hi Eric,
Quoted 41 lines · Eric Farman
There is an oddity that turns up with the
float_convdandfloat_convstests, when running from different toolchains. As one example, the expectation at the start of tests/tcg/ppc64/float_conv*.ref is:### Rounding to nearest from double: f64(nan:0x007ff4000000000000) to single: f32(nan:0x7fe00000) (INVALID) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) to uint64: -9223372036854775808 (INVALID)But, other hosts offer a different response, e.g., this debian guest on a laptop:
### Rounding to nearest from double: f64(nan:0x007ff4000000000000) to single: f32(nan:0x7fe00000) (INVALID) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) to uint64: 0 (INVALID)The explanation seems to be a behavior change when compiling to different versions of power hardware. Disable this for the time being, and it can be added back in manually with the correct responses.
Signed-off-by Eric Farman <[email protected]>--- tests/tcg/ppc64/meson.build | 3 +++ 1 file changed, 3 insertions(+)tests/tcg/ppc64/meson.build +1
-0@@ -13,6 +13,9 @@ foreach t: tcg_tests['multiarch-linux-user']['tests'] if fs.stem(src) == 'test-plugin-mem-access' and 'wrapper' in setup continue endif + if 'float_conv' in fs.stem(src)
Quoted 8 lines
tests/tcg/ppc64/meson.build foreach t: tcg_tests['multiarch-linux-user']['tests'] · line 21
Quoted 5 lines
tests/tcg/ppc64/meson.build +2
-0+ continue + endif tests += {src: setup} endforeach endforeachcould this be made deterministic by setting an explicit -march or -mcpu compiler option?
That's what ends up happening in patches 3 and 4. I didn't like the idea of cobbling a conditional add to an existing dictionary of options within this multiarch loop, so thought it'd be cleaner to skip it and readd it outside the loop. Could squash them all together either way, of course.
Thanks,
Eric
Re: [PATCH v1 2/4] tests/tcg/ppc64: Skip float_conv* tests
Quoted 57 lines · Eric Farman
Quoted 45 lines · Pierrick Bouvier
Hi Eric,
Quoted 42 lines · Eric Farman
There is an oddity that turns up with the
float_convdandfloat_convstests, when running from different toolchains. As one example, the expectation at the start of tests/tcg/ppc64/float_conv*.ref is:### Rounding to nearest
from double: f64(nan:0x007ff4000000000000)
to single: f32(nan:0x7fe00000) (INVALID)
to int32: -2147483648 (INVALID)
to int64: -9223372036854775808 (INVALID)
to uint32: 0 (INVALID)
to uint64: -9223372036854775808 (INVALID)But, other hosts offer a different response, e.g., this debian guest on a laptop:
### Rounding to nearest
from double: f64(nan:0x007ff4000000000000)
to single: f32(nan:0x7fe00000) (INVALID)
to int32: -2147483648 (INVALID)
to int64: -9223372036854775808 (INVALID)
to uint32: 0 (INVALID)
to uint64: 0 (INVALID)The explanation seems to be a behavior change when compiling to different
versions of power hardware. Disable this for the time being, and it can be added back in manually with the correct responses.Signed-off-by Eric Farman <[email protected]>---
tests/tcg/ppc64/meson.build | 3 +++1 file changed, 3 insertions(+)tests/tcg/ppc64/meson.build +0
-0@@ -13,6 +13,9 @@ foreach t: tcg_tests['multiarch-linux-user']['tests']if
fs.stem(src)== 'test-plugin-mem-access' and 'wrapper' in setup continue
endif
+ if 'float_conv' infs.stem(src)Quoted 8 lines
Quoted 5 lines
+ continue
+ endif
tests += {src: setup}
endforeach
endforeachcould this be made deterministic by setting an explicit -march or -mcpu compiler option?
Quoted 6 lines
That's what ends up happening in patches 3 and 4. I didn't like the idea of cobbling a conditional add to an existing dictionary of options within this multiarch loop, so thought it'd be cleaner to skip it and readd it outside the loop. Could squash them all together either way, of course.
Just saw that after sending this message, thanks.
For why to keep them in the loop, the reason is to keep multiarch definition centralized. For instance, by removing and adding them, one plugin test was unexpectedly removed. It's also just the general pattern I enforced in all arch, so that could be nice if it could stay enforced.
Thus, I would invite you to use the following instead:
if fs.stem(src) == 'test-plugin-mem-access' and 'wrapper' in setup
continue
endif+ if fs.stem(src).contains('float_conv') and 'cflags' in setup
+ # ensure float conversion tests are deterministic
+ setup += {'cflags': setup['cflags'] + '-mcpu=power8'}
+ endif
tests += {src: setup} endforeach
endforeach
You can squash the ref files update with this change, that's good for me.
Thanks,
Pierrick
Re: [PATCH v1 2/4] tests/tcg/ppc64: Skip float_conv* tests
Quoted 77 lines · Pierrick Bouvier
Quoted 57 lines · Eric Farman
Quoted 45 lines · Pierrick Bouvier
Hi Eric,
Quoted 42 lines · Eric Farman
There is an oddity that turns up with the
float_convdandfloat_convstests, when running from different toolchains. As one example, the expectation at the start of tests/tcg/ppc64/float_conv*.ref is:### Rounding to nearest
from double: f64(nan:0x007ff4000000000000)
to single: f32(nan:0x7fe00000) (INVALID)
to int32: -2147483648 (INVALID)
to int64: -9223372036854775808 (INVALID)
to uint32: 0 (INVALID)
to uint64: -9223372036854775808 (INVALID)But, other hosts offer a different response, e.g., this debian guest on a laptop:
### Rounding to nearest
from double: f64(nan:0x007ff4000000000000)
to single: f32(nan:0x7fe00000) (INVALID)
to int32: -2147483648 (INVALID)
to int64: -9223372036854775808 (INVALID)
to uint32: 0 (INVALID)
to uint64: 0 (INVALID)The explanation seems to be a behavior change when compiling to different
versions of power hardware. Disable this for the time being, and it can be added back in manually with the correct responses.Signed-off-by Eric Farman <[email protected]>--- tests/tcg/ppc64/meson.build | 3 +++ 1 file changed, 3 insertions(+)tests/tcg/ppc64/meson.build +1
-0@@ -13,6 +13,9 @@ foreach t: tcg_tests['multiarch-linux-user']['tests'] if fs.stem(src) == 'test-plugin-mem-access' and 'wrapper' in setup continue endif + if 'float_conv' in fs.stem(src)Quoted 8 lines
tests/tcg/ppc64/meson.build foreach t: tcg_tests['multiarch-linux-user']['tests'] · line 21
Quoted 5 lines
tests/tcg/ppc64/meson.build +2
-0+ continue + endif tests += {src: setup} endforeach endforeachcould this be made deterministic by setting an explicit -march or -mcpu compiler option?
Quoted 6 lines
That's what ends up happening in patches 3 and 4. I didn't like the idea of cobbling a conditional add to an existing dictionary of options within this multiarch loop, so thought it'd be cleaner to skip it and readd it outside the loop. Could squash them all together either way, of course.
Just saw that after sending this message, thanks.
For why to keep them in the loop, the reason is to keep multiarch definition centralized. For instance, by removing and adding them, one plugin test was unexpectedly removed. It's also just the general pattern I enforced in all arch, so that could be nice if it could stay enforced.
Thus, I would invite you to use the following instead:
if fs.stem(src) == 'test-plugin-mem-access' and 'wrapper' in setup continue endif
Review
Quoted 4 lines
(quoted diff) +4
-0+ if fs.stem(src).contains('float_conv') and 'cflags' in setup + # ensure float conversion tests are deterministic + setup += {'cflags': setup['cflags'] + '-mcpu=power8'} + endif
Yup, that's much what I had, though I overengineered it in case there isn't a cflags.
Quoted 5 lines
tests += {src: setup} endforeachendforeach
You can squash the ref files update with this change, that's good for me.
Works for me; I'll go through my combinations to make sure it's still behaving and send a v2.
Thanks,
Eric
Quoted 3 lines
Thanks,
Pierrick
PATCH 3/4 tests/tcg/ppc64: Add float_convd test
In reply to Eric FarmanRe-enable the float_convd test, passing "power8" directly as a compiler flag to ensure a consistent result. Update the reference output to match the newly expected output.
--- tests/tcg/ppc64/float_convd.ref | 144 ++++++++++++++++---------------- tests/tcg/ppc64/meson.build | 4 + 2 files changed, 76 insertions(+), 72 deletions(-)
tests/tcg/ppc64/float_convd.ref +72 -72
@@ -4,61 +4,61 @@ from double: f64(nan:0x007ff4000000000000) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-nan:0x00fff8000000000000) to single: f32(-nan:0xffc00000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-inf:0x00fff0000000000000) to single: f32(-inf:0xff800000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.fffffffffffff0000000p+1023:0x00ffefffffffffffff) to single: f32(-inf:0xff800000) (OVERFLOW INEXACT ) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.1874b135ff6540000000p+103:0x00c661874b135ff654) to single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59) (INEXACT ) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.c0bab523323b90000000p+99:0x00c62c0bab523323b9) to single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) (INEXACT ) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.00000000000000000000p+1:0x00c000000000000000) to single: f32(-0x1.00000000000000000000p+1:0xc0000000) (OK) to int32: -2 (OK) to int64: -2 (OK) - to uint32: -2 (OK) - to uint64: -2 (OK) + to uint32: 0 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.00000000000000000000p+0:0x00bff0000000000000) to single: f32(-0x1.00000000000000000000p+0:0xbf800000) (OK) to int32: -1 (OK) to int64: -1 (OK) - to uint32: -1 (OK) - to uint64: -1 (OK) + to uint32: 0 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.00000000000000000000p-1022:0x008010000000000000) to single: f32(-0x0.00000000000000000000p+0:0x80000000) (UNDERFLOW INEXACT ) to int32: 0 (INEXACT )
@@ -208,19 +208,19 @@ from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from double: f64(0x1.fffffffffffff0000000p+1023:0x007fefffffffffffff) to single: f32(inf:0x7f800000) (OVERFLOW INEXACT ) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from double: f64(inf:0x007ff0000000000000) to single: f32(inf:0x7f800000) (OK) to int32: 2147483647 (INVALID)
@@ -232,80 +232,80 @@ from double: f64(nan:0x007ff8000000000000) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(nan:0x007ff0000000000001) to single: f32(nan:0x7fc00000) (INVALID) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(nan:0x007ff4000000000000) to single: f32(nan:0x7fe00000) (INVALID) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) ### Rounding upwards from double: f64(nan:0x007ff4000000000000) to single: f32(nan:0x7fe00000) (INVALID) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-nan:0x00fff8000000000000) to single: f32(-nan:0xffc00000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-inf:0x00fff0000000000000) to single: f32(-inf:0xff800000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.fffffffffffff0000000p+1023:0x00ffefffffffffffff) to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OVERFLOW INEXACT ) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.1874b135ff6540000000p+103:0x00c661874b135ff654) to single: f32(-0x1.1874b000000000000000p+103:0xf30c3a58) (INEXACT ) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.c0bab523323b90000000p+99:0x00c62c0bab523323b9) to single: f32(-0x1.c0bab400000000000000p+99:0xf1605d5a) (INEXACT ) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.00000000000000000000p+1:0x00c000000000000000) to single: f32(-0x1.00000000000000000000p+1:0xc0000000) (OK) to int32: -2 (OK) to int64: -2 (OK) - to uint32: -2 (OK) - to uint64: -2 (OK) + to uint32: 0 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.00000000000000000000p+0:0x00bff0000000000000) to single: f32(-0x1.00000000000000000000p+0:0xbf800000) (OK) to int32: -1 (OK) to int64: -1 (OK) - to uint32: -1 (OK) - to uint64: -1 (OK) + to uint32: 0 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.00000000000000000000p-1022:0x008010000000000000) to single: f32(-0x0.00000000000000000000p+0:0x80000000) (UNDERFLOW INEXACT ) to int32: 0 (INEXACT )
@@ -455,19 +455,19 @@ from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from double: f64(0x1.fffffffffffff0000000p+1023:0x007fefffffffffffff) to single: f32(inf:0x7f800000) (OVERFLOW INEXACT ) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from double: f64(inf:0x007ff0000000000000) to single: f32(inf:0x7f800000) (OK) to int32: 2147483647 (INVALID)
@@ -479,80 +479,80 @@ from double: f64(nan:0x007ff8000000000000) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(nan:0x007ff0000000000001) to single: f32(nan:0x7fc00000) (INVALID) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(nan:0x007ff4000000000000) to single: f32(nan:0x7fe00000) (INVALID) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) ### Rounding downwards from double: f64(nan:0x007ff4000000000000) to single: f32(nan:0x7fe00000) (INVALID) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-nan:0x00fff8000000000000) to single: f32(-nan:0xffc00000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-inf:0x00fff0000000000000) to single: f32(-inf:0xff800000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.fffffffffffff0000000p+1023:0x00ffefffffffffffff) to single: f32(-inf:0xff800000) (OVERFLOW INEXACT ) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.1874b135ff6540000000p+103:0x00c661874b135ff654) to single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59) (INEXACT ) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.c0bab523323b90000000p+99:0x00c62c0bab523323b9) to single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) (INEXACT ) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.00000000000000000000p+1:0x00c000000000000000) to single: f32(-0x1.00000000000000000000p+1:0xc0000000) (OK) to int32: -2 (OK) to int64: -2 (OK) - to uint32: -2 (OK) - to uint64: -2 (OK) + to uint32: 0 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.00000000000000000000p+0:0x00bff0000000000000) to single: f32(-0x1.00000000000000000000p+0:0xbf800000) (OK) to int32: -1 (OK) to int64: -1 (OK) - to uint32: -1 (OK) - to uint64: -1 (OK) + to uint32: 0 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.00000000000000000000p-1022:0x008010000000000000) to single: f32(-0x1.00000000000000000000p-149:0x80000001) (UNDERFLOW INEXACT ) to int32: 0 (INEXACT )
@@ -702,19 +702,19 @@ from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from double: f64(0x1.fffffffffffff0000000p+1023:0x007fefffffffffffff) to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OVERFLOW INEXACT ) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from double: f64(inf:0x007ff0000000000000) to single: f32(inf:0x7f800000) (OK) to int32: 2147483647 (INVALID)
@@ -726,80 +726,80 @@ from double: f64(nan:0x007ff8000000000000) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(nan:0x007ff0000000000001) to single: f32(nan:0x7fc00000) (INVALID) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(nan:0x007ff4000000000000) to single: f32(nan:0x7fe00000) (INVALID) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) ### Rounding to zero from double: f64(nan:0x007ff4000000000000) to single: f32(nan:0x7fe00000) (INVALID) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-nan:0x00fff8000000000000) to single: f32(-nan:0xffc00000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-inf:0x00fff0000000000000) to single: f32(-inf:0xff800000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.fffffffffffff0000000p+1023:0x00ffefffffffffffff) to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OVERFLOW INEXACT ) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) to single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.1874b135ff6540000000p+103:0x00c661874b135ff654) to single: f32(-0x1.1874b000000000000000p+103:0xf30c3a58) (INEXACT ) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.c0bab523323b90000000p+99:0x00c62c0bab523323b9) to single: f32(-0x1.c0bab400000000000000p+99:0xf1605d5a) (INEXACT ) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.00000000000000000000p+1:0x00c000000000000000) to single: f32(-0x1.00000000000000000000p+1:0xc0000000) (OK) to int32: -2 (OK) to int64: -2 (OK) - to uint32: -2 (OK) - to uint64: -2 (OK) + to uint32: 0 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.00000000000000000000p+0:0x00bff0000000000000) to single: f32(-0x1.00000000000000000000p+0:0xbf800000) (OK) to int32: -1 (OK) to int64: -1 (OK) - to uint32: -1 (OK) - to uint64: -1 (OK) + to uint32: 0 (INVALID) + to uint64: 0 (INVALID) from double: f64(-0x1.00000000000000000000p-1022:0x008010000000000000) to single: f32(-0x0.00000000000000000000p+0:0x80000000) (UNDERFLOW INEXACT ) to int32: 0 (INEXACT )
@@ -949,19 +949,19 @@ from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OK) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from double: f64(0x1.fffffffffffff0000000p+1023:0x007fefffffffffffff) to single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) (OVERFLOW INEXACT ) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from double: f64(inf:0x007ff0000000000000) to single: f32(inf:0x7f800000) (OK) to int32: 2147483647 (INVALID)
@@ -973,16 +973,16 @@ from double: f64(nan:0x007ff8000000000000) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(nan:0x007ff0000000000001) to single: f32(nan:0x7fc00000) (INVALID) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from double: f64(nan:0x007ff4000000000000) to single: f32(nan:0x7fe00000) (INVALID) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID)
tests/tcg/ppc64/meson.build +4 -0
@@ -36,6 +36,10 @@ tests += { 'cc_feat': 'power10', 'cflags': ['-O3'], 'qemu_args': ['-cpu', 'POWER10'], + }, + '../multiarch/float_convd.c': { + 'cflags': float_cflags + ['-mcpu=power8'], + 'expected_output': 'float_convd.ref', } }
Signature · 1 line
2.53.0
PATCH 4/4 tests/tcg/ppc64: Add float_convs test
In reply to Eric FarmanPass "power8" as a compiler flag, and update the reference file with the new output.
--- tests/tcg/ppc64/float_convs.ref | 80 ++++++++++++++++----------------- tests/tcg/ppc64/meson.build | 4 ++ 2 files changed, 44 insertions(+), 40 deletions(-)
tests/tcg/ppc64/float_convs.ref +40 -40
@@ -4,37 +4,37 @@ from single: f32(-nan:0xffa00000) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-nan:0xffc00000) to double: f64(-nan:0x00fff8000000000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-inf:0xff800000) to double: f64(-inf:0x00fff0000000000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) to double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59) to double: f64(-0x1.1874b200000000000000p+103:0x00c661874b20000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) to double: f64(-0x1.c0bab600000000000000p+99:0x00c62c0bab60000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-0x1.31f75000000000000000p-40:0xab98fba8) to double: f64(-0x1.31f75000000000000000p-40:0x00bd731f7500000000) (OK) to int32: 0 (INEXACT )
@@ -160,13 +160,13 @@ from single: f32(0x1.c0bab600000000000000p+99:0x71605d5b) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) to double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) (OK) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from single: f32(inf:0x7f800000) to double: f64(inf:0x007ff0000000000000) (OK) to int32: 2147483647 (INVALID)
@@ -178,50 +178,50 @@ from single: f32(nan:0x7fc00000) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(nan:0x7fa00000) to double: f64(nan:0x007ff4000000000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) ### Rounding upwards from single: f32(-nan:0xffa00000) to double: f64(-nan:0x00fff4000000000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-nan:0xffc00000) to double: f64(-nan:0x00fff8000000000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-inf:0xff800000) to double: f64(-inf:0x00fff0000000000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) to double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59) to double: f64(-0x1.1874b200000000000000p+103:0x00c661874b20000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) to double: f64(-0x1.c0bab600000000000000p+99:0x00c62c0bab60000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-0x1.31f75000000000000000p-40:0xab98fba8) to double: f64(-0x1.31f75000000000000000p-40:0x00bd731f7500000000) (OK) to int32: 0 (INEXACT )
@@ -347,13 +347,13 @@ from single: f32(0x1.c0bab600000000000000p+99:0x71605d5b) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) to double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) (OK) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from single: f32(inf:0x7f800000) to double: f64(inf:0x007ff0000000000000) (OK) to int32: 2147483647 (INVALID)
@@ -365,50 +365,50 @@ from single: f32(nan:0x7fc00000) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(nan:0x7fa00000) to double: f64(nan:0x007ff4000000000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) ### Rounding downwards from single: f32(-nan:0xffa00000) to double: f64(-nan:0x00fff4000000000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-nan:0xffc00000) to double: f64(-nan:0x00fff8000000000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-inf:0xff800000) to double: f64(-inf:0x00fff0000000000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) to double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59) to double: f64(-0x1.1874b200000000000000p+103:0x00c661874b20000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) to double: f64(-0x1.c0bab600000000000000p+99:0x00c62c0bab60000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-0x1.31f75000000000000000p-40:0xab98fba8) to double: f64(-0x1.31f75000000000000000p-40:0x00bd731f7500000000) (OK) to int32: 0 (INEXACT )
@@ -534,13 +534,13 @@ from single: f32(0x1.c0bab600000000000000p+99:0x71605d5b) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) to double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) (OK) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from single: f32(inf:0x7f800000) to double: f64(inf:0x007ff0000000000000) (OK) to int32: 2147483647 (INVALID)
@@ -552,50 +552,50 @@ from single: f32(nan:0x7fc00000) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(nan:0x7fa00000) to double: f64(nan:0x007ff4000000000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) ### Rounding to zero from single: f32(-nan:0xffa00000) to double: f64(-nan:0x00fff4000000000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-nan:0xffc00000) to double: f64(-nan:0x00fff8000000000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-inf:0xff800000) to double: f64(-inf:0x00fff0000000000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff) to double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe0000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59) to double: f64(-0x1.1874b200000000000000p+103:0x00c661874b20000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b) to double: f64(-0x1.c0bab600000000000000p+99:0x00c62c0bab60000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(-0x1.31f75000000000000000p-40:0xab98fba8) to double: f64(-0x1.31f75000000000000000p-40:0x00bd731f7500000000) (OK) to int32: 0 (INEXACT )
@@ -721,13 +721,13 @@ from single: f32(0x1.c0bab600000000000000p+99:0x71605d5b) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from single: f32(0x1.fffffe00000000000000p+127:0x7f7fffff) to double: f64(0x1.fffffe00000000000000p+127:0x0047efffffe0000000) (OK) to int32: 2147483647 (INVALID) to int64: 9223372036854775807 (INVALID) to uint32: -1 (INVALID) - to uint64: -1 (INEXACT INVALID) + to uint64: -1 (INVALID) from single: f32(inf:0x7f800000) to double: f64(inf:0x007ff0000000000000) (OK) to int32: 2147483647 (INVALID)
@@ -739,10 +739,10 @@ from single: f32(nan:0x7fc00000) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID) from single: f32(nan:0x7fa00000) to double: f64(nan:0x007ff4000000000000) (OK) to int32: -2147483648 (INVALID) to int64: -9223372036854775808 (INVALID) to uint32: 0 (INVALID) - to uint64: -9223372036854775808 (INVALID) + to uint64: 0 (INVALID)
tests/tcg/ppc64/meson.build +4 -0
@@ -40,6 +40,10 @@ tests += { '../multiarch/float_convd.c': { 'cflags': float_cflags + ['-mcpu=power8'], 'expected_output': 'float_convd.ref', + }, + '../multiarch/float_convs.c': { + 'cflags': float_cflags + ['-mcpu=power8'], + 'expected_output': 'float_convs.ref', } }
Signature · 1 line
2.53.0