| 1 |
(* |
| 2 |
* WARNING: This file was automatically generated by MDLGen (v3.1) |
| 3 |
* from the machine description file "alpha/alpha.mdl". |
| 4 |
* DO NOT EDIT this file directly |
| 5 |
*) |
| 6 |
|
| 7 |
|
| 8 |
signature ALPHACELLS = |
| 9 |
sig |
| 10 |
include CELLS |
| 11 |
val CELLSET : CellsBasis.cellkind |
| 12 |
val showGP : CellsBasis.register_id -> string |
| 13 |
val showFP : CellsBasis.register_id -> string |
| 14 |
val showCC : CellsBasis.register_id -> string |
| 15 |
val showMEM : CellsBasis.register_id -> string |
| 16 |
val showCTRL : CellsBasis.register_id -> string |
| 17 |
val showCELLSET : CellsBasis.register_id -> string |
| 18 |
val showGPWithSize : CellsBasis.register_id * CellsBasis.sz -> string |
| 19 |
val showFPWithSize : CellsBasis.register_id * CellsBasis.sz -> string |
| 20 |
val showCCWithSize : CellsBasis.register_id * CellsBasis.sz -> string |
| 21 |
val showMEMWithSize : CellsBasis.register_id * CellsBasis.sz -> string |
| 22 |
val showCTRLWithSize : CellsBasis.register_id * CellsBasis.sz -> string |
| 23 |
val showCELLSETWithSize : CellsBasis.register_id * CellsBasis.sz -> string |
| 24 |
val returnAddr : CellsBasis.cell |
| 25 |
val r31 : CellsBasis.cell |
| 26 |
val f31 : CellsBasis.cell |
| 27 |
val addGP : CellsBasis.cell * cellset -> cellset |
| 28 |
val addFP : CellsBasis.cell * cellset -> cellset |
| 29 |
val addCC : CellsBasis.cell * cellset -> cellset |
| 30 |
val addMEM : CellsBasis.cell * cellset -> cellset |
| 31 |
val addCTRL : CellsBasis.cell * cellset -> cellset |
| 32 |
val addCELLSET : CellsBasis.cell * cellset -> cellset |
| 33 |
end |
| 34 |
|
| 35 |
structure AlphaCells : ALPHACELLS = |
| 36 |
struct |
| 37 |
exception AlphaCells |
| 38 |
fun error msg = MLRiscErrorMsg.error("AlphaCells",msg) |
| 39 |
open CellsBasis |
| 40 |
fun showGPWithSize (r, ty) = (fn (30, _) => "$sp" |
| 41 |
| (r, _) => "$" ^ (Int.toString r) |
| 42 |
) (r, ty) |
| 43 |
and showFPWithSize (r, ty) = (fn (f, _) => "$f" ^ (Int.toString f) |
| 44 |
) (r, ty) |
| 45 |
and showCCWithSize (r, ty) = (fn _ => "cc" |
| 46 |
) (r, ty) |
| 47 |
and showMEMWithSize (r, ty) = (fn (r, _) => "m" ^ (Int.toString r) |
| 48 |
) (r, ty) |
| 49 |
and showCTRLWithSize (r, ty) = (fn (r, _) => "ctrl" ^ (Int.toString r) |
| 50 |
) (r, ty) |
| 51 |
and showCELLSETWithSize (r, ty) = (fn _ => "CELLSET" |
| 52 |
) (r, ty) |
| 53 |
fun showGP r = showGPWithSize (r, 64) |
| 54 |
fun showFP r = showFPWithSize (r, 64) |
| 55 |
fun showCC r = showCCWithSize (r, 64) |
| 56 |
fun showMEM r = showMEMWithSize (r, 8) |
| 57 |
fun showCTRL r = showCTRLWithSize (r, 0) |
| 58 |
fun showCELLSET r = showCELLSETWithSize (r, 0) |
| 59 |
val CELLSET = CellsBasis.newCellKind {name="CELLSET", nickname="cellset"} |
| 60 |
structure MyCells = Cells |
| 61 |
(exception Cells = AlphaCells |
| 62 |
val firstPseudo = 256 |
| 63 |
val desc_GP = CellsBasis.DESC {low=0, high=31, kind=CellsBasis.GP, defaultValues=[(31, |
| 64 |
0)], zeroReg=SOME 31, toString=showGP, toStringWithSize=showGPWithSize, |
| 65 |
counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0} |
| 66 |
and desc_FP = CellsBasis.DESC {low=32, high=63, kind=CellsBasis.FP, |
| 67 |
defaultValues=[(63, 0)], zeroReg=SOME 31, toString=showFP, toStringWithSize=showFPWithSize, |
| 68 |
counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0} |
| 69 |
and desc_MEM = CellsBasis.DESC {low=64, high=63, kind=CellsBasis.MEM, |
| 70 |
defaultValues=[], zeroReg=NONE, toString=showMEM, toStringWithSize=showMEMWithSize, |
| 71 |
counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0} |
| 72 |
and desc_CTRL = CellsBasis.DESC {low=64, high=63, kind=CellsBasis.CTRL, |
| 73 |
defaultValues=[], zeroReg=NONE, toString=showCTRL, toStringWithSize=showCTRLWithSize, |
| 74 |
counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0} |
| 75 |
and desc_CELLSET = CellsBasis.DESC {low=64, high=63, kind=CELLSET, defaultValues=[], |
| 76 |
zeroReg=NONE, toString=showCELLSET, toStringWithSize=showCELLSETWithSize, |
| 77 |
counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0} |
| 78 |
val cellKindDescs = [(CellsBasis.GP, desc_GP), (CellsBasis.FP, desc_FP), |
| 79 |
(CellsBasis.CC, desc_GP), (CellsBasis.MEM, desc_MEM), (CellsBasis.CTRL, |
| 80 |
desc_CTRL), (CELLSET, desc_CELLSET)] |
| 81 |
val cellSize = 8 |
| 82 |
) |
| 83 |
|
| 84 |
open MyCells |
| 85 |
val addGP = CellSet.add |
| 86 |
and addFP = CellSet.add |
| 87 |
and addCC = CellSet.add |
| 88 |
and addMEM = CellSet.add |
| 89 |
and addCTRL = CellSet.add |
| 90 |
and addCELLSET = CellSet.add |
| 91 |
val RegGP = Reg GP |
| 92 |
and RegFP = Reg FP |
| 93 |
and RegCC = Reg CC |
| 94 |
and RegMEM = Reg MEM |
| 95 |
and RegCTRL = Reg CTRL |
| 96 |
and RegCELLSET = Reg CELLSET |
| 97 |
val stackptrR = RegGP 30 |
| 98 |
val asmTmpR = RegGP 28 |
| 99 |
val fasmTmp = RegGP 30 |
| 100 |
val returnAddr = RegGP 26 |
| 101 |
val r31 = RegGP 31 |
| 102 |
val f31 = RegFP 31 |
| 103 |
end |
| 104 |
|