For software that is not designed to use the BWX extension, the intended sequence for loading and
LDL | R1, 8(R3) | ; R1 | = ssss BAxx | |
|
| ; Faults if | R3 is not longword aligned | |
EXTWL | R1, #2, R1 | ; R1 | = 0000 | 00BA |
For software that is not designed to use the BWX extension, the intended sequence for loading and
LDL | R1, 8(R3) | ; R1 | = ssss BAxx | |
|
| ; Faults if | R3 is not longword aligned | |
SRA | R1, #16, R1 | ; R1 | = ssss | ssBA |
Big-endian examples:
For software that is not designed to use the BWX extension, the intended sequence for loading and
LDQ_U | R1, X(R11) | ; Ignores va<2:0>, R1 = xxxx xAyy |
LDA | R3, X(R11) | ; R3<2:0> = 5, shift will be 2 bytes |
EXTBL | R1, R3, R1 | ; R1 = 0000 000A |
The intended sequence for loading a quadword from unaligned address X(R11) is:
LDQ_U | R1, X(R11) | ; Ignores va<2:0>, R1 = xxxxxABC | |
LDQ_U | R2, X+7(R11) | ; Ignores va<2:0>, R2 = DEFGHyyy | |
LDA | R3, X+7(R11) | ; R3<2:0> = 4, shift will be 3 bytes | |
EXTQH | R1, R3, R1 | ; R1 | = ABC0 0000 |
EXTQL | R2, R3, R2 | ; R2 | = 000D EFGH |
OR | R1, R2, R1 | ; R1 | = ABCD EFGH |
Note that the address in the LDA instruction for