2-16 PPC405 Core User’s Manual
2.4 Data Types and Alignment
The data types consist of bytes (eight bits), halfwords (two bytes), words (four bytes), and strings (1 to
128 bytes). Figure 2-10 shows the byte, halfword, and word data types and their bit and byte
definitions for big endian representations of values. Note that PowerPC bit numbering is reversed
from industry conventions; bit 0 represents the most significant bit of a value.
Data is represented in either twos-complement notation or in an unsigned integer format; data
representation is independent of alignment issues.
The address of a data object is always the lowest address of any byte comprising the object.
All instructions are words, and are word-aligned (the lowest byte address is divisible by 4).
2.4.1 Alignment for Storage Reference and Cache Control Instructions
The storage reference instructions (loads and stores; see Table 2-12, “Storage Reference
Instructions,” on page 2-37) move data to and from storage. The data cache control instructions listed
in Table 2-21, “Cache Management Instructions,” on page 2-41, control the contents and operation of
the data cache unit (DCU). Both types of instructions form an effective address (EA). The method of
calculating the EA for the storage reference and cache control instructions is detailed in the
description of those instructions. See Chapter 9, “Instruction Set,” for more information.
Cache control instructions ignore the five least significant bits of the EA; no alignment restrictions
exist in the DCU because of EAs. However, storage control attributes can cause alignment
exceptions. When data address translation is disabled and a dcbz instruction references a storage
region that is non-cachable, or for which write-through caching is the write strategy, an alignment
exception is taken. Such exceptions result from the storage control attributes, not from EA alignment.
The alignment exception enables system software to emulate the write-through function.
Alignment requirements for the storage reference instructions and the dcread instruction depend on
the particular instruction. Table 2-5, “Alignment Exception Summary,” on page 2-17, summarizes the
instructions that cause alignment exceptions.
The data targets of instructions are of types that depend upon the instruction. The load/store
instructions have the following “natural” alignments:
• Load/store word instructions have word targets, word-aligned.
• Load/ store halfword instructions have halfword targets, halfword-aligned.
• Load/store byte instructions have byte targets, byte-aligned (that is, any alignment).
Byte
Halfword
Word
Bit
Figure 2-10. PPC405 Data Types
3
2
1
0
0
31
Byte
0
15
1
0
0
0
7