Instead of incrementing by 4 bytes each time, would I need to increment by 8 bytes? Like for example, addi x9, x9, 8
instead of addi x9, x9, 4
? Or would we need to consider the size of each word itself?
Asked
Active
Viewed 15 times
0

num_111000
- 11
- 1
-
You increment by the element size, whatever that is. e.g. 4 bytes for `int32_t`. – Peter Cordes Nov 10 '21 at 03:36
-
@PeterCordes ok so for ```int32_t``` if I wanted the int 2 elements away, it would increment by 8 bytes then? – num_111000 Nov 10 '21 at 03:42
-
Yup, look at C compiler output on https://godbolt.org/ for a simple loop or something over an `int *arr` function arg if you want examples. See also [How to remove "noise" from GCC/clang assembly output?](https://stackoverflow.com/q/38552116) – Peter Cordes Nov 10 '21 at 03:57