📄 minimips.c
字号:
/* 62 */ 1, /* \tor $%c,$%0,%1\n *//* 63 */ 1, /* \txor $%c,$%0,%1\n *//* 64 */ 1, /* \tand $%c,$%0,%1\n *//* 65 */ 1, /* \tor $%c,$%0,%1\n *//* 66 */ 1, /* \txor $%c,$%0,%1\n *//* 67 */ 1, /* \tsubu $%c,$%0,%1\n *//* 68 */ 1, /* \tsubu $%c,$%0,%1\n *//* 69 */ 1, /* \tsubu $%c,$%0,%1\n *//* 70 */ 1, /* # sll\n *//* 71 */ 1, /* # sll\n *//* 72 */ 1, /* # sra\n *//* 73 */ 1, /* # srl\n *//* 74 */ 1, /* \tjal __sll\n *//* 75 */ 1, /* \tjal __sll\n *//* 76 */ 1, /* \tjal __sra\n *//* 77 */ 1, /* \tjal __srl\n *//* 78 */ 1, /* \tli $30, -1; xor $%c,$%0,$30\n *//* 79 */ 1, /* \tli $30, -1; xor $%c,$%0,$30\n *//* 80 */ 1, /* \tnegu $%c,$%0\n *//* 81 */ 1, /* \tmove $%c,$%0\n *//* 82 */ 1, /* \tmove $%c,$%0\n *//* 83 */ 1, /* \tmove $%c,$%0\n *//* 84 */ 1, /* \tmove $%c,$%0\n *//* 85 */ 1, /* \tmove $%c,$%0\n *//* 86 */ 1, /* \tmove $%c,$%0\n *//* 87 */ 1, /* \tjal float32_add\n *//* 88 */ 1, /* \tjal float32_sub\n *//* 89 */ 1, /* \tjal float32_mul\n *//* 90 */ 1, /* \tjal float32_div\n *//* 91 */ 1, /* \tjal float32_neg\n *//* 92 */ 1, /* \tsb $%0,CVII4_int; lb $%c,CVII4_int\n *//* 93 */ 1, /* \tand $%c,$%0,255\n *//* 94 */ 1, /* \tand $%c,$%0,255\n *//* 95 */ 0, /* \t??? *//* 96 */ 1, /* \tjal int32_to_float32\n *//* 97 */ 1, /* \tjal float32_to_int32_round_to_zero\n *//* 98 */ 1, /* %a:\n *//* 99 */ 1, /* \tb %0\n *//* 100 */ 1, /* \tj $%0\n *//* 101 */ 1, /* \tbeq $%0,$%1,%a\n *//* 102 */ 1, /* \tbeq $%0,$%1,%a\n *//* 103 */ 1, /* \tbne $%0,$%1,%a\n *//* 104 */ 1, /* \tbne $%0,$%1,%a\n *//* 105 */ 1, /* \tslt $30,$%0,$%1\n\tbne $30,$0,%a\n *//* 106 */ 1, /* \tsltu $30,$%0,$%1\n\tbne $30,$0,%a\n *//* 107 */ 1, /* \tslt $30,$%1,$%0\n\tbne $30,$0,%a\n *//* 108 */ 1, /* \tsltu $30,$%1,$%0\n\tbne $30,$0,%a\n *//* 109 */ 1, /* \tslt $30,$%0,$%1\n\tbeq $30,$0,%a\n *//* 110 */ 1, /* \tsltu $30,$%0,$%1\n\tbeq $30,$0,%a\n *//* 111 */ 1, /* \tslt $30,$%1,$%0\n\tbeq $30,$0,%a\n *//* 112 */ 1, /* \tsltu $30,$%1,$%0\n\tbeq $30,$0,%a\n *//* 113 */ 1, /* \tbeq $%0,$%1,%a\n *//* 114 */ 1, /* \tbne $%0,$%1,%a\n *//* 115 */ 1, /* \tslt $30,$%1,$%0\n\tbeq $30,$0,%a\n *//* 116 */ 1, /* \tslt $30,$%0,$%1\n\tbne $30,$0,%a\n *//* 117 */ 1, /* \tslt $30,$%0,$%1\n\tbeq $30,$0,%a\n *//* 118 */ 1, /* \tslt $30,$%1,$%0\n\tbne $30,$0,%a\n *//* 119 */ 1, /* \tjal %0\n *//* 120 */ 1, /* \tjal %0\n *//* 121 */ 1, /* \tjal %0\n *//* 122 */ 1, /* \tjal %0\n *//* 123 */ 1, /* \tjal %0\n *//* 124 */ 0, /* $%0 *//* 125 */ 0, /* %a *//* 126 */ 0, /* %a *//* 127 */ 0, /* %a *//* 128 */ 1, /* \t.word (%c<<11)|(%0<<21)|(%1<<16)|0x30\n *//* 129 */ 1, /* \t.word (%c<<11)|(%0<<21)|(%1<<16)|0x31\n *//* 130 */ 1, /* \t.word (%c<<11)|(%0<<21)|(%1<<16)|0x32\n *//* 131 */ 1, /* \t.word (%c<<11)|(%0<<21)|(%1<<16)|0x33\n *//* 132 */ 1, /* \t.word (%c<<11)|(%2<<21)|(%2<<16)|0x35\n \t.word (%c<<11)|(%0<<21)|(%1<<16)|0x34\n *//* 133 */ 1, /* # ret\n *//* 134 */ 1, /* # ret\n *//* 135 */ 1, /* # ret\n *//* 136 */ 1, /* # ret\n *//* 137 */ 1, /* # ret\n *//* 138 */ 1, /* # arg\n *//* 139 */ 1, /* # arg\n *//* 140 */ 1, /* # arg\n *//* 141 */ 1, /* # arg\n *//* 142 */ 1, /* # argb %0\n *//* 143 */ 1, /* # asgnb %0 %1\n */};static char *_string[] = {/* 0 */ 0,/* 1 */ "reg: INDIRI1(VREGP)",/* 2 */ "reg: INDIRU1(VREGP)",/* 3 */ "reg: INDIRF4(VREGP)",/* 4 */ "reg: INDIRI4(VREGP)",/* 5 */ "reg: INDIRP4(VREGP)",/* 6 */ "reg: INDIRU4(VREGP)",/* 7 */ "stmt: ASGNI1(VREGP,reg)",/* 8 */ "stmt: ASGNU1(VREGP,reg)",/* 9 */ "stmt: ASGNF4(VREGP,reg)",/* 10 */ "stmt: ASGNI4(VREGP,reg)",/* 11 */ "stmt: ASGNP4(VREGP,reg)",/* 12 */ "stmt: ASGNU4(VREGP,reg)",/* 13 */ "con: CNSTI1",/* 14 */ "con: CNSTU1",/* 15 */ "con: CNSTI4",/* 16 */ "con: CNSTU4",/* 17 */ "con: CNSTP4",/* 18 */ "stmt: reg",/* 19 */ "acon: con",/* 20 */ "acon: ADDRGP4",/* 21 */ "addr: ADDI4(reg,acon)",/* 22 */ "addr: ADDU4(reg,acon)",/* 23 */ "addr: ADDP4(reg,acon)",/* 24 */ "addr: acon",/* 25 */ "addr: reg",/* 26 */ "addr: ADDRFP4",/* 27 */ "addr: ADDRLP4",/* 28 */ "reg: addr",/* 29 */ "reg: CNSTI1",/* 30 */ "reg: CNSTI4",/* 31 */ "reg: CNSTU1",/* 32 */ "reg: CNSTU4",/* 33 */ "reg: CNSTP4",/* 34 */ "reg: CNSTF4",/* 35 */ "stmt: ASGNI1(addr,reg)",/* 36 */ "stmt: ASGNU1(addr,reg)",/* 37 */ "stmt: ASGNI4(addr,reg)",/* 38 */ "stmt: ASGNU4(addr,reg)",/* 39 */ "stmt: ASGNP4(addr,reg)",/* 40 */ "reg: INDIRI1(addr)",/* 41 */ "reg: INDIRU1(addr)",/* 42 */ "reg: INDIRI4(addr)",/* 43 */ "reg: INDIRU4(addr)",/* 44 */ "reg: INDIRP4(addr)",/* 45 */ "reg: CVII4(INDIRI1(addr))",/* 46 */ "reg: CVUU4(INDIRU1(addr))",/* 47 */ "reg: CVUI4(INDIRU1(addr))",/* 48 */ "reg: INDIRF4(addr)",/* 49 */ "stmt: ASGNF4(addr,reg)",/* 50 */ "reg: DIVI4(reg,reg)",/* 51 */ "reg: DIVU4(reg,reg)",/* 52 */ "reg: MODI4(reg,reg)",/* 53 */ "reg: MODU4(reg,reg)",/* 54 */ "reg: MULI4(reg,reg)",/* 55 */ "reg: MULU4(reg,reg)",/* 56 */ "rc: con",/* 57 */ "rc: reg",/* 58 */ "reg: ADDI4(reg,rc)",/* 59 */ "reg: ADDP4(reg,rc)",/* 60 */ "reg: ADDU4(reg,rc)",/* 61 */ "reg: BANDI4(reg,rc)",/* 62 */ "reg: BORI4(reg,rc)",/* 63 */ "reg: BXORI4(reg,rc)",/* 64 */ "reg: BANDU4(reg,rc)",/* 65 */ "reg: BORU4(reg,rc)",/* 66 */ "reg: BXORU4(reg,rc)",/* 67 */ "reg: SUBI4(reg,rc)",/* 68 */ "reg: SUBP4(reg,rc)",/* 69 */ "reg: SUBU4(reg,rc)",/* 70 */ "reg: LSHI4(reg,CNSTI4)",/* 71 */ "reg: LSHU4(reg,CNSTI4)",/* 72 */ "reg: RSHI4(reg,CNSTI4)",/* 73 */ "reg: RSHU4(reg,CNSTI4)",/* 74 */ "reg: LSHI4(reg,reg)",/* 75 */ "reg: LSHU4(reg,reg)",/* 76 */ "reg: RSHI4(reg,reg)",/* 77 */ "reg: RSHU4(reg,reg)",/* 78 */ "reg: BCOMI4(reg)",/* 79 */ "reg: BCOMU4(reg)",/* 80 */ "reg: NEGI4(reg)",/* 81 */ "reg: LOADI1(reg)",/* 82 */ "reg: LOADU1(reg)",/* 83 */ "reg: LOADI4(reg)",/* 84 */ "reg: LOADP4(reg)",/* 85 */ "reg: LOADU4(reg)",/* 86 */ "reg: LOADF4(reg)",/* 87 */ "reg: ADDF4(reg,reg)",/* 88 */ "reg: SUBF4(reg,reg)",/* 89 */ "reg: MULF4(reg,reg)",/* 90 */ "reg: DIVF4(reg,reg)",/* 91 */ "reg: NEGF4(reg)",/* 92 */ "reg: CVII4(reg)",/* 93 */ "reg: CVUI4(reg)",/* 94 */ "reg: CVUU4(reg)",/* 95 */ "reg: CVFF4(reg)",/* 96 */ "reg: CVIF4(reg)",/* 97 */ "reg: CVFI4(reg)",/* 98 */ "stmt: LABELV",/* 99 */ "stmt: JUMPV(acon)",/* 100 */ "stmt: JUMPV(reg)",/* 101 */ "stmt: EQI4(reg,reg)",/* 102 */ "stmt: EQU4(reg,reg)",/* 103 */ "stmt: NEI4(reg,reg)",/* 104 */ "stmt: NEU4(reg,reg)",/* 105 */ "stmt: LTI4(reg,reg)",/* 106 */ "stmt: LTU4(reg,reg)",/* 107 */ "stmt: GTI4(reg,reg)",/* 108 */ "stmt: GTU4(reg,reg)",/* 109 */ "stmt: GEI4(reg,reg)",/* 110 */ "stmt: GEU4(reg,reg)",/* 111 */ "stmt: LEI4(reg,reg)",/* 112 */ "stmt: LEU4(reg,reg)",/* 113 */ "stmt: EQF4(reg,reg)",/* 114 */ "stmt: NEF4(reg,reg)",/* 115 */ "stmt: LEF4(reg,reg)",/* 116 */ "stmt: LTF4(reg,reg)",/* 117 */ "stmt: GEF4(reg,reg)",/* 118 */ "stmt: GTF4(reg,reg)",/* 119 */ "reg: CALLF4(ar)",/* 120 */ "reg: CALLI4(ar)",/* 121 */ "reg: CALLP4(ar)",/* 122 */ "reg: CALLU4(ar)",/* 123 */ "stmt: CALLV(ar)",/* 124 */ "ar: reg",/* 125 */ "ar: CNSTP4",/* 126 */ "ar: ADDRGP4",/* 127 */ "magic_addr: CNSTP4",/* 128 */ "reg: ADDI4(reg,ADDI4(reg,INDIRI4(magic_addr)))",/* 129 */ "reg: SUBI4(reg,ADDI4(reg,INDIRI4(magic_addr)))",/* 130 */ "reg: ADDI4(reg,SUBI4(reg,INDIRI4(magic_addr)))",/* 131 */ "reg: SUBI4(reg,SUBI4(reg,INDIRI4(magic_addr)))",/* 132 */ "reg: SUBI4(reg,SUBI4(reg,ADDI4(reg,INDIRI4(magic_addr))))",/* 133 */ "stmt: RETF4(reg)",/* 134 */ "stmt: RETI4(reg)",/* 135 */ "stmt: RETU4(reg)",/* 136 */ "stmt: RETP4(reg)",/* 137 */ "stmt: RETV(reg)",/* 138 */ "stmt: ARGF4(reg)",/* 139 */ "stmt: ARGI4(reg)",/* 140 */ "stmt: ARGP4(reg)",/* 141 */ "stmt: ARGU4(reg)",/* 142 */ "stmt: ARGB(INDIRB(reg))",/* 143 */ "stmt: ASGNB(reg,INDIRB(reg))",};static short _decode_stmt[] = { 0, 7, 8, 9, 10, 11, 12, 18, 35, 36, 37, 38, 39, 49, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 123, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,};static short _decode_reg[] = { 0, 1, 2, 3, 4, 5, 6, 28, 29, 30, 31, 32, 33, 34, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 119, 120, 121, 122, 128, 129, 130, 131, 132,};static short _decode_con[] = { 0, 13, 14, 15, 16, 17,};static short _decode_acon[] = { 0, 19, 20,};static short _decode_addr[] = { 0, 21, 22, 23, 24, 25, 26, 27,};static short _decode_rc[] = { 0, 56, 57,};static short _decode_ar[] = { 0, 124, 125, 126,};static short _decode_magic_addr[] = { 0, 127,};static int _rule(void *state, int goalnt) { if (goalnt < 1 || goalnt > 8) 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 _reg_NT: return _decode_reg[((struct _state *)state)->rule._reg]; case _con_NT: return _decode_con[((struct _state *)state)->rule._con]; case _acon_NT: return _decode_acon[((struct _state *)state)->rule._acon]; case _addr_NT: return _decode_addr[((struct _state *)state)->rule._addr]; case _rc_NT: return _decode_rc[((struct _state *)state)->rule._rc]; case _ar_NT: return _decode_ar[((struct _state *)state)->rule._ar]; case _magic_addr_NT: return _decode_magic_addr[((struct _state *)state)->rule._magic_addr]; default: fatal("_rule", "Bad goal nonterminal %d\n", goalnt); return 0; }}static void _closure_reg(NODEPTR_TYPE, int);static void _closure_con(NODEPTR_TYPE, int);static void _closure_acon(NODEPTR_TYPE, int);static void _closure_addr(NODEPTR_TYPE, int);static void _closure_reg(NODEPTR_TYPE a, int c) { struct _state *p = STATE_LABEL(a); if (c + 0 < p->cost[_ar_NT]) { p->cost[_ar_NT] = c + 0; p->rule._ar = 1; } if (c + 0 < p->cost[_rc_NT]) { p->cost[_rc_NT] = c + 0; p->rule._rc = 2; } if (c + 0 < p->cost[_addr_NT]) { p->cost[_addr_NT] = c + 0; p->rule._addr = 5; _closure_addr(a, c + 0); } if (c + 0 < p->cost[_stmt_NT]) { p->cost[_stmt_NT] = c + 0; p->rule._stmt = 7; }}static void _closure_con(NODEPTR_TYPE a, int c) { struct _state *p = STATE_LABEL(a); if (c + 0 < p->cost[_rc_NT]) { p->cost[_rc_NT] = c + 0; p->rule._rc = 1; } if (c + 0 < p->cost[_acon_NT]) { p->cost[_acon_NT] = c + 0; p->rule._acon = 1; _closure_acon(a, c + 0); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -