[Next] [Up/Previous]

Instruction Format

The formats of the basic 32-bit instructions for this architecture are shown in the two diagrams below:

First, the instructions that are 32 bits in length which can never affect the condition code bits, as they perform functions such as load and store, or jump, are shown.

The 32-bit form of basic load and store instructions is shown in lines 1 through 5.

For a memory-reference instruction, the five-bit destination register field specifies one of 32 registers, either the general-purpose registers for integer instructions, or the floating-point registers for floating-point instructions.

The index register field contains a number from 0 to 7, if it contains 0, the instruction is not indexed; if it contains any other value, that value indicates which general register is to be used as the index register for that instruction.

Lines 1 through five show the five possible formats for 32-bit memory-reference instructions.

In line 1, a three-bit field indicates the base register. It may contain any value from 1 to 7, which indicates that a general register from 25 to 31 respectively is used as the base register.

Line 2 of the original diagram shows the second possibility: a 15-bit displacement is included in the instruction, and general register 16 contains the starting point of the 32,768-byte area of memory to which the values of this displacement may refer.

Line 3 of the original diagram shows the third possibility. Here, the displacement is 12 bits long, and there is a three-bit ssB field (short source base) adjacent to it.

If that field contains a number from 1 to 7, it indicates that a register from 17 to 23, respectively, is used as a base register, the contents of which point to a 4,096-byte area in memory.

If that field contains a 0, then one of the possibilities shown in lines 4 and 5 of the diagram apply.

Line 4 of the original diagram shows this possibility: if the ssB field, containing a 0, is followed by a 0, then program-relative addressing is indicated.

The instruction now contains an 11-bit displacement, which is in units of bytes, but now it is a signed two's complement value from -1,024 to 1,023, relative to the position immediately after the end of the instruction. One particularly important application of this addressing mode is at the beginning of a main program or a subroutine, where a Jump to Subroutine instruction having the following instruction as its destination can be used to initialize a base register by means of which adresses referring to the program code can be constructed.

Line 5 of the original diagram shows the format for two other addressing modes.

If the ssB field, containing a 0, is followed by 100, then it indicates Array Mode addressing.

Here, the contents of register 17 are added to the displacement, which is now in units of 64 bits or eight bytes, to indicate the location of a 64-bit pointer to an array.

If indexing is present in the instruction, the contents of the selected register are added to that pointer in order to address an element of that array. Thus, Array Mode provides post-indexed indirect addressing in order to conveniently allow a program to refer to up to 512 arrays which are larger than 65,536 bytes in size without having to reload base registers in order to access them.

If the ssB field, containing a 0, is followed by 101, then Address Table addressing is indicated.

Here, the contents of register 17 are added to the displacement, which is now in units of 64 bits or eight bytes, to indicate the location of a 64-bit constant containing the effective address of the instruction.

If indexing is present in the instruction, the contents of the selected register are added to the initial effective address formed by adding the contents of register 17 to the displacement, so as to change which 64-bit constant is taken as the effective address.

Thus, Array Mode addressing provides pre-indexed indirection, and Address Table addressing provides post-indexed indirection. Array Mode addressing is useful for accesing data in multiple large arrays without reloading base registers, and Address Table addressing is useful for such things as multi-way jump tables.

If the ssB field, containing a 0, is followed by 110, then Array Mode with Auto-Increment addressing is indicated. The displacement is in units of 64 bits, and the contents of base register 17 are added to the displacement after scaling to find the address to be used; this address may be indexed to form the effective address, and, in addition, after the memory location at the effective address so calculated is accessed, the index register is then incremented by the size of the operands of the instruction; incremented by one if the instruction acts on bytes, having eight added to it if the instruction acts on double-precision floating-point numbers, and so on. This includes adding six in the case of medium floating-point numbers.

If the ssB field, containing a 0, is followed by 111, then Array Mode with Flexible Auto-Increment addressing is indicated. Here, if the instruction is indexed, the index register must be one of registers 2, 4, or 6, and the amount by which it is incremented after memory access is found in the following register.

Note that the bit combination corresponding to the illegal use of an odd-numbered index register with a memory-reference instruction in this mode is used for a header of the first type, as also shown, as it also serves as an instruction, in line 7.

The subroutine jump instruction makes use of the opcode which would indicate an "unsigned load long" instruction; since the long data type is as long as a complete integer register, such an operation is not needed; similarly, the opcode for "insert long" is used for Load Address instead.

The format of the subroutine jump is shown in line 6; the contents of the offset field, shifted one place to the left, are added to the address of the location immediately following the subroutine jump instruction to form the return address.

This allows more efficient and rapid processing of returns from subroutines when the subroutine jump instruction precedes space reserved for pseudo-immeidates and/or a block header, which stand between it and the next instruction to be executed.


In line 7, a low-overhead header format is shown. Since Array Mode with Flexible Auto-Increment does not make sense if the instruction is not indexed, the combination of bits which would indicate this invalid mode is instead used to create a two-address register-to-register operate instruction which has three spare bits available for a decode field. In this way, 32-bit instruction slots can be reserved for pseudo-immediate values without having to give up a whole instruction slot for a header.


Lines 8 and 9 of the diagram show the formats of the multiple-register load and store instructions:

300xxxxxxxx LM   Load Multiple
304xxxxxxxx STM  Store Multiple
310xxxxxxxx LMF  Load Multiple Floating
314xxxxxxxx STMF Store Multiple Floating

Note that these instructions, in particular the ones for the floating-point registers, load and store their contents in raw internal form. Because of the complexities of the IEEE 754 format for floating-point numbers, they are converted to an internal form when loaded into the floating-point registers, and converted back to the standard form when stored from those registers, to allow register-to-register arithmetic to proceed more quickly.

The Long Vector load/store instructions in lines 12 and 13 provide a limited capability for loading and storing long vectors in the long vector registers. Stride is not provided in these instructions, and if it is desired to load and store less than all 64 elements of the vector, an integer register from among registers 1, 2, or 3 must be used to contain the length. If the lR field contains a zero, all 64 elements of the vector are loaded or stored.

The Supplemental Memory-Reference instructions in lines 14 and 15 permit instructions to load and store values in additional data types supported by this architecture to be included in a limited form in the basic 32-bit instruction set.

The Iterate instruction is shown in line 22. This instruction is used in combination with the Loop instruction, to be described below. The Loop instruction contains a count register field, as well as a start value and a limit value. The Iterate instruction must have a Loop instruction as its memory operand; it adds the step value which it contains to the contents of the count register indicated in the Loop instruction, storing the result in the count register. If register zero is indicated as the step register, then the step value is 1; if another register is indicated, the step value is the value contained in the step register.

If the step value is positive, then if the result of adding the step value to the contents of the count register is less than or equal to the limit value, the Iterate instruction branches to the instruction following the Loop instruction. If the Loop instruction contains a nonzero offset field, however, the value in that field is taken as a number of 32-bit instruction slots to skip after the Loop instruction to find the next instruction, and no checking is done to determine if that is correct.

If the step value is negative, then the Iterate instruction branches if the count result is greater than or equal to the limit value.


The diagram below shows the format for 32-bit instructions which perform arithmetic operations, and which may affect the condition codes:

A three-address register-to-register operate instruction is shown in lines 1 through 3; either one of the source and operand registers may be replaced with pointers to pseudo-immediate operands. As the result of the instruction would be a constant if both of those operands were so replaced, this combination is illegal, and the bit pattern it would have is reserved for future expansion of the instruction set.

Two-address register-to-register operate instructions are shown in lines 4 and 5. These have a considerably larger space available for the opcode field, and, thus, are not restricted to the basic arithmetic operations provided for three operands.

Line 6 shows the single-operand operate instructions, and line 7 shows the shift instructions.

Line 8 shows the format of a two-address instruction where the source operand is an 8-bit value; here, the value is part of the instruction, and the pseudo-immediate mechanism in the regular register-to-register instructions is not used.

Lines 9 through 11 show the Loop instruction.

A Loop instruction performs the following action when executed normally: the value in the start register operand is placed in the count register. The offset field indicates the number of 32-bit instruction slots, if any, to be skipped to reach the instruction slot containing the next instruction after the Loop instruction.

There is a limit register field in the Loop instruction, which is not used when it executes normally, but which is read by the Iterate instruction in order that it can do its work.

The Loop instruction is designed to work with the Iterate instruction. The action of the Iterate instruction is conceptualized as follows:

First it reads in information from its operand in memory, which must be a Loop instruction.

Then it acts somewhat like an Execute instruction on the Loop instruction. The instruction that it executes the Loop instruction as performs the following actions:

If the step register is not register 0, or the step operand is a pseudo-immediate, then the step operand (the contents of the step register, or the value of the pseudo-immediate) is added to the count register. If the step register is register 0, then count register is incremented by 1, and the value of the step operand is taken to be 1. If the step operand is positive, then:

If the step operand is negative, then the condition for the Iterate instruction proceeding to its next phase instead of ending is for the resulting value in the count register to be greater than or equal to the limit operand.

The next phase of the Iterate instruction, if the condition is met, is to branch to the instruction which follows the Loop instruction. It makes use of the Offset field in the Loop instruction to branch directly there.

In practice, in some implementations, the action of the Iterate instruction may be of a different, although equivalent, kind. Instead of executing the Loop instruction, it may branch to the Loop instruction, with a flag set to modify its action to be that described above for the first phase of an Iterate instruction.

Then, the Iterate instruction falling through (at the end of the loop) becomes the Step instruction branching to the instruction following the Iterate instruction, and the Iterate instruction branching to the instruction following the Step instruction becomes the (modified) Step instruction falling through.

If this implementation strategy is chosen, it is the implementor's responsibility to ensure that it does not cause the processor's behavior to differ from that it would have if the definition of the instruction were followed in any way visible to the programmer.

Line 12 shows a two-operand register-to-register operate instruction that can use any of eight possible sets of condition codes, if the C bit is set, instead of just the normal set of condition codes. Like the flag bits used with instruction predicatiion, alternate sets of condition codes are a way to allow conditional branches to be delayed so as to reduce the need for branch prediction.

Lines 13 and 14 show register-to-register operate instructions that involve extended register banks, both integer and floating, with 128 registers instead of 32 registers. Larger register banks permit more operations to be performed before there is a need to re-use a register from which the result has been stored, reducing the occurence of hazards in pipelined code.

The mixed register two-address instructions in line 14 allow the large register banks to interact with the normal register banks.

Lines 15 and 16 show instructions that allow individual elements of a vector register to be acted upon. The element affected is identified by an element register, which is one of integer registers 0 through 7; it is expected that these instructions will usually be used within loops.

In line 17, we see the short vector register-to-register operate instructions.

If the mask register (mR) field contains a non-zero value, it indicates that one of registers 1 to 7 contains a bit mask in which a 1 allows the operation to be performed, and a 0 prevents the operation. The number of bits used depends on the type of operation; a short vector is 256 bits long, and so it contains 32 bytes, 16 halfwords of 16 bits each, 8 words of 32 bits each, and so on.

If the condition register (cR) field contains a non-zero value, it indicates a register from 1 to 7 that has its bits set or cleared depending on whether the result of the operation satisfies the condition specified in the condition field.

The C bit, although present, is not used in these instructions.

In line 18, we see the long vector register-to-register operate instructions.

Here, the only special field for which there is room in the 32-bit form of these instructions is a length field; if it contains all zero bits, it is ignored, and the whole 64-element vector is operated upon; if it contains a value from 1 to 63, then that many elements of the vectors involved, starting from the first one, are operated upon.


In addition, shown below are the alternate 32-bit instructions of the first kind, the second and third kinds being currently reserved for future expansion.

Lines 1 through 13 of the diagram show instructions which are also called supplemental memory reference instructions, although their purpose is different from that of the ones seen before.

These instructions provide, for aligned operands in memory, and with displacements of 15 bits or less, memory-to-register operate instructions of the basic kinds.

Line 14 of the diagram shows instructions with 16-bit immediate operands which do not require the use of the pseudo-immediate mechanism.

Lines 15 and 16 of the diagram show an extended format of the multiple-register load and store instructions which permit indexing. It is also limited to displacements of 15 bits or less.


[Next] [Up/Previous]