I’m a bit curious about sizes of various integral types on different platforms, and I’d really appreciate a little help from people running various non-common architectures/toolchains. I’ve prepared a little package which just tries to get various type sizes using the C++ compiler, and I’d really appreciate if you could run it and paste the results in a comment.
To run it:
wget http://dev.gentoo.org/~mgorny/cxx-type-sizes-0.tar.bz2
tar -xf cxx-type-sizes-0.tar.bz2
cd cxx-type-sizes-0/
./configure
make
cat output/_all
It will try to compile a few programs, and then run them. Then it concatenates the results into output/_all
and that’s the file I’d like to get, along with your platform, toolchain, CHOST and ARCH, ABI and everything else you consider relevant.
I’d really like to get a single output for each architecture, and possibly additional outputs if some toolchain/other magic resulted in different results than the previous one. I’ll put the results then into a nice table. Thanks in advance.
And mine: amd64, gcc (Gentoo 4.7.1 p1.0, pie-0.5.3) 4.7.1
From monolith, the Gentoo Dev Alpha (EV68AL, aka 21264B) I’m admin of:
$ gcc –version
gcc (Gentoo 4.5.3-r2 p1.1, pie-0.4.7) 4.5.3
Full log: http://kaini.schwarzvogel.de/~klausman/its_results.txt
g++ (Gentoo 4.5.3-r2 p1.1, pie-0.4.7) 4.5.3
mips64el-unknown-linux-gnu-4.5.3
cpu model : ICT Loongson-2 V0.3 FPU V0.1
SLES11.1 IBM power7 gcc-4.7.1 (default 64 bit):
int: 1;8;7;8;15;16;31;32;63;64;
longlong: 63;64;
stdint: 7;8;15;16;-;-;31;32;63;64;-;-;
stdint-least: 7;8;15;16;-;-;31;32;63;64;-;-;
stdint-fast: 7;8;63;64;-;-;63;64;63;64;-;-;
int128: 127;
stdint-other: 63;64;63;64;
ptr: 0;64;0;64;0;64;
float: 24;32;53;64;
lfloat: 106;128;
SLES11.1 Power7 IBM xl compiler (default 32 bit)
int: 1;8;7;8;15;16;31;32;31;32;
longlong: 63;64;
stdint: 7;8;15;16;-;-;31;32;63;64;-;-;
stdint-least: 7;8;15;16;-;-;31;32;63;64;-;-;
stdint-fast: 7;8;31;32;-;-;31;32;63;64;-;-;
int128: 63;
stdint-other: 31;32;63;64;
ptr: 0;32;0;32;0;32;
float: 24;32;53;64;
lfloat: 106;128;
Hmm, do you maybe have the run log for the 32-bit run? Or result of
sizeof(__int128)
. I’m pretty curious because your results would mean that__int128
in that compiler is 64-bit…For the ibm xl compiler (xlC) this is the 32bit run. The 64 bit one is identical to the one from gcc-4.7.1 I cannot give you a 32 bit with a gnu compiler – I haven’t figured the magic formula to make it work.
Now the 64 bit run with
./configure CXX=xlC_r CXXFLAGS=-q64
int: 1;8;7;8;15;16;31;32;63;64;
longlong: 63;64;
stdint: 7;8;15;16;-;-;31;32;63;64;-;-;
stdint-least: 7;8;15;16;-;-;31;32;63;64;-;-;
stdint-fast: 7;8;63;64;-;-;63;64;63;64;-;-;
int128: 63;
stdint-other: 63;64;63;64;
ptr: 0;64;0;64;0;64;
float: 24;32;53;64;
lfloat: 106;128;
So it looks like to me xlC has just a very strange definition of int128.
It might be that, or that
std::numeric_limits
are mis-defined for it.Try the following:
Sorry – include what? In that code snippet.
Never mind, I figured it out, it says 8.
Yes, then indeed it is 64-bit.
Portage 2.2.0_alpha121 (default/linux/amd64/10.0, gcc-4.6.3, glibc-2.15-r2, 3.5.1-vs2.3.4.1 x86_64)
System uname:
Linux-3.5.1-vs2.3.4.1-x86_64-Intel-R-_Core-TM-_i7-3770K_CPU_@_3.50GHz-with-gentoo-2.1
int: 1;7;7;8;15;16;31;32;63;64;
longlong: 63;64;
stdint: 7;8;15;16;-;-;31;32;63;64;-;-;
stdint-least: 7;8;15;16;-;-;31;32;63;64;-;-;
stdint-fast: 7;8;63;64;-;-;63;64;63;64;-;-;
int128: 0;
stdint-other: 63;64;63;64;
ptr: 0;64;0;64;0;64;
float: 24;32;53;64;
lfloat: 64;128;
ia64
s390
s390x
sh
sparc
arm
I forgot to say that all of the results are done with gcc-4.5.3(i.e, current stable)
I’ve also tried with the Intel compiler 11.1.072 on an x86-64 machine with the same results as gcc.
A lot of thanks for so many results. However, could you clarify arm a little bit? I believe there’s a lot of ABIs on that platform…
The results are from an armv7a hardfloat EABI toolchain.
BTW, s390 = 31bits(yes, 31), s390x = 64bits
Western Digital MyBook World Edition II
(it doesn’t run Gentoo… yet… maybe won’t ever…)