PPC libgcc IEEE128 soft-fp exception/rounding fixes

Paul E. Murphy murphyp@linux.vnet.ibm.com
Fri Feb 19 20:55:00 GMT 2016

On 02/17/2016 08:37 PM, Alan Modra wrote:
>> +/* 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.

Thanks for taking a look Alan, and Joseph.  I've expanded the comment
to clarify the otherwise mysterious shift with the updated patch.

	* config/rs6000/sfp-machine.h:
	(_FP_DECL_EX): Declare _fpsr as a union of u64 and double.
	(FP_TRAPPING_EXCEPTIONS): Return a bitmask of trapping
	(FP_INIT_ROUNDMODE): Read the fpscr instead of writing
	a mystery value.
	(FP_ROUNDMODE): Update the usage of _fpscr.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ppc_ieee128_sfp_fix_rev2.patch
Type: text/x-patch
Size: 1681 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160219/4f8e530c/attachment.bin>

More information about the Gcc-patches mailing list