您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ testTMode函数代码示例

51自学网 2021-06-03 08:44:44
  C++
这篇教程C++ testTMode函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中testTMode函数的典型用法代码示例。如果您正苦于以下问题:C++ testTMode函数的具体用法?C++ testTMode怎么用?C++ testTMode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了testTMode函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1:

/*** Returns the position of the instruction "controlling" a given** jump (that is, its condition), or the jump itself if it is** unconditional.*/static Instruction *getjumpcontrol (FuncState *fs, int pc) {  Instruction *pi = &fs->f->code[pc];  if (pc >= 1 && testTMode(GET_OPCODE(*(pi-1))))    return pi-1;  else    return pi;}
开发者ID:celskeggs,项目名称:selkie,代码行数:12,


示例2:

/*static*/ Instruction *FuncState::getjumpcontrol (/*FuncState *fs,*/ int pc) {	Instruction *pi = &f->code[pc];	if (pc >= 1 && testTMode(GET_OPCODE(*(pi-1))))		return pi-1;	else		return pi;}
开发者ID:swizl,项目名称:lua,代码行数:7,


示例3: ju_bytecode

/* local op, a, b, c, test = jit.util.bytecode(func, pc) */static int ju_bytecode(lua_State *L){    Proto *pt = check_LCL(L)->l.p;    int pc = luaL_checkint(L, 2);    if (pc >= 1 && pc <= pt->sizecode) {        Instruction ins = pt->code[pc-1];        OpCode op = GET_OPCODE(ins);        if (pc > 1 && (((int)OP_SETLIST) << POS_OP) ==                (pt->code[pc-2] & (MASK1(SIZE_OP,POS_OP) | MASK1(SIZE_C,POS_C)))) {            lua_pushstring(L, luaP_opnames[OP_SETLIST]);            lua_pushnumber(L, (lua_Number)ins);  /* Fake extended op. */            return 1;        }        if (op >= NUM_OPCODES) return 0;  /* Just in case. */        lua_pushstring(L, luaP_opnames[op]);        lua_pushinteger(L, GETARG_A(ins));        switch (getOpMode(op)) {        case iABC: {            int b = GETARG_B(ins), c = GETARG_C(ins);            switch (getBMode(op)) {            case OpArgN:                lua_pushnil(L);                break;            case OpArgK:                if (ISK(b)) b = -1-INDEXK(b);            case OpArgR:            case OpArgU:                lua_pushinteger(L, b);                break;            }            switch (getCMode(op)) {            case OpArgN:                lua_pushnil(L);                break;            case OpArgK:                if (ISK(c)) c = -1-INDEXK(c);            case OpArgR:            case OpArgU:                lua_pushinteger(L, c);                break;            }            lua_pushboolean(L, testTMode(op));            return 5;        }        case iABx: {            int bx = GETARG_Bx(ins);            lua_pushinteger(L, getBMode(op) == OpArgK ? -1-bx : bx);            return 3;        }        case iAsBx:            lua_pushinteger(L, GETARG_sBx(ins));            return 3;        }    }    return 0;}
开发者ID:vasilenkomike,项目名称:xray,代码行数:57,


示例4: symbexec

static Instruction symbexec(const Proto* pt, int lastpc, int reg){	int pc;	int last;  /* stores position of last instruction that changed `reg' */	last = pt->sizecode - 1; /* points to final return (a `neutral' instruction) */	check(precheck(pt));	for (pc = 0; pc < lastpc; pc++)	{		Instruction i = pt->code[pc];		OpCode op = GET_OPCODE(i);		int a = GETARG_A(i);		int b = 0;		int c = 0;		check(op < NUM_OPCODES);		checkreg(pt, a);		switch (getOpMode(op))		{			case iABC:			{				b = GETARG_B(i);				c = GETARG_C(i);				check(checkArgMode(pt, b, getBMode(op)));				check(checkArgMode(pt, c, getCMode(op)));				break;			}			case iABx:			{				b = GETARG_Bx(i);				if (getBMode(op) == OpArgK) check(b < pt->sizek);				break;			}			case iAsBx:			{				b = GETARG_sBx(i);				if (getBMode(op) == OpArgR)				{					int dest = pc + 1 + b;					check(0 <= dest && dest < pt->sizecode);					if (dest > 0)					{						int j;						/* check that it does not jump to a setlist count; this						   is tricky, because the count from a previous setlist may						   have the same value of an invalid setlist; so, we must						   go all the way back to the first of them (if any) */						for (j = 0; j < dest; j++)						{							Instruction d = pt->code[dest - 1 - j];							if (!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0)) break;						}						/* if 'j' is even, previous value is not a setlist (even if						   it looks like one) */						check((j & 1) == 0);					}				}				break;			}		}		if (testAMode(op))		{			if (a == reg) last = pc;	/* change register `a' */		}		if (testTMode(op))		{			check(pc + 2 < pt->sizecode); /* check skip */			check(GET_OPCODE(pt->code[pc + 1]) == OP_JMP);		}		switch (op)		{			case OP_LOADBOOL:			{				if (c == 1)    /* does it jump? */				{					check(pc + 2 < pt->sizecode); /* check its jump */					check(GET_OPCODE(pt->code[pc + 1]) != OP_SETLIST ||					      GETARG_C(pt->code[pc + 1]) != 0);				}				break;			}			case OP_LOADNIL:			{				if (a <= reg && reg <= b)					last = pc;  /* set registers from `a' to `b' */				break;			}			case OP_GETUPVAL:			case OP_SETUPVAL:			{				check(b < pt->nups);				break;			}			case OP_GETGLOBAL:			case OP_SETGLOBAL:			{				check(ttisstring(&pt->k[b]));				break;			}			case OP_SELF:			{				checkreg(pt, a + 1);//.........这里部分代码省略.........
开发者ID:migerh,项目名称:DCPUToolchain,代码行数:101,


示例5: symbexec

static Instruction symbexec (const Proto *pt, int lastpc, int reg) {  int pc;  int last;  /* stores position of last instruction that changed `reg' */  last = pt->sizecode-1;  /* points to final return (a `neutral' instruction) */  check(precheck(pt));  for (pc = 0; pc < lastpc; pc++) {    Instruction i = pt->code[pc];    OpCode op = GET_OPCODE(i);    int a = GETARG_A(i);    int b = 0;    int c = 0;    check(op < NUM_OPCODES);    checkreg(pt, a);    switch (getOpMode(op)) {      case iABC: {        b = GETARG_B(i);        c = GETARG_C(i);        check(checkArgMode(pt, b, getBMode(op)));        check(checkArgMode(pt, c, getCMode(op)));        break;      }      case iABx: {        b = GETARG_Bx(i);        if (getBMode(op) == OpArgK) check(b < pt->sizek);        break;      }      case iAsBx: {        b = GETARG_sBx(i);        if (getBMode(op) == OpArgR) {          int dest = pc+1+b;          check(0 <= dest && dest < pt->sizecode);          if (dest > 0) {            /* cannot jump to a setlist count */            Instruction d = pt->code[dest-1];            check(!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0));          }        }        break;      }    }    if (testAMode(op)) {      if (a == reg) last = pc;  /* change register `a' */    }    if (testTMode(op)) {      check(pc+2 < pt->sizecode);  /* check skip */      check(GET_OPCODE(pt->code[pc+1]) == OP_JMP);    }    switch (op) {      case OP_LOADBOOL: {        check(c == 0 || pc+2 < pt->sizecode);  /* check its jump */        break;      }      case OP_LOADNIL: {        if (a <= reg && reg <= b)          last = pc;  /* set registers from `a' to `b' */        break;      }      case OP_GETUPVAL:      case OP_SETUPVAL: {        check(b < pt->nups);        break;      }      case OP_GETGLOBAL:      case OP_SETGLOBAL: {        check(ttisstring(&pt->k[b]));        break;      }      case OP_SELF: {        checkreg(pt, a+1);        if (reg == a+1) last = pc;        break;      }      case OP_CONCAT: {        check(b < c);  /* at least two operands */        break;      }      case OP_TFORLOOP: {        check(c >= 1);  /* at least one result (control variable) */        checkreg(pt, a+2+c);  /* space for results */        if (reg >= a+2) last = pc;  /* affect all regs above its base */        break;      }      case OP_FORLOOP:      case OP_FORPREP:        checkreg(pt, a+3);        /* go through */      case OP_JMP: {        int dest = pc+1+b;        /* not full check and jump is forward and do not skip `lastpc'? */        if (reg != NO_REG && pc < dest && dest <= lastpc)          pc += b;  /* do the jump */        break;      }      case OP_CALL:      case OP_TAILCALL: {        if (b != 0) {          checkreg(pt, a+b-1);        }        c--;  /* c = num. returns */        if (c == LUA_MULTRET) {//.........这里部分代码省略.........
开发者ID:robinelfrink,项目名称:squeezeplay,代码行数:101,


示例6: invertjump

static void invertjump (FuncState *fs, expdesc *e) {  Instruction *pc = getjumpcontrol(fs, e->u.info);  lua_assert(testTMode(GET_OPCODE(*pc)) && GET_OPCODE(*pc) != OP_TEST);  SETARG_A(*pc, !(GETARG_A(*pc)));}
开发者ID:hongzhidao,项目名称:yet-another-lua,代码行数:5,



注:本文中的testTMode函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ test_KErrNone函数代码示例
C++ testStart函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。