Go to the previous, next section.

Generic Instructions

To help support special-purpose extensions to SUIF, we have provided a generic class of instructions. This is implemented in the in_gen class. These generic instructions contain arbitrarily large arrays of source operands and a character string field to hold user-defined names that function as "sub-opcodes". Generic instructions are not part of standard SUIF and most SUIF passes will not handle them.

Because it is difficult to add new opcodes to SUIF at run-time, the generic instructions all share the same gen opcode. Instead, they are distinguished by user-defined names. The name and set_name methods may be used to access these character string fields. The set_name method automatically enters the name in the lexicon (see section Lexicon).

A generic instruction contains a pointer to an array of source operands. The base class num_srcs method may be used to determine the size of this array. The size may be changed at any time using the set_num_srcs method. If necessary, the array will be reallocated. The elements of the source operand array can be accessed using the standard base class src_op and set_src_op methods. See section Source Operands.

Go to the previous, next section.