Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
pjc50
on Dec 27, 2020
|
parent
|
context
|
favorite
| on:
The Genius of RISC-V Microprocessors
Remind me, how is this done in ARM?
torginus
on Dec 27, 2020
[–]
Since ARM has plenty of space in a 32 bit instruction, both the shift and the add are baked into the ldr instruction.
duskwuff
on Dec 28, 2020
|
parent
[–]
Even in Cortex-M, most array accesses are two instructions (lsls+ldr), as the ldr includes a "free" register+register add. For example, given an index in r0 and an array base address in r3:
lsls r0, r0, #2 ldr r0, [r0, r3]
Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: