[Bug middle-end/53100] New: Optimize __int128 with range information
marc.glisse at normalesup dot org
gcc-bugzilla@gcc.gnu.org
Tue Apr 24 07:08:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53100
Bug #: 53100
Summary: Optimize __int128 with range information
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: middle-end
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: marc.glisse@normalesup.org
(not sure about the "component" field)
In the following program, on x86_64, the first version generates two imulq,
while the second generates 4 imulq and 2 mulq. It would be convenient if I
could just write the whole code with __int128 and let the compiler do the
optimization by tracking the range of numbers.
int f(int a,int b,int c,int d,int e,int f){
#if 0
long x=a;
long y=b;
long z=c;
long t=d;
long u=e;
long v=f;
return (z-x)*(__int128)(v-y) < (u-x)*(__int128)(t-y);
#else
__int128 x=a;
__int128 y=b;
__int128 z=c;
__int128 t=d;
__int128 u=e;
__int128 v=f;
return (z-x)*(v-y) < (u-x)*(t-y);
#endif
}
More information about the Gcc-bugs
mailing list