On the Alpha architecture, memory references to data that is not naturally aligned may result in alignment faults, which can severely degrade the performance of all procedures that reference the unnaturally aligned data.
To avoid such performance degradation, all data values on Alpha systems should be naturally aligned. Moreover, the base address of a global variable or aggregate (but not necessarily the components of the aggregate) shared across a standard call must be quadword aligned. Table 4-3 shows the data alignment recommendations for non-global data.
Table 4-3 Data Alignment Addresses
Data type | Alignment starting position |
8-bit character string | Byte boundary |
16-bit integer | Address that is a multiple of 2 (word alignment) |
32-bit integer | Address that is a multiple of 4 (longword alignment) |
64-bit integer | Address that is a multiple of 8 (quadword alignment) |
IEEE floating single S | Address that is a multiple of 4 (longword alignment) |
IEEE floating double T | Address that is a multiple of 8 (quadword alignment) |
IEEE floating extended X | Address that is a multiple of 16 (octaword alignment) |
IEEE floating single S complex | Address that is a multiple of 4 (longword alignment) |
IEEE floating double T complex | Address that is a multiple of 8 (quadword alignment) |
IEEE floating extended X complex | Address that is a multiple of 16 (octaword alignment) |
For aggregates such as strings, arrays, and records, the data type to be considered for purposes of alignment is not the aggregate itself, but the elements of which the aggregate is composed. The alignment requirement of an aggregate is that all elements of the aggregate should be naturally aligned. Varying 8-bit character strings must, for example, start at addresses that are a multiple of at least 2 (word alignment) because of the 16-bit count at the beginning of the string; 32-bit integer arrays start at a longword boundary, irrespective of the extent of the array.
Note that the rules for passing an argument that is a record by value always provide quadword alignment of the record value independent of the normal alignment requirement of the record. If deemed appropriate by an implementation, normal alignment can be established within the called procedure by making a copy of the record argument at a suitably aligned location.