Linux Standard Base Specification for the Itanium™ Architecture 1.3 | ||
---|---|---|
Prev | Chapter 2. Machine Interface | Next |
See Itanium ™ Software Conventions & Runtime Architecture Guide Chapter 4.
Within this specification, the term byte refers to an 8-bit object, the term halfword refers to a 16-bit object, the term word refers to a 32-bit object, the term doubleword refers to a 64-bit object, and the term quadword refers to a 128-bit object. Although the Itanium™ architecture also supports 120-bit addressable objects, this specification does not require LSB-conforming implementations to provide support for these objects.
LSB-conforming applications shall use little-endian byte ordering. LSB-conforming implementations may support big-endian applications.
Table 2-1 describes how fundemental C language data types shall be represented:
Table 2-1. Scalar Types
Type | C | sizeof | Alignment (bytes) | Notes |
---|---|---|---|---|
Integral | char | 1 | 1 | |
signed char | ||||
unsigned char | ||||
short | 2 | 2 | ||
signed short | ||||
unsigned short | ||||
int | 4 | 4 | ||
signed int | ||||
unsigned int | ||||
long | 8 | 8 | ||
signed long | ||||
unsigned long | ||||
long long | 8 | 8 | See Note Below | |
signed long long | ||||
unsigned long long | ||||
Pointer | any-type * | 8 | 8 | |
any-type (*)() | ||||
Floating-Point | float | 4 | 4 | |
double | 8 | 8 | ||
long double | 16 | 16 |
Support for the long long data type is dependent on support for ISO9899:1999 C language. This standard is not required for LSB-conformance, but this data type is important when developing applications for the Itanium™ architecture. The GNU Compiler Collection (gcc) includes support for long long of ISO9899:1999. |
A null pointer (for all types) shall have the value zero.
Aggregates (structures and arrays) and unions assume the alignment of their most strictly aligned component. The size of any object, including aggregates and unions, shall always be a multiple of the object's alignment. An array uses the same alignment as its elements. Structure and union objects may require padding to meet size and element constraints. The contents of such padding is undefined.
An entire structure or union object shall be aligned on the same boundary as its most strictly aligned member.
Each member shall be assigned to the lowest available offset with the appropriate alignment. This may require internal padding, depending on the previous member.
A structure's size shall be increased, if necessary, to make it a multiple of the alignment. This may require tail padding, depending on the last member.
A conforming application shall not read padding.
C struct and union definitions may have bit-fields, which define integral objects with a specified number of bits.
Bit fields that are declared with neither signed nor unsigned specifier shall always be treated as unsigned. Bit fields obey the same size and alignment rules as other structure and union members, with the following additional properties:
Bit-fields are allocated from right to left (least to most significant).
A bit-field must entirely reside in a storage unit for its appropriate type. A bit field shall never cross its unit boundary.
Bit-fields may share a storage unit with other struct/union members, including members that are not bit fields. Such other struct/union members shall occupy different parts of the storage unit.
The type of unnamed bit-fields shall not affect the alignment of a structure or union, although individual bit-field member offsets shall obey the alignment constraints.
Figure 2-4. Bit-Field Ranges
Bit-field Type | Width w | Range | ||
---|---|---|---|---|
| 1 to 8 |
| ||
| 1 to 16 |
| ||
| 1 to 32 |
| ||
| 1 to 64 |
|