This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC options and floating-point correctness (benchmarks)


On Fri, 26 Mar 2004, Joe Buck wrote:
> I have not seen the assembly code that they are producing.  Evidently
> they do not simply reduce it to a constant, though they take shortcuts.
> So let's be sure before we accuse them.

int foo(double a, double b, double c)
{
  return (a+b)+c == a+(b+c);
}


; -- Machine type IA32
; mark_description "Intel(R) C++ Compiler for 32-bit applications, Version 7.1   Build 20030307Z";
; mark_description "-Qvc6 -Qlocation,link,C:\\Program Files\\Microsoft Visual Studio\\VC98\\Bin -nologo -FA -O2 -Ob2";
;ident "Intel(R) C++ Compiler for 32-bit applications, Version 7.1   Build 20030307Z"

_foo	PROC NEAR
.B1.1:                          ; Preds .B1.0
        push      ebx                                           ;2.1
        mov       ebx, esp                                      ;2.1
        and       esp, -8                                       ;2.1
        fld       QWORD PTR [ebx+8]                             ;1.5
        fadd      QWORD PTR [ebx+16]                            ;3.13
        fadd      QWORD PTR [ebx+24]                            ;3.26
        mov       edx, 1                                        ;3.26
        fcomp     st(0)                                         ;3.26
        fnstsw    ax                                            ;3.26
        xor       ecx, ecx                                      ;3.26
        sahf                                                    ;3.26
        mov       eax, edx                                      ;3.26
        je        .L1           ; Prob 50%                      ;3.26
        mov       eax, ecx                                      ;3.26
.L1:                                                            ;
        mov       esp, ebx                                      ;3.26
        pop       ebx                                           ;3.26
        ret                                                     ;3.26


Roger
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]