From: | christian.bau@cbau.wanadoo.co.uk |
Newsgroups: | comp.compilers |
Date: | Mon, 28 Oct 2013 15:50:07 -0700 (PDT) |
Organization: | Compilers Central |
References: | 13-10-026 13-10-029 |
Keywords: | arithmetic, optimize |
Posted-Date: | 28 Oct 2013 18:51:53 EDT |
> [I think you mean they're not associative. I don't know any situations
> where a+b != b+a, but lots where a+(b+c) != (a+b)+c -John]
Take fused multiply-add, and the expression a*b + c*d.
It can be evaluated either as fma (a, b, c*d) or fma (c, d, a*b).
It would seem natural that the code for a*b + c*d and for c*d + a*b
would be different, with different results.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.