Re: [PATCH v3 1/4] sim: Allow toggling of quiet NaN-bit semantics

Mike Frysinger via Gdb-patches
2022-01-12T10:45:21Z

[-- Attachment #1: Type: text/plain, Size: 788 bytes --]

On 12 Jan 2022 05:06, Mike Frysinger via Gdb-patches wrote:
> On 11 Jan 2022 22:24, Dragan Mladjenovic wrote:
> > --- a/sim/common/sim-fpu.h
> > +++ b/sim/common/sim-fpu.h
> >
> > +/* Toggle quiet NaN semantics. */
> >
> > +extern bool sim_fpu_quiet_nan_inverted;
>
> please avoid global variables. this should be part of sim_fpu state instead.

hrm, that doesn't work as sim_fpu is an operand ... i was thinking it was the
FPU state. all the sim-fpu APIs today have been assuming stateless FPU which
doesn't really work after this (and the other changes you're posting).

please add a new sim_fpu_state structure that this would be a member of. that
can be a global variable for now, but leave a TODO comment about moving it into
the SIM_CPU structure.