A pointer can look innocent in source code while carrying an unusually strong promise to the compiler. The program says that data is aligned, so the compiler is permitted to act as if the address has the required relationship to a boundary. That promise is about correctness before it is about speed. A different question asks how much work the processor needs to service a particular access. Writing both questions in the same margin as “unaligned is slow” loses the distinction that determines whether the program is merely inefficient or actually wrong.
Margin note: an address is aligned to a positive power-of-two boundary when its numerical value is a multiple of that boundary. The property belongs to the particular address, not permanently to the allocation’s name. An aligned base plus an arbitrary byte offset need not remain aligned to the original boundary. This is the first detail worth checking when a loop begins at a selected element rather than at the beginning of an array. The allocation and the load do not necessarily present the same address, even though both are described casually as accessing the aligned buffer.
What was promised to the instruction?
The Intel Intrinsics Guide distinguishes operations with aligned and unaligned memory requirements. The exact instruction and width matter. An operation whose contract requires a particular alignment cannot be made safe by assuming that a recent processor will be forgiving. On the other hand, an unaligned form is an explicit operation with its own documented behavior. Its existence does not mean that every possible address is accessible or that an access crossing into an unmapped page becomes valid. Alignment is one condition among the conditions needed for a legal memory reference.
The familiar load and loadu naming pattern is a useful reminder, but names are not a substitute for the documented intrinsic. Code can use different widths, instruction sets, and operand types. Some operations have different alignment requirements from the examples a programmer remembers. A compiler can also choose an instruction sequence rather than preserve a one-to-one visual correspondence with source operations. The reliable question is which contract the source establishes and what the generated instructions require. Treating every vector access as the same generic SIMD load conceals exactly the differences that make alignment relevant.
Margin note: let an invented buffer begin at byte address 4096 and consider a 32-byte vector access. The base is a multiple of 32. An access beginning at 4100 is displaced by four bytes and is not 32-byte aligned. Both facts follow from address arithmetic, without measuring a processor. Whether the second access is valid depends on the chosen operation and the accessible memory range. Whether it is expensive is a separate question about how that operation interacts with the implementation. The numbers are teaching addresses, not observations from an application’s address space.
A compiler assumption can introduce the promise without an explicit aligned-load intrinsic. GCC documents alignment built-ins that let code convey alignment information. Such information can enable transformations because the compiler is allowed to rely on it. It is not a runtime repair operation that moves a misplaced object onto a boundary. If the claim is false, reasoning based on it becomes unsafe under the relevant language and compiler rules. This is why an alignment assertion belongs beside evidence about the actual address and any offset, rather than beside a wish that the generated loop should run faster.
A library boundary is an especially easy place to lose the evidence. One function allocates storage with an alignment guarantee; another receives an interior pointer. The second function may not know whether the offset preserves the guarantee. Conversely, a function that accepts arbitrary addresses may legitimately use an operation designed for them rather than require callers to reorganize their data. The interface needs to say which condition it accepts. That design decision affects both the set of legal callers and the transformations available inside the implementation. Alignment is therefore part of an interface contract, not merely an aesthetic property of memory layout.
Where the access falls
Now put correctness to one side and examine a valid unaligned access. A processor works with memory structures whose boundaries are not necessarily the vector’s boundaries. An access wholly contained within one cache line can present a different servicing problem from an access spanning two lines. Page boundaries introduce another relationship, with translation and accessibility conditions of their own. It is plausible that these distinctions affect performance; it is not legitimate to assign them a universal cycle penalty without an appropriate implementation-specific measurement. A single adjective, unaligned, does not identify which boundary the access actually crosses.
Use another explicit teaching assumption: a cache line is 64 bytes and a vector load reads 32 bytes. A load beginning at offset 4 within the line covers offsets 4 through 35 and remains within that line. A load beginning at offset 48 covers offsets 48 through 79 and crosses into the next line. Both beginnings are unaligned to a 32-byte boundary, but their relationships to the assumed cache-line boundary differ. This calculation does not claim that every CPU has the chosen line size. It shows why one unaligned test case cannot describe all unaligned accesses, even on a machine with that line size.

Margin note: the boundary diagram depicts covered byte positions, not elapsed cycles. Two colored spans crossing a dividing line do not prove twice the latency, twice the instruction count, or half the throughput. The hardware can overlap or organize work in ways the picture does not measure. The diagram gives a precise question for an experiment: did the tested accesses stay within one line, cross lines, or cross pages? The result would then belong to that pattern. Without this question, a benchmark can compare two layouts and mistakenly attribute every difference to the aligned or unaligned spelling of one instruction.
A loop complicates the picture because its starting address is only the first member of an access sequence. The stride determines how later accesses relate to boundaries. An unaligned start can repeat a pattern, and the vector width can determine whether the pattern changes as the loop advances. A peeled prologue may move a later vector loop onto a desired boundary, while a tail handles the remaining elements. Such transformations have their own work and control costs. They can be reasonable without being universally profitable. The entire loop, including preparation and completion, is the unit whose useful outcome matters to the application.
Multiple input arrays create a subtler problem. Making one pointer aligned at a particular loop index does not guarantee that another pointer with a different initial offset becomes aligned at the same index. A function may read two streams and write a third. The relative offsets can prevent one simple adjustment from satisfying all desired alignments together. An implementation then chooses among legal alternatives rather than following a universal rule to align the loop once. This is one reason actual compiler output and documented source assumptions matter more than a blanket recommendation copied from a loop with a single stream.
Allocation alignment and object representation can also be different requirements. A language type has an alignment contract, and placing objects into a byte buffer requires respecting the rules for their construction and access. A processor instruction that tolerates an unaligned memory operand does not automatically make every high-level typed access valid. The machine’s capabilities and the language’s permissions are separate descriptions. An argument that a load instruction supports the address therefore cannot, by itself, settle every issue in a source program using that address through a type with stronger requirements. Correctness needs the relevant contract at each boundary.
A useful code review asks a concrete question: where was the alignment guarantee established, and which operations preserve it? An aligned allocation is evidence about the base. Adding an offset is an arithmetic transformation whose effect must be considered. Passing a pointer through an interface can preserve or lose knowledge depending on the contract. A compiler assumption communicates knowledge; it does not create the underlying physical fact. These are connected statements about one address, rather than a generic checklist of speed tricks. The chain becomes auditable when each claim refers to the address that the load actually uses.
A performance experiment needs a different set of evidence. It should distinguish useful work, data size, access sequence, generated instructions, and relevant boundary crossings. Repeated loads from cache do not answer the same question as a stream whose limiting factor is data delivery from elsewhere. A short loop dominated by setup does not answer the same question as a large steady stream. Neither experiment is inherently dishonest. The problem is naming its result simply the penalty of unaligned SIMD and then transferring the number to code with a different access pattern. A precise result can remain narrow and still be valuable.
There is a tempting but unnecessary moral that programmers must always choose either maximal assumptions or maximal flexibility. A function can expose a documented aligned interface where callers genuinely possess the guarantee, and a different interface where arbitrary valid addresses are supported. A compiler can also generate versions under supported optimization strategies. What should not happen is silently strengthening a requirement because a benchmark looked better under one layout. The set of accepted inputs is part of the function’s meaning. Performance work that changes that set has made an interface decision, which deserves to be stated as such.
The last margin note belongs beside the pointer rather than beside the stopwatch. “Aligned” answers a divisibility question about an address and, in context, a requirement that an operation may rely on. “Crosses a cache line” answers a placement question under a specified line size. “Finished sooner” answers an experimental question about a workload. A strong explanation can connect the statements while preserving their different evidence. That is more useful than declaring an entire class of valid loads slow, or treating a false promise to the compiler as a harmless request for a faster instruction.
Sources checked on October 22, 2026. All addresses, widths, and cache-line examples are explicitly assumed; no cycle cost or universal speedup is reported.



