Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/MLRISC/ppc/instructions/ppcCells.sml
ViewVC logotype

View of /sml/trunk/src/MLRISC/ppc/instructions/ppcCells.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 810 - (download) (annotate)
Fri Apr 20 13:26:46 2001 UTC (18 years, 3 months ago) by george
File size: 5487 byte(s)
Port to Mac OS X
(*
 * WARNING: This file was automatically generated by MDLGen (v3.0)
 * from the machine description file "../../ppc/ppc.mdl".
 * DO NOT EDIT this file directly
 *)


signature PPCCELLS =
sig
   include CELLS_COMMON
   val SPR : cellkind
   val CELLSET : cellkind
   val showGP : register_id -> string
   val showFP : register_id -> string
   val showCC : register_id -> string
   val showSPR : register_id -> string
   val showMEM : register_id -> string
   val showCTRL : register_id -> string
   val showCELLSET : register_id -> string
   val showGPWithSize : (register_id * sz) -> string
   val showFPWithSize : (register_id * sz) -> string
   val showCCWithSize : (register_id * sz) -> string
   val showSPRWithSize : (register_id * sz) -> string
   val showMEMWithSize : (register_id * sz) -> string
   val showCTRLWithSize : (register_id * sz) -> string
   val showCELLSETWithSize : (register_id * sz) -> string
   val stackptrR : cell
   val asmTmpR : cell
   val fasmTmp : cell
   val r0 : cell
   val xer : cell
   val lr : cell
   val ctr : cell
   val addGP : (cell * cellset) -> cellset
   val addFP : (cell * cellset) -> cellset
   val addCC : (cell * cellset) -> cellset
   val addSPR : (cell * cellset) -> cellset
   val addMEM : (cell * cellset) -> cellset
   val addCTRL : (cell * cellset) -> cellset
   val addCELLSET : (cell * cellset) -> cellset
end

structure PPCCells : PPCCELLS =
struct
   exception PPCCells
   fun error msg = MLRiscErrorMsg.error("PPCCells",msg)
   fun showGPWithSize (r, ty) = (fn (r, _) => Int.toString r
                                ) (r, ty)
   and showFPWithSize (r, ty) = (fn (f, _) => Int.toString f
                                ) (r, ty)
   and showCCWithSize (r, ty) = (fn (cr, _) => "cr" ^ (Int.toString cr)
                                ) (r, ty)
   and showSPRWithSize (r, ty) = (fn (1, _) => "xer"
                                   | (8, _) => "lr"
                                   | (9, _) => "ctr"
                                   | (r, _) => Int.toString r
                                 ) (r, ty)
   and showMEMWithSize (r, ty) = (fn (r, _) => "m" ^ (Int.toString r)
                                 ) (r, ty)
   and showCTRLWithSize (r, ty) = (fn (r, _) => "ctrl" ^ (Int.toString r)
                                  ) (r, ty)
   and showCELLSETWithSize (r, ty) = (fn _ => "CELLSET"
                                     ) (r, ty)
   fun showGP r = showGPWithSize (r, 64)
   fun showFP r = showFPWithSize (r, 64)
   fun showCC r = showCCWithSize (r, 4)
   fun showSPR r = showSPRWithSize (r, 64)
   fun showMEM r = showMEMWithSize (r, 8)
   fun showCTRL r = showCTRLWithSize (r, 8)
   fun showCELLSET r = showCELLSETWithSize (r, 0)
   val SPR = CellsBasis.newCellKind {name="SPR", nickname="spr"}
   and CELLSET = CellsBasis.newCellKind {name="CELLSET", nickname="cellset"}
   structure MyCellsCommon = CellsCommon
      (exception Cells = PPCCells
       val firstPseudo = 256
       val desc_GP = CellsInternal.DESC {low=0, high=31, kind=CellsBasis.GP, 
              defaultValues=[], zeroReg=NONE, toString=showGP, toStringWithSize=showGPWithSize, 
              counter=ref 0, physicalRegs=ref CellsInternal.array0}
       and desc_FP = CellsInternal.DESC {low=32, high=63, kind=CellsBasis.FP, 
              defaultValues=[], zeroReg=NONE, toString=showFP, toStringWithSize=showFPWithSize, 
              counter=ref 0, physicalRegs=ref CellsInternal.array0}
       and desc_CC = CellsInternal.DESC {low=64, high=71, kind=CellsBasis.CC, 
              defaultValues=[], zeroReg=NONE, toString=showCC, toStringWithSize=showCCWithSize, 
              counter=ref 0, physicalRegs=ref CellsInternal.array0}
       and desc_SPR = CellsInternal.DESC {low=72, high=103, kind=SPR, defaultValues=[], 
              zeroReg=NONE, toString=showSPR, toStringWithSize=showSPRWithSize, 
              counter=ref 0, physicalRegs=ref CellsInternal.array0}
       and desc_MEM = CellsInternal.DESC {low=104, high=103, kind=CellsBasis.MEM, 
              defaultValues=[], zeroReg=NONE, toString=showMEM, toStringWithSize=showMEMWithSize, 
              counter=ref 0, physicalRegs=ref CellsInternal.array0}
       and desc_CTRL = CellsInternal.DESC {low=104, high=103, kind=CellsBasis.CTRL, 
              defaultValues=[], zeroReg=NONE, toString=showCTRL, toStringWithSize=showCTRLWithSize, 
              counter=ref 0, physicalRegs=ref CellsInternal.array0}
       and desc_CELLSET = CellsInternal.DESC {low=104, high=103, kind=CELLSET, 
              defaultValues=[], zeroReg=NONE, toString=showCELLSET, toStringWithSize=showCELLSETWithSize, 
              counter=ref 0, physicalRegs=ref CellsInternal.array0}
       val cellKindDescs = [(CellsBasis.GP, desc_GP), (CellsBasis.FP, desc_FP), 
              (CellsBasis.CC, desc_CC), (SPR, desc_SPR), (CellsBasis.MEM, desc_MEM), 
              (CellsBasis.CTRL, desc_CTRL), (CELLSET, desc_CELLSET)]
      )

   open MyCellsCommon
   val addGP = CellSet.add
   and addFP = CellSet.add
   and addCC = CellSet.add
   and addSPR = CellSet.add
   and addMEM = CellSet.add
   and addCTRL = CellSet.add
   and addCELLSET = CellSet.add
   val RegGP = Reg GP
   and RegFP = Reg FP
   and RegCC = Reg CC
   and RegSPR = Reg SPR
   and RegMEM = Reg MEM
   and RegCTRL = Reg CTRL
   and RegCELLSET = Reg CELLSET
   val stackptrR = RegGP 1
   val asmTmpR = RegGP 28
   val fasmTmp = RegFP 0
   val r0 = RegGP 0
   val xer = RegSPR 1
   val lr = RegSPR 8
   val ctr = RegSPR 9
end


root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0