Store pair instruction

discussion of forwardcom instruction set and corresponding hardware and software

Moderator: agner

Post Reply
Kulasko
Posts: 31
Joined: 2017-11-14, 21:41:53
Location: Germany

Store pair instruction

Post by Kulasko »

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?
agner
Site Admin
Posts: 179
Joined: 2017-10-15, 8:07:27
Contact:

Re: Store pair instruction

Post by agner »

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.
Kulasko
Posts: 31
Joined: 2017-11-14, 21:41:53
Location: Germany

Re: Store pair instruction

Post by Kulasko »

So I take it you are against adding an instruction for storing two independent (general purpose) registers?
Post Reply