The CELLS signature

CELLS is used to provide a consistent view of registers to the MLRisc generation phase, and the various phases in the backend.


Synopsis

signature CELLS

Interface

val stackptrR : int
val asmTmpR : int
val newReg : unit -> int
val newFreg : unit -> int
val newCCreg : unit -> int
val maxReg : unit -> int
val maxFreg : unit -> int
val maxCCreg : unit -> int
val firstPseudoReg : int
val firstPseudoFreg : int
val firstPseudoCCreg : int
val resetRegs : unit -> int Array.array ref list
type cellset
val cellset2string : cellset -> string
val addReg : (int * cellset) -> cellset
val addFreg : (int * cellset) -> cellset
val addCCreg : (int * cellset) -> cellset
val empty : cellset

Description

stackptrR
Every architecture is expected to have a stack pointer that is assumed to be a general purpose register.

asmTmpR
Every architecture is expected to reserve at least one register to be used for scratch purposes. This is used in numerous places such as in register shuffles, and implementing span dependent instructions.

newReg ()
Allocates a new general purpose pseudo-register.

newFreg ()
Allocates a new floating point pseudo-register.

newCCreg ()
Allocates a new condition code pseudo-register.

maxReg ()
Returns the number general purpose registers allocated.

maxFreg ()
Returns the number floating point registers allocated.

maxFreg ()
Returns the number condition code registers allocated.

firstPseudoReg
Is the number of physical general purpose registers available on the machine.

firstPseudoFreg
Is the number of physical floating point registers available on the machine.

firstPseudoFreg
Is the number of physical condition code registers available on the machine.

resetRegs ()
Resets the counters used to generate pseudo-registers. The int Array.array ref returned, is a reference to a register map. Intially the register map is empty or of size zero, but gets initialized when the flowgraph is constructed. The register map is used to record register aliases without having to change the instructions that use those registers. The number of register maps depends on the number of distinct register types on the machine.

type cellset
Used to represent a hetrogenous collection of resources --- typically registers.

cellset2string ce
Converts a cellset to a string. Used primarily for debugging purposes.

addReg (r, ce)
Adds a general purpose register r to the cellset ce.

addFreg (f, ce)
Adds a floating point register f to the cellset ce.

addCCreg (cc, ce)
Adds a condition code register cc to the cellset ce.

empty
Returns the empty cellset.



  Submit a comment on this page  

[ INDEX | TOP | Parent | Root ]

Author: Lal George
Last Modified: October 10, 1996
Copyright © 1996 Bell Laboratories