On Wed, Feb 17, 2016 at 05:40:01PM -0600, Paul E. Murphy wrote: > - FP_INIT_ROUNDMODE writes junk to the fpscr. I assume this should be > reading the fpscr and initializing the local rounding mode variable > declared via _FP_DECL_EX.
Yeah, looks that way. > - FP_TRAPPING_EXCEPTIONS evaluates to zero where used. It seems like it > should return a bit field of FP_EX_* bits indicating which trap is > enabled. Likewise, when these bits are set in the fpscr, the trap is > enabled. Yes, but > +/* A set bit indicates an exception is trapping. */ > +# define FP_TRAPPING_EXCEPTIONS ((_fpscr.i << 22) & FP_EX_ALL) why then a shift here, since FP_EX_* are defined as the actual register bits? Oh, I see. FP_EX_* are the status bits, and you want the enable bits. ie. bit 56 rather than bit 34, bit 57 rather than bit 35 and so on (bits numbered from 0 as msb). A comment to that effect might reduce head scratching. -- Alan Modra Australia Development Lab, IBM