forked from ocaml-flambda/flambda-backend
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgen_domain_state32_inc.awk
36 lines (35 loc) · 1.56 KB
/
gen_domain_state32_inc.awk
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
#**************************************************************************
#* *
#* OCaml *
#* *
#* KC Sivaramakrishnan, Indian Institute of Technology, Madras *
#* *
#* Copyright 2019 Indian Institute of Technology, Madras *
#* *
#* All rights reserved. This file is distributed under the terms of *
#* the GNU Lesser General Public License version 2.1, with the *
#* special exception on linking described in the file LICENSE. *
#* *
#**************************************************************************
BEGIN{FS="[,)] *";count=0};
/DOMAIN_STATE/{
print "Store_" $2 " MACRO reg1, reg2";
print " mov [reg1+" count "], reg2";
print "ENDM";
print "Load_" $2 " MACRO reg1, reg2";
print " mov reg2, [reg1+" count "]";
print "ENDM";
print "Push_" $2 " MACRO reg1";
print " push [reg1+" count "]";
print "ENDM";
print "Pop_" $2 " MACRO reg1";
print " pop [reg1+" count "]";
print "ENDM";
print "Cmp_" $2 " MACRO reg1, reg2";
print " cmp reg2, [reg1+" count "]";
print "ENDM";
print "Sub_" $2 " MACRO reg1, reg2";
print " sub reg2, [reg1+" count "]";
print "ENDM";
count+=8
}