How read the gdb registers in fmulp case

18 views Asked by At

I am trying to make sense of the following:

Program received signal SIGFPE, Arithmetic exception.
hwy::N_EMU128::Log1p<hwy::N_EMU128::Simd<double, 1u, 0>, hwy::N_EMU128::Vec128<double, 1u> > (x=..., d=...) at math_test.cc:62
62        auto non_pole = Mul( tmp1, tmp2);
(gdb) p tmp1
$1 = <optimized out>
(gdb) p tmp2
$2 = <optimized out>
(gdb) display/i $pc
1: x/i $pc
=> 0x56556365 <_ZN3hwy8TestMathINS_8N_EMU1284SimdIdLj1ELi0EEEEEvT_+357>:        fmulp  %st,%st(1)
(gdb) i r f
st0            0                   (raw 0x00000000000000000000)
st1            0                   (raw 0x00000000000000000000)
st2            5.52672057424411896785e-20 (raw 0x3fbf827ef9db22bdb000)
st3            0.399999999994094190825 (raw 0x3ffdccccccccbfd02000)
st4            0                   (raw 0x00000000000000000000)
st5            0                   (raw 0x00000000000000000000)
st6            0                   (raw 0x00000000000000000000)
st7            0                   (raw 0x00000000000000000000)
fctrl          0x37a               890
fstat          0xacb6              44214
ftag           0x17ff              6143
fiseg          0x0                 0
fioff          0x56556363          1448436579
foseg          0x0                 0
fooff          0xffffcd38          -13000
fop            0xfa                250

How can I get the values in my C code: tmp1 and tmp2 ? Reading previous post (eg. this one), it seems that the operation fmulp is taking the value from st0 and st1 which as I can read as:

st0            0                   (raw 0x00000000000000000000)
st1            0                   (raw 0x00000000000000000000)

If I did read this correctly, how is it possible I am getting an FPE here ? +0 by +0 is perfectly valid, right ?

Using debian/stable with g++-9 -m32 and exceptions setup with:

  feenableexcept(FE_INVALID | FE_DIVBYZERO );
0

There are 0 answers