surprising optimization of comparison operations for __int128_t

Mathieu Lacage mathieu.lacage@gmail.com
Fri Jul 9 10:35:00 GMT 2010


On Fri, Jul 9, 2010 at 11:33 AM, Andrew Haley <aph@redhat.com> wrote:

> g++ seems to be generating a specialization of run_cmp() in the
> __int128_t case, with the parameters a and b fixed at a=1 and b=2, in
> an attempt to do some constant propagation.  This ought to help, but
> unfortunately the back-end generates worse code for the specialized
> case.

Interesting: this is what the clone thing is about then. I found this
issue only because I am actually doing some benchmarking and am trying
to evaluate the average cost of a 128bit comparison (compared to other
things). Do you know of a way to convince gcc to not generate this
specialization so that I really measure the generic comparison
function ? I guess that I could pull the constant values from the
command line to ensure that gcc does not generate this specialization
but is there a better way ?

Mathieu
-- 
Mathieu Lacage <mathieu.lacage@gmail.com>



More information about the Gcc-help mailing list