Commit | Line | Data |
---|---|---|
7f918cf1 CE |
1 | (* Copyright (C) 2009 Matthew Fluet. |
2 | * Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh | |
3 | * Jagannathan, and Stephen Weeks. | |
4 | * Copyright (C) 1997-2000 NEC Research Institute. | |
5 | * | |
6 | * MLton is released under a BSD-style license. | |
7 | * See the file MLton-LICENSE for details. | |
8 | *) | |
9 | ||
10 | signature AMD64_MLTON_BASIC_STRUCTS = | |
11 | sig | |
12 | structure Machine: MACHINE | |
13 | structure amd64: AMD64_PSEUDO | |
14 | sharing amd64.CFunction = Machine.CFunction | |
15 | sharing amd64.CType = Machine.CType | |
16 | sharing amd64.Label = Machine.Label | |
17 | sharing amd64.ProfileLabel = Machine.ProfileLabel | |
18 | sharing amd64.RepType = Machine.Type | |
19 | sharing amd64.Runtime = Machine.Runtime | |
20 | sharing amd64.WordSize = Machine.WordSize | |
21 | sharing amd64.WordX = Machine.WordX | |
22 | end | |
23 | ||
24 | signature AMD64_MLTON_BASIC = | |
25 | sig | |
26 | include AMD64_MLTON_BASIC_STRUCTS | |
27 | ||
28 | structure CFunction: C_FUNCTION | |
29 | structure CType: C_TYPE | |
30 | structure RepType: REP_TYPE | |
31 | sharing CFunction = RepType.CFunction | |
32 | sharing CType = RepType.CType | |
33 | sharing RepType = Machine.Type | |
34 | ||
35 | val init : unit -> unit | |
36 | ||
37 | (* | |
38 | * amd64.Size.t equivalents | |
39 | *) | |
40 | val wordBytes : int | |
41 | val wordSize : amd64.Size.t | |
42 | val wordScale : amd64.Scale.t | |
43 | val pointerBytes : int | |
44 | val pointerSize : amd64.Size.t | |
45 | ||
46 | (* | |
47 | * Memory classes | |
48 | *) | |
49 | structure Classes : | |
50 | sig | |
51 | val Heap : amd64.MemLoc.Class.t | |
52 | val Stack : amd64.MemLoc.Class.t | |
53 | val Locals : amd64.MemLoc.Class.t | |
54 | val Globals : amd64.MemLoc.Class.t | |
55 | ||
56 | val Temp : amd64.MemLoc.Class.t | |
57 | val StaticTemp : amd64.MemLoc.Class.t | |
58 | val CArg : amd64.MemLoc.Class.t | |
59 | val CStack : amd64.MemLoc.Class.t | |
60 | val Code : amd64.MemLoc.Class.t | |
61 | ||
62 | val CStatic : amd64.MemLoc.Class.t | |
63 | val StaticNonTemp : amd64.MemLoc.Class.t | |
64 | ||
65 | val GCState : amd64.MemLoc.Class.t | |
66 | val GCStateHold : amd64.MemLoc.Class.t | |
67 | val GCStateVolatile : amd64.MemLoc.Class.t | |
68 | ||
69 | val allClasses : amd64.ClassSet.t ref | |
70 | val livenessClasses : amd64.ClassSet.t ref | |
71 | val holdClasses : amd64.ClassSet.t ref | |
72 | val volatileClasses : amd64.ClassSet.t ref | |
73 | val runtimeClasses : amd64.ClassSet.t ref | |
74 | val heapClasses : amd64.ClassSet.t ref | |
75 | val cstaticClasses : amd64.ClassSet.t ref | |
76 | val cargClasses : amd64.ClassSet.t ref | |
77 | end | |
78 | ||
79 | (* CStack locations *) | |
80 | val c_stackP : amd64.Label.t | |
81 | val c_stackPContents : amd64.MemLoc.t | |
82 | val c_stackPContentsOperand : amd64.Operand.t | |
83 | val c_stackPDerefWordOperand : amd64.Operand.t | |
84 | val c_stackPDerefDoubleOperand : amd64.Operand.t | |
85 | val c_stackPDerefFloatOperand : amd64.Operand.t | |
86 | ||
87 | (* Static temps defined in amd64-main.h *) | |
88 | val applyFFTempFunContentsOperand : amd64.Operand.t | |
89 | val applyFFTempRegArgContents : int -> amd64.MemLoc.t | |
90 | val applyFFTempXmmRegArgContents : amd64.Size.t * int -> amd64.MemLoc.t | |
91 | val fpcvtTempContentsOperand : amd64.Operand.t | |
92 | val fpeqTempContentsOperand : amd64.Size.t -> amd64.Operand.t | |
93 | ||
94 | (* Static arrays defined in main.h and amd64-main.h *) | |
95 | val local_base : amd64.CType.t -> amd64.Label.t | |
96 | val global_base : amd64.CType.t -> amd64.Label.t | |
97 | val globalObjptrNonRoot_base : amd64.Label.t | |
98 | ||
99 | (* gcState relative locations defined in gc.h *) | |
100 | val gcState_label: amd64.Label.t | |
101 | val gcState_offset: {offset: int, ty: amd64.CType.t} -> amd64.Operand.t | |
102 | val gcState_exnStackContents: unit -> amd64.MemLoc.t | |
103 | val gcState_exnStackContentsOperand: unit -> amd64.Operand.t | |
104 | val gcState_frontierContents: unit -> amd64.MemLoc.t | |
105 | val gcState_frontierContentsOperand: unit -> amd64.Operand.t | |
106 | val gcState_stackBottomContents: unit -> amd64.MemLoc.t | |
107 | val gcState_stackBottomContentsOperand: unit -> amd64.Operand.t | |
108 | val gcState_stackTopContents: unit -> amd64.MemLoc.t | |
109 | val gcState_stackTopContentsOperand: unit -> amd64.Operand.t | |
110 | val gcState_stackTopMinusWordDeref: unit -> amd64.MemLoc.t | |
111 | val gcState_stackTopMinusWordDerefOperand: unit -> amd64.Operand.t | |
112 | ||
113 | val stackTopTempContentsOperand: unit -> amd64.Operand.t | |
114 | val stackTopTempMinusWordDeref: unit -> amd64.MemLoc.t | |
115 | val stackTopTempMinusWordDerefOperand: unit -> amd64.Operand.t | |
116 | end |