floating point emulation can fail to set FE_UNDERFLOW
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Floating point emulation can fail to set FE_UNDERFLOW in some circumstances. This shows up often in glibc's "math" tests. A similar test is attached.
This is similar to bug #1841442, but not the same problem, and I don't think the fix will be in the same code.
On ppc64le native:
--
$ gcc -c -O2 fma.c
$ gcc -O2 test-fma.c fma.o -lm -o test-fma
$ ./test-fma $(./test-fma)
fma(0x1.
0x0
0xa000000
FE_INEXACT FE_UNDERFLOW
0x1p-1022
--
On qemu-system-ppc64:
--
$ ./test-fma $(./test-fma)
fma(0x1.
0x0
0x2000000
FE_INEXACT
0x1p-1022
--
QEMU versions vary, but not too much, and are pretty close to git HEAD:
- 586f3dced9 (HEAD -> master, origin/master, origin/HEAD) Merge remote-tracking branch 'remotes/
- 864ab31 Update version for v4.1.0-rc4 release
There are worse symptoms on qemu-x86_64, but this is apparently not surprising per https:/
Responding to the patch https:/ /lists. nongnu. org/archive/ html/qemu- ppc/2019- 08/msg00404. html, it seems to work for "double", but not for "float". Test case attached.