8.1. Alignment

Data and code must be aligned to appropriate boundaries. The alignment of accesses can affect performance on ARM cores and can represent a portability problem when moving code from an earlier architecture to ARMv8-A. It is worth being aware of alignment issues for performance reasons, or when porting code that makes assumptions about pointers or 32-bit and 64-bit integer variables.

Previous versions of the ARM compiler syntax assembly provide the ALIGN n directive, where n specifies the alignment boundary in bytes. For example, the directive ALIGN 128 aligns addresses to 128-byte boundaries.

The GNU assember syntax (ARM Complier 6 syntax) provides the .balign n directive, which uses the same format as ALIGN.


GNU syntax assembly also provides the .align n directive. However, the format of n varies from system to system. The .balign directive provides the same alignment functionality as .align with a consistent behavior across all architectures

You should convert all instances of ALIGN n to .balign n whn moving from the older compilers to ARM Compiler 6.

Copyright © 2015 ARM. All rights reserved.ARM DEN0024A