COA Notes
ARM processor architecture, Thumb instruction set, and ARM dominance in mobile computing.
Introduction
ARM (Advanced RISC Machines) is the world's most widely-deployed processor architecture — over 250 billion ARM chips have been manufactured. From the phone in your pocket to the chip controlling your car's brakes, ARM processors are everywhere. What makes ARM special is not raw speed but performance-per-watt — delivering useful computation while sipping minimal power. This page covers the ARM architecture from its RISC foundations through its modern AArch64 incarnation, explaining why it dominates mobile and is increasingly challenging x86 in laptops and servers.
ARM Design Principles
ARM follows RISC philosophy with some unique additions:
- Load/Store Architecture: Only LDR/STR access memory; all computation between registers
- Fixed-length instructions: 32-bit in ARM mode, 16/32-bit mixed in Thumb-2
- Conditional Execution: Every instruction has a 4-bit condition field — execute or skip without branching
- Barrel Shifter: One operand can be shifted/rotated for free before ALU operation
- Multiple Load/Store: LDM/STM move multiple registers in one instruction (efficient context switch)
- Link Register: Function return address stored in register (LR), not on stack
Instruction Set Modes
ARM Mode (32-bit instructions)
All instructions are 32 bits, conditionally executable:
Example — absolute value without branches:
CMP R0, #0 ; Compare R0 with 0, sets flags
RSBLT R0, R0, #0 ; If (Less Than): R0 = 0 - R0 (negate)
; No branch! No pipeline flush! Conditional execution handles it.Thumb Mode (16-bit compressed)
Thumb uses 16-bit instructions for common operations:
- Reduces code size by ~30% (important for embedded with limited flash)
- Fewer registers accessible (only R0-R7 in most Thumb-1 instructions)
- Less functionality per instruction
Thumb-2 (Mixed 16/32-bit)
The best of both worlds — compiler chooses 16-bit or 32-bit encoding per instruction:
Modern ARM cores (Cortex-A/M) use Thumb-2 as the primary mode.
AArch64 (64-bit ARM)
ARMv8-A introduced a clean 64-bit architecture:
Register File
| X0-X30 | 31 general-purpose 64-bit registers |
| W0-W30 | Lower 32-bit halves (like EAX in x86-64) |
| XZR/WZR | Zero register (reads as 0, writes discarded) |
| SP | Stack Pointer (separate from GP registers) |
| PC | Program Counter (not directly accessible as GP register) |
| LR (X30) | Link Register (return address) |
Key AArch64 Changes from AArch32
- No conditional execution (except conditional select/compare)
- No multiple load/store (replaced by LDP/STP — load/store pair)
- PC not a general-purpose register (cleaner, safer)
- Simplified addressing modes
- 31 registers instead of 16 (reduces register pressure significantly)
ARM Barrel Shifter
Every data processing instruction can optionally shift one operand:
ADD R0, R1, R2, LSL #3 ; R0 = R1 + (R2 << 3) = R1 + R2*8
SUB R0, R1, R2, LSR #1 ; R0 = R1 - (R2 >> 1) = R1 - R2/2
MOV R0, R1, ROR #8 ; R0 = Rotate R1 right by 8 bitsThis means operations like "multiply by 5" are single instructions:
ADD R0, R1, R1, LSL #2 ; R0 = R1 + R1*4 = R1*5 (one cycle!)In x86 or MIPS, this would require a separate shift instruction plus an add.
Memory System
Load/Store Instructions
Multiple Register Transfer (AArch32)
STMFD SP!, {R4-R11, LR} ; Push multiple registers (function prologue)
LDMFD SP!, {R4-R11, PC} ; Pop multiple registers and return (epilogue)
; One instruction saves/restores 9 registers — very efficient for context switchesNEON SIMD Architecture
ARM's NEON extension provides 128-bit SIMD:
Example — adding 4 floats simultaneously:
VADD.F32 Q0, Q1, Q2 ; 4 float additions in parallel (one cycle)
; Equivalent to 4 separate FADD instructionsPower Efficiency: Why ARM Wins Mobile
ARM's power advantage comes from architectural simplicity:
| Instruction decode | ~5% of die ~15-20% of die |
| Branch prediction | ~8% ~10% |
| Execution | ~25% ~20% |
| Caches | ~40% ~35% |
| Other | ~22% ~15-20% |
The 10-15% die area savings from simpler decode translates directly into power savings — those transistors simply do not switch.
ARM Processor Implementations
| Implementation | Designer | Target | Performance |
|---|---|---|---|
| Cortex-A510 | ARM | Efficiency mobile | Low power, in-order |
| Cortex-A720 | ARM | Performance mobile | Mid-range, OoO |
| Cortex-X4 | ARM | Maximum performance | Wide OoO, high freq |
| Apple Everest (M3) | Apple | Desktop/laptop | Extreme IPC |
| Qualcomm Oryon | Qualcomm | Laptop/mobile | Custom high-perf |
| Graviton4 | AWS | Cloud server | Throughput optimized |
Key Takeaways
- ARM's load/store architecture, fixed-length instructions, and conditional execution create a clean, pipeline-friendly design
- The barrel shifter provides "free" shift operations, reducing instruction count for common patterns
- Thumb-2 encoding gives ARM competitive code density despite RISC's typically larger programs
- AArch64 is a clean 64-bit design with 31 registers — reducing spills and improving performance
- ARM's licensing model enables customization — Apple, Qualcomm, and AWS all create ARM implementations optimized for their specific use cases
- The simplicity of ARM's decode logic is the primary reason it achieves 3-10× better power efficiency than x86 at equivalent performance levels
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for ARM Architecture.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Computer Organization & Architecture topic.
Search Terms
computer-organization, computer organization & architecture, computer, organization, advanced, architecture, arm, arm architecture
Related Computer Organization & Architecture Topics