You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 13, 2019. It is now read-only.
In translate.c, there is explicit code to NaN box the result of FLW. However, there is no equivalent code for any of the FP arithmetic instructions, add, sub, mul, div, etc. They all should produce NaN boxed results also. Likewise the conversion instructions that produce single float results. This was noticed while testing linux kernel ptrace support for FP registers in gdb running on system qemu. I can see that the raw FP values are wrong after an operation. This is probably hard to notice otherwise, you would have to have broken code that performs single float operations and then tries to read the results as double float.
There is a closely related bug here. If one of the input values to a single float instruction is not NaN boxed, then the result must be a canonical NaN. Qemu gets this wrong also. Found while trying to debug a different gdb bug.
In translate.c, there is explicit code to NaN box the result of FLW. However, there is no equivalent code for any of the FP arithmetic instructions, add, sub, mul, div, etc. They all should produce NaN boxed results also. Likewise the conversion instructions that produce single float results. This was noticed while testing linux kernel ptrace support for FP registers in gdb running on system qemu. I can see that the raw FP values are wrong after an operation. This is probably hard to notice otherwise, you would have to have broken code that performs single float operations and then tries to read the results as double float.
(gdb)
0x0000000000010462 6 return a + b;
1: x/i $pc
=> 0x10462 <sub+22>: fadd.s fa5,fa4,fa5
(gdb) print $fa4
$1 = -nan(0xfffff3fc00000)
(gdb) print $fa5
$2 = -nan(0xfffff40200000)
(gdb) stepi
7 }
1: x/i $pc
=> 0x10466 <sub+26>: fmv.s fa0,fa5
(gdb) print $fa5
$3 = 5.3464347077054713e-315
(gdb)
info all-registers shows
fa4 -nan(0xfffff3fc00000) (raw 0xffffffff3fc00000)
fa5 5.3464347077054713e-315 (raw 0x0000000040800000)
The text was updated successfully, but these errors were encountered: