On Fri, 15 May 2020 at 22:23, Joseph Myers <jos...@codesourcery.com> wrote: > > Most x87 instruction implementations fail to raise the expected IEEE > floating-point exceptions because they do nothing to convert the > exception state from the softfloat machinery into the exception flags > in the x87 status word. There is special-case handling of division to > raise the divide-by-zero exception, but that handling is itself buggy: > it raises the exception in inappropriate cases (inf / 0 and nan / 0, > which should not raise any exceptions, and 0 / 0, which should raise > "invalid" instead).
> Signed-off-by: Joseph Myers <jos...@codesourcery.com> > --- > target/i386/fpu_helper.c | 126 +++- > tests/tcg/i386/test-i386-fp-exceptions.c | 831 +++++++++++++++++++++++ > 2 files changed, 926 insertions(+), 31 deletions(-) > create mode 100644 tests/tcg/i386/test-i386-fp-exceptions.c I've just noticed that the new test program here provokes compiler warnings when 'make check-tcg' builds it: make[2]: Entering directory '/home/petmay01/linaro/qemu-for-merges/build/all-linux-static/tests/tcg/i386-linux-user' /home/petmay01/linaro/qemu-for-merges/tests/docker/docker.py --engine auto cc --cc gcc -i qemu/fedora-i386-cross -s /home/petmay01/linaro/qemu-for-merges -- -Wall -Werror -O0 -g -fno-strict-aliasing -m32 /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386-fp-exceptions.c -o test-i386-fp-exceptions -static /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386-fp-exceptions.c: Assembler messages: /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386-fp-exceptions.c:426: Warning: no instruction mnemonic suffix given and no register operands; using default for `fistp' /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386-fp-exceptions.c:433: Warning: no instruction mnemonic suffix given and no register operands; using default for `fistp' /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386-fp-exceptions.c:440: Warning: no instruction mnemonic suffix given and no register operands; using default for `fistp' /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386-fp-exceptions.c:447: Warning: no instruction mnemonic suffix given and no register operands; using default for `fistp' /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386-fp-exceptions.c:454: Warning: no instruction mnemonic suffix given and no register operands; using default for `fistp' /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386-fp-exceptions.c:541: Warning: no instruction mnemonic suffix given and no register operands; using default for `fisttp' /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386-fp-exceptions.c:548: Warning: no instruction mnemonic suffix given and no register operands; using default for `fisttp' /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386-fp-exceptions.c:555: Warning: no instruction mnemonic suffix given and no register operands; using default for `fisttp' /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386-fp-exceptions.c:562: Warning: no instruction mnemonic suffix given and no register operands; using default for `fisttp' /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386-fp-exceptions.c:569: Warning: no instruction mnemonic suffix given and no register operands; using default for `fisttp' /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386-fp-exceptions.c:576: Warning: no instruction mnemonic suffix given and no register operands; using default for `fisttp' /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386-fp-exceptions.c:583: Warning: no instruction mnemonic suffix given and no register operands; using default for `fisttp' There's a similar warning also in test-i386.c: /home/petmay01/linaro/qemu-for-merges/tests/docker/docker.py --engine auto cc --cc gcc -i qemu/fedora-i386-cross -s /home/petmay01/linaro/qemu-for-merges -- -Wall -Werror -O0 -g -fno-strict-aliasing -fno-pie -static -m32 -o test-i386 \ /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386.c /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386-code16.S /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386-vm86.S -lm /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386.c: Assembler messages: /home/petmay01/linaro/qemu-for-merges/tests/tcg/i386/test-i386.c:869: Warning: no instruction mnemonic suffix given and no register operands; using default for `fist' They don't make the build fail but it would be nice if we could make them go away... thanks -- PMM