Import Upstream version 20180207
[hcoop/debian/mlton.git] / mlton / codegen / x86-codegen / x86-mlton.sig
1 (* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
3 * Copyright (C) 1997-2000 NEC Research Institute.
4 *
5 * MLton is released under a BSD-style license.
6 * See the file MLton-LICENSE for details.
7 *)
8
9 signature X86_MLTON_STRUCTS =
10 sig
11 structure x86MLtonBasic : X86_MLTON_BASIC
12 structure x86Liveness : X86_LIVENESS
13 sharing x86MLtonBasic.x86 = x86Liveness.x86
14 end
15
16 signature X86_MLTON =
17 sig
18 include X86_MLTON_STRUCTS
19 include X86_MLTON_BASIC
20 sharing x86 = x86MLtonBasic.x86
21 sharing x86 = x86Liveness.x86
22 sharing x86.Label = Machine.Label
23 sharing Machine = x86MLtonBasic.Machine
24
25 type transInfo = {addData : x86.Assembly.t list -> unit,
26 frameInfoToX86: (x86MLtonBasic.Machine.FrameInfo.t
27 -> x86.FrameInfo.t),
28 live: x86.Label.t -> x86.Operand.t list,
29 liveInfo: x86Liveness.LiveInfo.t}
30
31 (* arith, c call, and primitive assembly sequences. *)
32 val arith: {prim: RepType.t Machine.Prim.t,
33 args: (x86.Operand.t * x86.Size.t) vector,
34 dsts: (x86.Operand.t * x86.Size.t) vector,
35 overflow: x86.Label.t,
36 success: x86.Label.t,
37 transInfo : transInfo} -> x86.Block.t' AppendList.t
38 val ccall: {args: (x86.Operand.t * x86.Size.t) vector,
39 frameInfo: x86.FrameInfo.t option,
40 func: RepType.t Machine.CFunction.t,
41 return: x86.Label.t option,
42 transInfo: transInfo} -> x86.Block.t' AppendList.t
43 val creturn: {dsts: (x86.Operand.t * x86.Size.t) vector,
44 frameInfo: x86.FrameInfo.t option,
45 func: RepType.t Machine.CFunction.t,
46 label: x86.Label.t,
47 transInfo: transInfo} -> x86.Block.t' AppendList.t
48 val implementsPrim: RepType.t Machine.Prim.t -> bool
49 val prim: {prim: RepType.t Machine.Prim.t,
50 args: (x86.Operand.t * x86.Size.t) vector,
51 dsts: (x86.Operand.t * x86.Size.t) vector,
52 transInfo: transInfo} -> x86.Block.t' AppendList.t
53 end