Pass auxiliary arguments to opcodes (XARGS)
XARGS provides a backward compatible mechanism for supplying additional (optional) arguments to other opcodes. The command may be used freely in the RVP10 instruction stream, even if the opcode being modified does not expect any optional arguments. XARGS is a NOP in that case.
To supply optional arguments to another opcode OP, the XARGS command is first executed with the additional argument count encoded in its upper 11-bits. This is followed by the array of 0 ... 2047 additional arguments. At this point the XARGS command finishes and the OP command is fetched as the next instruction. OP executes normally, except that the additional arguments from XARGS can be picked up after its own input list has been read to completion.
XARGS affects only the opcode that immediately follows it. The entire list of optional arguments is discarded after OP executes, even if OP did not use some or all of the list.
However, if OP is another XARGS command, then the additional arguments that it supplies are appended to the first set. In this way, XARGS can supply an arbitrarily large number of additional arguments.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
---------------------------------------------------------------
| | | | | | | | | | | | | | | | |
| Number of Additional Arguments N | 1 1 0 0 0 | Command
|--------------------------------------------|-------------------|
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
---------------------------------------------------------------
| | | | | | | | | | | | | | | | |
| First Additional Argument | Input 1
|-------------------|--------------------------------------------|
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
---------------------------------------------------------------
| | | | | | | | | | | | | | | | |
| Last Additional Argument | Input N
|-------------------|--------------------------------------------|
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
---------------------------------------------------------------
| | | | | | | | | | | | | | | | |
| “OP” Command that accepts optional arguments | Command
|----------------------------------------------------------------|
