This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -mno-fancy-math-387 doesn't work with -mpentium3 in gcc 3.1
- From: Jan Hubicka <jh at suse dot cz>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 22 Jul 2002 12:17:42 +0200
- Subject: Re: -mno-fancy-math-387 doesn't work with -mpentium3 in gcc 3.1
- References: <20020721230615.A15646@lucon.org>
> # ../xgcc -B../ ~/work/gnu/import/gcc-3.1/gcc/testsuite/gcc.dg/i386-387-1.c -ffast-math -mfpmath=387 -mno-fancy-math-387 -S -O -mcpu=i386 -march=pentium3
> # cat i386-387-1.s
You need -ffast-math in addition to fancy math as fsin is not 100%
compatible with C standard notion of sin (it does not work for out of
range values)
It may be interesting to inline the fast path of fsin instruction tought
- the overflows are signalized in standard integer flags.
Honza
> .file "i386-387-1.c"
> .text
> .align 2
> .globl f1
> .type f1,@function
> f1:
> pushl %ebp
> movl %esp, %ebp
> fldl 8(%ebp)
> fsin
> leave
> ret
> .Lfe1:
> .size f1,.Lfe1-f1
> .align 2
> .globl f2
> .type f2,@function
> f2:
> pushl %ebp
> movl %esp, %ebp
> fldl 8(%ebp)
> fcos
> leave
> ret
> .Lfe2:
> .size f2,.Lfe2-f2
> .align 2
> .globl f3
> .type f3,@function
> f3:
> pushl %ebp
> movl %esp, %ebp
> fldl 8(%ebp)
> fsqrt
> leave
> ret
> .Lfe3:
> .size f3,.Lfe3-f3
> .ident "GCC: (GNU) 3.1.1 20020719 (prerelease)"