Article: AMD's Jaguar Microarchitecture
By: UnmaskedUnderflow (unmasked.delete@this.unmasked.org), April 7, 2014 1:11 pm
Room: Moderated Discussions
Wilco (Wilco.Dijkstra.delete@this.ntlworld.com) on April 7, 2014 1:50 pm wrote:
> UnmaskedUnderflow (unmasked.delete@this.unmasked.org) on April 7, 2014 12:26 pm wrote:
> > Michael S (already5chosen.delete@this.yahoo.com) on April 7, 2014 5:39 am wrote:
> > > Wilco (Wilco.Dijkstra.delete@this.ntlworld.com) on April 7, 2014 3:27 am wrote:
> > > > >
> > > > > The real problem is more exotic - x87 precision control can reduce the precision of
> > > > > mantissa, but it can't reduce the range of exponent. So, results of x87 computations
> > > > > with single or double precision remain the same as specified by IEEE only as long as
> > > > > you stay within official range. Which sounds nearly impossible in practice.
> > > >
> > > > You can store to memory after every operation to get the exponent right - this is still
> > > > not IEEE compliant as denormals suffer from double rounding. Of course doing this causes
> > > > another performance penalty but at least it gives more consistent results than variables
> > > > whose values suddenly change due to needing to be spilled to memory by the compiler.
> > > >
> > > >
> > > > Basically you cannot get IEEE results from x87. Quite ironic since
> > > > x87 was supposed to be the first IEEE implementation...
> > > >
> > >
> >
> > This part of the conversation is confusing details. x87 precision will correctly round
> > once if you set it to DP/SP and produce the correct memory result internally.
>
> If only - my point was that it doesn't produce correct SP/DP results. See eg. http://hal.archives-ouvertes.fr/docs/00/28/14/29/PDF/floating-point-article.pdf
> for a good writeup of the many pitfalls of x87.
Page 13 of that exact paper "
but the value that z2
holds will have been doubly rounded (first to extended precision, then to double
precision for storing to z2) while z1 holds a value directly rounded to double
precision"
matches what you didn't quote from me
"
It is ONLY if you set precision to EP, then store it as a DP to memory. You are turning it into two operations -- operation then store/convert. That's the famous "double-round" bit. Per operation, that is exactly IEEE compliant.
"
To Michael's point, I do not recall what happens on double denorms in EP, been too long for me. You/Wilco may be right since the exponents are held in EP. If this small sub-section of sub-sections is causing you math pain, yikes?
>
> I'm not sure what you mean, what is your point? You're right, most people do not know or
> care about these issues (I've had the misfortune of running an IEEE test on a simulator that
> used the x87 FPU...), however the many problems meant the world quickly adopted SSE.
>
> Wilco
>
I'm not sure what we're arguing about at this point? If you want to hear that ARM kicks x86's butt in masked denormals, yes, big time. But x87 being "wrong" is a bit of a stretch. It does precisely what the spec says it does...
Again, I'll stop. Defending x87 was not my intent. By all means move on, please!
> UnmaskedUnderflow (unmasked.delete@this.unmasked.org) on April 7, 2014 12:26 pm wrote:
> > Michael S (already5chosen.delete@this.yahoo.com) on April 7, 2014 5:39 am wrote:
> > > Wilco (Wilco.Dijkstra.delete@this.ntlworld.com) on April 7, 2014 3:27 am wrote:
> > > > >
> > > > > The real problem is more exotic - x87 precision control can reduce the precision of
> > > > > mantissa, but it can't reduce the range of exponent. So, results of x87 computations
> > > > > with single or double precision remain the same as specified by IEEE only as long as
> > > > > you stay within official range. Which sounds nearly impossible in practice.
> > > >
> > > > You can store to memory after every operation to get the exponent right - this is still
> > > > not IEEE compliant as denormals suffer from double rounding. Of course doing this causes
> > > > another performance penalty but at least it gives more consistent results than variables
> > > > whose values suddenly change due to needing to be spilled to memory by the compiler.
> > > >
> > > >
> > > > Basically you cannot get IEEE results from x87. Quite ironic since
> > > > x87 was supposed to be the first IEEE implementation...
> > > >
> > >
> >
> > This part of the conversation is confusing details. x87 precision will correctly round
> > once if you set it to DP/SP and produce the correct memory result internally.
>
> If only - my point was that it doesn't produce correct SP/DP results. See eg. http://hal.archives-ouvertes.fr/docs/00/28/14/29/PDF/floating-point-article.pdf
> for a good writeup of the many pitfalls of x87.
Page 13 of that exact paper "
but the value that z2
holds will have been doubly rounded (first to extended precision, then to double
precision for storing to z2) while z1 holds a value directly rounded to double
precision"
matches what you didn't quote from me
"
It is ONLY if you set precision to EP, then store it as a DP to memory. You are turning it into two operations -- operation then store/convert. That's the famous "double-round" bit. Per operation, that is exactly IEEE compliant.
"
To Michael's point, I do not recall what happens on double denorms in EP, been too long for me. You/Wilco may be right since the exponents are held in EP. If this small sub-section of sub-sections is causing you math pain, yikes?
>
> I'm not sure what you mean, what is your point? You're right, most people do not know or
> care about these issues (I've had the misfortune of running an IEEE test on a simulator that
> used the x87 FPU...), however the many problems meant the world quickly adopted SSE.
>
> Wilco
>
I'm not sure what we're arguing about at this point? If you want to hear that ARM kicks x86's butt in masked denormals, yes, big time. But x87 being "wrong" is a bit of a stretch. It does precisely what the spec says it does...
Again, I'll stop. Defending x87 was not my intent. By all means move on, please!