floating point inconsistency

Cedric Roux cedric.roux@acri-st.fr
Tue Feb 16 13:30:00 GMT 2010

Christoph Groth wrote:
> Now the question remains whether this is a bug in gcc or not.

I doubt it.

.globl _start
        fldl    angle
        fstpl   result
        mov     $4, %eax
        mov     $1, %ebx
        mov     $result, %ecx
        mov     $8, %edx
        int     $0x80
        movl    $1, %eax
        xorl    %ebx, %ebx
        int     $0x80

.align 8
.globl angle
.globl result
.byte 0x3f, 0x73, 0x11, 0xf7, 0xa3, 0x38, 0xe3, 0x3f

.byte 0, 0, 0, 0, 0, 0, 0, 0
gives that:

on the AMD:
/users/cro> ./a.out |od -tx1
0000000 75 d8 82 70 13 66 ea 3f

on the intel:
/users/cro> ./a.out |od -tx1
0000000 76 d8 82 70 13 66 ea 3f

on my 32b computer, it's same result as intel 64b.
Maybe a rounding issue on the AMD?
(one should do the computation by hand or with some
soft mathematical library to get more precision and
see what the next bit is so to know for sure what
truncation has to be done...)

More information about the Gcc-help mailing list