[Bug target/57056] New: Missed optimization of finite finite builtin
neleai at seznam dot cz
gcc-bugzilla@gcc.gnu.org
Wed Apr 24 16:36:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57056
Bug #: 57056
Summary: Missed optimization of finite finite builtin
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: neleai@seznam.cz
Created attachment 29930
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29930
benchmark
Hi,
Current builtin finite is slower on attached benchmark than my version.
It also needs to load 64bit constants which is not friendly to code size.
My version is:
int finite4(double x)
{
uint64_t lx;
EXTRACT_WORDS64(lx,x);
lx=lx>>52;
return ((lx&0x7ff)!=0x7ff);
}
Most of uses of isfinite()/finite() function are in condition so I benchmark
finite in condition.
Benchmark is run by
for i in `seq 0 7`; do echo finite$i; gcc finite_bench.c -O3 -Wall -W
-fno-builtin-finite -Dfinite=finite$i; for j in `seq 1 8`; do /usr/bin/time -f
"%U" ./a.out; done; done
More information about the Gcc-bugs
mailing list