Data Type Storage

For basic (scalar) types, the minimum alignment of an object is the size of its type. The minimum alignment for an object with an array type is that specified by the type of its elements.

For general information about data types, see Section 5.3. Table 6-1 lists register and memory storage for various data types:

Table 6-1 Data Representation in Registers and Memory

Data Type Register Storage Memory Storage
char Bits 0-7 of register 8 bits aligned to 8-bit boundary
unsigned char Bits 0-7 of register 8 bits aligned to 8-bit boundary
short Bits 0-15 of register 16 bits aligned to 16-bit boundary
unsigned short Bits 0-15 of register 16 bits aligned to 16-bit boundary
int Bits 0-31 of register 32 bits aligned to 32-bit boundary
unsigned int Bits 0-31 of register 32 bits aligned to 32-bit boundary
long Entire scalar register or bits 0-63 of vector register 64 bits aligned to 64-bit boundary
unsigned long Entire scalar register or bits 0-63 of vector register. 64 bits aligned to 64-bit boundary
enum (1) Bits 0-31 of register or entire register 32 bits aligned to 32-bit boundary or 64 bits aligned to 64-bit boundary
float Bits 0-31 of register 32 bits aligned to 32-bit boundary
double Entire scalar register or bits 0-63 of vector register. 64 bits aligned to 64-bit boundary
long double Entire scalar register or bits 0-63 of vector register. 64 bits aligned to 64-bit boundary
struct Members are stored as their individual types require. Storage is a multiple of the alignment to the boundary of largest member type; members are stored and aligned as their individual types require.
array Members are stored as their individual types require. Members are stored as their individual types require. All arrays inside a structure are aligned according to the type of each element in the array.
pointer to data member Entire scalar register or bits 0-63 of vector register. 64 bits aligned to 64-bit boundary
pointer to member function Components stored as their individual types require 64 bits aligned to 64-bit boundary
cchar Bits 0-15 of register 8 bits aligned to 8-bit boundary
cshort Bits 0-31 of register 16 bits aligned to 16-bit boundary
cint Entire scalar register or bits 0-63 of vector register 64 bits aligned to 32-bit boundary
cfloat Entire scalar register or bits 0-63 of vector register 64 bits aligned to 32-bit boundary
clong Bits 0-127 of vector register 128 bits aligned to 64-bit boundary
cdouble Bits 0-127 of vector register 128 bits aligned to 64-bit boundary
For details about the size of an enum type, see Section 5.3.1.

For vector data types, the minimum alignment of an object is specified by the type of its elements.