[Patch, MIPS] Enable fp-contract on MIPS and update -mfused-madd

Joseph Myers joseph@codesourcery.com
Mon Jun 15 21:37:00 GMT 2015


On Mon, 15 Jun 2015, Maciej W. Rozycki wrote:

> operands negated.  That negation, implemented with the IEEE Std 754-2008 
> `negate' operation that you referred to, by definition is required to 
> operate on the sign of its operand in a specific way even if the operand 
> is a qNaN.
> 
>  So for example `fmsM4', that is specified at the RTL level as (fma:M OP1 
> OP2 (neg:M OP3)) will not produce the correct result with the fused 
> version of the MIPS MSUB.fmt instruction in the case where OP1 and OP2 are 
> numeric data patterns and OP3 is a qNaN data pattern that has its sign bit 
> clear.  As specified by IEEE Std 754-2008 the (neg:M OP3) operation is 
> required to invert the sign bit of the qNaN data pattern in calculating 
> TMP3, and then the (fma:M OP1 OP2 TMP3) operation is required to pass the 
> TMP3 qNaN data pattern unchanged in calculating the final result.

It is only required (well, recommended) to pass the *payload*.  The sign 
bit is not part of the payload.  "For all other operations, this standard 
does not specify the sign bit of a NaN result, even when there is only one 
input NaN, or when the NaN is produced from an invalid operation.".

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list