<div class="gmail_quote">On Tue, Jun 5, 2012 at 2:45 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Jun 5, 2012, at 2:15 PM, Stephen Canon wrote:<br>
> On Jun 5, 2012, at 1:51 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:<br>
</div><div class="im">>> That said, FP_CONTRACT doesn't apply to C++, and it's quite unlikely to become a serious part of the standard given these (among other) limitations. Curiously, in C++11, it may not be needed to get the benefit of fused multiply-add:<br>

><br>
> Perversely, a strict reading of C++11 seems (to me) to not allow FMA formation in C++ at all:<br>
><br>
>       • The values of the floating operands and the results of floating expressions may be represented in greater precision and range than that required by the type; the types are not changed thereby.<br>
><br>
> FMA formation does not increase the precision or range of the result (it may or may not have smaller error, but it is not more precise), so this paragraph doesn't actually license FMA formation.  I can't find anywhere else in the standard that could (though I am *far* less familiar with C++11 than C11, so I may not be looking in the right places).<br>

<br>
</div>Correct me if I'm wrong, but I thought that an FMA could be formalized as representing the result of the multiply with greater precision than the operation's type actually provides, and then using that as the operand of the addition.</blockquote>
<div><br></div><div>I don't see any specification of the distinction between the precision at which the operation is performed vs. the precision with which the the result is held in a register... but...</div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It's understand that that can change the result of the addition in ways that aren't just "more precise".  Similarly, performing 'float' operations using x87 long doubles can change the result of the operation, but I'm pretty sure that the committees explicitly had hardware limitations like that in mind when they added this language.<br>
</blockquote><div><br></div><div>I tend to agree with you. I suspect (without evidence beyond what you cite) that the committee would have intended this paragraph to allow FMA as well as x87 instructions.</div></div>