Julian Seward [mailto:jsew...@acm.org] wrote:

> Even then it's not simple.  The x87 control word has a bit-pair that
> controls the default x87 FP precision.  Currently V ignores all attempts to
> change it, and just does its thing at 64 bits.  If 80-bit arithmetic
> becomes supported, and V ignores attempts to change the precision away
> from 80 bits, will we have people complaining that the default precision
> can't be changed away from 80 bit?

Yes. Loudly. If x87 is stuck at 80-bit evaluation, Valgrind will become
significantly less useful to me. The reasons go like this:

The x87 hardware powers up at its 80-bit evaluation setting, and Linux
does not change this. This means that arithmetic done with ordinary doubles,
not long doubles, in code that is trying quite hard to be portable, is
evaluated to 80-bit precision while it stays in x87 registers, but rounded
to 64-bit when saved back into memory. In any code in C or any higher level
language that's the slightest bit complicated, this rounding happens at
essentially random places, subject to change whenever the code is changed.
Coding round this isn't really practical, if you have lots of floating-point
code.

This means that if I leave the x87 set to 80-bit evaluation, I get quite
a lot of differences from platforms with normal 64-bit doubles. Saying
"they're more correct" doesn't help, because the random rounding means that
usually isn't true. If I set the x87 to 64-bit evaluation, then Linux produces
very similar results to other platforms, and that matters a lot.

So Valgrind's current approach matches what I need. But if x87 becomes always
80-bit, with no way to change back to 64-bit, then I'm going to have a
problem. Because of the arithmetic differences, evaluation will take sometimes
take different paths, which means different memory allocations, and so on.
Valgrind execution becomes a lot less similar to real use, which makes memcheck
testing significantly less useful.

--
John Dallman


-----------------
Siemens Industry Software Limited is a limited company registered in England 
and Wales.
Registered number: 3476850.
Registered office: Faraday House, Sir William Siemens Square, Frimley, Surrey, 
GU16 8QD.

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to