Memory Instructions Throughout the Ages
Not all of the memory access instructions available in the current ARM ISA were present in the original ARM. Newer instructions, such as those for processing half-words, have had to be squeezed into later architectures. Limits on the amount of instruction space available meant that they could not be made as flexible as the original instructions.
Architecture |
Instruction |
Action |
Pre-ARMv4 |
LDRB |
load unsigned 8-bit |
|
STRB |
store signed or unsigned 8-bit |
|
LDR |
load signed or unsigned 32-bit |
|
STR |
store signed or unsigned 32-bit |
ARMv4 |
LDRSB |
load signed 8-bit |
|
LDRH |
load unsigned 16-bit |
|
LDRSH |
load signed 16-bit |
|
STRH |
store signed or unsigned 16-bit |
ARMv5 |
LDRD |
load signed or unsigned 64-bit |
|
STRD |
store signed or unsigned 64-bit |
You may get better performance by using LDR
to process packed pairs of half-words instead of LDRH
, for example.