summaryrefslogtreecommitdiff
path: root/runtime/gen_domain_state64_inc.awk
blob: 8280d4d19f373f6dfdb41e507a57e7e8f3ec8331 (plain)
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
}