compiling on amd opteron and sizeof long double


I have a question which may be quite silly to ask, however, i am having my first compiling experiences on an opteron machine+pgCC/cc+64bit arch. The first thing i wanted to check was the size of data types compiled with pgi. i get below information:

char (bytes): 1
short int: 2
int: 4
long int: 8
int pointer: 8
float: 4
double: 8
double pointer: 4
long double: 8

when i compile on a redhat ES x86_64 x86_64 x86_64 GNU/Linux
AMD Opteron Processor 248
with /usr/pgi/linux86-64/5.2/bin/pgcc.
(with gnu, i get 16B with 64bit compilation and 12 for 32)

is this the expected normal behaviour of sizes/alignments? could anybody confirm and give me some insight?

also, if i wanted to get quadruple precision on the same arch., is there a specific compiler option that you can suggest with pgi?

thanks a lot for any help!

Hi Muge,

Except for the “double pointer”, these look correct. Pointers should all be 8 bytes so I’m not sure why you got 4. There is not support for quad precision since the hardware does not support 128-bit floating point operations. I do believe there are freely available libraries on the web that emulate quad precision, but I don’t have any recommendations and assume that performance would be quite slow.


Hi Mat,
thanks for your reply!
i am sorry to hear about 128-bit fpo.
about doublle pointer: for the same machine, i get a sizeof 8 with gnu compilation.
i will let our sysop know about this issue.
thanks a lot again!