This is the mail archive of the
`gcc@gcc.gnu.org`
mailing list for the GCC project.

Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|

Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |

Other format: | [Raw text] |

*From*: Kenneth Zadeck <zadeck at naturalbridge dot com>*To*: gcc <gcc at gcc dot gnu dot org>, Mike Stump <mikestump at comcast dot net>, Kenneth Zadeck <Kenneth dot Zadeck at NaturalBridge dot com>*Date*: Mon, 14 May 2012 18:21:21 -0400*Subject*: confusion about fma description in section 16.9 of gccint doc.

`fmam4' Multiply operand 2 and operand 1, then add operand 3, storing the result in operand 0. All operands must have mode m. This pattern is used to implement the |fma|, |fmaf|, and |fmal| builtin functions from the ISO C99 standard. The |fma| operation may produce different results than doing the multiply followed by the add if the machine does not perform a rounding step between the operations.

7.12.13 Floating multiply-add 7.12.13.1 Thefmafunctions Synopsis 1 #include<math.h> double fma(double x, double y, double z); float fmaf(float x, float y, float z); long double fmal(long double x, long double y, long double z); Description 2 The fma functions compute (x × y) + z, rounded as one ternary operation: they compute the value (as if) to infinite precision and round once to the result format, according to the rounding mode characterized by the value of FLT_ROUNDS. Returns 3 The fma functions return (x × y) + z, rounded as one ternary operation.

Point 2 of the standard above states that those functions only do single rounding. My guess is that the gccint doc is wrong. (I should point out that the gccint doc for the new rtl operator in section 10.9 does require only single rounding. But that is not the question here.)

**Follow-Ups**:**Re: confusion about fma description in section 16.9 of gccint doc.***From:*Ian Lance Taylor

Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|

Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |