File: README

package info (click to toggle)
mlton 20210117%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 58,464 kB
  • sloc: ansic: 27,682; sh: 4,455; asm: 3,569; lisp: 2,879; makefile: 2,347; perl: 1,169; python: 191; pascal: 68; javascript: 7
file content (45 lines) | stat: -rw-r--r-- 1,406 bytes parent folder | download | duplicates (5)
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
What's in Here
--------------

This is a simple demo backend for MLRISC.  It only includes instruction
selection and register allocation.  It takes MLTREE statements as input
and emit assembly code in AMD64, Alpha, or Sparc format.  A lot of things
are ignored here: for example, how the stack frame is laid out.  So don't
expect the assembly output to run without some changes.

You can probably use this as a starting point for developing your backend, 
as a lot of stuff here is just boilerplate functor instantiation.

Note: you do not need to have an AMD64 or Alpha or Sparc machine to use the system.

How to Build the System for Alpha or Sparc
-----------------------

I assume you already have either SML/NJ version 110.0.6, 110.25 or 110.29+
Unfortunately, the building process are slightly different across
the versions because of changes to CM.  So three different build files
are provided.

1.  Run sml in this directory
2.  Type:

      use "build-<version>.sml"

    Once you have done this all the code generator definitions are loaded 
    into memory.

3.  You can try: 

      use "eg-sparc.sml"
      use "eg-alpha.sml"

    to load the test inputs.
    Running eg1() and eg2() should produce the assembly. 


How to Build the System for AMD64
-----------------------
1. Run sml in this directory
2. Type "CM.make "sources-amd64.cm"
3. Try generating code by typing
     AMD64Demo.eg();