3 ms·
What do you by rotating in x86? are you referring to the renaming? Where is the xtensa documentation? My random googling seems to indicate it has a more tradit
by olliej 6y ago
What do you by rotating in x86? are you referring to the renaming?
Where is the xtensa documentation? My random googling seems to indicate it has a more traditional fixed set of registers?
On SPARC for instance (super super super pseudo code here, I haven't written sparc assembly for... almost 20 years?)
mov %o0, an_argument
call a_function
...
a_function:
; the argument is now in %i0
or something like that.
- lokedhs 6y agoYou got the arguments backward. SPARC uses the proper order (source,dest) So it would be something like: ld [%l0],%o0 ; Load whatever is pointed to by %l0 into %o0 call some_function ; Stores the old pc in %o7 ; Result is now in %o0 some_function: save ; Move the register window ; The argument is now in %i0 ld %i0,%l0 ; This does not overwrite the caller's l0 ret ; Return, essentially a jump to %i7 restore ; Called due to delay slot, restores the window
- ajross 6y agox86 does not rotate its registers (though the 8087 did). I said "ia64", which is the Itanium architecture. It actually had a mix of fixed, caller-save registers and rotating argument registers, and an outrageously complicated hardware engine for moving them to and from the stack. Xtensa is simpler than Itanium, in that the windows are fixed 4-register sets and the spilling and filling is done in an exception handler. But it's more complicated than SPARC for sure. The details are in the "Xtensa Instruction Set Architecture Reference Manual", which is a PDF that is commonly available on the internet but not AFAIK actually distributed by Cadence itself.
- olliej 6y agoah my bad! Sorry I just brainfarted on arches name! I'm a muppet