1 Feb 2007 01:58
Re: [PATCH]: Expand finite() as inline i386 asm
Richard Henderson <rth <at> redhat.com>
2007-02-01 00:58:32 GMT
2007-02-01 00:58:32 GMT
On Thu, Jan 25, 2007 at 04:31:16PM +0100, Uros Bizjak wrote:
> Attached patch expands call to finite(), finitef() and finitel() as
> inline i386 asm (and produces the same code as is present in libm for
> those functions).
First, I'd rather any internals like optabs etc reference the
C99 function isfinite, rather than the BSD name.
Second, as I mentioned in the notes for PR 30652, I suspect
that using non-trapping comparisons will result in better
code than all these bit manipulations. I.e.
isfinite(d) => islessequal(fabs(d), DBL_MAX)
> subl $12, %esp
> movl $-1048577, %eax
> flds .LC0
> faddl 16(%esp)
> fstpl (%esp)
> movl 4(%esp), %edx
> addl $12, %esp
> subl %edx, %eax
> xorl %edx, %eax
> shrl $31, %eax
> ret
fldl 4(%esp)
xorl %eax, %eax
fabs
fldl .LC0
(Continue reading)
RSS Feed