Comment 4 for bug 408694

Revision history for this message
Ross M. (rwmcfa1) wrote : Re: [Bug 408694] Re: main.func_math fails due to precision error

On Mon, Aug 3, 2009 at 10:18 PM, Stewart Smith<email address hidden> wrote:
> would you be able to attach the disassembly of the test program (just
> the relevant bits, don't need whole objdump) from each platform?
>
> Also try with -O0 and -fno-builtins (or whatever it is)

made slight modifications to my test program so that the log calls
weren't going directly in to printf, compiled with -g -O0 -fno-builtin
results are identical, objdump info follows...

linux:
  double logx = log(x);
  4006b2: f2 0f 10 45 f8 movsd -0x8(%rbp),%xmm0
  4006b7: e8 dc fe ff ff callq 400598 <log@plt>
  4006bc: f2 0f 11 45 f0 movsd %xmm0,-0x10(%rbp)
  double log3 = log(3.0);
  4006c1: f2 0f 10 05 87 01 00 movsd 0x187(%rip),%xmm0
 # 400850 <_IO_stdin_used+0x28>
  4006c8: 00
  4006c9: e8 ca fe ff ff callq 400598 <log@plt>
  4006ce: f2 0f 11 45 e8 movsd %xmm0,-0x18(%rbp)
  double logxlog3 = log(x) / log(3.0);
  4006d3: f2 0f 10 45 f8 movsd -0x8(%rbp),%xmm0
  4006d8: e8 bb fe ff ff callq 400598 <log@plt>
  4006dd: f2 0f 11 45 d8 movsd %xmm0,-0x28(%rbp)
  4006e2: f2 0f 10 05 66 01 00 movsd 0x166(%rip),%xmm0
 # 400850 <_IO_stdin_used+0x28>
  4006e9: 00
  4006ea: e8 a9 fe ff ff callq 400598 <log@plt>
  4006ef: f2 0f 10 4d d8 movsd -0x28(%rbp),%xmm1
  4006f4: f2 0f 5e c8 divsd %xmm0,%xmm1
  4006f8: 66 0f 28 c1 movapd %xmm1,%xmm0
  4006fc: f2 0f 11 45 e0 movsd %xmm0,-0x20(%rbp)

freebsd:
  double logx = log(x);
  4006e6: f2 0f 10 45 e0 movsd 0xffffffffffffffe0(%rbp),%xmm0
  4006eb: e8 84 fe ff ff callq 400574 <_init+0x44>
  4006f0: f2 0f 11 45 e8 movsd %xmm0,0xffffffffffffffe8(%rbp)
  double log3 = log(3.0);
  4006f5: f2 0f 10 05 23 01 00 movsd 291(%rip),%xmm0
# 400820 <_fini+0x88>
  4006fc: 00
  4006fd: e8 72 fe ff ff callq 400574 <_init+0x44>
  400702: f2 0f 11 45 f0 movsd %xmm0,0xfffffffffffffff0(%rbp)
  double logxlog3 = log(x) / log(3.0);
  400707: f2 0f 10 45 e0 movsd 0xffffffffffffffe0(%rbp),%xmm0
  40070c: e8 63 fe ff ff callq 400574 <_init+0x44>
  400711: f2 0f 11 45 d8 movsd %xmm0,0xffffffffffffffd8(%rbp)
  400716: f2 0f 10 05 02 01 00 movsd 258(%rip),%xmm0
# 400820 <_fini+0x88>
  40071d: 00
  40071e: e8 51 fe ff ff callq 400574 <_init+0x44>
  400723: f2 0f 10 4d d8 movsd 0xffffffffffffffd8(%rbp),%xmm1
  400728: f2 0f 5e c8 divsd %xmm0,%xmm1
  40072c: 66 0f 28 c1 movapd %xmm1,%xmm0
  400730: f2 0f 11 45 f8 movsd %xmm0,0xfffffffffffffff8(%rbp)

--
-rm