Go to the first, previous, next, last section, table of contents.


Load Constant Instructions

Rather than allowing constant values to be used directly as operands, SUIF uses separate ldc instructions to load constant values. The in_ldc class holds these instructions. Instead of the usual source operands, this class has an immediate value field (see section Immediate Values). The value and set_value methods may be used to access this field.

Only certain kinds of immediate values are supported in an ldc instruction:

Symbolic addresses (See section Symbolic Addresses)
The result type of the instruction must be a pointer type.
Integers
The result type must be an integer or pointer type. Pointer types are allowed so that the null pointer can be loaded as the integer value zero.
Floating-point values
The result type must be a floating-point type.

Other kinds of immediate values may be stored in the value field of an ldc instruction, but most SUIF passes and certain library functions will not be able to handle them.


Go to the first, previous, next, last section, table of contents.