#define STACK_MACHINE #include "c.h" #define NODEPTR_TYPE Node #define OP_LABEL(p) ((p)->op) #define LEFT_CHILD(p) ((p)->kids[0]) #define RIGHT_CHILD(p) ((p)->kids[1]) #define STATE_LABEL(p) ((p)->x.state) static void address(Symbol, Symbol, long); static void defaddress(Symbol); static void defconst(int, int, Value); static void defstring(int, char *); static void defsymbol(Symbol); static void emit2(Node); static void export(Symbol); static void function(Symbol, Symbol [], Symbol [], int); static void global(Symbol); static void import(Symbol); static void local(Symbol); static void progbeg(int, char **); static void progend(void); static void segment(int); static void space(int); static void blockbeg(Env* env); static void blockend(Env* env); static int getLocal(Symbol s); static int isCurrentFun(Node); static int isNotCurrentFun(Node); static int isDefinedFun(Node); static int isNotDefinedFun(Node); static int isDefinedVar(Node); static int isNotDefinedVar(Node); static int isAligned(Node); static int isNotAligned(Node); extern void stackemit(Node forest); extern Node stackgen(Node forest); extern void swtch(Symbol label); static int initedVars = 0; // if 1 lcc defined BSS, where not initialized variables are placed static int arguments = 0; static int iElems = 0; // the number of elements in an array static long pendingBits = 0; // the number of elements in an array static int hasPendingBits = 0; // the number of elements in an array static Symbol curFun; #define USR_FUN 1 #define D 0 #define D_ENTER(p) if(D) enterDebug(p); #define D_LEAVE(p) if(D) exitDebug(p); #define D_POINT(p) if(D) traceDebug(p); int intend = 0; static void enterDebug(char* f){ int i; for(i = 0; i < intend;i++){ print("\t"); } intend++; print("enter: %s\n", f); } static void exitDebug(char* f){ int i; intend--; for(i = 0; i < intend;i++){ print("\t"); } print("leave: %s\n", f); } static void traceDebug(char* f){ int i; for(i = 0; i < intend;i++){ print("\t"); } print("trace: %s\n", f); } //Are their 3 Byte Operations? for 24 Bit #define WITH_MULT (0) //Not yet fully flexible in this param #define DATA_WIDTH (32) #define DATA_ADDR_WIDTH (12) #define DATA_BYTES (DATA_WIDTH/8) /* This is log(DATA_BYTES) <-- zweier log) */ #define BYTE_ADDR_BITS (2) #define COPY_BLOCK_SIZE (12) #define MULT_COST (((WITH_MULT^1)*(DATA_WIDTH+3))+1) /* generated at Tue May 13 12:28:22 2014 by $Id: lburg.c,v 2.10 2002/03/08 18:45:21 drh Exp $ */ static void _kids(NODEPTR_TYPE, int, NODEPTR_TYPE[]); static void _label(NODEPTR_TYPE); static int _rule(void*, int); #define _stmt_NT 1 #define _zero_NT 2 #define _cnst1_NT 3 #define _cnst2_NT 4 #define _cnst3_NT 5 #define _cnst4_NT 6 #define _cnstn_NT 7 #define _stk_NT 8 #define _addr_NT 9 #define _addr4_NT 10 #define _sread_NT 11 #define _swrite_NT 12 #define _tuck1_NT 13 #define _tuck2_NT 14 #define _tuck3_NT 15 #define _lAddr_NT 16 #define _jAddr_NT 17 static char *_ntname[] = { 0, "stmt", "zero", "cnst1", "cnst2", "cnst3", "cnst4", "cnstn", "stk", "addr", "addr4", "sread", "swrite", "tuck1", "tuck2", "tuck3", "lAddr", "jAddr", 0 }; struct _state { short cost[18]; struct { unsigned int _stmt:6; unsigned int _zero:3; unsigned int _cnst1:3; unsigned int _cnst2:3; unsigned int _cnst3:1; unsigned int _cnst4:3; unsigned int _cnstn:2; unsigned int _stk:7; unsigned int _addr:6; unsigned int _addr4:5; unsigned int _sread:3; unsigned int _swrite:2; unsigned int _tuck1:3; unsigned int _tuck2:3; unsigned int _tuck3:3; unsigned int _lAddr:1; unsigned int _jAddr:1; } rule; }; static short _nts_0[] = { 0 }; static short _nts_1[] = { _stk_NT, 0 }; static short _nts_2[] = { _sread_NT, 0 }; static short _nts_3[] = { _stk_NT, _swrite_NT, 0 }; static short _nts_4[] = { _addr_NT, _swrite_NT, 0 }; static short _nts_5[] = { _addr_NT, 0 }; static short _nts_6[] = { _tuck1_NT, 0 }; static short _nts_7[] = { _tuck2_NT, 0 }; static short _nts_8[] = { _tuck3_NT, 0 }; static short _nts_9[] = { _addr4_NT, 0 }; static short _nts_10[] = { _stk_NT, _lAddr_NT, 0 }; static short _nts_11[] = { _addr_NT, _lAddr_NT, 0 }; static short _nts_12[] = { _stk_NT, _addr4_NT, 0 }; static short _nts_13[] = { _stk_NT, _addr_NT, 0 }; static short _nts_14[] = { _addr_NT, _addr_NT, 0 }; static short _nts_15[] = { _lAddr_NT, 0 }; static short _nts_16[] = { _addr4_NT, _stk_NT, 0 }; static short _nts_17[] = { _addr4_NT, _zero_NT, 0 }; static short _nts_18[] = { _addr4_NT, _cnst4_NT, 0 }; static short _nts_19[] = { _addr4_NT, _addr4_NT, 0 }; static short _nts_20[] = { _addr_NT, _addr4_NT, 0 }; static short _nts_21[] = { _addr4_NT, _addr_NT, 0 }; static short _nts_22[] = { _addr_NT, _zero_NT, 0 }; static short _nts_23[] = { _addr_NT, _stk_NT, 0 }; static short _nts_24[] = { _addr_NT, _cnst1_NT, 0 }; static short _nts_25[] = { _addr_NT, _cnst2_NT, 0 }; static short _nts_26[] = { _addr_NT, _cnst4_NT, 0 }; static short _nts_27[] = { _addr_NT, _cnstn_NT, 0 }; static short _nts_28[] = { _stk_NT, _cnst2_NT, 0 }; static short _nts_29[] = { _stk_NT, _cnst3_NT, 0 }; static short _nts_30[] = { _stk_NT, _cnst4_NT, 0 }; static short _nts_31[] = { _stk_NT, _stk_NT, 0 }; static short _nts_32[] = { _cnst1_NT, _stk_NT, 0 }; static short _nts_33[] = { _stk_NT, _cnst1_NT, 0 }; static short _nts_34[] = { _jAddr_NT, 0 }; static short *_nts[] = { 0, /* 0 */ _nts_0, /* 1 */ _nts_0, /* 2 */ _nts_0, /* 3 */ _nts_0, /* 4 */ _nts_0, /* 5 */ _nts_0, /* 6 */ _nts_0, /* 7 */ _nts_0, /* 8 */ _nts_0, /* 9 */ _nts_0, /* 10 */ _nts_0, /* 11 */ _nts_0, /* 12 */ _nts_0, /* 13 */ _nts_0, /* 14 */ _nts_0, /* 15 */ _nts_0, /* 16 */ _nts_0, /* 17 */ _nts_0, /* 18 */ _nts_0, /* 19 */ _nts_0, /* 20 */ _nts_0, /* 21 */ _nts_0, /* 22 */ _nts_0, /* 23 */ _nts_0, /* 24 */ _nts_0, /* 25 */ _nts_0, /* 26 */ _nts_0, /* 27 */ _nts_0, /* 28 */ _nts_0, /* 29 */ _nts_0, /* 30 */ _nts_0, /* 31 */ _nts_0, /* 32 */ _nts_0, /* 33 */ _nts_0, /* 34 */ _nts_0, /* 35 */ _nts_0, /* 36 */ _nts_0, /* 37 */ _nts_0, /* 38 */ _nts_1, /* 39 */ _nts_0, /* 40 */ _nts_0, /* 41 */ _nts_0, /* 42 */ _nts_0, /* 43 */ _nts_0, /* 44 */ _nts_0, /* 45 */ _nts_0, /* 46 */ _nts_0, /* 47 */ _nts_0, /* 48 */ _nts_0, /* 49 */ _nts_2, /* 50 */ _nts_2, /* 51 */ _nts_2, /* 52 */ _nts_2, /* 53 */ _nts_2, /* 54 */ _nts_2, /* 55 */ _nts_2, /* 56 */ _nts_3, /* 57 */ _nts_3, /* 58 */ _nts_3, /* 59 */ _nts_3, /* 60 */ _nts_3, /* 61 */ _nts_3, /* 62 */ _nts_4, /* 63 */ _nts_1, /* 64 */ _nts_1, /* 65 */ _nts_1, /* 66 */ _nts_1, /* 67 */ _nts_1, /* 68 */ _nts_1, /* 69 */ _nts_5, /* 70 */ _nts_5, /* 71 */ _nts_1, /* 72 */ _nts_1, /* 73 */ _nts_1, /* 74 */ _nts_1, /* 75 */ _nts_1, /* 76 */ _nts_1, /* 77 */ _nts_5, /* 78 */ _nts_5, /* 79 */ _nts_1, /* 80 */ _nts_1, /* 81 */ _nts_1, /* 82 */ _nts_1, /* 83 */ _nts_1, /* 84 */ _nts_1, /* 85 */ _nts_5, /* 86 */ _nts_5, /* 87 */ _nts_6, /* 88 */ _nts_7, /* 89 */ _nts_8, /* 90 */ _nts_6, /* 91 */ _nts_7, /* 92 */ _nts_8, /* 93 */ _nts_0, /* 94 */ _nts_0, /* 95 */ _nts_0, /* 96 */ _nts_0, /* 97 */ _nts_0, /* 98 */ _nts_0, /* 99 */ _nts_0, /* 100 */ _nts_9, /* 101 */ _nts_10, /* 102 */ _nts_10, /* 103 */ _nts_11, /* 104 */ _nts_10, /* 105 */ _nts_10, /* 106 */ _nts_10, /* 107 */ _nts_10, /* 108 */ _nts_10, /* 109 */ _nts_10, /* 110 */ _nts_10, /* 111 */ _nts_10, /* 112 */ _nts_12, /* 113 */ _nts_12, /* 114 */ _nts_12, /* 115 */ _nts_12, /* 116 */ _nts_13, /* 117 */ _nts_13, /* 118 */ _nts_13, /* 119 */ _nts_13, /* 120 */ _nts_13, /* 121 */ _nts_13, /* 122 */ _nts_14, /* 123 */ _nts_15, /* 124 */ _nts_15, /* 125 */ _nts_15, /* 126 */ _nts_15, /* 127 */ _nts_15, /* 128 */ _nts_15, /* 129 */ _nts_15, /* 130 */ _nts_15, /* 131 */ _nts_15, /* 132 */ _nts_15, /* 133 */ _nts_15, /* 134 */ _nts_9, /* 135 */ _nts_9, /* 136 */ _nts_9, /* 137 */ _nts_9, /* 138 */ _nts_5, /* 139 */ _nts_5, /* 140 */ _nts_5, /* 141 */ _nts_5, /* 142 */ _nts_5, /* 143 */ _nts_5, /* 144 */ _nts_5, /* 145 */ _nts_16, /* 146 */ _nts_12, /* 147 */ _nts_16, /* 148 */ _nts_12, /* 149 */ _nts_17, /* 150 */ _nts_18, /* 151 */ _nts_19, /* 152 */ _nts_19, /* 153 */ _nts_20, /* 154 */ _nts_20, /* 155 */ _nts_21, /* 156 */ _nts_21, /* 157 */ _nts_22, /* 158 */ _nts_23, /* 159 */ _nts_13, /* 160 */ _nts_24, /* 161 */ _nts_25, /* 162 */ _nts_26, /* 163 */ _nts_27, /* 164 */ _nts_19, /* 165 */ _nts_23, /* 166 */ _nts_13, /* 167 */ _nts_22, /* 168 */ _nts_24, /* 169 */ _nts_25, /* 170 */ _nts_26, /* 171 */ _nts_27, /* 172 */ _nts_28, /* 173 */ _nts_28, /* 174 */ _nts_29, /* 175 */ _nts_29, /* 176 */ _nts_30, /* 177 */ _nts_30, /* 178 */ _nts_9, /* 179 */ _nts_5, /* 180 */ _nts_5, /* 181 */ _nts_1, /* 182 */ _nts_1, /* 183 */ _nts_1, /* 184 */ _nts_1, /* 185 */ _nts_1, /* 186 */ _nts_1, /* 187 */ _nts_1, /* 188 */ _nts_1, /* 189 */ _nts_1, /* 190 */ _nts_1, /* 191 */ _nts_31, /* 192 */ _nts_31, /* 193 */ _nts_32, /* 194 */ _nts_32, /* 195 */ _nts_33, /* 196 */ _nts_33, /* 197 */ _nts_31, /* 198 */ _nts_31, /* 199 */ _nts_33, /* 200 */ _nts_33, /* 201 */ _nts_1, /* 202 */ _nts_1, /* 203 */ _nts_1, /* 204 */ _nts_31, /* 205 */ _nts_31, /* 206 */ _nts_31, /* 207 */ _nts_31, /* 208 */ _nts_31, /* 209 */ _nts_31, /* 210 */ _nts_31, /* 211 */ _nts_31, /* 212 */ _nts_31, /* 213 */ _nts_31, /* 214 */ _nts_31, /* 215 */ _nts_31, /* 216 */ _nts_31, /* 217 */ _nts_31, /* 218 */ _nts_31, /* 219 */ _nts_31, /* 220 */ _nts_31, /* 221 */ _nts_31, /* 222 */ _nts_31, /* 223 */ _nts_31, /* 224 */ _nts_31, /* 225 */ _nts_31, /* 226 */ _nts_31, /* 227 */ _nts_31, /* 228 */ _nts_31, /* 229 */ _nts_31, /* 230 */ _nts_31, /* 231 */ _nts_31, /* 232 */ _nts_34, /* 233 */ _nts_34, /* 234 */ _nts_34, /* 235 */ _nts_34, /* 236 */ _nts_34, /* 237 */ _nts_34, /* 238 */ _nts_34, /* 239 */ _nts_34, /* 240 */ _nts_34, /* 241 */ _nts_34, /* 242 */ _nts_34, /* 243 */ _nts_34, /* 244 */ _nts_5, /* 245 */ _nts_5, /* 246 */ _nts_5, /* 247 */ _nts_5, /* 248 */ _nts_1, /* 249 */ _nts_1, /* 250 */ _nts_5, /* 251 */ _nts_0, /* 252 */ _nts_1, /* 253 */ _nts_1, /* 254 */ _nts_5, /* 255 */ _nts_34, /* 256 */ _nts_5, /* 257 */ _nts_0, /* 258 */ _nts_14, /* 259 */ }; static char *_templates[] = { /* 0 */ 0, /* 1 */ "", /* zero: CNSTI1 */ /* 2 */ "", /* zero: CNSTI2 */ /* 3 */ "", /* zero: CNSTI4 */ /* 4 */ "", /* zero: CNSTU1 */ /* 5 */ "", /* zero: CNSTU2 */ /* 6 */ "", /* zero: CNSTU4 */ /* 7 */ "", /* zero: CNSTP4 */ /* 8 */ "", /* cnst1: CNSTI1 */ /* 9 */ "", /* cnst1: CNSTU1 */ /* 10 */ "", /* cnst1: CNSTI2 */ /* 11 */ "", /* cnst1: CNSTU2 */ /* 12 */ "", /* cnst1: CNSTI4 */ /* 13 */ "", /* cnst1: CNSTU4 */ /* 14 */ "", /* cnst2: CNSTI1 */ /* 15 */ "", /* cnst2: CNSTU1 */ /* 16 */ "", /* cnst2: CNSTI2 */ /* 17 */ "", /* cnst2: CNSTU2 */ /* 18 */ "", /* cnst2: CNSTI4 */ /* 19 */ "", /* cnst2: CNSTU4 */ /* 20 */ "", /* cnst3: CNSTI4 */ /* 21 */ "", /* cnst4: CNSTI1 */ /* 22 */ "", /* cnst4: CNSTU1 */ /* 23 */ "", /* cnst4: CNSTI2 */ /* 24 */ "", /* cnst4: CNSTU2 */ /* 25 */ "", /* cnst4: CNSTI4 */ /* 26 */ "", /* cnst4: CNSTU4 */ /* 27 */ "%a\n", /* cnstn: CNSTU4 */ /* 28 */ "%a\n", /* cnstn: CNSTI4 */ /* 29 */ "%a\n", /* stk: CNSTI1 */ /* 30 */ "%a\n", /* stk: CNSTU1 */ /* 31 */ "%a\n", /* stk: CNSTI2 */ /* 32 */ "%a\n", /* stk: CNSTU2 */ /* 33 */ "%a\n", /* stk: CNSTI4 */ /* 34 */ "%a\n", /* stk: CNSTU4 */ /* 35 */ "#\n", /* addr: CNSTP4 */ /* 36 */ "#\n", /* addr4: CNSTP4 */ /* 37 */ "#\n", /* addr4: CNSTI4 */ /* 38 */ "#\n", /* addr4: CNSTU4 */ /* 39 */ "drop\n", /* stmt: stk */ /* 40 */ "\n", /* sread: STACKP */ /* 41 */ "swap\n", /* sread: STACKP */ /* 42 */ "rot\n", /* sread: STACKP */ /* 43 */ "dup\n", /* sread: COPYP */ /* 44 */ "over\n", /* sread: COPYP */ /* 45 */ "2over\nnip\n", /* sread: COPYP */ /* 46 */ "any\n", /* sread: COPYP */ /* 47 */ "\n", /* swrite: STACKP */ /* 48 */ "swap\n", /* swrite: STACKP */ /* 49 */ "-rot\n", /* swrite: STACKP */ /* 50 */ "\n", /* stk: INDIRI1(sread) */ /* 51 */ "\n", /* stk: INDIRU1(sread) */ /* 52 */ "\n", /* stk: INDIRI2(sread) */ /* 53 */ "\n", /* stk: INDIRU2(sread) */ /* 54 */ "\n", /* stk: INDIRI4(sread) */ /* 55 */ "\n", /* stk: INDIRU4(sread) */ /* 56 */ "\n", /* addr: INDIRP4(sread) */ /* 57 */ "\n", /* stmt: ASGNI1(stk,swrite) */ /* 58 */ "\n", /* stmt: ASGNU1(stk,swrite) */ /* 59 */ "\n", /* stmt: ASGNI2(stk,swrite) */ /* 60 */ "\n", /* stmt: ASGNU2(stk,swrite) */ /* 61 */ "\n", /* stmt: ASGNI4(stk,swrite) */ /* 62 */ "\n", /* stmt: ASGNU4(stk,swrite) */ /* 63 */ "\n", /* stmt: ASGNP4(addr,swrite) */ /* 64 */ "\n", /* tuck1: TUCKI1(stk) */ /* 65 */ "\n", /* tuck1: TUCKU1(stk) */ /* 66 */ "\n", /* tuck1: TUCKI2(stk) */ /* 67 */ "\n", /* tuck1: TUCKU2(stk) */ /* 68 */ "\n", /* tuck1: TUCKI4(stk) */ /* 69 */ "\n", /* tuck1: TUCKU4(stk) */ /* 70 */ "dup\n", /* addr: TUCKP4(addr) */ /* 71 */ "\n", /* stmt: TUCKP4(addr) */ /* 72 */ "\n", /* tuck2: TUCKI1(stk) */ /* 73 */ "\n", /* tuck2: TUCKU1(stk) */ /* 74 */ "\n", /* tuck2: TUCKI2(stk) */ /* 75 */ "\n", /* tuck2: TUCKU2(stk) */ /* 76 */ "\n", /* tuck2: TUCKI4(stk) */ /* 77 */ "\n", /* tuck2: TUCKU4(stk) */ /* 78 */ "tuck\n", /* addr: TUCKP4(addr) */ /* 79 */ "swap\n", /* stmt: TUCKP4(addr) */ /* 80 */ "\n", /* tuck3: TUCKI1(stk) */ /* 81 */ "\n", /* tuck3: TUCKU1(stk) */ /* 82 */ "\n", /* tuck3: TUCKI2(stk) */ /* 83 */ "\n", /* tuck3: TUCKU2(stk) */ /* 84 */ "\n", /* tuck3: TUCKI4(stk) */ /* 85 */ "\n", /* tuck3: TUCKU4(stk) */ /* 86 */ "-rot\n2over\nnip\n", /* addr: TUCKP4(addr) */ /* 87 */ "-rot\n", /* stmt: TUCKP4(addr) */ /* 88 */ "dup\n", /* stk: tuck1 */ /* 89 */ "tuck\n", /* stk: tuck2 */ /* 90 */ "-rot\n2over\nnip\n", /* stk: tuck3 */ /* 91 */ "\n", /* stmt: tuck1 */ /* 92 */ "swap\n", /* stmt: tuck2 */ /* 93 */ "-rot\n", /* stmt: tuck3 */ /* 94 */ "nop\n", /* stk: NOOP */ /* 95 */ "%a", /* lAddr: ADDRLP4 */ /* 96 */ "%a", /* jAddr: ADDRGP4 */ /* 97 */ "ADDR %a\n", /* addr: ADDRGP4 */ /* 98 */ "%a\n", /* addr: ADDRGP4 */ /* 99 */ "#\n", /* addr4: ADDRLP4 */ /* 100 */ "#\n", /* addr: ADDRLP4 */ /* 101 */ "\n", /* addr: addr4 */ /* 102 */ "#\n", /* stmt: ASGNI4(stk,lAddr) */ /* 103 */ "#\n", /* stmt: ASGNU4(stk,lAddr) */ /* 104 */ "#\n", /* stmt: ASGNP4(addr,lAddr) */ /* 105 */ "#\n", /* stmt: ASGNI1(stk,lAddr) */ /* 106 */ "#\n", /* stmt: ASGNU1(stk,lAddr) */ /* 107 */ "#\n", /* stmt: ASGNI2(stk,lAddr) */ /* 108 */ "#\n", /* stmt: ASGNU2(stk,lAddr) */ /* 109 */ "#\n", /* stmt: ASGNI1(stk,lAddr) */ /* 110 */ "#\n", /* stmt: ASGNU1(stk,lAddr) */ /* 111 */ "#\n", /* stmt: ASGNI2(stk,lAddr) */ /* 112 */ "#\n", /* stmt: ASGNU2(stk,lAddr) */ /* 113 */ "__SAB__\n", /* stmt: ASGNI1(stk,addr4) */ /* 114 */ "__SAB__\n", /* stmt: ASGNU1(stk,addr4) */ /* 115 */ "__SAS__\n", /* stmt: ASGNI2(stk,addr4) */ /* 116 */ "__SAS__\n", /* stmt: ASGNU2(stk,addr4) */ /* 117 */ "__SB__\n", /* stmt: ASGNI1(stk,addr) */ /* 118 */ "__SB__\n", /* stmt: ASGNU1(stk,addr) */ /* 119 */ "__SS__\n", /* stmt: ASGNI2(stk,addr) */ /* 120 */ "__SS__\n", /* stmt: ASGNU2(stk,addr) */ /* 121 */ "!\n", /* stmt: ASGNI4(stk,addr) */ /* 122 */ "!\n", /* stmt: ASGNU4(stk,addr) */ /* 123 */ "!\n", /* stmt: ASGNP4(addr,addr) */ /* 124 */ "#\n", /* stk: INDIRI4(lAddr) */ /* 125 */ "#\n", /* stk: INDIRU4(lAddr) */ /* 126 */ "#\n", /* addr: INDIRP4(lAddr) */ /* 127 */ "#\n", /* stk: INDIRI1(lAddr) */ /* 128 */ "#\n", /* stk: INDIRU1(lAddr) */ /* 129 */ "#\n", /* stk: INDIRI2(lAddr) */ /* 130 */ "#\n", /* stk: INDIRU2(lAddr) */ /* 131 */ "#\n", /* stk: INDIRI1(lAddr) */ /* 132 */ "#\n", /* stk: INDIRU1(lAddr) */ /* 133 */ "#\n", /* stk: INDIRI2(lAddr) */ /* 134 */ "#\n", /* stk: INDIRU2(lAddr) */ /* 135 */ "__RAB__\n", /* stk: INDIRI1(addr4) */ /* 136 */ "__RAB__\n", /* stk: INDIRU1(addr4) */ /* 137 */ "__RAS__\n", /* stk: INDIRI2(addr4) */ /* 138 */ "__RAS__\n", /* stk: INDIRU2(addr4) */ /* 139 */ "__RB__\n", /* stk: INDIRI1(addr) */ /* 140 */ "__RB__\n", /* stk: INDIRU1(addr) */ /* 141 */ "__RS__\n", /* stk: INDIRI2(addr) */ /* 142 */ "__RS__\n", /* stk: INDIRU2(addr) */ /* 143 */ "@\n", /* stk: INDIRI4(addr) */ /* 144 */ "@\n", /* stk: INDIRU4(addr) */ /* 145 */ "@\n", /* addr: INDIRP4(addr) */ /* 146 */ "*\n", /* addr4: MULU4(addr4,stk) */ /* 147 */ "*\n", /* addr4: MULU4(stk,addr4) */ /* 148 */ "*\n", /* addr4: MULI4(addr4,stk) */ /* 149 */ "*\n", /* addr4: MULI4(stk,addr4) */ /* 150 */ "\n", /* addr4: ADDP4(addr4,zero) */ /* 151 */ "1+\n", /* addr4: ADDP4(addr4,cnst4) */ /* 152 */ "+\n", /* addr4: ADDP4(addr4,addr4) */ /* 153 */ "+\n", /* addr4: ADDU4(addr4,addr4) */ /* 154 */ "+\n", /* addr: ADDP4(addr,addr4) */ /* 155 */ "+\n", /* addr: ADDU4(addr,addr4) */ /* 156 */ "+\n", /* addr: ADDP4(addr4,addr) */ /* 157 */ "+\n", /* addr: ADDU4(addr4,addr) */ /* 158 */ "\n", /* addr: ADDP4(addr,zero) */ /* 159 */ "swap\n__ROL__\n__ROL__\n+\n__ROR__\n__ROR__\n", /* addr: ADDP4(addr,stk) */ /* 160 */ "__ROL__\n__ROL__\n+\n__ROR__\n__ROR__\n", /* addr: ADDP4(stk,addr) */ /* 161 */ "__ROL__\n__ROL__\n1+\n__ROR__\n__ROR__\n", /* addr: ADDP4(addr,cnst1) */ /* 162 */ "__ROL__\n1+\n__ROR__\n", /* addr: ADDP4(addr,cnst2) */ /* 163 */ "1+\n", /* addr: ADDP4(addr,cnst4) */ /* 164 */ "__ROL__\n__ROL__\n%1\n+\n__ROR__\n__ROR__\n", /* addr: ADDP4(addr,cnstn) */ /* 165 */ "-\n", /* addr4: SUBP4(addr4,addr4) */ /* 166 */ "swap\n__ROL__\n__ROL__\n-\n__ROR__\n__ROR__\n", /* addr: SUBP4(addr,stk) */ /* 167 */ "__ROL__\n__ROL__\n-\n__ROR__\n__ROR__\n", /* addr: SUBP4(stk,addr) */ /* 168 */ "\n", /* addr: SUBP4(addr,zero) */ /* 169 */ "__ROL__\n__ROL__\n1-\n__ROR__\n__ROR__\n", /* addr: SUBP4(addr,cnst1) */ /* 170 */ "__ROL__\n1-\n__ROR__\n", /* addr: SUBP4(addr,cnst2) */ /* 171 */ "1-\n", /* addr: SUBP4(addr,cnst4) */ /* 172 */ "__ROL__\n__ROL__\n%1\n-\n__ROR__\n__ROR__\n", /* addr: SUBP4(addr,cnstn) */ /* 173 */ "\n", /* addr4: LSHI4(stk,cnst2) */ /* 174 */ "\n", /* addr4: LSHU4(stk,cnst2) */ /* 175 */ "1\nshift\n", /* addr4: LSHI4(stk,cnst3) */ /* 176 */ "1\nshift\n", /* addr4: LSHU4(stk,cnst3) */ /* 177 */ "2\nshift\n", /* addr4: LSHI4(stk,cnst4) */ /* 178 */ "2\nshift\n", /* addr4: LSHU4(stk,cnst4) */ /* 179 */ "\n", /* addr4: CVPU4(addr4) */ /* 180 */ "\n", /* addr: CVPU4(addr) */ /* 181 */ "__ROL__\n__ROL__\n", /* stk: addr */ /* 182 */ "__ROR__\n__ROR__\n", /* addr: stk */ /* 183 */ "\n", /* stk: CVII1(stk) */ /* 184 */ "255\nand\n", /* stk: CVUU1(stk) */ /* 185 */ "\n", /* stk: CVII2(stk) */ /* 186 */ "65535\nand\n", /* stk: CVUU2(stk) */ /* 187 */ "\n", /* stk: CVII4(stk) */ /* 188 */ "\n", /* stk: CVUI4(stk) */ /* 189 */ "\n", /* stk: CVIU4(stk) */ /* 190 */ "\n", /* stk: CVUU4(stk) */ /* 191 */ "\n", /* stk: CVUP4(stk) */ /* 192 */ "+\n", /* stk: ADDI4(stk,stk) */ /* 193 */ "+\n", /* stk: ADDU4(stk,stk) */ /* 194 */ "1+\n", /* stk: ADDI4(cnst1,stk) */ /* 195 */ "1+\n", /* stk: ADDU4(cnst1,stk) */ /* 196 */ "1+\n", /* stk: ADDI4(stk,cnst1) */ /* 197 */ "1+\n", /* stk: ADDU4(stk,cnst1) */ /* 198 */ "-\n", /* stk: SUBI4(stk,stk) */ /* 199 */ "-\n", /* stk: SUBU4(stk,stk) */ /* 200 */ "1-\n", /* stk: SUBI4(stk,cnst1) */ /* 201 */ "1-\n", /* stk: SUBU4(stk,cnst1) */ /* 202 */ "invert\n", /* stk: BCOMI4(stk) */ /* 203 */ "invert\n", /* stk: BCOMU4(stk) */ /* 204 */ "negate\n", /* stk: NEGI4(stk) */ /* 205 */ "and\n", /* stk: BANDI4(stk,stk) */ /* 206 */ "or\n", /* stk: BORI4(stk,stk) */ /* 207 */ "xor\n", /* stk: BXORI4(stk,stk) */ /* 208 */ "and\n", /* stk: BANDU4(stk,stk) */ /* 209 */ "or\n", /* stk: BORU4(stk,stk) */ /* 210 */ "xor\n", /* stk: BXORU4(stk,stk) */ /* 211 */ "/\n", /* stk: DIVI4(stk,stk) */ /* 212 */ "shift\n", /* stk: LSHI4(stk,stk) */ /* 213 */ "mod\n", /* stk: MODI4(stk,stk) */ /* 214 */ "*\n", /* stk: MULI4(stk,stk) */ /* 215 */ "negate\nashift\n", /* stk: RSHI4(stk,stk) */ /* 216 */ "u/\n", /* stk: DIVU4(stk,stk) */ /* 217 */ "shift\n", /* stk: LSHU4(stk,stk) */ /* 218 */ "umod\n", /* stk: MODU4(stk,stk) */ /* 219 */ "*\n", /* stk: MULU4(stk,stk) */ /* 220 */ "negate\nshift\n", /* stk: RSHU4(stk,stk) */ /* 221 */ "-\n0=\n?GOTO %a ( jump if equal )\n", /* stmt: EQI4(stk,stk) */ /* 222 */ "-\n0=\n?GOTO %a ( jump if equal )\n", /* stmt: EQU4(stk,stk) */ /* 223 */ "<\n0=\n?GOTO %a ( jump if greater or equal )\n", /* stmt: GEI4(stk,stk) */ /* 224 */ "u<\n0=\n?GOTO %a ( jump if greater or equal )\n", /* stmt: GEU4(stk,stk) */ /* 225 */ ">\n?GOTO %a ( jump if greater )\n", /* stmt: GTI4(stk,stk) */ /* 226 */ "u>\n?GOTO %a ( jump if greater )\n", /* stmt: GTU4(stk,stk) */ /* 227 */ ">\n0=\n?GOTO %a ( jump if less or equal )\n", /* stmt: LEI4(stk,stk) */ /* 228 */ "u>\n0=\n?GOTO %a ( jump if less or equal )\n", /* stmt: LEU4(stk,stk) */ /* 229 */ "<\n?GOTO %a ( jump if less )\n", /* stmt: LTI4(stk,stk) */ /* 230 */ "u<\n?GOTO %a ( jump if less )\n", /* stmt: LTU4(stk,stk) */ /* 231 */ "-\n?GOTO %a ( jump if not equal )\n", /* stmt: NEI4(stk,stk) */ /* 232 */ "-\n?GOTO %a ( jump if not equal )\n", /* stmt: NEU4(stk,stk) */ /* 233 */ "%0\n", /* stmt: CALLV(jAddr) */ /* 234 */ "%0\n", /* stk: CALLI4(jAddr) */ /* 235 */ "%0\n", /* stk: CALLU4(jAddr) */ /* 236 */ "%0\n", /* addr: CALLP4(jAddr) */ /* 237 */ "RECURSE ( recursive call to function )\n", /* stmt: CALLV(jAddr) */ /* 238 */ "RECURSE ( recursive call to function )\n", /* stk: CALLI4(jAddr) */ /* 239 */ "RECURSE ( recursive call to function )\n", /* stk: CALLU4(jAddr) */ /* 240 */ "RECURSE ( recursive call to function )\n", /* addr: CALLP4(jAddr) */ /* 241 */ "CALL %0 ( call to function )\n", /* stmt: CALLV(jAddr) */ /* 242 */ "CALL %0 ( call to function )\n", /* stk: CALLI4(jAddr) */ /* 243 */ "CALL %0 ( call to function )\n", /* stk: CALLU4(jAddr) */ /* 244 */ "CALL %0 ( call to function )\n", /* addr: CALLP4(jAddr) */ /* 245 */ "EXECUTE ( call to function pointer )\n", /* stmt: CALLV(addr) */ /* 246 */ "EXECUTE ( call to function pointer )\n", /* stk: CALLI4(addr) */ /* 247 */ "EXECUTE ( call to function pointer )\n", /* stk: CALLU4(addr) */ /* 248 */ "EXECUTE ( call to function pointer )\n", /* addr: CALLP4(addr) */ /* 249 */ "( return int )\n", /* stmt: RETI4(stk) */ /* 250 */ "( return uint )\n", /* stmt: RETU4(stk) */ /* 251 */ "( return addr )\n", /* stmt: RETP4(addr) */ /* 252 */ "", /* stmt: RETV */ /* 253 */ "#\n", /* stmt: ARGI4(stk) */ /* 254 */ "#\n", /* stmt: ARGU4(stk) */ /* 255 */ "#\n", /* stmt: ARGP4(addr) */ /* 256 */ "GOTO %0\n", /* stmt: JUMPV(jAddr) */ /* 257 */ "branch\n", /* stmt: JUMPV(addr) */ /* 258 */ "Label %a\n", /* stmt: LABELV */ /* 259 */ "#\n", /* stmt: ASGNB(INDIRB(addr),addr) */ }; static char _isinstruction[] = { /* 0 */ 0, /* 1 */ 0, /* */ /* 2 */ 0, /* */ /* 3 */ 0, /* */ /* 4 */ 0, /* */ /* 5 */ 0, /* */ /* 6 */ 0, /* */ /* 7 */ 0, /* */ /* 8 */ 0, /* */ /* 9 */ 0, /* */ /* 10 */ 0, /* */ /* 11 */ 0, /* */ /* 12 */ 0, /* */ /* 13 */ 0, /* */ /* 14 */ 0, /* */ /* 15 */ 0, /* */ /* 16 */ 0, /* */ /* 17 */ 0, /* */ /* 18 */ 0, /* */ /* 19 */ 0, /* */ /* 20 */ 0, /* */ /* 21 */ 0, /* */ /* 22 */ 0, /* */ /* 23 */ 0, /* */ /* 24 */ 0, /* */ /* 25 */ 0, /* */ /* 26 */ 0, /* */ /* 27 */ 1, /* %a\n */ /* 28 */ 1, /* %a\n */ /* 29 */ 1, /* %a\n */ /* 30 */ 1, /* %a\n */ /* 31 */ 1, /* %a\n */ /* 32 */ 1, /* %a\n */ /* 33 */ 1, /* %a\n */ /* 34 */ 1, /* %a\n */ /* 35 */ 1, /* #\n */ /* 36 */ 1, /* #\n */ /* 37 */ 1, /* #\n */ /* 38 */ 1, /* #\n */ /* 39 */ 1, /* drop\n */ /* 40 */ 1, /* \n */ /* 41 */ 1, /* swap\n */ /* 42 */ 1, /* rot\n */ /* 43 */ 1, /* dup\n */ /* 44 */ 1, /* over\n */ /* 45 */ 1, /* 2over\nnip\n */ /* 46 */ 1, /* any\n */ /* 47 */ 1, /* \n */ /* 48 */ 1, /* swap\n */ /* 49 */ 1, /* -rot\n */ /* 50 */ 1, /* \n */ /* 51 */ 1, /* \n */ /* 52 */ 1, /* \n */ /* 53 */ 1, /* \n */ /* 54 */ 1, /* \n */ /* 55 */ 1, /* \n */ /* 56 */ 1, /* \n */ /* 57 */ 1, /* \n */ /* 58 */ 1, /* \n */ /* 59 */ 1, /* \n */ /* 60 */ 1, /* \n */ /* 61 */ 1, /* \n */ /* 62 */ 1, /* \n */ /* 63 */ 1, /* \n */ /* 64 */ 1, /* \n */ /* 65 */ 1, /* \n */ /* 66 */ 1, /* \n */ /* 67 */ 1, /* \n */ /* 68 */ 1, /* \n */ /* 69 */ 1, /* \n */ /* 70 */ 1, /* dup\n */ /* 71 */ 1, /* \n */ /* 72 */ 1, /* \n */ /* 73 */ 1, /* \n */ /* 74 */ 1, /* \n */ /* 75 */ 1, /* \n */ /* 76 */ 1, /* \n */ /* 77 */ 1, /* \n */ /* 78 */ 1, /* tuck\n */ /* 79 */ 1, /* swap\n */ /* 80 */ 1, /* \n */ /* 81 */ 1, /* \n */ /* 82 */ 1, /* \n */ /* 83 */ 1, /* \n */ /* 84 */ 1, /* \n */ /* 85 */ 1, /* \n */ /* 86 */ 1, /* -rot\n2over\nnip\n */ /* 87 */ 1, /* -rot\n */ /* 88 */ 1, /* dup\n */ /* 89 */ 1, /* tuck\n */ /* 90 */ 1, /* -rot\n2over\nnip\n */ /* 91 */ 1, /* \n */ /* 92 */ 1, /* swap\n */ /* 93 */ 1, /* -rot\n */ /* 94 */ 1, /* nop\n */ /* 95 */ 0, /* %a */ /* 96 */ 0, /* %a */ /* 97 */ 1, /* ADDR %a\n */ /* 98 */ 1, /* %a\n */ /* 99 */ 1, /* #\n */ /* 100 */ 1, /* #\n */ /* 101 */ 1, /* \n */ /* 102 */ 1, /* #\n */ /* 103 */ 1, /* #\n */ /* 104 */ 1, /* #\n */ /* 105 */ 1, /* #\n */ /* 106 */ 1, /* #\n */ /* 107 */ 1, /* #\n */ /* 108 */ 1, /* #\n */ /* 109 */ 1, /* #\n */ /* 110 */ 1, /* #\n */ /* 111 */ 1, /* #\n */ /* 112 */ 1, /* #\n */ /* 113 */ 1, /* __SAB__\n */ /* 114 */ 1, /* __SAB__\n */ /* 115 */ 1, /* __SAS__\n */ /* 116 */ 1, /* __SAS__\n */ /* 117 */ 1, /* __SB__\n */ /* 118 */ 1, /* __SB__\n */ /* 119 */ 1, /* __SS__\n */ /* 120 */ 1, /* __SS__\n */ /* 121 */ 1, /* !\n */ /* 122 */ 1, /* !\n */ /* 123 */ 1, /* !\n */ /* 124 */ 1, /* #\n */ /* 125 */ 1, /* #\n */ /* 126 */ 1, /* #\n */ /* 127 */ 1, /* #\n */ /* 128 */ 1, /* #\n */ /* 129 */ 1, /* #\n */ /* 130 */ 1, /* #\n */ /* 131 */ 1, /* #\n */ /* 132 */ 1, /* #\n */ /* 133 */ 1, /* #\n */ /* 134 */ 1, /* #\n */ /* 135 */ 1, /* __RAB__\n */ /* 136 */ 1, /* __RAB__\n */ /* 137 */ 1, /* __RAS__\n */ /* 138 */ 1, /* __RAS__\n */ /* 139 */ 1, /* __RB__\n */ /* 140 */ 1, /* __RB__\n */ /* 141 */ 1, /* __RS__\n */ /* 142 */ 1, /* __RS__\n */ /* 143 */ 1, /* @\n */ /* 144 */ 1, /* @\n */ /* 145 */ 1, /* @\n */ /* 146 */ 1, /* *\n */ /* 147 */ 1, /* *\n */ /* 148 */ 1, /* *\n */ /* 149 */ 1, /* *\n */ /* 150 */ 1, /* \n */ /* 151 */ 1, /* 1+\n */ /* 152 */ 1, /* +\n */ /* 153 */ 1, /* +\n */ /* 154 */ 1, /* +\n */ /* 155 */ 1, /* +\n */ /* 156 */ 1, /* +\n */ /* 157 */ 1, /* +\n */ /* 158 */ 1, /* \n */ /* 159 */ 1, /* swap\n__ROL__\n__ROL__\n+\n__ROR__\n__ROR__\n */ /* 160 */ 1, /* __ROL__\n__ROL__\n+\n__ROR__\n__ROR__\n */ /* 161 */ 1, /* __ROL__\n__ROL__\n1+\n__ROR__\n__ROR__\n */ /* 162 */ 1, /* __ROL__\n1+\n__ROR__\n */ /* 163 */ 1, /* 1+\n */ /* 164 */ 1, /* __ROL__\n__ROL__\n%1\n+\n__ROR__\n__ROR__\n */ /* 165 */ 1, /* -\n */ /* 166 */ 1, /* swap\n__ROL__\n__ROL__\n-\n__ROR__\n__ROR__\n */ /* 167 */ 1, /* __ROL__\n__ROL__\n-\n__ROR__\n__ROR__\n */ /* 168 */ 1, /* \n */ /* 169 */ 1, /* __ROL__\n__ROL__\n1-\n__ROR__\n__ROR__\n */ /* 170 */ 1, /* __ROL__\n1-\n__ROR__\n */ /* 171 */ 1, /* 1-\n */ /* 172 */ 1, /* __ROL__\n__ROL__\n%1\n-\n__ROR__\n__ROR__\n */ /* 173 */ 1, /* \n */ /* 174 */ 1, /* \n */ /* 175 */ 1, /* 1\nshift\n */ /* 176 */ 1, /* 1\nshift\n */ /* 177 */ 1, /* 2\nshift\n */ /* 178 */ 1, /* 2\nshift\n */ /* 179 */ 1, /* \n */ /* 180 */ 1, /* \n */ /* 181 */ 1, /* __ROL__\n__ROL__\n */ /* 182 */ 1, /* __ROR__\n__ROR__\n */ /* 183 */ 1, /* \n */ /* 184 */ 1, /* 255\nand\n */ /* 185 */ 1, /* \n */ /* 186 */ 1, /* 65535\nand\n */ /* 187 */ 1, /* \n */ /* 188 */ 1, /* \n */ /* 189 */ 1, /* \n */ /* 190 */ 1, /* \n */ /* 191 */ 1, /* \n */ /* 192 */ 1, /* +\n */ /* 193 */ 1, /* +\n */ /* 194 */ 1, /* 1+\n */ /* 195 */ 1, /* 1+\n */ /* 196 */ 1, /* 1+\n */ /* 197 */ 1, /* 1+\n */ /* 198 */ 1, /* -\n */ /* 199 */ 1, /* -\n */ /* 200 */ 1, /* 1-\n */ /* 201 */ 1, /* 1-\n */ /* 202 */ 1, /* invert\n */ /* 203 */ 1, /* invert\n */ /* 204 */ 1, /* negate\n */ /* 205 */ 1, /* and\n */ /* 206 */ 1, /* or\n */ /* 207 */ 1, /* xor\n */ /* 208 */ 1, /* and\n */ /* 209 */ 1, /* or\n */ /* 210 */ 1, /* xor\n */ /* 211 */ 1, /* /\n */ /* 212 */ 1, /* shift\n */ /* 213 */ 1, /* mod\n */ /* 214 */ 1, /* *\n */ /* 215 */ 1, /* negate\nashift\n */ /* 216 */ 1, /* u/\n */ /* 217 */ 1, /* shift\n */ /* 218 */ 1, /* umod\n */ /* 219 */ 1, /* *\n */ /* 220 */ 1, /* negate\nshift\n */ /* 221 */ 1, /* -\n0=\n?GOTO %a ( jump if equal )\n */ /* 222 */ 1, /* -\n0=\n?GOTO %a ( jump if equal )\n */ /* 223 */ 1, /* <\n0=\n?GOTO %a ( jump if greater or equal )\n */ /* 224 */ 1, /* u<\n0=\n?GOTO %a ( jump if greater or equal )\n */ /* 225 */ 1, /* >\n?GOTO %a ( jump if greater )\n */ /* 226 */ 1, /* u>\n?GOTO %a ( jump if greater )\n */ /* 227 */ 1, /* >\n0=\n?GOTO %a ( jump if less or equal )\n */ /* 228 */ 1, /* u>\n0=\n?GOTO %a ( jump if less or equal )\n */ /* 229 */ 1, /* <\n?GOTO %a ( jump if less )\n */ /* 230 */ 1, /* u<\n?GOTO %a ( jump if less )\n */ /* 231 */ 1, /* -\n?GOTO %a ( jump if not equal )\n */ /* 232 */ 1, /* -\n?GOTO %a ( jump if not equal )\n */ /* 233 */ 1, /* %0\n */ /* 234 */ 1, /* %0\n */ /* 235 */ 1, /* %0\n */ /* 236 */ 1, /* %0\n */ /* 237 */ 1, /* RECURSE ( recursive call to function )\n */ /* 238 */ 1, /* RECURSE ( recursive call to function )\n */ /* 239 */ 1, /* RECURSE ( recursive call to function )\n */ /* 240 */ 1, /* RECURSE ( recursive call to function )\n */ /* 241 */ 1, /* CALL %0 ( call to function )\n */ /* 242 */ 1, /* CALL %0 ( call to function )\n */ /* 243 */ 1, /* CALL %0 ( call to function )\n */ /* 244 */ 1, /* CALL %0 ( call to function )\n */ /* 245 */ 1, /* EXECUTE ( call to function pointer )\n */ /* 246 */ 1, /* EXECUTE ( call to function pointer )\n */ /* 247 */ 1, /* EXECUTE ( call to function pointer )\n */ /* 248 */ 1, /* EXECUTE ( call to function pointer )\n */ /* 249 */ 1, /* ( return int )\n */ /* 250 */ 1, /* ( return uint )\n */ /* 251 */ 1, /* ( return addr )\n */ /* 252 */ 0, /* */ /* 253 */ 1, /* #\n */ /* 254 */ 1, /* #\n */ /* 255 */ 1, /* #\n */ /* 256 */ 1, /* GOTO %0\n */ /* 257 */ 1, /* branch\n */ /* 258 */ 1, /* Label %a\n */ /* 259 */ 1, /* #\n */ }; static char *_string[] = { /* 0 */ 0, /* 1 */ "zero: CNSTI1", /* 2 */ "zero: CNSTI2", /* 3 */ "zero: CNSTI4", /* 4 */ "zero: CNSTU1", /* 5 */ "zero: CNSTU2", /* 6 */ "zero: CNSTU4", /* 7 */ "zero: CNSTP4", /* 8 */ "cnst1: CNSTI1", /* 9 */ "cnst1: CNSTU1", /* 10 */ "cnst1: CNSTI2", /* 11 */ "cnst1: CNSTU2", /* 12 */ "cnst1: CNSTI4", /* 13 */ "cnst1: CNSTU4", /* 14 */ "cnst2: CNSTI1", /* 15 */ "cnst2: CNSTU1", /* 16 */ "cnst2: CNSTI2", /* 17 */ "cnst2: CNSTU2", /* 18 */ "cnst2: CNSTI4", /* 19 */ "cnst2: CNSTU4", /* 20 */ "cnst3: CNSTI4", /* 21 */ "cnst4: CNSTI1", /* 22 */ "cnst4: CNSTU1", /* 23 */ "cnst4: CNSTI2", /* 24 */ "cnst4: CNSTU2", /* 25 */ "cnst4: CNSTI4", /* 26 */ "cnst4: CNSTU4", /* 27 */ "cnstn: CNSTU4", /* 28 */ "cnstn: CNSTI4", /* 29 */ "stk: CNSTI1", /* 30 */ "stk: CNSTU1", /* 31 */ "stk: CNSTI2", /* 32 */ "stk: CNSTU2", /* 33 */ "stk: CNSTI4", /* 34 */ "stk: CNSTU4", /* 35 */ "addr: CNSTP4", /* 36 */ "addr4: CNSTP4", /* 37 */ "addr4: CNSTI4", /* 38 */ "addr4: CNSTU4", /* 39 */ "stmt: stk", /* 40 */ "sread: STACKP", /* 41 */ "sread: STACKP", /* 42 */ "sread: STACKP", /* 43 */ "sread: COPYP", /* 44 */ "sread: COPYP", /* 45 */ "sread: COPYP", /* 46 */ "sread: COPYP", /* 47 */ "swrite: STACKP", /* 48 */ "swrite: STACKP", /* 49 */ "swrite: STACKP", /* 50 */ "stk: INDIRI1(sread)", /* 51 */ "stk: INDIRU1(sread)", /* 52 */ "stk: INDIRI2(sread)", /* 53 */ "stk: INDIRU2(sread)", /* 54 */ "stk: INDIRI4(sread)", /* 55 */ "stk: INDIRU4(sread)", /* 56 */ "addr: INDIRP4(sread)", /* 57 */ "stmt: ASGNI1(stk,swrite)", /* 58 */ "stmt: ASGNU1(stk,swrite)", /* 59 */ "stmt: ASGNI2(stk,swrite)", /* 60 */ "stmt: ASGNU2(stk,swrite)", /* 61 */ "stmt: ASGNI4(stk,swrite)", /* 62 */ "stmt: ASGNU4(stk,swrite)", /* 63 */ "stmt: ASGNP4(addr,swrite)", /* 64 */ "tuck1: TUCKI1(stk)", /* 65 */ "tuck1: TUCKU1(stk)", /* 66 */ "tuck1: TUCKI2(stk)", /* 67 */ "tuck1: TUCKU2(stk)", /* 68 */ "tuck1: TUCKI4(stk)", /* 69 */ "tuck1: TUCKU4(stk)", /* 70 */ "addr: TUCKP4(addr)", /* 71 */ "stmt: TUCKP4(addr)", /* 72 */ "tuck2: TUCKI1(stk)", /* 73 */ "tuck2: TUCKU1(stk)", /* 74 */ "tuck2: TUCKI2(stk)", /* 75 */ "tuck2: TUCKU2(stk)", /* 76 */ "tuck2: TUCKI4(stk)", /* 77 */ "tuck2: TUCKU4(stk)", /* 78 */ "addr: TUCKP4(addr)", /* 79 */ "stmt: TUCKP4(addr)", /* 80 */ "tuck3: TUCKI1(stk)", /* 81 */ "tuck3: TUCKU1(stk)", /* 82 */ "tuck3: TUCKI2(stk)", /* 83 */ "tuck3: TUCKU2(stk)", /* 84 */ "tuck3: TUCKI4(stk)", /* 85 */ "tuck3: TUCKU4(stk)", /* 86 */ "addr: TUCKP4(addr)", /* 87 */ "stmt: TUCKP4(addr)", /* 88 */ "stk: tuck1", /* 89 */ "stk: tuck2", /* 90 */ "stk: tuck3", /* 91 */ "stmt: tuck1", /* 92 */ "stmt: tuck2", /* 93 */ "stmt: tuck3", /* 94 */ "stk: NOOP", /* 95 */ "lAddr: ADDRLP4", /* 96 */ "jAddr: ADDRGP4", /* 97 */ "addr: ADDRGP4", /* 98 */ "addr: ADDRGP4", /* 99 */ "addr4: ADDRLP4", /* 100 */ "addr: ADDRLP4", /* 101 */ "addr: addr4", /* 102 */ "stmt: ASGNI4(stk,lAddr)", /* 103 */ "stmt: ASGNU4(stk,lAddr)", /* 104 */ "stmt: ASGNP4(addr,lAddr)", /* 105 */ "stmt: ASGNI1(stk,lAddr)", /* 106 */ "stmt: ASGNU1(stk,lAddr)", /* 107 */ "stmt: ASGNI2(stk,lAddr)", /* 108 */ "stmt: ASGNU2(stk,lAddr)", /* 109 */ "stmt: ASGNI1(stk,lAddr)", /* 110 */ "stmt: ASGNU1(stk,lAddr)", /* 111 */ "stmt: ASGNI2(stk,lAddr)", /* 112 */ "stmt: ASGNU2(stk,lAddr)", /* 113 */ "stmt: ASGNI1(stk,addr4)", /* 114 */ "stmt: ASGNU1(stk,addr4)", /* 115 */ "stmt: ASGNI2(stk,addr4)", /* 116 */ "stmt: ASGNU2(stk,addr4)", /* 117 */ "stmt: ASGNI1(stk,addr)", /* 118 */ "stmt: ASGNU1(stk,addr)", /* 119 */ "stmt: ASGNI2(stk,addr)", /* 120 */ "stmt: ASGNU2(stk,addr)", /* 121 */ "stmt: ASGNI4(stk,addr)", /* 122 */ "stmt: ASGNU4(stk,addr)", /* 123 */ "stmt: ASGNP4(addr,addr)", /* 124 */ "stk: INDIRI4(lAddr)", /* 125 */ "stk: INDIRU4(lAddr)", /* 126 */ "addr: INDIRP4(lAddr)", /* 127 */ "stk: INDIRI1(lAddr)", /* 128 */ "stk: INDIRU1(lAddr)", /* 129 */ "stk: INDIRI2(lAddr)", /* 130 */ "stk: INDIRU2(lAddr)", /* 131 */ "stk: INDIRI1(lAddr)", /* 132 */ "stk: INDIRU1(lAddr)", /* 133 */ "stk: INDIRI2(lAddr)", /* 134 */ "stk: INDIRU2(lAddr)", /* 135 */ "stk: INDIRI1(addr4)", /* 136 */ "stk: INDIRU1(addr4)", /* 137 */ "stk: INDIRI2(addr4)", /* 138 */ "stk: INDIRU2(addr4)", /* 139 */ "stk: INDIRI1(addr)", /* 140 */ "stk: INDIRU1(addr)", /* 141 */ "stk: INDIRI2(addr)", /* 142 */ "stk: INDIRU2(addr)", /* 143 */ "stk: INDIRI4(addr)", /* 144 */ "stk: INDIRU4(addr)", /* 145 */ "addr: INDIRP4(addr)", /* 146 */ "addr4: MULU4(addr4,stk)", /* 147 */ "addr4: MULU4(stk,addr4)", /* 148 */ "addr4: MULI4(addr4,stk)", /* 149 */ "addr4: MULI4(stk,addr4)", /* 150 */ "addr4: ADDP4(addr4,zero)", /* 151 */ "addr4: ADDP4(addr4,cnst4)", /* 152 */ "addr4: ADDP4(addr4,addr4)", /* 153 */ "addr4: ADDU4(addr4,addr4)", /* 154 */ "addr: ADDP4(addr,addr4)", /* 155 */ "addr: ADDU4(addr,addr4)", /* 156 */ "addr: ADDP4(addr4,addr)", /* 157 */ "addr: ADDU4(addr4,addr)", /* 158 */ "addr: ADDP4(addr,zero)", /* 159 */ "addr: ADDP4(addr,stk)", /* 160 */ "addr: ADDP4(stk,addr)", /* 161 */ "addr: ADDP4(addr,cnst1)", /* 162 */ "addr: ADDP4(addr,cnst2)", /* 163 */ "addr: ADDP4(addr,cnst4)", /* 164 */ "addr: ADDP4(addr,cnstn)", /* 165 */ "addr4: SUBP4(addr4,addr4)", /* 166 */ "addr: SUBP4(addr,stk)", /* 167 */ "addr: SUBP4(stk,addr)", /* 168 */ "addr: SUBP4(addr,zero)", /* 169 */ "addr: SUBP4(addr,cnst1)", /* 170 */ "addr: SUBP4(addr,cnst2)", /* 171 */ "addr: SUBP4(addr,cnst4)", /* 172 */ "addr: SUBP4(addr,cnstn)", /* 173 */ "addr4: LSHI4(stk,cnst2)", /* 174 */ "addr4: LSHU4(stk,cnst2)", /* 175 */ "addr4: LSHI4(stk,cnst3)", /* 176 */ "addr4: LSHU4(stk,cnst3)", /* 177 */ "addr4: LSHI4(stk,cnst4)", /* 178 */ "addr4: LSHU4(stk,cnst4)", /* 179 */ "addr4: CVPU4(addr4)", /* 180 */ "addr: CVPU4(addr)", /* 181 */ "stk: addr", /* 182 */ "addr: stk", /* 183 */ "stk: CVII1(stk)", /* 184 */ "stk: CVUU1(stk)", /* 185 */ "stk: CVII2(stk)", /* 186 */ "stk: CVUU2(stk)", /* 187 */ "stk: CVII4(stk)", /* 188 */ "stk: CVUI4(stk)", /* 189 */ "stk: CVIU4(stk)", /* 190 */ "stk: CVUU4(stk)", /* 191 */ "stk: CVUP4(stk)", /* 192 */ "stk: ADDI4(stk,stk)", /* 193 */ "stk: ADDU4(stk,stk)", /* 194 */ "stk: ADDI4(cnst1,stk)", /* 195 */ "stk: ADDU4(cnst1,stk)", /* 196 */ "stk: ADDI4(stk,cnst1)", /* 197 */ "stk: ADDU4(stk,cnst1)", /* 198 */ "stk: SUBI4(stk,stk)", /* 199 */ "stk: SUBU4(stk,stk)", /* 200 */ "stk: SUBI4(stk,cnst1)", /* 201 */ "stk: SUBU4(stk,cnst1)", /* 202 */ "stk: BCOMI4(stk)", /* 203 */ "stk: BCOMU4(stk)", /* 204 */ "stk: NEGI4(stk)", /* 205 */ "stk: BANDI4(stk,stk)", /* 206 */ "stk: BORI4(stk,stk)", /* 207 */ "stk: BXORI4(stk,stk)", /* 208 */ "stk: BANDU4(stk,stk)", /* 209 */ "stk: BORU4(stk,stk)", /* 210 */ "stk: BXORU4(stk,stk)", /* 211 */ "stk: DIVI4(stk,stk)", /* 212 */ "stk: LSHI4(stk,stk)", /* 213 */ "stk: MODI4(stk,stk)", /* 214 */ "stk: MULI4(stk,stk)", /* 215 */ "stk: RSHI4(stk,stk)", /* 216 */ "stk: DIVU4(stk,stk)", /* 217 */ "stk: LSHU4(stk,stk)", /* 218 */ "stk: MODU4(stk,stk)", /* 219 */ "stk: MULU4(stk,stk)", /* 220 */ "stk: RSHU4(stk,stk)", /* 221 */ "stmt: EQI4(stk,stk)", /* 222 */ "stmt: EQU4(stk,stk)", /* 223 */ "stmt: GEI4(stk,stk)", /* 224 */ "stmt: GEU4(stk,stk)", /* 225 */ "stmt: GTI4(stk,stk)", /* 226 */ "stmt: GTU4(stk,stk)", /* 227 */ "stmt: LEI4(stk,stk)", /* 228 */ "stmt: LEU4(stk,stk)", /* 229 */ "stmt: LTI4(stk,stk)", /* 230 */ "stmt: LTU4(stk,stk)", /* 231 */ "stmt: NEI4(stk,stk)", /* 232 */ "stmt: NEU4(stk,stk)", /* 233 */ "stmt: CALLV(jAddr)", /* 234 */ "stk: CALLI4(jAddr)", /* 235 */ "stk: CALLU4(jAddr)", /* 236 */ "addr: CALLP4(jAddr)", /* 237 */ "stmt: CALLV(jAddr)", /* 238 */ "stk: CALLI4(jAddr)", /* 239 */ "stk: CALLU4(jAddr)", /* 240 */ "addr: CALLP4(jAddr)", /* 241 */ "stmt: CALLV(jAddr)", /* 242 */ "stk: CALLI4(jAddr)", /* 243 */ "stk: CALLU4(jAddr)", /* 244 */ "addr: CALLP4(jAddr)", /* 245 */ "stmt: CALLV(addr)", /* 246 */ "stk: CALLI4(addr)", /* 247 */ "stk: CALLU4(addr)", /* 248 */ "addr: CALLP4(addr)", /* 249 */ "stmt: RETI4(stk)", /* 250 */ "stmt: RETU4(stk)", /* 251 */ "stmt: RETP4(addr)", /* 252 */ "stmt: RETV", /* 253 */ "stmt: ARGI4(stk)", /* 254 */ "stmt: ARGU4(stk)", /* 255 */ "stmt: ARGP4(addr)", /* 256 */ "stmt: JUMPV(jAddr)", /* 257 */ "stmt: JUMPV(addr)", /* 258 */ "stmt: LABELV", /* 259 */ "stmt: ASGNB(INDIRB(addr),addr)", }; static short _decode_stmt[] = { 0, 39, 57, 58, 59, 60, 61, 62, 63, 71, 79, 87, 91, 92, 93, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 237, 241, 245, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, }; static short _decode_zero[] = { 0, 1, 2, 3, 4, 5, 6, 7, }; static short _decode_cnst1[] = { 0, 8, 9, 10, 11, 12, 13, }; static short _decode_cnst2[] = { 0, 14, 15, 16, 17, 18, 19, }; static short _decode_cnst3[] = { 0, 20, }; static short _decode_cnst4[] = { 0, 21, 22, 23, 24, 25, 26, }; static short _decode_cnstn[] = { 0, 27, 28, }; static short _decode_stk[] = { 0, 29, 30, 31, 32, 33, 34, 50, 51, 52, 53, 54, 55, 88, 89, 90, 94, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 181, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 234, 235, 238, 239, 242, 243, 246, 247, }; static short _decode_addr[] = { 0, 35, 56, 70, 78, 86, 97, 98, 100, 101, 126, 145, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 166, 167, 168, 169, 170, 171, 172, 180, 182, 236, 240, 244, 248, }; static short _decode_addr4[] = { 0, 36, 37, 38, 99, 146, 147, 148, 149, 150, 151, 152, 153, 165, 173, 174, 175, 176, 177, 178, 179, }; static short _decode_sread[] = { 0, 40, 41, 42, 43, 44, 45, 46, }; static short _decode_swrite[] = { 0, 47, 48, 49, }; static short _decode_tuck1[] = { 0, 64, 65, 66, 67, 68, 69, }; static short _decode_tuck2[] = { 0, 72, 73, 74, 75, 76, 77, }; static short _decode_tuck3[] = { 0, 80, 81, 82, 83, 84, 85, }; static short _decode_lAddr[] = { 0, 95, }; static short _decode_jAddr[] = { 0, 96, }; static int _rule(void *state, int goalnt) { if (goalnt < 1 || goalnt > 17) fatal("_rule", "Bad goal nonterminal %d\n", goalnt); if (!state) return 0; switch (goalnt) { case _stmt_NT: return _decode_stmt[((struct _state *)state)->rule._stmt]; case _zero_NT: return _decode_zero[((struct _state *)state)->rule._zero]; case _cnst1_NT: return _decode_cnst1[((struct _state *)state)->rule._cnst1]; case _cnst2_NT: return _decode_cnst2[((struct _state *)state)->rule._cnst2]; case _cnst3_NT: return _decode_cnst3[((struct _state *)state)->rule._cnst3]; case _cnst4_NT: return _decode_cnst4[((struct _state *)state)->rule._cnst4]; case _cnstn_NT: return _decode_cnstn[((struct _state *)state)->rule._cnstn]; case _stk_NT: return _decode_stk[((struct _state *)state)->rule._stk]; case _addr_NT: return _decode_addr[((struct _state *)state)->rule._addr]; case _addr4_NT: return _decode_addr4[((struct _state *)state)->rule._addr4]; case _sread_NT: return _decode_sread[((struct _state *)state)->rule._sread]; case _swrite_NT: return _decode_swrite[((struct _state *)state)->rule._swrite]; case _tuck1_NT: return _decode_tuck1[((struct _state *)state)->rule._tuck1]; case _tuck2_NT: return _decode_tuck2[((struct _state *)state)->rule._tuck2]; case _tuck3_NT: return _decode_tuck3[((struct _state *)state)->rule._tuck3]; case _lAddr_NT: return _decode_lAddr[((struct _state *)state)->rule._lAddr]; case _jAddr_NT: return _decode_jAddr[((struct _state *)state)->rule._jAddr]; default: fatal("_rule", "Bad goal nonterminal %d\n", goalnt); return 0; } } static void _closure_stk(NODEPTR_TYPE, int); static void _closure_addr(NODEPTR_TYPE, int); static void _closure_addr4(NODEPTR_TYPE, int); static void _closure_tuck1(NODEPTR_TYPE, int); static void _closure_tuck2(NODEPTR_TYPE, int); static void _closure_tuck3(NODEPTR_TYPE, int); static void _closure_stk(NODEPTR_TYPE a, int c) { struct _state *p = STATE_LABEL(a); if (c + 2 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 2; p->rule._addr = 31; _closure_addr(a, c + 2); } if (c + 1 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 1; p->rule._stmt = 1; } } static void _closure_addr(NODEPTR_TYPE a, int c) { struct _state *p = STATE_LABEL(a); if (c + 2 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 2; p->rule._stk = 37; _closure_stk(a, c + 2); } } static void _closure_addr4(NODEPTR_TYPE a, int c) { struct _state *p = STATE_LABEL(a); if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 9; _closure_addr(a, c + 0); } } static void _closure_tuck1(NODEPTR_TYPE a, int c) { struct _state *p = STATE_LABEL(a); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 12; } if (c + 1 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 1; p->rule._stk = 13; _closure_stk(a, c + 1); } } static void _closure_tuck2(NODEPTR_TYPE a, int c) { struct _state *p = STATE_LABEL(a); if (c + 1 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 1; p->rule._stmt = 13; } if (c + 1 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 1; p->rule._stk = 14; _closure_stk(a, c + 1); } } static void _closure_tuck3(NODEPTR_TYPE a, int c) { struct _state *p = STATE_LABEL(a); if (c + 1 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 1; p->rule._stmt = 14; } if (c + 3 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 3; p->rule._stk = 15; _closure_stk(a, c + 3); } } static void _label(NODEPTR_TYPE a) { int c; struct _state *p; if (!a) fatal("_label", "Null tree\n", 0); STATE_LABEL(a) = p = allocate(sizeof *p, FUNC); p->rule._stmt = 0; p->cost[1] = p->cost[2] = p->cost[3] = p->cost[4] = p->cost[5] = p->cost[6] = p->cost[7] = p->cost[8] = p->cost[9] = p->cost[10] = p->cost[11] = p->cost[12] = p->cost[13] = p->cost[14] = p->cost[15] = p->cost[16] = p->cost[17] = 0x7fff; switch (OP_LABEL(a)) { case 41: /* ARGB */ break; case 48: /* NOOP */ /* stk: NOOP */ if (1 + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = 1 + 0; p->rule._stk = 16; _closure_stk(a, 1 + 0); } break; case 57: /* ASGNB */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); if ( /* stmt: ASGNB(INDIRB(addr),addr) */ LEFT_CHILD(a)->op == 73 /* INDIRB */ ) { c = ((struct _state *)(LEFT_CHILD(LEFT_CHILD(a))->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr_NT] + (20 /*Make Fun which does loo @ iTermSize and def costs*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 63; } } break; case 73: /* INDIRB */ _label(LEFT_CHILD(a)); break; case 216: /* CALLV */ _label(LEFT_CHILD(a)); /* stmt: CALLV(jAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_jAddr_NT] + (1+isNotCurrentFun(a)+isDefinedFun(a)); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 49; } /* stmt: CALLV(jAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_jAddr_NT] + (1+isCurrentFun(a)); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 50; } /* stmt: CALLV(jAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_jAddr_NT] + (1+isNotCurrentFun(a)+isNotDefinedFun(a)); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 51; } /* stmt: CALLV(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + 1; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 52; } break; case 217: /* CALLB */ break; case 248: /* RETV */ /* stmt: RETV */ if (0 + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = 0 + 0; p->rule._stmt = 56; } break; case 437: /* ADDRFP4 */ break; case 584: /* JUMPV */ _label(LEFT_CHILD(a)); /* stmt: JUMPV(jAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_jAddr_NT] + (1 /*Branchoperation: unconditional branch*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 60; } /* stmt: JUMPV(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + (1 /*Branchoperation: unconditional branch (to pointer)*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 61; } break; case 600: /* LABELV */ /* stmt: LABELV */ c = (0 /*Define a Label at current position*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 62; } break; case 711: /* VREGP */ break; case 727: /* STACKP */ /* sread: STACKP */ c = (range(a, 1, 1)); if (c + 0 < p->cost[_sread_NT]) { p->cost[_sread_NT] = c + 0; p->rule._sread = 1; } /* sread: STACKP */ c = (range(a, 2, 2)+1); if (c + 0 < p->cost[_sread_NT]) { p->cost[_sread_NT] = c + 0; p->rule._sread = 2; } /* sread: STACKP */ c = (range(a, 3, 3)+1); if (c + 0 < p->cost[_sread_NT]) { p->cost[_sread_NT] = c + 0; p->rule._sread = 3; } /* swrite: STACKP */ c = (range(a, 1, 1)); if (c + 0 < p->cost[_swrite_NT]) { p->cost[_swrite_NT] = c + 0; p->rule._swrite = 1; } /* swrite: STACKP */ c = (range(a, 2, 2)+1); if (c + 0 < p->cost[_swrite_NT]) { p->cost[_swrite_NT] = c + 0; p->rule._swrite = 2; } /* swrite: STACKP */ c = (range(a, 3, 3)+1); if (c + 0 < p->cost[_swrite_NT]) { p->cost[_swrite_NT] = c + 0; p->rule._swrite = 3; } break; case 759: /* COPYP */ /* sread: COPYP */ c = (range(a, 1, 1)+1); if (c + 0 < p->cost[_sread_NT]) { p->cost[_sread_NT] = c + 0; p->rule._sread = 4; } /* sread: COPYP */ c = (range(a, 2, 2)+1); if (c + 0 < p->cost[_sread_NT]) { p->cost[_sread_NT] = c + 0; p->rule._sread = 5; } /* sread: COPYP */ c = (range(a, 3, 3)+2); if (c + 0 < p->cost[_sread_NT]) { p->cost[_sread_NT] = c + 0; p->rule._sread = 6; } /* sread: COPYP */ c = (range(a, 0, 0)+1); if (c + 0 < p->cost[_sread_NT]) { p->cost[_sread_NT] = c + 0; p->rule._sread = 7; } break; case 1045: /* CNSTI1 */ /* zero: CNSTI1 */ c = (range(a, 0, 0)); if (c + 0 < p->cost[_zero_NT]) { p->cost[_zero_NT] = c + 0; p->rule._zero = 1; } /* cnst1: CNSTI1 */ c = (range(a, 1, 1)); if (c + 0 < p->cost[_cnst1_NT]) { p->cost[_cnst1_NT] = c + 0; p->rule._cnst1 = 1; } /* cnst2: CNSTI1 */ c = (range(a, 2, 2)); if (c + 0 < p->cost[_cnst2_NT]) { p->cost[_cnst2_NT] = c + 0; p->rule._cnst2 = 1; } /* cnst4: CNSTI1 */ c = (range(a, 4, 4)); if (c + 0 < p->cost[_cnst4_NT]) { p->cost[_cnst4_NT] = c + 0; p->rule._cnst4 = 1; } /* stk: CNSTI1 */ if (1 + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = 1 + 0; p->rule._stk = 1; _closure_stk(a, 1 + 0); } break; case 1046: /* CNSTU1 */ /* zero: CNSTU1 */ c = (range(a, 0, 0)); if (c + 0 < p->cost[_zero_NT]) { p->cost[_zero_NT] = c + 0; p->rule._zero = 4; } /* cnst1: CNSTU1 */ c = (range(a, 1, 1)); if (c + 0 < p->cost[_cnst1_NT]) { p->cost[_cnst1_NT] = c + 0; p->rule._cnst1 = 2; } /* cnst2: CNSTU1 */ c = (range(a, 2, 2)); if (c + 0 < p->cost[_cnst2_NT]) { p->cost[_cnst2_NT] = c + 0; p->rule._cnst2 = 2; } /* cnst4: CNSTU1 */ c = (range(a, 4, 4)); if (c + 0 < p->cost[_cnst4_NT]) { p->cost[_cnst4_NT] = c + 0; p->rule._cnst4 = 2; } /* stk: CNSTU1 */ if (1 + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = 1 + 0; p->rule._stk = 2; _closure_stk(a, 1 + 0); } break; case 1061: /* ARGI1 */ break; case 1062: /* ARGU1 */ break; case 1077: /* ASGNI1 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: ASGNI1(stk,swrite) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_swrite_NT] + 0; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 2; } /* stmt: ASGNI1(stk,lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_lAddr_NT] + (7+isAligned(a)); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 18; } /* stmt: ASGNI1(stk,lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_lAddr_NT] + (30+isNotAligned(a)); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 22; } /* stmt: ASGNI1(stk,addr4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr4_NT] + 11; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 26; } /* stmt: ASGNI1(stk,addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr_NT] + (30 /* Candidate for Hardware Fun if pos */); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 30; } break; case 1078: /* ASGNU1 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: ASGNU1(stk,swrite) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_swrite_NT] + 0; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 3; } /* stmt: ASGNU1(stk,lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_lAddr_NT] + (7+isAligned(a)); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 19; } /* stmt: ASGNU1(stk,lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_lAddr_NT] + (30+isNotAligned(a)); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 23; } /* stmt: ASGNU1(stk,addr4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr4_NT] + 11; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 27; } /* stmt: ASGNU1(stk,addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr_NT] + 30; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 31; } break; case 1093: /* INDIRI1 */ _label(LEFT_CHILD(a)); /* stk: INDIRI1(sread) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_sread_NT] + 0; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 7; _closure_stk(a, c + 0); } /* stk: INDIRI1(lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_lAddr_NT] + (4+isAligned(a)); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 19; _closure_stk(a, c + 0); } /* stk: INDIRI1(lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_lAddr_NT] + (25+isNotAligned(a)); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 23; _closure_stk(a, c + 0); } /* stk: INDIRI1(addr4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr4_NT] + 6; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 27; _closure_stk(a, c + 0); } /* stk: INDIRI1(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + (25 /* Candidate for Hardware Fun if pos */); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 31; _closure_stk(a, c + 0); } break; case 1094: /* INDIRU1 */ _label(LEFT_CHILD(a)); /* stk: INDIRU1(sread) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_sread_NT] + 0; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 8; _closure_stk(a, c + 0); } /* stk: INDIRU1(lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_lAddr_NT] + (4+isAligned(a)); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 20; _closure_stk(a, c + 0); } /* stk: INDIRU1(lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_lAddr_NT] + (25+isNotAligned(a)); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 24; _closure_stk(a, c + 0); } /* stk: INDIRU1(addr4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr4_NT] + 6; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 28; _closure_stk(a, c + 0); } /* stk: INDIRU1(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + 25; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 32; _closure_stk(a, c + 0); } break; case 1095: /* INDIRP1 */ break; case 1157: /* CVII1 */ _label(LEFT_CHILD(a)); /* stk: CVII1(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + 0; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 38; _closure_stk(a, c + 0); } break; case 1158: /* CVIU1 */ break; case 1205: /* CVUI1 */ break; case 1206: /* CVUU1 */ _label(LEFT_CHILD(a)); /* stk: CVUU1(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + 2; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 39; _closure_stk(a, c + 0); } break; case 1237: /* CALLI1 */ break; case 1238: /* CALLU1 */ break; case 1239: /* CALLP1 */ break; case 1253: /* LOADI1 */ break; case 1254: /* LOADU1 */ break; case 1255: /* LOADP1 */ break; case 1269: /* RETI1 */ break; case 1270: /* RETU1 */ break; case 1271: /* RETP1 */ break; case 1287: /* ADDRGP1 */ break; case 1319: /* ADDRLP1 */ break; case 1333: /* ADDI1 */ break; case 1334: /* ADDU1 */ break; case 1335: /* ADDP1 */ break; case 1349: /* SUBI1 */ break; case 1350: /* SUBU1 */ break; case 1351: /* SUBP1 */ break; case 1365: /* LSHI1 */ break; case 1366: /* LSHU1 */ break; case 1381: /* MODI1 */ break; case 1382: /* MODU1 */ break; case 1397: /* RSHI1 */ break; case 1398: /* RSHU1 */ break; case 1413: /* BANDI1 */ break; case 1414: /* BANDU1 */ break; case 1445: /* BORI1 */ break; case 1446: /* BORU1 */ break; case 1461: /* BXORI1 */ break; case 1462: /* BXORU1 */ break; case 1477: /* DIVI1 */ break; case 1478: /* DIVU1 */ break; case 1493: /* MULI1 */ break; case 1494: /* MULU1 */ break; case 1509: /* EQI1 */ break; case 1510: /* EQU1 */ break; case 1525: /* GEI1 */ break; case 1526: /* GEU1 */ break; case 1541: /* GTI1 */ break; case 1542: /* GTU1 */ break; case 1557: /* LEI1 */ break; case 1558: /* LEU1 */ break; case 1573: /* LTI1 */ break; case 1574: /* LTU1 */ break; case 1589: /* NEI1 */ break; case 1590: /* NEU1 */ break; case 1765: /* TUCKI1 */ _label(LEFT_CHILD(a)); /* tuck1: TUCKI1(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (range(a, 1, 1)); if (c + 0 < p->cost[_tuck1_NT]) { p->cost[_tuck1_NT] = c + 0; p->rule._tuck1 = 1; _closure_tuck1(a, c + 0); } /* tuck2: TUCKI1(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (range(a, 2, 2)); if (c + 0 < p->cost[_tuck2_NT]) { p->cost[_tuck2_NT] = c + 0; p->rule._tuck2 = 1; _closure_tuck2(a, c + 0); } /* tuck3: TUCKI1(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (range(a, 3, 3)); if (c + 0 < p->cost[_tuck3_NT]) { p->cost[_tuck3_NT] = c + 0; p->rule._tuck3 = 1; _closure_tuck3(a, c + 0); } break; case 1766: /* TUCKU1 */ _label(LEFT_CHILD(a)); /* tuck1: TUCKU1(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (range(a, 1, 1)); if (c + 0 < p->cost[_tuck1_NT]) { p->cost[_tuck1_NT] = c + 0; p->rule._tuck1 = 2; _closure_tuck1(a, c + 0); } /* tuck2: TUCKU1(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (range(a, 2, 2)); if (c + 0 < p->cost[_tuck2_NT]) { p->cost[_tuck2_NT] = c + 0; p->rule._tuck2 = 2; _closure_tuck2(a, c + 0); } /* tuck3: TUCKU1(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (range(a, 3, 3)); if (c + 0 < p->cost[_tuck3_NT]) { p->cost[_tuck3_NT] = c + 0; p->rule._tuck3 = 2; _closure_tuck3(a, c + 0); } break; case 2069: /* CNSTI2 */ /* zero: CNSTI2 */ c = (range(a, 0, 0)); if (c + 0 < p->cost[_zero_NT]) { p->cost[_zero_NT] = c + 0; p->rule._zero = 2; } /* cnst1: CNSTI2 */ c = (range(a, 1, 1)); if (c + 0 < p->cost[_cnst1_NT]) { p->cost[_cnst1_NT] = c + 0; p->rule._cnst1 = 3; } /* cnst2: CNSTI2 */ c = (range(a, 2, 2)); if (c + 0 < p->cost[_cnst2_NT]) { p->cost[_cnst2_NT] = c + 0; p->rule._cnst2 = 3; } /* cnst4: CNSTI2 */ c = (range(a, 4, 4)); if (c + 0 < p->cost[_cnst4_NT]) { p->cost[_cnst4_NT] = c + 0; p->rule._cnst4 = 3; } /* stk: CNSTI2 */ if (1 + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = 1 + 0; p->rule._stk = 3; _closure_stk(a, 1 + 0); } break; case 2070: /* CNSTU2 */ /* zero: CNSTU2 */ c = (range(a, 0, 0)); if (c + 0 < p->cost[_zero_NT]) { p->cost[_zero_NT] = c + 0; p->rule._zero = 5; } /* cnst1: CNSTU2 */ c = (range(a, 1, 1)); if (c + 0 < p->cost[_cnst1_NT]) { p->cost[_cnst1_NT] = c + 0; p->rule._cnst1 = 4; } /* cnst2: CNSTU2 */ c = (range(a, 2, 2)); if (c + 0 < p->cost[_cnst2_NT]) { p->cost[_cnst2_NT] = c + 0; p->rule._cnst2 = 4; } /* cnst4: CNSTU2 */ c = (range(a, 4, 4)); if (c + 0 < p->cost[_cnst4_NT]) { p->cost[_cnst4_NT] = c + 0; p->rule._cnst4 = 4; } /* stk: CNSTU2 */ if (1 + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = 1 + 0; p->rule._stk = 4; _closure_stk(a, 1 + 0); } break; case 2101: /* ASGNI2 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: ASGNI2(stk,swrite) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_swrite_NT] + 0; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 4; } /* stmt: ASGNI2(stk,lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_lAddr_NT] + (7+isAligned(a)); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 20; } /* stmt: ASGNI2(stk,lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_lAddr_NT] + (30+isNotAligned(a)); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 24; } /* stmt: ASGNI2(stk,addr4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr4_NT] + 11; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 28; } /* stmt: ASGNI2(stk,addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr_NT] + 30; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 32; } break; case 2102: /* ASGNU2 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: ASGNU2(stk,swrite) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_swrite_NT] + 0; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 5; } /* stmt: ASGNU2(stk,lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_lAddr_NT] + (7+isAligned(a)); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 21; } /* stmt: ASGNU2(stk,lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_lAddr_NT] + (30+isNotAligned(a)); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 25; } /* stmt: ASGNU2(stk,addr4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr4_NT] + 11; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 29; } /* stmt: ASGNU2(stk,addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr_NT] + 30; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 33; } break; case 2117: /* INDIRI2 */ _label(LEFT_CHILD(a)); /* stk: INDIRI2(sread) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_sread_NT] + 0; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 9; _closure_stk(a, c + 0); } /* stk: INDIRI2(lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_lAddr_NT] + (4+isAligned(a)); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 21; _closure_stk(a, c + 0); } /* stk: INDIRI2(lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_lAddr_NT] + (25+isNotAligned(a)); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 25; _closure_stk(a, c + 0); } /* stk: INDIRI2(addr4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr4_NT] + 6; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 29; _closure_stk(a, c + 0); } /* stk: INDIRI2(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + 25; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 33; _closure_stk(a, c + 0); } break; case 2118: /* INDIRU2 */ _label(LEFT_CHILD(a)); /* stk: INDIRU2(sread) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_sread_NT] + 0; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 10; _closure_stk(a, c + 0); } /* stk: INDIRU2(lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_lAddr_NT] + (4+isAligned(a)); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 22; _closure_stk(a, c + 0); } /* stk: INDIRU2(lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_lAddr_NT] + (25+isNotAligned(a)); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 26; _closure_stk(a, c + 0); } /* stk: INDIRU2(addr4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr4_NT] + 6; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 30; _closure_stk(a, c + 0); } /* stk: INDIRU2(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + 25; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 34; _closure_stk(a, c + 0); } break; case 2181: /* CVII2 */ _label(LEFT_CHILD(a)); /* stk: CVII2(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + 0; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 40; _closure_stk(a, c + 0); } break; case 2182: /* CVIU2 */ break; case 2229: /* CVUI2 */ break; case 2230: /* CVUU2 */ _label(LEFT_CHILD(a)); /* stk: CVUU2(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + 2; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 41; _closure_stk(a, c + 0); } break; case 2789: /* TUCKI2 */ _label(LEFT_CHILD(a)); /* tuck1: TUCKI2(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (range(a, 1, 1)); if (c + 0 < p->cost[_tuck1_NT]) { p->cost[_tuck1_NT] = c + 0; p->rule._tuck1 = 3; _closure_tuck1(a, c + 0); } /* tuck2: TUCKI2(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (range(a, 2, 2)); if (c + 0 < p->cost[_tuck2_NT]) { p->cost[_tuck2_NT] = c + 0; p->rule._tuck2 = 3; _closure_tuck2(a, c + 0); } /* tuck3: TUCKI2(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (range(a, 3, 3)); if (c + 0 < p->cost[_tuck3_NT]) { p->cost[_tuck3_NT] = c + 0; p->rule._tuck3 = 3; _closure_tuck3(a, c + 0); } break; case 2790: /* TUCKU2 */ _label(LEFT_CHILD(a)); /* tuck1: TUCKU2(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (range(a, 1, 1)); if (c + 0 < p->cost[_tuck1_NT]) { p->cost[_tuck1_NT] = c + 0; p->rule._tuck1 = 4; _closure_tuck1(a, c + 0); } /* tuck2: TUCKU2(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (range(a, 2, 2)); if (c + 0 < p->cost[_tuck2_NT]) { p->cost[_tuck2_NT] = c + 0; p->rule._tuck2 = 4; _closure_tuck2(a, c + 0); } /* tuck3: TUCKU2(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (range(a, 3, 3)); if (c + 0 < p->cost[_tuck3_NT]) { p->cost[_tuck3_NT] = c + 0; p->rule._tuck3 = 4; _closure_tuck3(a, c + 0); } break; case 4113: /* CNSTF4 */ break; case 4117: /* CNSTI4 */ /* zero: CNSTI4 */ c = (range(a, 0, 0)); if (c + 0 < p->cost[_zero_NT]) { p->cost[_zero_NT] = c + 0; p->rule._zero = 3; } /* cnst1: CNSTI4 */ c = (range(a, 1, 1)); if (c + 0 < p->cost[_cnst1_NT]) { p->cost[_cnst1_NT] = c + 0; p->rule._cnst1 = 5; } /* cnst2: CNSTI4 */ c = (range(a, 2, 2)); if (c + 0 < p->cost[_cnst2_NT]) { p->cost[_cnst2_NT] = c + 0; p->rule._cnst2 = 5; } /* cnst3: CNSTI4 */ c = (range(a, 3, 3)); if (c + 0 < p->cost[_cnst3_NT]) { p->cost[_cnst3_NT] = c + 0; p->rule._cnst3 = 1; } /* cnst4: CNSTI4 */ c = (range(a, 4, 4)); if (c + 0 < p->cost[_cnst4_NT]) { p->cost[_cnst4_NT] = c + 0; p->rule._cnst4 = 5; } /* cnstn: CNSTI4 */ if (2 + 0 < p->cost[_cnstn_NT]) { p->cost[_cnstn_NT] = 2 + 0; p->rule._cnstn = 2; } /* stk: CNSTI4 */ if (1 + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = 1 + 0; p->rule._stk = 5; _closure_stk(a, 1 + 0); } /* addr4: CNSTI4 */ c = (((a->syms[0]->u.c.v.i & 3) ? LBURG_MAX : 1)); if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 2; _closure_addr4(a, c + 0); } break; case 4118: /* CNSTU4 */ /* zero: CNSTU4 */ c = (range(a, 0, 0)); if (c + 0 < p->cost[_zero_NT]) { p->cost[_zero_NT] = c + 0; p->rule._zero = 6; } /* cnst1: CNSTU4 */ c = (range(a, 1, 1)); if (c + 0 < p->cost[_cnst1_NT]) { p->cost[_cnst1_NT] = c + 0; p->rule._cnst1 = 6; } /* cnst2: CNSTU4 */ c = (range(a, 2, 2)); if (c + 0 < p->cost[_cnst2_NT]) { p->cost[_cnst2_NT] = c + 0; p->rule._cnst2 = 6; } /* cnst4: CNSTU4 */ c = (range(a, 4, 4)); if (c + 0 < p->cost[_cnst4_NT]) { p->cost[_cnst4_NT] = c + 0; p->rule._cnst4 = 6; } /* cnstn: CNSTU4 */ if (2 + 0 < p->cost[_cnstn_NT]) { p->cost[_cnstn_NT] = 2 + 0; p->rule._cnstn = 1; } /* stk: CNSTU4 */ if (1 + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = 1 + 0; p->rule._stk = 6; _closure_stk(a, 1 + 0); } /* addr4: CNSTU4 */ c = (((a->syms[0]->u.c.v.u & 3) ? LBURG_MAX : 1)); if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 3; _closure_addr4(a, c + 0); } break; case 4119: /* CNSTP4 */ /* zero: CNSTP4 */ c = (range(a, 0, 0)); if (c + 0 < p->cost[_zero_NT]) { p->cost[_zero_NT] = c + 0; p->rule._zero = 7; } /* addr: CNSTP4 */ if (1 + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = 1 + 0; p->rule._addr = 1; _closure_addr(a, 1 + 0); } /* addr4: CNSTP4 */ c = (((a->syms[0]->u.c.v.u & 3) ? LBURG_MAX : 1)); if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 1; _closure_addr4(a, c + 0); } break; case 4129: /* ARGF4 */ break; case 4133: /* ARGI4 */ _label(LEFT_CHILD(a)); /* stmt: ARGI4(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (0 /*Push int parameter for function call*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 57; } break; case 4134: /* ARGU4 */ _label(LEFT_CHILD(a)); /* stmt: ARGU4(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (0 /*Push unsigned parameter for function call*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 58; } break; case 4135: /* ARGP4 */ _label(LEFT_CHILD(a)); /* stmt: ARGP4(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + (0 /*Push unsigned parameter for function call*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 59; } break; case 4145: /* ASGNF4 */ break; case 4149: /* ASGNI4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: ASGNI4(stk,swrite) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_swrite_NT] + 0; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 6; } /* stmt: ASGNI4(stk,lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_lAddr_NT] + 2; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 15; } /* stmt: ASGNI4(stk,addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr_NT] + 1; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 34; } break; case 4150: /* ASGNU4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: ASGNU4(stk,swrite) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_swrite_NT] + 0; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 7; } /* stmt: ASGNU4(stk,lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_lAddr_NT] + 2; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 16; } /* stmt: ASGNU4(stk,addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr_NT] + 1; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 35; } break; case 4151: /* ASGNP4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: ASGNP4(addr,swrite) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_swrite_NT] + 0; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 8; } /* stmt: ASGNP4(addr,lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_lAddr_NT] + 2; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 17; } /* stmt: ASGNP4(addr,addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr_NT] + 1; if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 36; } break; case 4161: /* INDIRF4 */ break; case 4165: /* INDIRI4 */ _label(LEFT_CHILD(a)); /* stk: INDIRI4(sread) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_sread_NT] + 0; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 11; _closure_stk(a, c + 0); } /* stk: INDIRI4(lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_lAddr_NT] + 2; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 17; _closure_stk(a, c + 0); } /* stk: INDIRI4(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + 1; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 35; _closure_stk(a, c + 0); } break; case 4166: /* INDIRU4 */ _label(LEFT_CHILD(a)); /* stk: INDIRU4(sread) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_sread_NT] + 0; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 12; _closure_stk(a, c + 0); } /* stk: INDIRU4(lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_lAddr_NT] + 2; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 18; _closure_stk(a, c + 0); } /* stk: INDIRU4(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + 1; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 36; _closure_stk(a, c + 0); } break; case 4167: /* INDIRP4 */ _label(LEFT_CHILD(a)); /* addr: INDIRP4(sread) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_sread_NT] + 0; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 2; _closure_addr(a, c + 0); } /* addr: INDIRP4(lAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_lAddr_NT] + 2; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 10; _closure_addr(a, c + 0); } /* addr: INDIRP4(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + 1; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 11; _closure_addr(a, c + 0); } break; case 4209: /* CVFF4 */ break; case 4213: /* CVFI4 */ break; case 4225: /* CVIF4 */ break; case 4229: /* CVII4 */ _label(LEFT_CHILD(a)); /* stk: CVII4(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + 0; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 42; _closure_stk(a, c + 0); } break; case 4230: /* CVIU4 */ _label(LEFT_CHILD(a)); /* stk: CVIU4(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + 0; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 44; _closure_stk(a, c + 0); } break; case 4246: /* CVPU4 */ _label(LEFT_CHILD(a)); /* addr4: CVPU4(addr4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr4_NT] + 0; if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 20; _closure_addr4(a, c + 0); } /* addr: CVPU4(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + 0; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 30; _closure_addr(a, c + 0); } break; case 4277: /* CVUI4 */ _label(LEFT_CHILD(a)); /* stk: CVUI4(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + 0; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 43; _closure_stk(a, c + 0); } break; case 4278: /* CVUU4 */ _label(LEFT_CHILD(a)); /* stk: CVUU4(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + 0; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 45; _closure_stk(a, c + 0); } break; case 4279: /* CVUP4 */ _label(LEFT_CHILD(a)); /* stk: CVUP4(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + 0; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 46; _closure_stk(a, c + 0); } break; case 4289: /* NEGF4 */ break; case 4293: /* NEGI4 */ _label(LEFT_CHILD(a)); /* stk: NEGI4(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (1 /*negate a integer*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 59; _closure_stk(a, c + 0); } break; case 4305: /* CALLF4 */ break; case 4309: /* CALLI4 */ _label(LEFT_CHILD(a)); /* stk: CALLI4(jAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_jAddr_NT] + (1+isNotCurrentFun(a)+isDefinedFun(a)); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 76; _closure_stk(a, c + 0); } /* stk: CALLI4(jAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_jAddr_NT] + (1+isCurrentFun(a)); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 78; _closure_stk(a, c + 0); } /* stk: CALLI4(jAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_jAddr_NT] + (1+isNotCurrentFun(a)+isNotDefinedFun(a)); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 80; _closure_stk(a, c + 0); } /* stk: CALLI4(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + 1; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 82; _closure_stk(a, c + 0); } break; case 4310: /* CALLU4 */ _label(LEFT_CHILD(a)); /* stk: CALLU4(jAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_jAddr_NT] + (1+isNotCurrentFun(a)+isDefinedFun(a)); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 77; _closure_stk(a, c + 0); } /* stk: CALLU4(jAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_jAddr_NT] + (1+isCurrentFun(a)); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 79; _closure_stk(a, c + 0); } /* stk: CALLU4(jAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_jAddr_NT] + (1+isNotCurrentFun(a)+isNotDefinedFun(a)); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 81; _closure_stk(a, c + 0); } /* stk: CALLU4(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + 1; if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 83; _closure_stk(a, c + 0); } break; case 4311: /* CALLP4 */ _label(LEFT_CHILD(a)); /* addr: CALLP4(jAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_jAddr_NT] + (1+isNotCurrentFun(a)+isDefinedFun(a)); if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 32; _closure_addr(a, c + 0); } /* addr: CALLP4(jAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_jAddr_NT] + (1+isCurrentFun(a)); if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 33; _closure_addr(a, c + 0); } /* addr: CALLP4(jAddr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_jAddr_NT] + (1+isNotCurrentFun(a)+isNotDefinedFun(a)); if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 34; _closure_addr(a, c + 0); } /* addr: CALLP4(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + 1; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 35; _closure_addr(a, c + 0); } break; case 4337: /* RETF4 */ break; case 4341: /* RETI4 */ _label(LEFT_CHILD(a)); /* stmt: RETI4(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (0 /*Return Int (is already on Datastack, because we have evaluated it there)*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 53; } break; case 4342: /* RETU4 */ _label(LEFT_CHILD(a)); /* stmt: RETU4(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (0 /*Return unsigned Int (is already on Datastack, because we have evaluated it there)*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 54; } break; case 4343: /* RETP4 */ _label(LEFT_CHILD(a)); /* stmt: RETP4(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + (0 /*Return unsigned Int (is already on Datastack, because we have evaluated it there)*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 55; } break; case 4359: /* ADDRGP4 */ /* jAddr: ADDRGP4 */ c = (1 /*No \n so must be printed by Jump*/); if (c + 0 < p->cost[_jAddr_NT]) { p->cost[_jAddr_NT] = c + 0; p->rule._jAddr = 1; } /* addr: ADDRGP4 */ c = (1+isNotDefinedVar(a)); if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 6; _closure_addr(a, c + 0); } /* addr: ADDRGP4 */ c = (1+isDefinedVar(a)); if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 7; _closure_addr(a, c + 0); } break; case 4391: /* ADDRLP4 */ /* lAddr: ADDRLP4 */ c = (1 /*No \n so must be printed by assig/indir*/); if (c + 0 < p->cost[_lAddr_NT]) { p->cost[_lAddr_NT] = c + 0; p->rule._lAddr = 1; } /* addr4: ADDRLP4 */ c = (4+isAligned(a) /*increased by one to prefer local loads/stores*/); if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 4; _closure_addr4(a, c + 0); } /* addr: ADDRLP4 */ c = (4+isNotAligned(a) /*increased by one to prefer local loads/stores*/); if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 8; _closure_addr(a, c + 0); } break; case 4401: /* ADDF4 */ break; case 4405: /* ADDI4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stk: ADDI4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (1 /*Integerarithmetic: add two values*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 47; _closure_stk(a, c + 0); } /* stk: ADDI4(cnst1,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_cnst1_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (1 /*Integerarithmetic: add two values*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 49; _closure_stk(a, c + 0); } /* stk: ADDI4(stk,cnst1) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnst1_NT] + (1 /*Integerarithmetic: add two values*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 51; _closure_stk(a, c + 0); } break; case 4406: /* ADDU4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* addr4: ADDU4(addr4,addr4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr4_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr4_NT] + 1; if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 12; _closure_addr4(a, c + 0); } /* addr: ADDU4(addr,addr4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr4_NT] + 1; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 13; _closure_addr(a, c + 0); } /* addr: ADDU4(addr4,addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr4_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr_NT] + 1; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 15; _closure_addr(a, c + 0); } /* stk: ADDU4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (1 /*Unsignedarithmetic: add two values*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 48; _closure_stk(a, c + 0); } /* stk: ADDU4(cnst1,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_cnst1_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (1 /*Unsignedarithmetic: add two values*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 50; _closure_stk(a, c + 0); } /* stk: ADDU4(stk,cnst1) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnst1_NT] + (1 /*Unsignedarithmetic: add two values*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 52; _closure_stk(a, c + 0); } break; case 4407: /* ADDP4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* addr4: ADDP4(addr4,zero) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr4_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_zero_NT] + 0; if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 9; _closure_addr4(a, c + 0); } /* addr4: ADDP4(addr4,cnst4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr4_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnst4_NT] + 1; if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 10; _closure_addr4(a, c + 0); } /* addr4: ADDP4(addr4,addr4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr4_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr4_NT] + 1; if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 11; _closure_addr4(a, c + 0); } /* addr: ADDP4(addr,addr4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr4_NT] + 1; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 12; _closure_addr(a, c + 0); } /* addr: ADDP4(addr4,addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr4_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr_NT] + 1; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 14; _closure_addr(a, c + 0); } /* addr: ADDP4(addr,zero) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_zero_NT] + 0; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 16; _closure_addr(a, c + 0); } /* addr: ADDP4(addr,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + 6; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 17; _closure_addr(a, c + 0); } /* addr: ADDP4(stk,addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr_NT] + 5; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 18; _closure_addr(a, c + 0); } /* addr: ADDP4(addr,cnst1) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnst1_NT] + 5; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 19; _closure_addr(a, c + 0); } /* addr: ADDP4(addr,cnst2) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnst2_NT] + 3; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 20; _closure_addr(a, c + 0); } /* addr: ADDP4(addr,cnst4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnst4_NT] + 1; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 21; _closure_addr(a, c + 0); } /* addr: ADDP4(addr,cnstn) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnstn_NT] + 6; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 22; _closure_addr(a, c + 0); } break; case 4417: /* SUBF4 */ break; case 4421: /* SUBI4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stk: SUBI4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (1 /*Integerarithmetic: subtract two values*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 53; _closure_stk(a, c + 0); } /* stk: SUBI4(stk,cnst1) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnst1_NT] + (1 /*Integerarithmetic: subtract two values*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 55; _closure_stk(a, c + 0); } break; case 4422: /* SUBU4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stk: SUBU4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (1 /*Unsignedarithmetic: subtract two values*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 54; _closure_stk(a, c + 0); } /* stk: SUBU4(stk,cnst1) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnst1_NT] + (1 /*Unsignedarithmetic: subtract two values*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 56; _closure_stk(a, c + 0); } break; case 4423: /* SUBP4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* addr4: SUBP4(addr4,addr4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr4_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr4_NT] + 1; if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 13; _closure_addr4(a, c + 0); } /* addr: SUBP4(addr,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + 6; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 23; _closure_addr(a, c + 0); } /* addr: SUBP4(stk,addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr_NT] + 5; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 24; _closure_addr(a, c + 0); } /* addr: SUBP4(addr,zero) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_zero_NT] + 0; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 25; _closure_addr(a, c + 0); } /* addr: SUBP4(addr,cnst1) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnst1_NT] + 5; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 26; _closure_addr(a, c + 0); } /* addr: SUBP4(addr,cnst2) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnst2_NT] + 3; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 27; _closure_addr(a, c + 0); } /* addr: SUBP4(addr,cnst4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnst4_NT] + 1; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 28; _closure_addr(a, c + 0); } /* addr: SUBP4(addr,cnstn) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnstn_NT] + 6; if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 29; _closure_addr(a, c + 0); } break; case 4437: /* LSHI4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* addr4: LSHI4(stk,cnst2) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnst2_NT] + 0; if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 14; _closure_addr4(a, c + 0); } /* addr4: LSHI4(stk,cnst3) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnst3_NT] + 2; if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 16; _closure_addr4(a, c + 0); } /* addr4: LSHI4(stk,cnst4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnst4_NT] + 3; if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 18; _closure_addr4(a, c + 0); } /* stk: LSHI4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (1+(DATA_WIDTH+1)/2 /*Integerarithmetic: lshift by a value (cost depends on uForth Compiler, we assume a streight forward variant)*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 67; _closure_stk(a, c + 0); } break; case 4438: /* LSHU4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* addr4: LSHU4(stk,cnst2) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnst2_NT] + 0; if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 15; _closure_addr4(a, c + 0); } /* addr4: LSHU4(stk,cnst3) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnst3_NT] + 2; if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 17; _closure_addr4(a, c + 0); } /* addr4: LSHU4(stk,cnst4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_cnst4_NT] + 3; if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 19; _closure_addr4(a, c + 0); } /* stk: LSHU4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (1+(DATA_WIDTH+1)/2 /*Unsignedarithmetic: lshift by a value (cost depends on uForth Compiler, we assume a streight forward variant) (hardware fun candidate) */); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 72; _closure_stk(a, c + 0); } break; case 4453: /* MODI4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stk: MODI4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (DATA_WIDTH+4 /*Integerarithmetic: mod a value (cost depends on uForth Compiler, we assume he chose most performant variant)*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 68; _closure_stk(a, c + 0); } break; case 4454: /* MODU4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stk: MODU4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (DATA_WIDTH+4 /*Unsignedarithmetic: mod a value (cost depends on uForth Compiler, we assume he chose most performant variant)*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 73; _closure_stk(a, c + 0); } break; case 4469: /* RSHI4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stk: RSHI4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (2+(DATA_WIDTH+1)/2 /*Integerarithmetic: rshift by a value (cost depends on uForth Compiler, we assume a streight forward variant)*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 70; _closure_stk(a, c + 0); } break; case 4470: /* RSHU4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stk: RSHU4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (2+(DATA_WIDTH+1)/2 /*Unsignedarithmetic: rshift by a value (cost depends on uForth Compiler, we assume a streight forward variant)*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 75; _closure_stk(a, c + 0); } break; case 4485: /* BANDI4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stk: BANDI4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (1 /*Logische operation: bitwise and of 2 values*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 60; _closure_stk(a, c + 0); } break; case 4486: /* BANDU4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stk: BANDU4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (1 /*Logische operation: bitwise and of 2 values */); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 63; _closure_stk(a, c + 0); } break; case 4501: /* BCOMI4 */ _label(LEFT_CHILD(a)); /* stk: BCOMI4(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (1 /*invert a integer*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 57; _closure_stk(a, c + 0); } break; case 4502: /* BCOMU4 */ _label(LEFT_CHILD(a)); /* stk: BCOMU4(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (1 /*invert a unsigned integer*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 58; _closure_stk(a, c + 0); } break; case 4517: /* BORI4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stk: BORI4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (1 /*Logische operation: bitwise or of 2 values*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 61; _closure_stk(a, c + 0); } break; case 4518: /* BORU4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stk: BORU4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (1 /*Logische operation: bitwise or of 2 values */); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 64; _closure_stk(a, c + 0); } break; case 4533: /* BXORI4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stk: BXORI4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (1 /*Logische operation: bitwise xor of 2 values*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 62; _closure_stk(a, c + 0); } break; case 4534: /* BXORU4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stk: BXORU4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (1 /*Logische operation: bitwise xor of 2 values */); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 65; _closure_stk(a, c + 0); } break; case 4545: /* DIVF4 */ break; case 4549: /* DIVI4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stk: DIVI4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (DATA_WIDTH+3 /*Integerarithmetic: divide by a value (cost depends on uForth Compiler, we assume he chose most performant variant)*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 66; _closure_stk(a, c + 0); } break; case 4550: /* DIVU4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stk: DIVU4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (DATA_WIDTH+3 /*Unsignedarithmetic: divide by a value (cost depends on uForth Compiler, we assume he chose most performant variant)*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 71; _closure_stk(a, c + 0); } break; case 4561: /* MULF4 */ break; case 4565: /* MULI4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* addr4: MULI4(addr4,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr4_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (MULT_COST+1); if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 7; _closure_addr4(a, c + 0); } /* addr4: MULI4(stk,addr4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr4_NT] + (MULT_COST+1); if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 8; _closure_addr4(a, c + 0); } /* stk: MULI4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (MULT_COST+1 /*Integerarithmetic: multiply 2 values (cost may depend on uForth Compiler, we assume he chose most performant variant)*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 69; _closure_stk(a, c + 0); } break; case 4566: /* MULU4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* addr4: MULU4(addr4,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr4_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (MULT_COST+1); if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 5; _closure_addr4(a, c + 0); } /* addr4: MULU4(stk,addr4) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_addr4_NT] + (MULT_COST+1); if (c + 0 < p->cost[_addr4_NT]) { p->cost[_addr4_NT] = c + 0; p->rule._addr4 = 6; _closure_addr4(a, c + 0); } /* stk: MULU4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (MULT_COST+1 /*Unsignedarithmetic: multiply 2 values (cost may depend on uForth Compiler, we assume most performant variant)*/); if (c + 0 < p->cost[_stk_NT]) { p->cost[_stk_NT] = c + 0; p->rule._stk = 74; _closure_stk(a, c + 0); } break; case 4577: /* EQF4 */ break; case 4581: /* EQI4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: EQI4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (3 /*Branchoperation: Branch if equal*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 37; } break; case 4582: /* EQU4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: EQU4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (3 /*Branchoperation: Branch if equal (DO WE NEED THIS)*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 38; } break; case 4593: /* GEF4 */ break; case 4597: /* GEI4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: GEI4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (3 /*Branchoperation: Branch if greater or equal*/ /* check this in asm impl*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 39; } break; case 4598: /* GEU4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: GEU4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (5 /*Branchoperation: Branch if greater or equal*/ /* check this in asm impl*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 40; } break; case 4609: /* GTF4 */ break; case 4613: /* GTI4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: GTI4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (3 /*Branchoperation: Branch if greater*/ /* check this in asm impl*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 41; } break; case 4614: /* GTU4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: GTU4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (5 /*Branchoperation: Branch if greater*/ /* check this in asm impl*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 42; } break; case 4625: /* LEF4 */ break; case 4629: /* LEI4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: LEI4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (3 /*Branchoperation: Branch if less or equal*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 43; } break; case 4630: /* LEU4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: LEU4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (5 /*Branchoperation: Branch if less or equal*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 44; } break; case 4641: /* LTF4 */ break; case 4645: /* LTI4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: LTI4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (3 /*Branchoperation: Branch if less*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 45; } break; case 4646: /* LTU4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: LTU4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (5 /*Branchoperation: Branch if less*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 46; } break; case 4657: /* NEF4 */ break; case 4661: /* NEI4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: NEI4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (3 /*Branchoperation: Branch if not equal*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 47; } break; case 4662: /* NEU4 */ _label(LEFT_CHILD(a)); _label(RIGHT_CHILD(a)); /* stmt: NEU4(stk,stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_stk_NT] + (3 /*Branchoperation: Branch if not equal (DO WE NEED THIS)*/); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 48; } break; case 4833: /* TUCKF4 */ break; case 4837: /* TUCKI4 */ _label(LEFT_CHILD(a)); /* tuck1: TUCKI4(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (range(a, 1, 1)); if (c + 0 < p->cost[_tuck1_NT]) { p->cost[_tuck1_NT] = c + 0; p->rule._tuck1 = 5; _closure_tuck1(a, c + 0); } /* tuck2: TUCKI4(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (range(a, 2, 2)); if (c + 0 < p->cost[_tuck2_NT]) { p->cost[_tuck2_NT] = c + 0; p->rule._tuck2 = 5; _closure_tuck2(a, c + 0); } /* tuck3: TUCKI4(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (range(a, 3, 3)); if (c + 0 < p->cost[_tuck3_NT]) { p->cost[_tuck3_NT] = c + 0; p->rule._tuck3 = 5; _closure_tuck3(a, c + 0); } break; case 4838: /* TUCKU4 */ _label(LEFT_CHILD(a)); /* tuck1: TUCKU4(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (range(a, 1, 1)); if (c + 0 < p->cost[_tuck1_NT]) { p->cost[_tuck1_NT] = c + 0; p->rule._tuck1 = 6; _closure_tuck1(a, c + 0); } /* tuck2: TUCKU4(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (range(a, 2, 2)); if (c + 0 < p->cost[_tuck2_NT]) { p->cost[_tuck2_NT] = c + 0; p->rule._tuck2 = 6; _closure_tuck2(a, c + 0); } /* tuck3: TUCKU4(stk) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_stk_NT] + (range(a, 3, 3)); if (c + 0 < p->cost[_tuck3_NT]) { p->cost[_tuck3_NT] = c + 0; p->rule._tuck3 = 6; _closure_tuck3(a, c + 0); } break; case 4839: /* TUCKP4 */ _label(LEFT_CHILD(a)); /* addr: TUCKP4(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + (range(a, 1, 1)+1); if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 3; _closure_addr(a, c + 0); } /* stmt: TUCKP4(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + (range(a, 1, 1)); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 9; } /* addr: TUCKP4(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + (range(a, 2, 2)+1); if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 4; _closure_addr(a, c + 0); } /* stmt: TUCKP4(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + (range(a, 2, 2)); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 10; } /* addr: TUCKP4(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + (range(a, 3, 3)+3); if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 5; _closure_addr(a, c + 0); } /* stmt: TUCKP4(addr) */ c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + (range(a, 3, 3)); if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 11; } break; case 8209: /* CNSTF8 */ break; case 8213: /* CNSTI8 */ break; case 8214: /* CNSTU8 */ break; case 8225: /* ARGF8 */ break; case 8229: /* ARGI8 */ break; case 8230: /* ARGU8 */ break; case 8241: /* ASGNF8 */ break; case 8245: /* ASGNI8 */ break; case 8246: /* ASGNU8 */ break; case 8257: /* INDIRF8 */ break; case 8261: /* INDIRI8 */ break; case 8262: /* INDIRU8 */ break; case 8305: /* CVFF8 */ break; case 8309: /* CVFI8 */ break; case 8321: /* CVIF8 */ break; case 8325: /* CVII8 */ break; case 8326: /* CVIU8 */ break; case 8373: /* CVUI8 */ break; case 8374: /* CVUU8 */ break; case 8385: /* NEGF8 */ break; case 8389: /* NEGI8 */ break; case 8401: /* CALLF8 */ break; case 8405: /* CALLI8 */ break; case 8406: /* CALLU8 */ break; case 8433: /* RETF8 */ break; case 8437: /* RETI8 */ break; case 8438: /* RETU8 */ break; case 8497: /* ADDF8 */ break; case 8501: /* ADDI8 */ break; case 8502: /* ADDU8 */ break; case 8513: /* SUBF8 */ break; case 8517: /* SUBI8 */ break; case 8518: /* SUBU8 */ break; case 8533: /* LSHI8 */ break; case 8534: /* LSHU8 */ break; case 8549: /* MODI8 */ break; case 8550: /* MODU8 */ break; case 8565: /* RSHI8 */ break; case 8566: /* RSHU8 */ break; case 8581: /* BANDI8 */ break; case 8582: /* BANDU8 */ break; case 8597: /* BCOMI8 */ break; case 8598: /* BCOMU8 */ break; case 8613: /* BORI8 */ break; case 8614: /* BORU8 */ break; case 8629: /* BXORI8 */ break; case 8630: /* BXORU8 */ break; case 8641: /* DIVF8 */ break; case 8645: /* DIVI8 */ break; case 8646: /* DIVU8 */ break; case 8657: /* MULF8 */ break; case 8661: /* MULI8 */ break; case 8662: /* MULU8 */ break; case 8673: /* EQF8 */ break; case 8677: /* EQI8 */ break; case 8678: /* EQU8 */ break; case 8689: /* GEF8 */ break; case 8693: /* GEI8 */ break; case 8694: /* GEU8 */ break; case 8705: /* GTF8 */ break; case 8709: /* GTI8 */ break; case 8710: /* GTU8 */ break; case 8721: /* LEF8 */ break; case 8725: /* LEI8 */ break; case 8726: /* LEU8 */ break; case 8737: /* LTF8 */ break; case 8741: /* LTI8 */ break; case 8742: /* LTU8 */ break; case 8753: /* NEF8 */ break; case 8757: /* NEI8 */ break; case 8758: /* NEU8 */ break; case 8929: /* TUCKF8 */ break; case 8933: /* TUCKI8 */ break; case 8934: /* TUCKU8 */ break; default: fatal("_label", "Bad terminal %d\n", OP_LABEL(a)); } } static void _kids(NODEPTR_TYPE p, int eruleno, NODEPTR_TYPE kids[]) { if (!p) fatal("_kids", "Null tree\n", 0); if (!kids) fatal("_kids", "Null kids\n", 0); switch (eruleno) { case 258: /* stmt: LABELV */ case 252: /* stmt: RETV */ case 100: /* addr: ADDRLP4 */ case 99: /* addr4: ADDRLP4 */ case 98: /* addr: ADDRGP4 */ case 97: /* addr: ADDRGP4 */ case 96: /* jAddr: ADDRGP4 */ case 95: /* lAddr: ADDRLP4 */ case 94: /* stk: NOOP */ case 49: /* swrite: STACKP */ case 48: /* swrite: STACKP */ case 47: /* swrite: STACKP */ case 46: /* sread: COPYP */ case 45: /* sread: COPYP */ case 44: /* sread: COPYP */ case 43: /* sread: COPYP */ case 42: /* sread: STACKP */ case 41: /* sread: STACKP */ case 40: /* sread: STACKP */ case 38: /* addr4: CNSTU4 */ case 37: /* addr4: CNSTI4 */ case 36: /* addr4: CNSTP4 */ case 35: /* addr: CNSTP4 */ case 34: /* stk: CNSTU4 */ case 33: /* stk: CNSTI4 */ case 32: /* stk: CNSTU2 */ case 31: /* stk: CNSTI2 */ case 30: /* stk: CNSTU1 */ case 29: /* stk: CNSTI1 */ case 28: /* cnstn: CNSTI4 */ case 27: /* cnstn: CNSTU4 */ case 26: /* cnst4: CNSTU4 */ case 25: /* cnst4: CNSTI4 */ case 24: /* cnst4: CNSTU2 */ case 23: /* cnst4: CNSTI2 */ case 22: /* cnst4: CNSTU1 */ case 21: /* cnst4: CNSTI1 */ case 20: /* cnst3: CNSTI4 */ case 19: /* cnst2: CNSTU4 */ case 18: /* cnst2: CNSTI4 */ case 17: /* cnst2: CNSTU2 */ case 16: /* cnst2: CNSTI2 */ case 15: /* cnst2: CNSTU1 */ case 14: /* cnst2: CNSTI1 */ case 13: /* cnst1: CNSTU4 */ case 12: /* cnst1: CNSTI4 */ case 11: /* cnst1: CNSTU2 */ case 10: /* cnst1: CNSTI2 */ case 9: /* cnst1: CNSTU1 */ case 8: /* cnst1: CNSTI1 */ case 7: /* zero: CNSTP4 */ case 6: /* zero: CNSTU4 */ case 5: /* zero: CNSTU2 */ case 4: /* zero: CNSTU1 */ case 3: /* zero: CNSTI4 */ case 2: /* zero: CNSTI2 */ case 1: /* zero: CNSTI1 */ break; case 182: /* addr: stk */ case 181: /* stk: addr */ case 101: /* addr: addr4 */ case 93: /* stmt: tuck3 */ case 92: /* stmt: tuck2 */ case 91: /* stmt: tuck1 */ case 90: /* stk: tuck3 */ case 89: /* stk: tuck2 */ case 88: /* stk: tuck1 */ case 39: /* stmt: stk */ kids[0] = p; break; case 257: /* stmt: JUMPV(addr) */ case 256: /* stmt: JUMPV(jAddr) */ case 255: /* stmt: ARGP4(addr) */ case 254: /* stmt: ARGU4(stk) */ case 253: /* stmt: ARGI4(stk) */ case 251: /* stmt: RETP4(addr) */ case 250: /* stmt: RETU4(stk) */ case 249: /* stmt: RETI4(stk) */ case 248: /* addr: CALLP4(addr) */ case 247: /* stk: CALLU4(addr) */ case 246: /* stk: CALLI4(addr) */ case 245: /* stmt: CALLV(addr) */ case 244: /* addr: CALLP4(jAddr) */ case 243: /* stk: CALLU4(jAddr) */ case 242: /* stk: CALLI4(jAddr) */ case 241: /* stmt: CALLV(jAddr) */ case 240: /* addr: CALLP4(jAddr) */ case 239: /* stk: CALLU4(jAddr) */ case 238: /* stk: CALLI4(jAddr) */ case 237: /* stmt: CALLV(jAddr) */ case 236: /* addr: CALLP4(jAddr) */ case 235: /* stk: CALLU4(jAddr) */ case 234: /* stk: CALLI4(jAddr) */ case 233: /* stmt: CALLV(jAddr) */ case 204: /* stk: NEGI4(stk) */ case 203: /* stk: BCOMU4(stk) */ case 202: /* stk: BCOMI4(stk) */ case 191: /* stk: CVUP4(stk) */ case 190: /* stk: CVUU4(stk) */ case 189: /* stk: CVIU4(stk) */ case 188: /* stk: CVUI4(stk) */ case 187: /* stk: CVII4(stk) */ case 186: /* stk: CVUU2(stk) */ case 185: /* stk: CVII2(stk) */ case 184: /* stk: CVUU1(stk) */ case 183: /* stk: CVII1(stk) */ case 180: /* addr: CVPU4(addr) */ case 179: /* addr4: CVPU4(addr4) */ case 145: /* addr: INDIRP4(addr) */ case 144: /* stk: INDIRU4(addr) */ case 143: /* stk: INDIRI4(addr) */ case 142: /* stk: INDIRU2(addr) */ case 141: /* stk: INDIRI2(addr) */ case 140: /* stk: INDIRU1(addr) */ case 139: /* stk: INDIRI1(addr) */ case 138: /* stk: INDIRU2(addr4) */ case 137: /* stk: INDIRI2(addr4) */ case 136: /* stk: INDIRU1(addr4) */ case 135: /* stk: INDIRI1(addr4) */ case 134: /* stk: INDIRU2(lAddr) */ case 133: /* stk: INDIRI2(lAddr) */ case 132: /* stk: INDIRU1(lAddr) */ case 131: /* stk: INDIRI1(lAddr) */ case 130: /* stk: INDIRU2(lAddr) */ case 129: /* stk: INDIRI2(lAddr) */ case 128: /* stk: INDIRU1(lAddr) */ case 127: /* stk: INDIRI1(lAddr) */ case 126: /* addr: INDIRP4(lAddr) */ case 125: /* stk: INDIRU4(lAddr) */ case 124: /* stk: INDIRI4(lAddr) */ case 87: /* stmt: TUCKP4(addr) */ case 86: /* addr: TUCKP4(addr) */ case 85: /* tuck3: TUCKU4(stk) */ case 84: /* tuck3: TUCKI4(stk) */ case 83: /* tuck3: TUCKU2(stk) */ case 82: /* tuck3: TUCKI2(stk) */ case 81: /* tuck3: TUCKU1(stk) */ case 80: /* tuck3: TUCKI1(stk) */ case 79: /* stmt: TUCKP4(addr) */ case 78: /* addr: TUCKP4(addr) */ case 77: /* tuck2: TUCKU4(stk) */ case 76: /* tuck2: TUCKI4(stk) */ case 75: /* tuck2: TUCKU2(stk) */ case 74: /* tuck2: TUCKI2(stk) */ case 73: /* tuck2: TUCKU1(stk) */ case 72: /* tuck2: TUCKI1(stk) */ case 71: /* stmt: TUCKP4(addr) */ case 70: /* addr: TUCKP4(addr) */ case 69: /* tuck1: TUCKU4(stk) */ case 68: /* tuck1: TUCKI4(stk) */ case 67: /* tuck1: TUCKU2(stk) */ case 66: /* tuck1: TUCKI2(stk) */ case 65: /* tuck1: TUCKU1(stk) */ case 64: /* tuck1: TUCKI1(stk) */ case 56: /* addr: INDIRP4(sread) */ case 55: /* stk: INDIRU4(sread) */ case 54: /* stk: INDIRI4(sread) */ case 53: /* stk: INDIRU2(sread) */ case 52: /* stk: INDIRI2(sread) */ case 51: /* stk: INDIRU1(sread) */ case 50: /* stk: INDIRI1(sread) */ kids[0] = LEFT_CHILD(p); break; case 232: /* stmt: NEU4(stk,stk) */ case 231: /* stmt: NEI4(stk,stk) */ case 230: /* stmt: LTU4(stk,stk) */ case 229: /* stmt: LTI4(stk,stk) */ case 228: /* stmt: LEU4(stk,stk) */ case 227: /* stmt: LEI4(stk,stk) */ case 226: /* stmt: GTU4(stk,stk) */ case 225: /* stmt: GTI4(stk,stk) */ case 224: /* stmt: GEU4(stk,stk) */ case 223: /* stmt: GEI4(stk,stk) */ case 222: /* stmt: EQU4(stk,stk) */ case 221: /* stmt: EQI4(stk,stk) */ case 220: /* stk: RSHU4(stk,stk) */ case 219: /* stk: MULU4(stk,stk) */ case 218: /* stk: MODU4(stk,stk) */ case 217: /* stk: LSHU4(stk,stk) */ case 216: /* stk: DIVU4(stk,stk) */ case 215: /* stk: RSHI4(stk,stk) */ case 214: /* stk: MULI4(stk,stk) */ case 213: /* stk: MODI4(stk,stk) */ case 212: /* stk: LSHI4(stk,stk) */ case 211: /* stk: DIVI4(stk,stk) */ case 210: /* stk: BXORU4(stk,stk) */ case 209: /* stk: BORU4(stk,stk) */ case 208: /* stk: BANDU4(stk,stk) */ case 207: /* stk: BXORI4(stk,stk) */ case 206: /* stk: BORI4(stk,stk) */ case 205: /* stk: BANDI4(stk,stk) */ case 201: /* stk: SUBU4(stk,cnst1) */ case 200: /* stk: SUBI4(stk,cnst1) */ case 199: /* stk: SUBU4(stk,stk) */ case 198: /* stk: SUBI4(stk,stk) */ case 197: /* stk: ADDU4(stk,cnst1) */ case 196: /* stk: ADDI4(stk,cnst1) */ case 195: /* stk: ADDU4(cnst1,stk) */ case 194: /* stk: ADDI4(cnst1,stk) */ case 193: /* stk: ADDU4(stk,stk) */ case 192: /* stk: ADDI4(stk,stk) */ case 178: /* addr4: LSHU4(stk,cnst4) */ case 177: /* addr4: LSHI4(stk,cnst4) */ case 176: /* addr4: LSHU4(stk,cnst3) */ case 175: /* addr4: LSHI4(stk,cnst3) */ case 174: /* addr4: LSHU4(stk,cnst2) */ case 173: /* addr4: LSHI4(stk,cnst2) */ case 172: /* addr: SUBP4(addr,cnstn) */ case 171: /* addr: SUBP4(addr,cnst4) */ case 170: /* addr: SUBP4(addr,cnst2) */ case 169: /* addr: SUBP4(addr,cnst1) */ case 168: /* addr: SUBP4(addr,zero) */ case 167: /* addr: SUBP4(stk,addr) */ case 166: /* addr: SUBP4(addr,stk) */ case 165: /* addr4: SUBP4(addr4,addr4) */ case 164: /* addr: ADDP4(addr,cnstn) */ case 163: /* addr: ADDP4(addr,cnst4) */ case 162: /* addr: ADDP4(addr,cnst2) */ case 161: /* addr: ADDP4(addr,cnst1) */ case 160: /* addr: ADDP4(stk,addr) */ case 159: /* addr: ADDP4(addr,stk) */ case 158: /* addr: ADDP4(addr,zero) */ case 157: /* addr: ADDU4(addr4,addr) */ case 156: /* addr: ADDP4(addr4,addr) */ case 155: /* addr: ADDU4(addr,addr4) */ case 154: /* addr: ADDP4(addr,addr4) */ case 153: /* addr4: ADDU4(addr4,addr4) */ case 152: /* addr4: ADDP4(addr4,addr4) */ case 151: /* addr4: ADDP4(addr4,cnst4) */ case 150: /* addr4: ADDP4(addr4,zero) */ case 149: /* addr4: MULI4(stk,addr4) */ case 148: /* addr4: MULI4(addr4,stk) */ case 147: /* addr4: MULU4(stk,addr4) */ case 146: /* addr4: MULU4(addr4,stk) */ case 123: /* stmt: ASGNP4(addr,addr) */ case 122: /* stmt: ASGNU4(stk,addr) */ case 121: /* stmt: ASGNI4(stk,addr) */ case 120: /* stmt: ASGNU2(stk,addr) */ case 119: /* stmt: ASGNI2(stk,addr) */ case 118: /* stmt: ASGNU1(stk,addr) */ case 117: /* stmt: ASGNI1(stk,addr) */ case 116: /* stmt: ASGNU2(stk,addr4) */ case 115: /* stmt: ASGNI2(stk,addr4) */ case 114: /* stmt: ASGNU1(stk,addr4) */ case 113: /* stmt: ASGNI1(stk,addr4) */ case 112: /* stmt: ASGNU2(stk,lAddr) */ case 111: /* stmt: ASGNI2(stk,lAddr) */ case 110: /* stmt: ASGNU1(stk,lAddr) */ case 109: /* stmt: ASGNI1(stk,lAddr) */ case 108: /* stmt: ASGNU2(stk,lAddr) */ case 107: /* stmt: ASGNI2(stk,lAddr) */ case 106: /* stmt: ASGNU1(stk,lAddr) */ case 105: /* stmt: ASGNI1(stk,lAddr) */ case 104: /* stmt: ASGNP4(addr,lAddr) */ case 103: /* stmt: ASGNU4(stk,lAddr) */ case 102: /* stmt: ASGNI4(stk,lAddr) */ case 63: /* stmt: ASGNP4(addr,swrite) */ case 62: /* stmt: ASGNU4(stk,swrite) */ case 61: /* stmt: ASGNI4(stk,swrite) */ case 60: /* stmt: ASGNU2(stk,swrite) */ case 59: /* stmt: ASGNI2(stk,swrite) */ case 58: /* stmt: ASGNU1(stk,swrite) */ case 57: /* stmt: ASGNI1(stk,swrite) */ kids[0] = LEFT_CHILD(p); kids[1] = RIGHT_CHILD(p); break; case 259: /* stmt: ASGNB(INDIRB(addr),addr) */ kids[0] = LEFT_CHILD(LEFT_CHILD(p)); kids[1] = RIGHT_CHILD(p); break; default: fatal("_kids", "Bad rule number %d\n", eruleno); } } /* * function for increased cost, when a function call not points to the current function * We do not use LBURG Max, because we want to be able to use it with a + after alla */ static int isCurrentFun(Node call){ D_ENTER("isCurrentFun") int op = specific(call->op); if(op == CALL+I || op == CALL+P || op == CALL+V || op == CALL+U){ //second is needed because call to pointer has no sym (because is just a pointer) if(curFun != NULL && call->kids[0]->syms[0] && strcmp(call->kids[0]->syms[0]->x.name, curFun->x.name) == 0){ D_LEAVE("isCurrentFun") return 0; } else { D_LEAVE("isCurrentFun") return LBURG_MAX; } } D_LEAVE("isCurrentFun") return LBURG_MAX; } /* * function for increased cost, when a function call points to the current function * We do not use LBURG Max, because we want to be able to use it with a + after alla */ static int isNotCurrentFun(Node call){ D_ENTER("isNotCurrentFun") int op = specific(call->op); if(op == CALL+I || op == CALL+P || op == CALL+V || op == CALL+U){ //second is needed because call to pointer has no sym (because is just a pointer) if(curFun != NULL && call->kids[0]->syms[0] && strcmp(call->kids[0]->syms[0]->x.name, curFun->x.name) == 0){ D_LEAVE("isNotCurrentFun") return LBURG_MAX; } else { D_LEAVE("isNotCurrentFun") return 0; } } D_LEAVE("isNotCurrentFun") return 0; } /* * function for increased cost, when a Function Symbol is not already defined * We do not use LBURG Max, because we want to be able to use it with a + after alla */ static int isDefinedFun(Node n){ D_ENTER("isDefinedFun") int op = specific(n->op); if(op == CALL+I || op == CALL+P || op == CALL+V){ //first is needed because call to pointer has no sym (because is just a pointer) if(n->kids[0]->syms[0] && (n->kids[0]->syms[0]->x.offset == 1 || n->kids[0]->syms[0]->x.name[0] != '_')){ D_LEAVE("isDefinedFun") return 0; } else { D_LEAVE("isDefinedFun") return LBURG_MAX; } } D_LEAVE("isDefinedFun") return LBURG_MAX; } /* * function for increased cost, when a Function Symbol is already defined * We do not use LBURG Max, because we want to be able to use it with a + after alla */ static int isNotDefinedFun(Node n){ D_ENTER("isNotDefinedFun") int op = specific(n->op); if(op == CALL+I || op == CALL+P || op == CALL+V){ //first is needed because call to pointer has no sym (because is just a pointer) if(n->kids[0]->syms[0] && (n->kids[0]->syms[0]->x.offset == 1 || n->kids[0]->syms[0]->x.name[0] != '_')){ D_LEAVE("isNotDefinedFun") return LBURG_MAX; } else { D_LEAVE("isNotDefinedFun") return 0; } } D_LEAVE("isNotDefinedFun") return 0; } /* * function for increased cost, when a Function Symbol is not already defined * We do not use LBURG Max, because we want to be able to use it with a + after alla */ static int isDefinedVar(Node n){ D_ENTER("isDefinedVar") int op = specific(n->op); if(op == ADDRG+P || op == ADDRG+B){ if(n->syms[0]->x.offset == 2){ D_LEAVE("isDefinedVar") return 0; } else { D_LEAVE("isDefinedVar") return LBURG_MAX; } } D_LEAVE("isDefinedVar") return LBURG_MAX; } /* * function for increased cost, when a Function Symbol is already defined * We do not use LBURG Max, because we want to be able to use it with a + after alla */ static int isNotDefinedVar(Node n){ D_ENTER("isNotDefinedVar") int op = specific(n->op); if(op == ADDRG+P || op == ADDRG+B){ if(n->syms[0]->x.offset == 2){ D_LEAVE("isNotDefinedVar") return LBURG_MAX; } else { D_LEAVE("isNotDefinedVar") return 0; } } D_LEAVE("isNotDefinedVar") return 0; } static int isAligned(Node n){ D_ENTER("isAligned") int op = specific(n->op); if (op == ADDRL + P) { //calculates the global adress in byte format int index = getLocal(n->syms[0]); //we do not need the offset if ((index & ((1 << BYTE_ADDR_BITS)-1) << (DATA_WIDTH - BYTE_ADDR_BITS)) == 0){ D_LEAVE("isAligned") return 0; } else { D_LEAVE("isAligned") return LBURG_MAX; } } else if (op == ASGN + I || op == ASGN + U || op == ASGN + P) { if(n->kids[1]->syms[0]){ int index = getLocal(n->kids[1]->syms[0]); if(index < (1 << (DATA_WIDTH-BYTE_ADDR_BITS))){ D_LEAVE("isAligned") return 0; } else { D_LEAVE("isAligned") return LBURG_MAX; } } } else if (op == INDIR + I || op == INDIR + U || op == INDIR + P) { if(n->kids[0]->syms[0]){ int index = getLocal(n->kids[0]->syms[0]); if(index < (1 << (DATA_WIDTH-BYTE_ADDR_BITS))){ D_LEAVE("isAligned") return 0; } else { D_LEAVE("isAligned") return LBURG_MAX; } } } D_LEAVE("isAligned") return LBURG_MAX; } static int isNotAligned(Node n){ D_ENTER("isNotAligned") int op = specific(n->op); if (op == ADDRL + P) { //calculates the global adress in byte format int index = getLocal(n->syms[0]); //we do not need the offset if ((index & ((1 << BYTE_ADDR_BITS)-1) << (DATA_WIDTH - BYTE_ADDR_BITS)) == 0){ D_LEAVE("isNotAligned") return LBURG_MAX; } else { D_LEAVE("isNotAligned") return 0; } } else if (op == ASGN + I || op == ASGN + U || op == ASGN + P) { if(n->kids[1]->syms[0]){ int index = getLocal(n->kids[1]->syms[0]); if(index < (1 << (DATA_WIDTH-BYTE_ADDR_BITS))){ D_LEAVE("isNotAligned") return LBURG_MAX; } else { D_LEAVE("isNotAligned") return 0; } } } else if (op == INDIR + I || op == INDIR + U || op == INDIR + P) { if(n->kids[0]->syms[0]){ int index = getLocal(n->kids[0]->syms[0]); if(index < (1 << (DATA_WIDTH-BYTE_ADDR_BITS))){ D_LEAVE("isNotAligned") return LBURG_MAX; } else { D_LEAVE("isNotAligned") return 0; } } } D_LEAVE("isNotAligned") return 0; } static void preamble(Symbol f, Symbol caller[], Symbol callee[], int ncalls); static void postamble(Symbol f, Symbol caller[], Symbol callee[], int ncalls); static int makeTemp(Symbol p) { D_ENTER("makeTemp") if (!isscalar(p->type) || p->type->size == 8) { p->sclass = AUTO; D_LEAVE("makeTemp") return 0; } else if (p->sclass == AUTO) { if (p->addressed) { D_LEAVE("makeTemp") return 0; } else { makeTemporary(p); D_LEAVE("makeTemp") return 1; } } else if (p->sclass == REGISTER) { makeTemporary(p); D_LEAVE("makeTemp") return 1; } else { D_LEAVE("makeTemp") return 0; } D_LEAVE("makeTemp") } static void local(Symbol p) { D_ENTER("local") //Do align local Blocks so we do not have to do tons of unaligned block copies (which are compilcated and do slow down everything if(p->type->size > DATA_BYTES){ p->type->size = roundup(p->type->size, DATA_BYTES); } if (isfloat(p->type)) { error("No floating point types supported by MicroCore TM\n"); assert(0); } if (!makeTemp(p)) { mkauto(p); } D_LEAVE("local") } static void optimiseLocals(){ D_ENTER("optimiseLocals") //1. Find all active vars (have store & loads) //2. Sort by Size //3. Use Same Slot, if Same Size and do not Overlap //4. Identify Standalones (No Overlap @ All) which we can optimise (have no pointer too it, addressed == 0) //5. Mark Stanalones to Use >r r> //6. Adapt alignement on semi filled slots (use the whole slot, so we have effective store loads) //7. Update nodes to use ASSIG4 and INDIR4 for the adapted slots Symbol D_LEAVE("optimiseLocals") } static void function(Symbol f, Symbol caller[], Symbol callee[], int ncalls) { D_ENTER("function") int i, size, varargs; Node params; if(f->x.offset == 1){ D_LEAVE("function") return; } if(USR_FUN && f->name[0] == '_' && f->name[strlen(f->name)-1] == '_'){ f->x.name = malloc((strlen(f->name)-1)*sizeof(char)); strncpy(f->x.name,f->name+1,strlen(f->name)-2); f->x.offset = 1; D_LEAVE("function") return; } f->x.name = stringf("_%s", f->name); //calcs the functions name f->x.offset = 1; //Mark as defined function (misuse offset == 1 for this) //Sill ok or is used for stack Stuff??? curFun = f; offset = local_variable_count = 0; varargs = variadic(f->type); params = stackParameters(caller, callee); gencode(caller, callee); optimise(); //Optimises Stack, generate Local Spillings optimiseLocals(); //Optimise Locals framesize = roundup(offset, DATA_BYTES); preamble(f, caller, callee, ncalls); stackemit(params); emitcode(); postamble(f, caller, callee, ncalls); D_LEAVE("function") } static Node recalcNode(Node temp, Node calc) { D_ENTER("recalcNode") int op = specific(calc->op); if (generic(calc->op) == CNST || op == ADDRG + P) { D_LEAVE("recalcNode") return calc; } else if (op == LSH + I) { if (specific(calc->kids[1]->op) == CNST + I && calc->kids[1]->syms[0]->u.c.v.i == 2) { int lhs_op = generic(calc->kids[0]->op); if (lhs_op == INDIR) { int addr_op = specific(calc->kids[0]->kids[0]->op); if (addr_op == ADDRL + P || addr_op == ADDRG + P || addr_op == VREG + P) { D_LEAVE("recalcNode") return calc; } } } } D_LEAVE("recalcNode") return temp; } static void preamble(Symbol f, Symbol caller[], Symbol callee[], int ncalls) { int fSize; D_ENTER("preamble") Type retType = freturn(f->type); int params = 0; print(": %s\n", f->x.name); //define the uForth word while(caller[params]) params++; print("( %d parameters ) \n", params); if (variadic(f->type)) { error("Varadic Arguments not yet supported\n"); assert(0); } if (framesize) { if((framesize & ((1 << BYTE_ADDR_BITS)-1)) != 0){ error("Wrong Framesize Alignement\n"); assert(0); } fSize = framesize >> BYTE_ADDR_BITS; if (fSize == 1) { print("0\n>r\n0\n>r ( allocate 1 local variable )\n"); //try later if we can use TOR and do >R r> then } else { print("0\n>r\nrsp@\n%d\n-\nrsp! ( allocate %d local variables )\n", fSize, fSize); //try later if we can use TOR and do >R r> then } } D_LEAVE("preamble") } static void postamble(Symbol f, Symbol caller[], Symbol callee[], int ncalls) { int i; int fSize; D_ENTER("postamble") if (variadic(f->type)) { error("Varadic Arguments not yet supported\n"); assert(0); } else { if (framesize) { if((framesize & ((1 << BYTE_ADDR_BITS)-1)) != 0){ error("Wrong Framesize Alignement\n"); assert(0); } fSize = framesize >> BYTE_ADDR_BITS; if (fSize < 4) { for(i = 0; i < fSize+1;i++) print("rdrop\n"); //drop each local print("( deallocate %d local Variables )\n",fSize); } else { print("\nrsp@\n%d\n+\nrsp!\nrdrop ( deallocate %d local variables )\n",fSize, fSize); } } } if (strcmp(f->name, "isr")) { // if not a ISR exit normal print(";\n\n"); } else { // else exit with IRET and assert that there are no parameters if(callee[0] || caller[0]){ error("Illegal isr Function\n"); assert(0); } print("\tIRET\n;\n\n"); //Do interrupt return and word ending } D_LEAVE("postamble") } static int fixedParameters(Type ty) { int i; D_ENTER("fixedParameters") for (i = 2; ty->u.f.proto[i]; i++); D_LEAVE("fixedParameters") return i - 1; } static int getLocal(Symbol s) { int offset = s->x.offset + framesize; //we address locals by offset to rsp (but this is subtracted not added) (we still track negative offsets for global adress calculations) return ((offset >> BYTE_ADDR_BITS)+1) | ((offset & ((1 << BYTE_ADDR_BITS)-1)) << (DATA_WIDTH-BYTE_ADDR_BITS)); } static void printStoreLocal(Symbol local, int size) { int i; D_ENTER("printStoreLocal") unsigned int index = getLocal(local); if(size == 4) { print("%d\nl!\n", index); } else if(index < (1 << (DATA_WIDTH-BYTE_ADDR_BITS))){ print("%d\nl@\n", index); int mask = -1; for(i = 0; i < size; i++){ mask = (mask << 8); } print("%d\nand\nor\n", mask); print("%d\nl!\n", index); } else { print("%d\shift\n", (index >> (DATA_WIDTH-BYTE_ADDR_BITS))*8); print("%d\nl@\n", index & ~(3 << (DATA_WIDTH-BYTE_ADDR_BITS))); int mask = -1; for(i = 0; i < size; i++){ mask = (mask << 8); } for(i = 0; i < (index >> (DATA_WIDTH-BYTE_ADDR_BITS)); i++){ mask = (mask << 8) | 0xFF; } print("%d\nand\nor\n", mask); print("%d\nl!\n", index & ~(3 << (DATA_WIDTH-BYTE_ADDR_BITS))); } D_LEAVE("printStoreLocal") } static void printReadLocal(Symbol local, int size) { int i; D_ENTER("printReadLocal") unsigned int index = getLocal(local); if(size == 4) { print("%d\nl@\n", index); } else if(index < (1 << (DATA_WIDTH-BYTE_ADDR_BITS))){ print("%d\nl@\n", index); int mask = 0; for(i = 0; i < size; i++){ mask = (mask << 8) | 0xFF; } print("%d\nand\n", mask); } else { print("%d\nl@\n", index & ~(3 << (DATA_WIDTH-BYTE_ADDR_BITS))); print("%d\shift\n", -((index >> (DATA_WIDTH-BYTE_ADDR_BITS))*8)); int mask = 0; for(i = 0; i < size; i++){ mask = (mask << 8) | 0xFF; } print("%d\nand\n", mask); } D_LEAVE("printReadLocal") } static void printbits(long i) { D_ENTER("printbits") if(i >= (1L << DATA_WIDTH)){ error("To Large Bitconstant %d\n",i); assert(0); } if(i >= (1L << (DATA_WIDTH-1))){ print("%d\n",(-1L << DATA_WIDTH) | i); } else { print("%d\n", i); } D_LEAVE("printbits") } static void structcopy(int iTermSize) { //assign Struct (need block copy) D_ENTER("structcopy") iTermSize = (roundup(iTermSize, DATA_BYTES) >> BYTE_ADDR_BITS); if (iTermSize <= COPY_BLOCK_SIZE) { //is their only one block to copy? print("%d\n+\n>r\n", iTermSize-1); //increment destination address by term size and push it on return stack if(iTermSize == 1){ print("@\n"); } else if(iTermSize == 2){ print("ld\n1+\n@\n"); } else { print("%d\nFOR\nld\n1+\nNEXT\n@\n", iTermSize-2); } print("r>\n"); if(iTermSize == 1){ print("!\n"); } else if(iTermSize == 2){ print("st\n1-\n!\n"); } else { print("%d\nFOR\nst\n1-\nNEXT\n!\n", iTermSize-2); } } else { //is their more than one block to copy? print(" MULTI BLOCK COPY NOT YET DONE "); //increment destination address by block size and push it on return stack } D_LEAVE("structcopy") } static void emit2(Node p) { D_ENTER("emit2") int op = specific(p->op); int size = opsize(p->op); if (op == ADDRL + P) { //calculates the global adress in byte format int index = getLocal(p->syms[0])-1; //we do not need the offset if (index){ print("rsp@\n%d\n+\n", index); } else { print("rsp@\n"); } } else if (op == INDIR + I || op == INDIR + U || op == INDIR + P) { printReadLocal(p->kids[0]->syms[0], size); } else if (op == ASGN + I || op == ASGN + U || op == ASGN + P) { printStoreLocal(p->kids[1]->syms[0], size); } else if (op == ASGN+B){ structcopy(p->syms[0]->u.c.v.i); } else if(op == CALL+I || op == CALL+U || op == CALL+P || op == CALL+V){ if (variadic(p->syms[0]->type)) { print("%d\n", arguments - fixedParameters(p->syms[0]->type)); } arguments = 0; } else if (op == CNST + P || op == CNST + I || op == CNST + U) { //Constant usesd as Adress unsigned int bytes = p->syms[0]->u.c.v.i; long addr = bytes >> BYTE_ADDR_BITS; long offset = bytes & ((1 << BYTE_ADDR_BITS)-1); if (offset) { addr = addr | (offset << (DATA_WIDTH - BYTE_ADDR_BITS)); } printbits(addr); } else if (op == ARG + P || op == ARG + I || op == ARG + F || op == ARG + U) { arguments++; } else { print("Error unexpected op\n"); } D_LEAVE("emit2") } static void printPending(){ D_ENTER("printPending") if(hasPendingBits){ print(" "); printbits(pendingBits); print(" ,\n"); pendingBits = 0; hasPendingBits = 0; } D_LEAVE("printPending") } static void defconst(int suffix, int size, Value v) { D_ENTER("defconst") long valueBits = 0; int shift = ((iElems*size) % DATA_BYTES)*8; if(shift == 0){ printPending(); } if (suffix == P){ //differ between int and pointer, other field holds the value valueBits = v.p; }else if (suffix == I){ valueBits = v.i; }else if (suffix == U){ valueBits = v.u; }else { error("No floating point types supported by MicroCore TM\n"); assert(0); } hasPendingBits = 1; pendingBits = pendingBits | valueBits << shift; iElems++; D_LEAVE("defconst") } static void defaddress(Symbol p) { D_ENTER("defaddress") print("%s\n,", p->x.name); //print the address and a , to fill the field. use ADDR to be able to also Fetch forward references iElems++; //one element filled (for arrays, structs) IS THIS NEEDED??? D_LEAVE("defaddress") } static void defstring(int n, char *str) { D_ENTER("defstring") int i = 0; //needed as counter for multi char Strings int shift = 0; while(i < n){ //print each char shift = (i % DATA_BYTES)*8; if(shift == 0){ printPending(); } hasPendingBits = 1; pendingBits = pendingBits | (str[i++] << shift); } iElems++; //one element filled (for arrays, structs) IS THIS NEEDED??? D_LEAVE("defstring") } static void export(Symbol f) { D_ENTER("export") if(USR_FUN && f->x.offset != 1 && f->name[0] == '_' && f->name[strlen(f->name)-1] == '_'){ f->x.name = malloc((strlen(f->name)-1)*sizeof(char)); strncpy(f->x.name,f->name+1,strlen(f->name)-2); f->x.offset = 1; } D_LEAVE("export") } static void import(Symbol f) { D_ENTER("import") if(USR_FUN && f->x.offset != 1 && f->name[0] == '_' && f->name[strlen(f->name)-1] == '_'){ f->x.name = malloc((strlen(f->name)-1)*sizeof(char)); strncpy(f->x.name,f->name+1,strlen(f->name)-2); f->x.offset = 1; } D_LEAVE("import") } static void defsymbol(Symbol p) { D_ENTER("defsymbol") if (p->scope >= LOCAL && p->sclass == STATIC) { D_POINT("LOCAL_STATIC") p->x.name = stringf("a_%d", genlabel(1)); //generate a name } else if (p->scope == LABELS) { D_POINT("LABEL") p->x.name = stringf("lbl_%s", p->name); } else if (p->generated){ D_POINT("GENERATED") p->x.name = stringf("x_%s", p->name); } else if (p->temporary){ D_POINT("TEMPORARY") p->x.name = stringf("tmp_%s", p->name); } else if (p->scope == GLOBAL){ D_POINT("GLOBAL") if(USR_FUN && p->name[0] == '_' && p->name[strlen(p->name)-1] == '_'){ p->x.name = malloc((strlen(p->name)-1)*sizeof(char)); strncpy(p->x.name,p->name+1,strlen(p->name)-2); p->x.offset = 1; } else { p->x.name = stringf("_%s", p->name); } } else { D_POINT("ELSE") if(!(p->scope != CONSTANTS || isint(p->type) || isptr(p->type))){ error("Unsupported Symbol definition\n"); assert(0); } p->x.name = p->name; } D_LEAVE("defsymbol") } static void address(Symbol q, Symbol p, long n) { // The problem of accessing global, static or extern variables has to be solved by uFortH int bOffset; int wOffset; int offset; D_ENTER("address") int neg = 0; if (p->scope == GLOBAL || p->sclass == STATIC || p->sclass == EXTERN){ q->x.offset = p->x.offset; //take over the global offset, because we use it as marker flag in globals if(n < 0){ neg = 1; n = n*-1; } if(n % 4 == 0){ if(neg){ q->x.name = stringf("%s\n%D\n-", p->x.name, n >> BYTE_ADDR_BITS); } else { q->x.name = stringf("%s\n%D\n+", p->x.name, n >> BYTE_ADDR_BITS); } } else if(n % 2 == 0){ if(neg){ q->x.name = stringf("%s\n__ROL__\n%D\n-\n__ROR__", p->x.name, n >> 1); } else { q->x.name = stringf("%s\n__ROL__\n%D\n+\n__ROR__", p->x.name, n >> 1); } } else { if(neg){ q->x.name = stringf("%s\n__ROL__\n__ROL__\n%D\n-\n__ROR__\n__ROR__", p->x.name, n); } else { q->x.name = stringf("%s\n__ROL__\n__ROL__\n%D\n+\n__ROR__\n__ROR__", p->x.name, n); } } } else { //In case of local variables we need to calculate the offset of the variable on the return stack assert(n <= INT_MAX); //check that we are still a int q->x.offset = p->x.offset + n; q->x.name = stringd(q->x.offset); //update the name } D_LEAVE("address") } /* * globalarray() handles global arrays declaration and initialisationaccording to their type */ static void globalarray(Type t, Symbol p) { D_ENTER("globalarray") switch(t->type->op) { //Some array types need special handling case CHAR: case INT: case SHORT: case LONG: case CONST: case POINTER: case ENUM: case STRUCT: //Standard case, direct number or pointer printPending(); print("\nCreate %s\n", p->x.name); //Print uForth variable creation code p->x.offset = 2; //Mark as defined Var (Missuse offset == 2 for this) if(initedVars == 0) print("%d\nalloc\n", roundup(t->size, DATA_BYTES) >> BYTE_ADDR_BITS); //if it is not inited instantly, reserve enougth space break; case ARRAY: //Nested array special handling globalarray(t->type, p); //recursivel cyll this function for nested type break; case FLOAT: case DOUBLE: //Unsupported floationgpoint array types error("No floating point types supported by MicroCore TM\n"); assert(0); break; case UNSIGNED: //CHANGE THIS //Unsupported unsigned arry types error("No unsigned types supported by MicroCore TM\n"); assert(0); break; default: //Everything else is not supported error("No specified type: %d\n ", t->type->op); assert(0); } D_LEAVE("globalarray") } /* * global() handles global variables, which basically means it formats the output * of those global variables */ static void global(Symbol p) { iElems = 0; D_ENTER("global") switch(p->type->op) { //different cases for different types case CHAR: case INT: case SHORT: case LONG: case CONST: case POINTER: case ENUM: case STRUCT: //Standard case, direct number or pointer printPending(); print("\nCreate %s\n", p->x.name); //Print uForth variable creation code p->x.offset = 2; //Mark as defined Var (Missuse offset == 2 for this) //Can we still do this or is this used for stack offsets???? if(initedVars == 0) print("%d\nalloc\n", roundup(p->type->size, DATA_BYTES) >> 2); //if it is not inited instantly, reserve enougth space break; case ARRAY: //Array special handling globalarray(p->type, p); //forward to array creation function break; case FLOAT: case DOUBLE: //Unsupported floationgpoint array types error("No floating point types are supported by MicroCore TM\n"); assert(0); break; case UNSIGNED: //Unsupported unsigned arry types //Make Supported error("No unsigned types are supported by MicroCore TM\n"); assert(0); break; default: //Everything else is not supported error("No specified type: %d\n ", p->type->op); assert(0); } D_LEAVE("global") } static void segment(int n) { //begin Initialisation Block if we need it and are not already in D_ENTER("segment") if ((n == DATA || n == LIT) && initedVars == 0){ print("\nINITIALISED\n"); //print uForth directive initedVars = 1; //mark that we are in init Block //end Initialisation Block if we don't it and are in it } else if ((n != DATA && n != LIT) && initedVars == 1){ printPending(); print("\nUNINITIALISED\n\n"); //print uForth directive initedVars = 0; //mark that we are not in init Block } D_LEAVE("segment") } static void space(int n) { //Is this ok or do we ned to do nops D_ENTER("space") print("\n"); D_LEAVE("space") } static void stabinit(char *, int, char *[]); static void stabline(Coordinate *); static void stabsym(Symbol); static char *currentfile; /* stabinit - initialize stab output */ //not passed currenty static void stabinit(char *file, int argc, char *argv[]) { if (file) { print(" ( file 2 , \" %s \" ) \n", file); currentfile = file; } } /* stabline - emit stab entry for source coordinate *cp */ //not passed currenty static void stabline(Coordinate *cp) { if (cp->file && cp->file != currentfile) { print(" ( file 2 , \" %s \" ) \n", cp->file); currentfile = cp->file; } print(" ( loc 2 , %d ) \n" , cp->y); } /* stabsym - output a stab entry for symbol p */ //not passed currenty static void stabsym(Symbol p) { if (p == cfunc && IR->stabline) (*IR->stabline)(&p->src); } static void progbeg(int argc, char *argv[]) { D_ENTER("progbeg") backendflags(argc, argv); print("( MicroCore TM uForth )\n"); print("decimal\n"); //switch to decimal, so we can share uCore compiler code and uForth compiler code and do not have to made tons of dec -> hex D_LEAVE("progbeg") } static void blockbeg(Env* env) { } static void blockend(Env* env) { } static void progend(void){ D_ENTER("progend") //end init Block if we are still in it if (initedVars == 1){ printPending(); print("\nUNINITIALISED\n"); //print uForth directive } D_LEAVE("progend") } //Express with DATA_WIDTH_BYTES Interface mcoreIR = { { 1, 1, 0 }, /* char_metrics */ { 2, 2, 0 }, /* short_metrics */ { 4, 4, 0 }, /* int_metrics */ { 4, 4, 0 }, /* long_metrics */ { 4, 4, 0 }, /* long_long_metrics */ { 4, 4, 1 }, /* float_metrics */ { 4, 4, 1 }, /* double_metrics */ { 4, 4, 1 }, /* long_double_metrics */ { 4, 4, 0 }, /* word_metrics */ { 0, 4, 0 }, /* struct_metrics */ 1, /* little_endian */ 0, /* mulops_calls */ 0, /* wants_callb */ 0, /* wants_argb */ 1, /* left_to_right */ 0, /* wants_dag */ 0, /* unsigned_char */ address, blockbeg, blockend, defaddress, defconst, defstring, defsymbol, stackemit, export, function, stackgen, global, import, local, progbeg, progend, segment, space, 0, 0, 0, 0, 0, 0, 0, swtch, { 1, /* max_unaligned_load */ 3, /* depth */ recalcNode, makeTemp, NULL, _label, _rule, _nts, _kids, _string, _templates, _isinstruction, _ntname, emit2, { 0, // sub 0, // lsh 0, // rsh 0, // mod 0, // div 0, // lt 0, // le 0, // gt 0 // ge } } };