Re: [Qemu-devel] [Bug 645662] Re: QEMU x87 emulation of trig and other complex ops is only at 64-bit precision, not 80-bit
Fine by me. I suggest to keep tracking this though, if necessary in another bug item. Regards, Arno On Fri, Aug 16, 2019 at 16:06:29 CEST, Peter Maydell wrote: > Looking at our code we're still implementing the x87 insns FSIN, FCOS, > FSINCOS, FPTAN, FPATAN, F2XM1, FYL2X, FYL2XP1 by "convert the floatx80 > to a host double and use the host C library functions", so I think this > bug is still unfixed. If the C program in comment 1 and/or the Python > code has stopped reporting failures it's probably just because the guest > C library routines have stopped using the x87 80-bit FPU instructions > internally. > > > ** Changed in: qemu >Status: Fix Released => Confirmed > > -- > You received this bug notification because you are subscribed to the bug > report. > https://bugs.launchpad.net/bugs/645662 > > Title: > QEMU x87 emulation of trig and other complex ops is only at 64-bit > precision, not 80-bit > > Status in QEMU: > Confirmed > > Bug description: > When doing the regression tests for Python 3.1.2 with Qemu 0.12.5, (Linux > version 2.6.26-2-686 (Debian 2.6.26-25lenny1)), > gcc (Debian 4.3.2-1.1) 4.3.2, Python compiled from sources within qemu, > 3 math tests fail, apparently because the floating point unit is buggy. > Qmeu was compiled from original sources > on Debian Lenny with kernel 2.6.34.6 from kernel.org, gcc (Debian > 4.3.2-1.1) 4.3. > > Regression testing errors: > > test_cmath > test test_cmath failed -- Traceback (most recent call last): > File "/root/tools/python3/Python-3.1.2/Lib/test/test_cmath.py", line 364, > in > self.fail(error_message) > AssertionError: acos0034: acos(complex(-1.0002, 0.0)) > Expected: complex(3.141592653589793, -2.1073424255447014e-08) > Received: complex(3.141592653589793, -2.1073424338879928e-08) > Received value insufficiently close to expected value. > > > test_float > test test_float failed -- Traceback (most recent call last): > File "/root/tools/python3/Python-3.1.2/Lib/test/test_float.py", line 479, > in > self.assertEqual(s, repr(float(s))) > AssertionError: '8.72293771110361e+25' != '8.722937711103609e+25' > > > test_math > test test_math failed -- multiple errors occurred; run in verbose mode for > deta > > => > > runtests.sh -v test_math > > le01:~/tools/python3/Python-3.1.2# ./runtests.sh -v test_math > test_math BAD >1 BAD >0 GOOD >0 SKIPPED >1 total > le01:~/tools/python3/Python-3.1.2# > > To manage notifications about this bug go to: > https://bugs.launchpad.net/qemu/+bug/645662/+subscriptions -- Arno Wagner, Dr. sc. techn., Dipl. Inform.,Email: a...@wagner.name GnuPG: ID: CB5D9718 FP: 12D6 C03B 1B30 33BB 13CF B774 E35C 5FA1 CB5D 9718 A good decision is based on knowledge and not on numbers. -- Plato If it's in the news, don't worry about it. The very definition of "news" is "something that hardly ever happens." -- Bruce Schneier -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/645662 Title: QEMU x87 emulation of trig and other complex ops is only at 64-bit precision, not 80-bit Status in QEMU: Confirmed Bug description: When doing the regression tests for Python 3.1.2 with Qemu 0.12.5, (Linux version 2.6.26-2-686 (Debian 2.6.26-25lenny1)), gcc (Debian 4.3.2-1.1) 4.3.2, Python compiled from sources within qemu, 3 math tests fail, apparently because the floating point unit is buggy. Qmeu was compiled from original sources on Debian Lenny with kernel 2.6.34.6 from kernel.org, gcc (Debian 4.3.2-1.1) 4.3. Regression testing errors: test_cmath test test_cmath failed -- Traceback (most recent call last): File "/root/tools/python3/Python-3.1.2/Lib/test/test_cmath.py", line 364, in self.fail(error_message) AssertionError: acos0034: acos(complex(-1.0002, 0.0)) Expected: complex(3.141592653589793, -2.1073424255447014e-08) Received: complex(3.141592653589793, -2.1073424338879928e-08) Received value insufficiently close to expected value. test_float test test_float failed -- Traceback (most recent call last): File "/root/tools/python3/Python-3.1.2/Lib/test/test_float.py", line 479, in self.assertEqual(s, repr(float(s))) AssertionError: '8.72293771110361e+25' != '8.722937711103609e+25' test_math test test_math failed -- multiple errors occurred; run in verbose mode for deta => runtests.sh -v test_math le01:~/tools/python3/Python-3.1.2# ./runtests.sh -v test_math test_math BAD 1 BAD 0 GOOD 0 SKIPPED 1 total le01:~/tools/python3/Python-3.1.2# To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/645662/+subscriptions
[Qemu-devel] [Bug 645662] Re: QEMU x87 emulation of trig and other complex ops is only at 64-bit precision, not 80-bit
Looking at our code we're still implementing the x87 insns FSIN, FCOS, FSINCOS, FPTAN, FPATAN, F2XM1, FYL2X, FYL2XP1 by "convert the floatx80 to a host double and use the host C library functions", so I think this bug is still unfixed. If the C program in comment 1 and/or the Python code has stopped reporting failures it's probably just because the guest C library routines have stopped using the x87 80-bit FPU instructions internally. ** Changed in: qemu Status: Fix Released => Confirmed -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/645662 Title: QEMU x87 emulation of trig and other complex ops is only at 64-bit precision, not 80-bit Status in QEMU: Confirmed Bug description: When doing the regression tests for Python 3.1.2 with Qemu 0.12.5, (Linux version 2.6.26-2-686 (Debian 2.6.26-25lenny1)), gcc (Debian 4.3.2-1.1) 4.3.2, Python compiled from sources within qemu, 3 math tests fail, apparently because the floating point unit is buggy. Qmeu was compiled from original sources on Debian Lenny with kernel 2.6.34.6 from kernel.org, gcc (Debian 4.3.2-1.1) 4.3. Regression testing errors: test_cmath test test_cmath failed -- Traceback (most recent call last): File "/root/tools/python3/Python-3.1.2/Lib/test/test_cmath.py", line 364, in self.fail(error_message) AssertionError: acos0034: acos(complex(-1.0002, 0.0)) Expected: complex(3.141592653589793, -2.1073424255447014e-08) Received: complex(3.141592653589793, -2.1073424338879928e-08) Received value insufficiently close to expected value. test_float test test_float failed -- Traceback (most recent call last): File "/root/tools/python3/Python-3.1.2/Lib/test/test_float.py", line 479, in self.assertEqual(s, repr(float(s))) AssertionError: '8.72293771110361e+25' != '8.722937711103609e+25' test_math test test_math failed -- multiple errors occurred; run in verbose mode for deta => runtests.sh -v test_math le01:~/tools/python3/Python-3.1.2# ./runtests.sh -v test_math test_math BAD 1 BAD 0 GOOD 0 SKIPPED 1 total le01:~/tools/python3/Python-3.1.2# To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/645662/+subscriptions
Re: [Qemu-devel] [Bug 645662] Re: QEMU x87 emulation of trig and other complex ops is only at 64-bit precision, not 80-bit
To be sure, you can also run my original C test code from 2010. If that produces a bit-identtical result, then this has indeed been fixed. If there are deviations in the last digits, then the fingerprinting issues is still there, but at least Python has stopped complaining. Regards, Arno On Fri, Aug 16, 2019 at 07:47:59 CEST, Thomas Huth wrote: > The test code from comment #1 now prints out the correct value with QEMU > v4.1, so I think this has been fixed with the softfloat work that has > been done within the last year. > > ** Changed in: qemu >Status: Confirmed => Fix Released > > -- > You received this bug notification because you are subscribed to the bug > report. > https://bugs.launchpad.net/bugs/645662 > > Title: > QEMU x87 emulation of trig and other complex ops is only at 64-bit > precision, not 80-bit > > Status in QEMU: > Fix Released > > Bug description: > When doing the regression tests for Python 3.1.2 with Qemu 0.12.5, (Linux > version 2.6.26-2-686 (Debian 2.6.26-25lenny1)), > gcc (Debian 4.3.2-1.1) 4.3.2, Python compiled from sources within qemu, > 3 math tests fail, apparently because the floating point unit is buggy. > Qmeu was compiled from original sources > on Debian Lenny with kernel 2.6.34.6 from kernel.org, gcc (Debian > 4.3.2-1.1) 4.3. > > Regression testing errors: > > test_cmath > test test_cmath failed -- Traceback (most recent call last): > File "/root/tools/python3/Python-3.1.2/Lib/test/test_cmath.py", line 364, > in > self.fail(error_message) > AssertionError: acos0034: acos(complex(-1.0002, 0.0)) > Expected: complex(3.141592653589793, -2.1073424255447014e-08) > Received: complex(3.141592653589793, -2.1073424338879928e-08) > Received value insufficiently close to expected value. > > > test_float > test test_float failed -- Traceback (most recent call last): > File "/root/tools/python3/Python-3.1.2/Lib/test/test_float.py", line 479, > in > self.assertEqual(s, repr(float(s))) > AssertionError: '8.72293771110361e+25' != '8.722937711103609e+25' > > > test_math > test test_math failed -- multiple errors occurred; run in verbose mode for > deta > > => > > runtests.sh -v test_math > > le01:~/tools/python3/Python-3.1.2# ./runtests.sh -v test_math > test_math BAD >1 BAD >0 GOOD >0 SKIPPED >1 total > le01:~/tools/python3/Python-3.1.2# > > To manage notifications about this bug go to: > https://bugs.launchpad.net/qemu/+bug/645662/+subscriptions -- Arno Wagner, Dr. sc. techn., Dipl. Inform.,Email: a...@wagner.name GnuPG: ID: CB5D9718 FP: 12D6 C03B 1B30 33BB 13CF B774 E35C 5FA1 CB5D 9718 A good decision is based on knowledge and not on numbers. -- Plato If it's in the news, don't worry about it. The very definition of "news" is "something that hardly ever happens." -- Bruce Schneier -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/645662 Title: QEMU x87 emulation of trig and other complex ops is only at 64-bit precision, not 80-bit Status in QEMU: Fix Released Bug description: When doing the regression tests for Python 3.1.2 with Qemu 0.12.5, (Linux version 2.6.26-2-686 (Debian 2.6.26-25lenny1)), gcc (Debian 4.3.2-1.1) 4.3.2, Python compiled from sources within qemu, 3 math tests fail, apparently because the floating point unit is buggy. Qmeu was compiled from original sources on Debian Lenny with kernel 2.6.34.6 from kernel.org, gcc (Debian 4.3.2-1.1) 4.3. Regression testing errors: test_cmath test test_cmath failed -- Traceback (most recent call last): File "/root/tools/python3/Python-3.1.2/Lib/test/test_cmath.py", line 364, in self.fail(error_message) AssertionError: acos0034: acos(complex(-1.0002, 0.0)) Expected: complex(3.141592653589793, -2.1073424255447014e-08) Received: complex(3.141592653589793, -2.1073424338879928e-08) Received value insufficiently close to expected value. test_float test test_float failed -- Traceback (most recent call last): File "/root/tools/python3/Python-3.1.2/Lib/test/test_float.py", line 479, in self.assertEqual(s, repr(float(s))) AssertionError: '8.72293771110361e+25' != '8.722937711103609e+25' test_math test test_math failed -- multiple errors occurred; run in verbose mode for deta => runtests.sh -v test_math le01:~/tools/python3/Python-3.1.2# ./runtests.sh -v test_math test_math BAD 1 BAD 0 GOOD 0 SKIPPED 1 total le01:~/tools/python3/Python-3.1.2# To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/645662/+subscriptions
[Qemu-devel] [Bug 645662] Re: QEMU x87 emulation of trig and other complex ops is only at 64-bit precision, not 80-bit
The test code from comment #1 now prints out the correct value with QEMU v4.1, so I think this has been fixed with the softfloat work that has been done within the last year. ** Changed in: qemu Status: Confirmed => Fix Released -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/645662 Title: QEMU x87 emulation of trig and other complex ops is only at 64-bit precision, not 80-bit Status in QEMU: Fix Released Bug description: When doing the regression tests for Python 3.1.2 with Qemu 0.12.5, (Linux version 2.6.26-2-686 (Debian 2.6.26-25lenny1)), gcc (Debian 4.3.2-1.1) 4.3.2, Python compiled from sources within qemu, 3 math tests fail, apparently because the floating point unit is buggy. Qmeu was compiled from original sources on Debian Lenny with kernel 2.6.34.6 from kernel.org, gcc (Debian 4.3.2-1.1) 4.3. Regression testing errors: test_cmath test test_cmath failed -- Traceback (most recent call last): File "/root/tools/python3/Python-3.1.2/Lib/test/test_cmath.py", line 364, in self.fail(error_message) AssertionError: acos0034: acos(complex(-1.0002, 0.0)) Expected: complex(3.141592653589793, -2.1073424255447014e-08) Received: complex(3.141592653589793, -2.1073424338879928e-08) Received value insufficiently close to expected value. test_float test test_float failed -- Traceback (most recent call last): File "/root/tools/python3/Python-3.1.2/Lib/test/test_float.py", line 479, in self.assertEqual(s, repr(float(s))) AssertionError: '8.72293771110361e+25' != '8.722937711103609e+25' test_math test test_math failed -- multiple errors occurred; run in verbose mode for deta => runtests.sh -v test_math le01:~/tools/python3/Python-3.1.2# ./runtests.sh -v test_math test_math BAD 1 BAD 0 GOOD 0 SKIPPED 1 total le01:~/tools/python3/Python-3.1.2# To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/645662/+subscriptions
[Qemu-devel] [Bug 645662] Re: QEMU x87 emulation of trig and other complex ops is only at 64-bit precision, not 80-bit
That explains it. For most operations that approach works well as basically nobody uses the 80 bit formats directly anyways. Unfortunately asinh() is very badly conditioned in the region tested and it is not enough. A possible approach to fix this would be to use long double (128 bit) were available instead of just double and to document this limitation for double. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/645662 Title: QEMU x87 emulation of trig and other complex ops is only at 64-bit precision, not 80-bit Status in QEMU: Confirmed Bug description: When doing the regression tests for Python 3.1.2 with Qemu 0.12.5, (Linux version 2.6.26-2-686 (Debian 2.6.26-25lenny1)), gcc (Debian 4.3.2-1.1) 4.3.2, Python compiled from sources within qemu, 3 math tests fail, apparently because the floating point unit is buggy. Qmeu was compiled from original sources on Debian Lenny with kernel 2.6.34.6 from kernel.org, gcc (Debian 4.3.2-1.1) 4.3. Regression testing errors: test_cmath test test_cmath failed -- Traceback (most recent call last): File "/root/tools/python3/Python-3.1.2/Lib/test/test_cmath.py", line 364, in self.fail(error_message) AssertionError: acos0034: acos(complex(-1.0002, 0.0)) Expected: complex(3.141592653589793, -2.1073424255447014e-08) Received: complex(3.141592653589793, -2.1073424338879928e-08) Received value insufficiently close to expected value. test_float test test_float failed -- Traceback (most recent call last): File "/root/tools/python3/Python-3.1.2/Lib/test/test_float.py", line 479, in self.assertEqual(s, repr(float(s))) AssertionError: '8.72293771110361e+25' != '8.722937711103609e+25' test_math test test_math failed -- multiple errors occurred; run in verbose mode for deta => runtests.sh -v test_math le01:~/tools/python3/Python-3.1.2# ./runtests.sh -v test_math test_math BAD 1 BAD 0 GOOD 0 SKIPPED 1 total le01:~/tools/python3/Python-3.1.2# To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/645662/+subscriptions
[Qemu-devel] [Bug 645662] Re: QEMU x87 emulation of trig and other complex ops is only at 64-bit precision, not 80-bit
Laurent Vivier recently started to adapt some of function from the "Previous" NeXT emulator for m68k, see e.g. this patch series here: https://lists.gnu.org/archive/html/qemu-devel/2017-11/msg04454.html Not sure, but I think that could help to fix at least some of the missing functions. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/645662 Title: QEMU x87 emulation of trig and other complex ops is only at 64-bit precision, not 80-bit Status in QEMU: Confirmed Bug description: When doing the regression tests for Python 3.1.2 with Qemu 0.12.5, (Linux version 2.6.26-2-686 (Debian 2.6.26-25lenny1)), gcc (Debian 4.3.2-1.1) 4.3.2, Python compiled from sources within qemu, 3 math tests fail, apparently because the floating point unit is buggy. Qmeu was compiled from original sources on Debian Lenny with kernel 2.6.34.6 from kernel.org, gcc (Debian 4.3.2-1.1) 4.3. Regression testing errors: test_cmath test test_cmath failed -- Traceback (most recent call last): File "/root/tools/python3/Python-3.1.2/Lib/test/test_cmath.py", line 364, in self.fail(error_message) AssertionError: acos0034: acos(complex(-1.0002, 0.0)) Expected: complex(3.141592653589793, -2.1073424255447014e-08) Received: complex(3.141592653589793, -2.1073424338879928e-08) Received value insufficiently close to expected value. test_float test test_float failed -- Traceback (most recent call last): File "/root/tools/python3/Python-3.1.2/Lib/test/test_float.py", line 479, in self.assertEqual(s, repr(float(s))) AssertionError: '8.72293771110361e+25' != '8.722937711103609e+25' test_math test test_math failed -- multiple errors occurred; run in verbose mode for deta => runtests.sh -v test_math le01:~/tools/python3/Python-3.1.2# ./runtests.sh -v test_math test_math BAD 1 BAD 0 GOOD 0 SKIPPED 1 total le01:~/tools/python3/Python-3.1.2# To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/645662/+subscriptions