Geert Bosch - Re: [PATCH]: Expand finite() as inline i386 asm (original) (raw)
This is the mail archive of the gcc-patches@gcc.gnu.orgmailing 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] |
- From: Geert Bosch
- To: Richard Henderson
- Cc: Uros Bizjak , GCC Patches
- Date: Thu, 1 Feb 2007 10:11:26 -0500
- Subject: Re: [PATCH]: Expand finite() as inline i386 asm
- References: 5787cf470701250731rb6cba27l360293b491b972a1@mail.gmail.com <20070201005832.GA8302@redhat.com>
On Jan 31, 2007, at 19:58, Richard Henderson wrote:
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)
The 'Valid attribute in Ada (see s-fatgen.adb, function Valid) does essentially the same in a target-independent way. Also, by keeping the entire operation in the integer domain, it avoids trapping on some architectures (e.g. MIPS).
It generates the following code for x86 (single): _ada_is_valid: .LFB4: movl 4(%esp), %eax andl $2139095040, %eax cmpl $2139095040, %eax setne %al ret
for x86 double: _ada_is_valid: .LFB4: subl $28, %esp .LCFI0: movl 36(%esp), %eax andl $2146435072, %eax shrl $20, %eax cmpl $2047, %eax setne %al addl $28, %esp ret .LFE4:
(Of course the extra stack adjustments should have been optimized away)
- Follow-Ups:
- Re: [PATCH]: Expand finite() as inline i386 asm
* From: Richard Henderson
- Re: [PATCH]: Expand finite() as inline i386 asm
- References:
- Re: [PATCH]: Expand finite() as inline i386 asm
* From: Richard Henderson
- Re: [PATCH]: Expand finite() as inline i386 asm
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |