x86.c

来自「基于4个mips核的noc设计」· C语言 代码 · 共 2,433 行 · 第 1/5 页

C
2,433 行
字号
		) {			if (mayrecalc(a)) {				struct _state *q = a->syms[RX]->u.t.cse->x.state;				if (q->cost[_stmt_NT] == 0) {					p->cost[_stmt_NT] = 0;					p->rule._stmt = q->rule._stmt;				}				if (q->cost[_reg_NT] == 0) {					p->cost[_reg_NT] = 0;					p->rule._reg = q->rule._reg;				}				if (q->cost[_con_NT] == 0) {					p->cost[_con_NT] = 0;					p->rule._con = q->rule._con;				}				if (q->cost[_acon_NT] == 0) {					p->cost[_acon_NT] = 0;					p->rule._acon = q->rule._acon;				}				if (q->cost[_base_NT] == 0) {					p->cost[_base_NT] = 0;					p->rule._base = q->rule._base;				}				if (q->cost[_index_NT] == 0) {					p->cost[_index_NT] = 0;					p->rule._index = q->rule._index;				}				if (q->cost[_con1_NT] == 0) {					p->cost[_con1_NT] = 0;					p->rule._con1 = q->rule._con1;				}				if (q->cost[_con2_NT] == 0) {					p->cost[_con2_NT] = 0;					p->rule._con2 = q->rule._con2;				}				if (q->cost[_con3_NT] == 0) {					p->cost[_con3_NT] = 0;					p->rule._con3 = q->rule._con3;				}				if (q->cost[_addr_NT] == 0) {					p->cost[_addr_NT] = 0;					p->rule._addr = q->rule._addr;				}				if (q->cost[_mem_NT] == 0) {					p->cost[_mem_NT] = 0;					p->rule._mem = q->rule._mem;				}				if (q->cost[_rc_NT] == 0) {					p->cost[_rc_NT] = 0;					p->rule._rc = q->rule._rc;				}				if (q->cost[_mr_NT] == 0) {					p->cost[_mr_NT] = 0;					p->rule._mr = q->rule._mr;				}				if (q->cost[_mrc0_NT] == 0) {					p->cost[_mrc0_NT] = 0;					p->rule._mrc0 = q->rule._mrc0;				}				if (q->cost[_mrc1_NT] == 0) {					p->cost[_mrc1_NT] = 0;					p->rule._mrc1 = q->rule._mrc1;				}				if (q->cost[_mrc3_NT] == 0) {					p->cost[_mrc3_NT] = 0;					p->rule._mrc3 = q->rule._mrc3;				}				if (q->cost[_con5_NT] == 0) {					p->cost[_con5_NT] = 0;					p->rule._con5 = q->rule._con5;				}				if (q->cost[_memf_NT] == 0) {					p->cost[_memf_NT] = 0;					p->rule._memf = q->rule._memf;				}				if (q->cost[_flt_NT] == 0) {					p->cost[_flt_NT] = 0;					p->rule._flt = q->rule._flt;				}				if (q->cost[_addrj_NT] == 0) {					p->cost[_addrj_NT] = 0;					p->rule._addrj = q->rule._addrj;				}				if (q->cost[_cmpf_NT] == 0) {					p->cost[_cmpf_NT] = 0;					p->rule._cmpf = q->rule._cmpf;				}			}			c = 0;			if (c + 0 < p->cost[_reg_NT]) {				p->cost[_reg_NT] = c + 0;				p->rule._reg = 2;				_closure_reg(a, c + 0);			}		}		/* mem: INDIRU1(addr) */		c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + 0;		if (c + 0 < p->cost[_mem_NT]) {			p->cost[_mem_NT] = c + 0;			p->rule._mem = 4;			_closure_mem(a, c + 0);		}		break;	case 1157: /* CVII1 */		_label(LEFT_CHILD(a));		/* reg: CVII1(reg) */		c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_reg_NT] + 1;		if (c + 0 < p->cost[_reg_NT]) {			p->cost[_reg_NT] = c + 0;			p->rule._reg = 62;			_closure_reg(a, c + 0);		}		break;	case 1158: /* CVIU1 */		break;	case 1205: /* CVUI1 */		break;	case 1206: /* CVUU1 */		_label(LEFT_CHILD(a));		/* reg: CVUU1(reg) */		c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_reg_NT] + 1;		if (c + 0 < p->cost[_reg_NT]) {			p->cost[_reg_NT] = c + 0;			p->rule._reg = 64;			_closure_reg(a, c + 0);		}		break;	case 1253: /* LOADI1 */		_label(LEFT_CHILD(a));		/* reg: LOADI1(reg) */		c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_reg_NT] + 1;		if (c + 0 < p->cost[_reg_NT]) {			p->cost[_reg_NT] = c + 0;			p->rule._reg = 15;			_closure_reg(a, c + 0);		}		break;	case 1254: /* LOADU1 */		_label(LEFT_CHILD(a));		/* reg: LOADU1(reg) */		c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_reg_NT] + 1;		if (c + 0 < p->cost[_reg_NT]) {			p->cost[_reg_NT] = c + 0;			p->rule._reg = 18;			_closure_reg(a, c + 0);		}		break;	case 2069: /* CNSTI2 */		/* con: CNSTI2 */		if (0 + 0 < p->cost[_con_NT]) {			p->cost[_con_NT] = 0 + 0;			p->rule._con = 3;			_closure_con(a, 0 + 0);		}		break;	case 2070: /* CNSTU2 */		/* con: CNSTU2 */		if (0 + 0 < p->cost[_con_NT]) {			p->cost[_con_NT] = 0 + 0;			p->rule._con = 4;			_closure_con(a, 0 + 0);		}		break;	case 2101: /* ASGNI2 */		_label(LEFT_CHILD(a));		_label(RIGHT_CHILD(a));		if (	/* stmt: ASGNI2(VREGP,reg) */			LEFT_CHILD(a)->op == 711 /* VREGP */		) {			c = ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_reg_NT] + 0;			if (c + 0 < p->cost[_stmt_NT]) {				p->cost[_stmt_NT] = c + 0;				p->rule._stmt = 3;			}		}		/* stmt: ASGNI2(addr,rc) */		c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_rc_NT] + 1;		if (c + 0 < p->cost[_stmt_NT]) {			p->cost[_stmt_NT] = c + 0;			p->rule._stmt = 38;		}		break;	case 2102: /* ASGNU2 */		_label(LEFT_CHILD(a));		_label(RIGHT_CHILD(a));		if (	/* stmt: ASGNU2(VREGP,reg) */			LEFT_CHILD(a)->op == 711 /* VREGP */		) {			c = ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_reg_NT] + 0;			if (c + 0 < p->cost[_stmt_NT]) {				p->cost[_stmt_NT] = c + 0;				p->rule._stmt = 4;			}		}		/* stmt: ASGNU2(addr,rc) */		c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + ((struct _state *)(RIGHT_CHILD(a)->x.state))->cost[_rc_NT] + 1;		if (c + 0 < p->cost[_stmt_NT]) {			p->cost[_stmt_NT] = c + 0;			p->rule._stmt = 41;		}		break;	case 2117: /* INDIRI2 */		_label(LEFT_CHILD(a));		if (	/* reg: INDIRI2(VREGP) */			LEFT_CHILD(a)->op == 711 /* VREGP */		) {			if (mayrecalc(a)) {				struct _state *q = a->syms[RX]->u.t.cse->x.state;				if (q->cost[_stmt_NT] == 0) {					p->cost[_stmt_NT] = 0;					p->rule._stmt = q->rule._stmt;				}				if (q->cost[_reg_NT] == 0) {					p->cost[_reg_NT] = 0;					p->rule._reg = q->rule._reg;				}				if (q->cost[_con_NT] == 0) {					p->cost[_con_NT] = 0;					p->rule._con = q->rule._con;				}				if (q->cost[_acon_NT] == 0) {					p->cost[_acon_NT] = 0;					p->rule._acon = q->rule._acon;				}				if (q->cost[_base_NT] == 0) {					p->cost[_base_NT] = 0;					p->rule._base = q->rule._base;				}				if (q->cost[_index_NT] == 0) {					p->cost[_index_NT] = 0;					p->rule._index = q->rule._index;				}				if (q->cost[_con1_NT] == 0) {					p->cost[_con1_NT] = 0;					p->rule._con1 = q->rule._con1;				}				if (q->cost[_con2_NT] == 0) {					p->cost[_con2_NT] = 0;					p->rule._con2 = q->rule._con2;				}				if (q->cost[_con3_NT] == 0) {					p->cost[_con3_NT] = 0;					p->rule._con3 = q->rule._con3;				}				if (q->cost[_addr_NT] == 0) {					p->cost[_addr_NT] = 0;					p->rule._addr = q->rule._addr;				}				if (q->cost[_mem_NT] == 0) {					p->cost[_mem_NT] = 0;					p->rule._mem = q->rule._mem;				}				if (q->cost[_rc_NT] == 0) {					p->cost[_rc_NT] = 0;					p->rule._rc = q->rule._rc;				}				if (q->cost[_mr_NT] == 0) {					p->cost[_mr_NT] = 0;					p->rule._mr = q->rule._mr;				}				if (q->cost[_mrc0_NT] == 0) {					p->cost[_mrc0_NT] = 0;					p->rule._mrc0 = q->rule._mrc0;				}				if (q->cost[_mrc1_NT] == 0) {					p->cost[_mrc1_NT] = 0;					p->rule._mrc1 = q->rule._mrc1;				}				if (q->cost[_mrc3_NT] == 0) {					p->cost[_mrc3_NT] = 0;					p->rule._mrc3 = q->rule._mrc3;				}				if (q->cost[_con5_NT] == 0) {					p->cost[_con5_NT] = 0;					p->rule._con5 = q->rule._con5;				}				if (q->cost[_memf_NT] == 0) {					p->cost[_memf_NT] = 0;					p->rule._memf = q->rule._memf;				}				if (q->cost[_flt_NT] == 0) {					p->cost[_flt_NT] = 0;					p->rule._flt = q->rule._flt;				}				if (q->cost[_addrj_NT] == 0) {					p->cost[_addrj_NT] = 0;					p->rule._addrj = q->rule._addrj;				}				if (q->cost[_cmpf_NT] == 0) {					p->cost[_cmpf_NT] = 0;					p->rule._cmpf = q->rule._cmpf;				}			}			c = 0;			if (c + 0 < p->cost[_reg_NT]) {				p->cost[_reg_NT] = c + 0;				p->rule._reg = 3;				_closure_reg(a, c + 0);			}		}		/* mem: INDIRI2(addr) */		c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + 0;		if (c + 0 < p->cost[_mem_NT]) {			p->cost[_mem_NT] = c + 0;			p->rule._mem = 2;			_closure_mem(a, c + 0);		}		break;	case 2118: /* INDIRU2 */		_label(LEFT_CHILD(a));		if (	/* reg: INDIRU2(VREGP) */			LEFT_CHILD(a)->op == 711 /* VREGP */		) {			if (mayrecalc(a)) {				struct _state *q = a->syms[RX]->u.t.cse->x.state;				if (q->cost[_stmt_NT] == 0) {					p->cost[_stmt_NT] = 0;					p->rule._stmt = q->rule._stmt;				}				if (q->cost[_reg_NT] == 0) {					p->cost[_reg_NT] = 0;					p->rule._reg = q->rule._reg;				}				if (q->cost[_con_NT] == 0) {					p->cost[_con_NT] = 0;					p->rule._con = q->rule._con;				}				if (q->cost[_acon_NT] == 0) {					p->cost[_acon_NT] = 0;					p->rule._acon = q->rule._acon;				}				if (q->cost[_base_NT] == 0) {					p->cost[_base_NT] = 0;					p->rule._base = q->rule._base;				}				if (q->cost[_index_NT] == 0) {					p->cost[_index_NT] = 0;					p->rule._index = q->rule._index;				}				if (q->cost[_con1_NT] == 0) {					p->cost[_con1_NT] = 0;					p->rule._con1 = q->rule._con1;				}				if (q->cost[_con2_NT] == 0) {					p->cost[_con2_NT] = 0;					p->rule._con2 = q->rule._con2;				}				if (q->cost[_con3_NT] == 0) {					p->cost[_con3_NT] = 0;					p->rule._con3 = q->rule._con3;				}				if (q->cost[_addr_NT] == 0) {					p->cost[_addr_NT] = 0;					p->rule._addr = q->rule._addr;				}				if (q->cost[_mem_NT] == 0) {					p->cost[_mem_NT] = 0;					p->rule._mem = q->rule._mem;				}				if (q->cost[_rc_NT] == 0) {					p->cost[_rc_NT] = 0;					p->rule._rc = q->rule._rc;				}				if (q->cost[_mr_NT] == 0) {					p->cost[_mr_NT] = 0;					p->rule._mr = q->rule._mr;				}				if (q->cost[_mrc0_NT] == 0) {					p->cost[_mrc0_NT] = 0;					p->rule._mrc0 = q->rule._mrc0;				}				if (q->cost[_mrc1_NT] == 0) {					p->cost[_mrc1_NT] = 0;					p->rule._mrc1 = q->rule._mrc1;				}				if (q->cost[_mrc3_NT] == 0) {					p->cost[_mrc3_NT] = 0;					p->rule._mrc3 = q->rule._mrc3;				}				if (q->cost[_con5_NT] == 0) {					p->cost[_con5_NT] = 0;					p->rule._con5 = q->rule._con5;				}				if (q->cost[_memf_NT] == 0) {					p->cost[_memf_NT] = 0;					p->rule._memf = q->rule._memf;				}				if (q->cost[_flt_NT] == 0) {					p->cost[_flt_NT] = 0;					p->rule._flt = q->rule._flt;				}				if (q->cost[_addrj_NT] == 0) {					p->cost[_addrj_NT] = 0;					p->rule._addrj = q->rule._addrj;				}				if (q->cost[_cmpf_NT] == 0) {					p->cost[_cmpf_NT] = 0;					p->rule._cmpf = q->rule._cmpf;				}			}			c = 0;			if (c + 0 < p->cost[_reg_NT]) {				p->cost[_reg_NT] = c + 0;				p->rule._reg = 4;				_closure_reg(a, c + 0);			}		}		/* mem: INDIRU2(addr) */		c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_addr_NT] + 0;		if (c + 0 < p->cost[_mem_NT]) {			p->cost[_mem_NT] = c + 0;			p->rule._mem = 5;			_closure_mem(a, c + 0);		}		break;	case 2181: /* CVII2 */		_label(LEFT_CHILD(a));		/* reg: CVII2(reg) */		c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_reg_NT] + 1;		if (c + 0 < p->cost[_reg_NT]) {			p->cost[_reg_NT] = c + 0;			p->rule._reg = 63;			_closure_reg(a, c + 0);		}		break;	case 2182: /* CVIU2 */		break;	case 2229: /* CVUI2 */		break;	case 2230: /* CVUU2 */		_label(LEFT_CHILD(a));		/* reg: CVUU2(reg) */		c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_reg_NT] + 1;		if (c + 0 < p->cost[_reg_NT]) {			p->cost[_reg_NT] = c + 0;			p->rule._reg = 65;			_closure_reg(a, c + 0);		}		break;	case 2277: /* LOADI2 */		_label(LEFT_CHILD(a));		/* reg: LOADI2(reg) */		c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_reg_NT] + 1;		if (c + 0 < p->cost[_reg_NT]) {			p->cost[_reg_NT] = c + 0;			p->rule._reg = 16;			_closure_reg(a, c + 0);		}		break;	case 2278: /* LOADU2 */		_label(LEFT_CHILD(a));		/* reg: LOADU2(reg) */		c = ((struct _state *)(LEFT_CHILD(a)->x.state))->cost[_reg_NT] + 1;		if (c + 0 < p->cost[_reg_NT]) {			p->cost[_reg_NT] = c + 0;			p->rule._reg = 19;			_closure_reg(a, c + 0);		}		break;	case 4113: /* CNSTF4 */		break;	case 4117: /* CNSTI4 */		/* con: CNSTI4 */		if (0 + 0 < p->cost[_con_NT]) {			p->cost[_con_NT] = 0 + 0;			p->rule._con = 5;			_closure_con(a, 0 + 0);		}		/* con1: CNSTI4 */		c = (range(a, 1, 1));		if (c + 0 < p->cost[_con1_NT]) {			p->cost[_con1_NT] = c + 0;			p->rule._con1 = 1;		}		/* con2: CNSTI4 */		c = (range(a, 2, 2));		if (c + 0 < p->cost[_con2_NT]) {			p->cost[_con2_NT] = c + 0;			p->rule._con2 = 1;		}		/* con3: CNSTI4 */		c = (range(a, 3, 3));		if (c + 0 < p->cost[_con3_NT]) {			p->cost[_con3_NT] = c + 0;			p->rule._con3 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?