forked from ocaml-flambda/flambda-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen_domain_state64_inc.awk
33 lines (32 loc) · 1.43 KB
/
gen_domain_state64_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
#**************************************************************************
#* *
#* 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 reg";
print " mov [r14+" count "], reg";
print "ENDM";
print "Load_" $2 " MACRO reg";
print " mov reg, [r14+" count "]";
print "ENDM";
print "Push_" $2 " MACRO";
print " push [r14+" count "]";
print "ENDM";
print "Pop_" $2 " MACRO";
print " pop [r14+" count "]";
print "ENDM";
print "Cmp_" $2 " MACRO reg";
print " cmp reg, [r14+" count "]";
print "ENDM";
count+=8
}