Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
tralarpa
on Nov 1, 2020
|
parent
|
context
|
favorite
| on:
An ex-ARM engineer critiques RISC-V
I thought the scale factor is either 1,2,4 or 8?
saagarjha
on Nov 1, 2020
[–]
You can combine them. For example, [rax+rax*8+1] (base register, register shifted by 8, constant).
tralarpa
on Nov 1, 2020
|
parent
|
next
[–]
Isn't the scale factor encoded in just two bits? (i.e. 00=1, 01=2, 10=4, 11=8)
saagarjha
on Nov 1, 2020
|
root
|
parent
|
next
[–]
Just edited with an example; I’m on my iPhone so assembling via nasm takes an extra minute ;)
tralarpa
on Nov 1, 2020
|
parent
|
prev
[–]
Thanks for the example. I was assuming that a and b are variables in OPs posting.
bonzini
on Nov 1, 2020
|
root
|
parent
[–]
True that. In my case it was 12+x*9, which is log2 of the page sizes on x86 (4K, 2M, 1G).
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: