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

SCM Repository

[smlnj] Annotation of /sml/trunk/src/compiler/CodeGen/ppc/ppcCpsRegs.sml
ViewVC logotype

Annotation of /sml/trunk/src/compiler/CodeGen/ppc/ppcCpsRegs.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 430 - (view) (download)

1 : monnier 245 (* ppcCpsRegs.sml --- CPS registers used on the POWER PC
2 :     *
3 :     * COPYRIGHT (c) 1999 Bell Laboratories.
4 :     *
5 :     *)
6 :    
7 :     structure PPCCpsRegs : CPSREGS =
8 :     struct
9 :     structure T = PPCMLTree
10 :     structure SL = SortedList
11 :     fun upto (from,to) = if from>to then [] else from::(upto (from+1,to))
12 :     infix upto
13 :    
14 : monnier 411 val GP = PPCCells.GPReg
15 :     val FP = PPCCells.FPReg
16 :     val CC = PPCCells.Reg PPCCells.CC
17 : monnier 245
18 : monnier 411 val exhaustedR = CC 0
19 :     val exhausted = SOME(T.CC(exhaustedR))
20 : monnier 245
21 : monnier 411 val allocptr = T.REG(32,GP 14)
22 :     val limitptr = T.REG(32,GP 15)
23 :     val storeptr = T.REG(32,GP 16)
24 :     val stdlink = T.REG(32,GP 17)
25 :     val stdclos = T.REG(32,GP 18)
26 :     val stdarg = T.REG(32,GP 19)
27 :     val stdcont = T.REG(32,GP 20)
28 :     val exnptr = T.REG(32,GP 21)
29 :     val varptr = T.REG(32,GP 22)
30 :     val baseptr = T.REG(32,GP 23)
31 :     val stackptr = T.REG(32,GP 1)
32 :     val gcLink = T.REG(32,PPCCells.lr)
33 :    
34 :     val miscregs = map (fn r => T.REG(32,GP r))
35 :     ([24,25,26,27,29,30,31] @ (3 upto 13))
36 : monnier 245 val calleesave = Array.fromList(miscregs)
37 : monnier 411 val floatregs = map (fn f => T.FREG(64,FP f)) (1 upto 31)
38 : monnier 245 val savedfpregs = []
39 :    
40 : monnier 411 val allRegs = map GP (SL.uniq(0 upto 31))
41 : monnier 245
42 :     val availR =
43 : monnier 411 map (fn T.REG(_,r) => r)
44 : monnier 245 ([stdlink, stdclos, stdarg, stdcont] @ miscregs)
45 :     val dedicatedR = SL.remove(SL.uniq availR, allRegs)
46 :    
47 : monnier 411 val availF = map FP (1 upto 31)
48 :     val dedicatedF = [FP 0]
49 :    
50 :     val signedGCTest = false
51 : monnier 429 val addressWidth = 32
52 : monnier 245 end

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