This is the mail archive of the gcc-help@gcc.gnu.org mailing 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]

surprising optimization of comparison operations for __int128_t


hi,

The attached C++ testcase compares the performance behavior of
__int128_t used directly vs __int128_t used through an overloaded
operator <. The overloaded < operator appears faster than the raw
__int128_t which I find really surprising so, I fear I am not
measuring what I think I am measuring. Hints ?

[mathieu@mathieu-laptop benchmark-time]$ g++ --version
g++ (GCC) 4.4.3 20100127 (Red Hat 4.4.3-4)
[mathieu@mathieu-laptop benchmark-time]$ g++ -O3 test.cc
# run raw __int128_t version
[mathieu@mathieu-laptop benchmark-time]$ time -p ./a.out 100000002 a
16384
2
real 0.60
user 0.60
sys 0.00
# run operator < version
[mathieu@mathieu-laptop benchmark-time]$ time -p ./a.out 100000002 test
16384
2
real 0.40
user 0.40
sys 0.00


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

Attachment: test.cc
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]