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


Miscellaneous

Alto uses the DEC Alpha machine instructions as its intermediate code. Therefore, it inherits all its peculiarities.

Defined and Used Registers

A typical Alpha instruction reads (uses) two registers and writes (defines) a third one.

In ALTO you can access those registers using the macros AINS_REG_A(iins), AINS_REG_B(iins) and AINS_REG_C(iins) where "iins" is an instruction id. The macros return an 8-bit-signed number (type REG) specifying the register. 0-31 represents an integer register, 32-63 represents a floating-point register, 64 represents an integer intermediate value. (The file "regs.h" contains the corresponfing symbolic definitions.) When an instruction does not make use of all three registers the unused ones contain either 31 or 63 which are the integer/floatin-point zero registers. Two instruction subgroups do not adhere to this convention:

conditional-move-instructions (IT_ICM,IT_FCM) implicitly read the register AINS_REG_C(iins) besides writing it.

In order to shield the programer form these exceptions two functions have been introduced to ALTO:

AinsDef(iins) returns a 64-bit bit-mask (type REGLIST) representing the read registers of the instruction. AinsUSe(iins) returns a 64-bit bit-mask representing the written registers of the instruction. Here bit number i in the mask represent register number i.

The shielding is not perfect though since a conditional-move-instructions does not always define its target register.


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