As I was translating a program compiled to ARM assembly to ForwardCom, I realized that ARM can load and store two registers whereas ForwardCom can only do one register, apart from the push and pop instruction. They have additional restrictions such as registers needing to be next to each other (for example r28 and r29) and updating the stack pointer, which you might not want, for example when working with stack frames.
Loading a register pair would violate the contraint of a maximum of one register output per instruction. Storing two registers, however, would fit.
For this reason, I would propose adding a store instruction for two registers. What do you all think of this?
Store pair instruction
Moderator: agner
Re: Store pair instruction
The push and pop instructions can write or read a sequence of registers with increment or decrement of the stack pointer or an arbitrary pointer register. It will typically take one clock cycle for each register plus an extra clock cycle in the end for updating the pointer.
Support for these instructions is optional because they are complex instructions that do not fit into the standard pipeline structure, and because a possible interrupt would have to be delayed until the sequence if finished.
Support for these instructions is optional because they are complex instructions that do not fit into the standard pipeline structure, and because a possible interrupt would have to be delayed until the sequence if finished.
Re: Store pair instruction
So I take it you are against adding an instruction for storing two independent (general purpose) registers?