[LLVMdev] TSVC/Equivalencing-dbl

Duncan Sands baldrick at free.fr
Fri Oct 5 10:06:22 PDT 2012


Hi Hal, I was looking into why this fails with dragonegg, and noticed the
following: if I compile with GCC (-O0) then I get as output:

Running each loop 3125 times...

Loop 	 Time(Sec) 	 Checksum
S421	 0.00 		32010.620068485
S1421	 0.00 		16000
S422	 0.00 		3.7377231414078
S423	 0.00 		32000.736895702
S424	 0.00 		32822.36069424

This is the same as the reference output.  If I run exactly the same program
under valgrind then I get:

Running each loop 3125 times...

Loop 	 Time(Sec) 	 Checksum
S421	 0.00 		32010.620068485
S1421	 0.00 		17208.404325315
S422	 0.00 		3.7377231414078
S423	 0.00 		32000.736895702
S424	 0.00 		32822.36069424

This is the same except for the S1421 line.

When built in the testsuite with dragonegg (which means optimized) I get:

Running each loop 3125 times...

Loop     Time(Sec)       Checksum
S421     0.00           32010.620068485
S1421    0.00           17208.404325315
S422     0.00           3.7377231414078
S423     0.00           32000.736895702
S424     0.00           32822.36069424

Which is *exactly* the same as when using valgrind!

Interestingly, the main difference between valgrind emulated floating point and
the real behaviour of the processor is that valgrind doesn't support 80 bit
extended precision floating point: it does everything in 64 bits instead.  So I
wonder if these differences are basically due to whether operations are going in
and out of memory (-> 64 bits) or using 80 bit precision, or something else that
may change rounding...

Any thoughts?

Ciao, Duncan.



More information about the llvm-dev mailing list