File: amd64MLTree.sml

package info (click to toggle)
smlnj 110.79-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 82,564 kB
  • sloc: ansic: 32,532; asm: 6,314; sh: 2,296; makefile: 1,821; perl: 1,170; pascal: 295; yacc: 190; cs: 78; python: 77; lisp: 19
file content (80 lines) | stat: -rw-r--r-- 2,285 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

(* MLTree specialization *)
structure AMD64MLTree = 
  MLTreeF(structure Constant = SMLNJConstant
          structure Region=CPSRegions
	  structure Extension=AMD64_SMLNJMLTreeExt)


structure AMD64MLTreeEval =
    MLTreeEval
       (structure T = AMD64MLTree
	fun eq _ _ =  false
        val eqRext = eq		val eqFext = eq
        val eqCCext = eq	val eqSext = eq)
					    
structure AMD64MLTreeHash = 
    MLTreeHash
       (structure T = AMD64MLTree
        fun h _ _ = 0w0
        val hashRext = h	val hashFext = h
        val hashCCext = h       val hashSext = h)

structure AMD64GasPseudoOps = 
   AMD64GasPseudoOps(structure T=AMD64MLTree
		   structure MLTreeEval=AMD64MLTreeEval)

structure AMD64ClientPseudoOps =
   SMLNJPseudoOps(structure Asm=AMD64GasPseudoOps)

structure AMD64PseudoOps = PseudoOps(structure Client = AMD64ClientPseudoOps)
	      
structure AMD64Stream = InstructionStream(AMD64PseudoOps)

structure AMD64MLTreeStream = 
    MLTreeStream
      (structure T = AMD64MLTree
       structure S = AMD64Stream)


(* specialised AMD64 instruction set *)
structure AMD64Instr = AMD64Instr(AMD64MLTree)

structure AMD64MemRegs = AMD64MemRegs(AMD64Instr)

structure AMD64Props = 
    AMD64Props
       (structure Instr=AMD64Instr
	structure MLTreeHash = AMD64MLTreeHash
        structure MLTreeEval = AMD64MLTreeEval)

structure AMD64Shuffle = AMD64Shuffle(AMD64Instr)

(* Assembly code emmitter *)
structure AMD64AsmEmitter=
  AMD64AsmEmitter(structure Instr=AMD64Instr
		structure Shuffle=AMD64Shuffle
		structure MemRegs=AMD64MemRegs
		structure MLTreeEval=AMD64MLTreeEval
		structure S = AMD64Stream
		val memRegBase=SOME(AMD64Instr.C.rsp))


(* Machine code emitter *)
structure AMD64MCEmitter = 
  AMD64MCEmitter(structure Instr=AMD64Instr
	       structure Shuffle=AMD64Shuffle
	       structure AsmEmitter=AMD64AsmEmitter
	       structure MemRegs=AMD64MemRegs
	       structure MLTreeEval=AMD64MLTreeEval
	       val memRegBase=SOME(AMD64Instr.C.rsp))

(* Flowgraph data structure specialized to AMD64 instructions *)
structure AMD64CFG = 
  ControlFlowGraph
     (structure I = AMD64Instr
      structure PseudoOps = AMD64PseudoOps
      structure GraphImpl = DirectedGraph
      structure InsnProps = AMD64Props
      structure Asm = AMD64AsmEmitter)