#include <iostream>
#include <stdint.h>
using namespace std;
typedef __int128_t int128_t;
int main() {
int128_t y = 0;
cout<<__builtin_clzll(static_cast<unsigned long long>(y>>64)) <<endl;
cout<<__builtin_clzll(static_cast<unsigned long long>(0)) <<endl;
}
the output: 63 64
gcc version 5.3.0 20151204
why the results is wrong? is there any other way to count leading zeros of int128_t.