Re: comments on latest draft
Bradley Lucier 07 Jun 2017 19:55 UTC
On 06/06/2017 11:48 PM, William D Clinger wrote:
> The spec for fl+* says it computes its result "as if to infinite
> precision and rounded only once." That's fine as an aspirational
> goal, but it's overly ambitious as a requirement. To implement
> it portably, or on hardware that doesn't have machine instructions
> that satisfy the requirement, satisfying the requirement probably
> involves conversion to an exact representation for the operations
> followed by conversion back to a flonum. That's going to be quite
> slow. If speed is one of this procedure's goals, as I gather from
> the discussion, the SRFI shouldn't impose absolute requirements
> that force implementors to make the procedure much slower (on some
> platforms) than the obvious composition.
Will:
In a previous email to this list:
http://srfi-email.schemers.org/srfi-144/msg/5816099
I stated:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
In reviewing my previous comments, I see I should say more about fl+*:
The "fma" operation means "*fused* multiply-add", if it isn't fused it
isn't fma. If fl+* isn't fma, then fl-fast-fl+* isn't FP_FAST_FMA.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The language "as if to infinite precision and rounded only once" is from
the C99 standard (I believe). I don't see any benefit to fma without
the "fused" part of the operation, which requires precisely the "as if
to infinite precision and rounded only once" part.
Brad