mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-23 02:41:30 +00:00
[gamecode] Rename ifnot and if to be less confusing
I think :) anyway, now they're ifz and ifnz, making them consistent with the rest of the if instructions.
This commit is contained in:
parent
db7a67e5b7
commit
ba29be3f82
4 changed files with 49 additions and 49 deletions
|
@ -114,8 +114,8 @@ branch_formats = {
|
|||
"types": "ev_void, ev_void, ev_integer",
|
||||
"args": {
|
||||
"op_mode": "ABCD",
|
||||
"op_cond": ["ifnot", "ifb", "ifa", "jump",
|
||||
"if", "ifae", "ifbe", "call"],
|
||||
"op_cond": ["ifz", "ifb", "ifa", "jump",
|
||||
"ifnz", "ifae", "ifbe", "call"],
|
||||
"branch_fmt": branch_fmt,
|
||||
"cond_fmt": ["%Gc ", "%Gc ", "%Gc ", "", "%Gc ", "%Gc ", "%Gc ", ""],
|
||||
"cond_widths": [
|
||||
|
|
|
@ -2819,20 +2819,29 @@ pr_exec_ruamoko (progs_t *pr, int exitdepth)
|
|||
MM(ivec4) = STK(ivec4);
|
||||
break;
|
||||
// 0 0100
|
||||
case OP_IFNOT_A:
|
||||
case OP_IFNOT_B:
|
||||
case OP_IFNOT_C:
|
||||
case OP_IFNOT_D:
|
||||
case OP_IFZ_A:
|
||||
case OP_IFZ_B:
|
||||
case OP_IFZ_C:
|
||||
case OP_IFZ_D:
|
||||
if (!OPC(int)) {
|
||||
pr->pr_xstatement = pr_jump_mode (pr, st);
|
||||
st = pr->pr_statements + pr->pr_xstatement;
|
||||
}
|
||||
break;
|
||||
case OP_IF_A:
|
||||
case OP_IF_B:
|
||||
case OP_IF_C:
|
||||
case OP_IF_D:
|
||||
if (OPC(int)) {
|
||||
case OP_IFB_A:
|
||||
case OP_IFB_B:
|
||||
case OP_IFB_C:
|
||||
case OP_IFB_D:
|
||||
if (OPC(int) < 0) {
|
||||
pr->pr_xstatement = pr_jump_mode (pr, st);
|
||||
st = pr->pr_statements + pr->pr_xstatement;
|
||||
}
|
||||
break;
|
||||
case OP_IFA_A:
|
||||
case OP_IFA_B:
|
||||
case OP_IFA_C:
|
||||
case OP_IFA_D:
|
||||
if (OPC(int) > 0) {
|
||||
pr->pr_xstatement = pr_jump_mode (pr, st);
|
||||
st = pr->pr_statements + pr->pr_xstatement;
|
||||
}
|
||||
|
@ -2844,6 +2853,33 @@ pr_exec_ruamoko (progs_t *pr, int exitdepth)
|
|||
pr->pr_xstatement = pr_jump_mode (pr, st);
|
||||
st = pr->pr_statements + pr->pr_xstatement;
|
||||
break;
|
||||
case OP_IFNZ_A:
|
||||
case OP_IFNZ_B:
|
||||
case OP_IFNZ_C:
|
||||
case OP_IFNZ_D:
|
||||
if (OPC(int)) {
|
||||
pr->pr_xstatement = pr_jump_mode (pr, st);
|
||||
st = pr->pr_statements + pr->pr_xstatement;
|
||||
}
|
||||
break;
|
||||
case OP_IFAE_A:
|
||||
case OP_IFAE_B:
|
||||
case OP_IFAE_C:
|
||||
case OP_IFAE_D:
|
||||
if (OPC(int) >= 0) {
|
||||
pr->pr_xstatement = pr_jump_mode (pr, st);
|
||||
st = pr->pr_statements + pr->pr_xstatement;
|
||||
}
|
||||
break;
|
||||
case OP_IFBE_A:
|
||||
case OP_IFBE_B:
|
||||
case OP_IFBE_C:
|
||||
case OP_IFBE_D:
|
||||
if (OPC(int) <= 0) {
|
||||
pr->pr_xstatement = pr_jump_mode (pr, st);
|
||||
st = pr->pr_statements + pr->pr_xstatement;
|
||||
}
|
||||
break;
|
||||
case OP_CALL_A:
|
||||
case OP_CALL_B:
|
||||
case OP_CALL_C:
|
||||
|
@ -2922,42 +2958,6 @@ pr_exec_ruamoko (progs_t *pr, int exitdepth)
|
|||
}
|
||||
break;
|
||||
// 0 0110
|
||||
case OP_IFA_A:
|
||||
case OP_IFA_B:
|
||||
case OP_IFA_C:
|
||||
case OP_IFA_D:
|
||||
if (OPC(int) > 0) {
|
||||
pr->pr_xstatement = pr_jump_mode (pr, st);
|
||||
st = pr->pr_statements + pr->pr_xstatement;
|
||||
}
|
||||
break;
|
||||
case OP_IFBE_A:
|
||||
case OP_IFBE_B:
|
||||
case OP_IFBE_C:
|
||||
case OP_IFBE_D:
|
||||
if (OPC(int) <= 0) {
|
||||
pr->pr_xstatement = pr_jump_mode (pr, st);
|
||||
st = pr->pr_statements + pr->pr_xstatement;
|
||||
}
|
||||
break;
|
||||
case OP_IFB_A:
|
||||
case OP_IFB_B:
|
||||
case OP_IFB_C:
|
||||
case OP_IFB_D:
|
||||
if (OPC(int) < 0) {
|
||||
pr->pr_xstatement = pr_jump_mode (pr, st);
|
||||
st = pr->pr_statements + pr->pr_xstatement;
|
||||
}
|
||||
break;
|
||||
case OP_IFAE_A:
|
||||
case OP_IFAE_B:
|
||||
case OP_IFAE_C:
|
||||
case OP_IFAE_D:
|
||||
if (OPC(int) >= 0) {
|
||||
pr->pr_xstatement = pr_jump_mode (pr, st);
|
||||
st = pr->pr_statements + pr->pr_xstatement;
|
||||
}
|
||||
break;
|
||||
// 0 0111
|
||||
case OP_CROSS_F:
|
||||
{
|
||||
|
|
|
@ -129,7 +129,7 @@ static dstatement_t double_cossin_statements[] = {
|
|||
{ OP(0, 0, 0, OP_DIV_D_2), 40, 16, 40 }, // xn /= f
|
||||
{ OP(0, 0, 0, OP_ADD_D_2), 16, 24, 16 }, // f += inc
|
||||
{ OP(0, 0, 0, OP_LT_D_1), 16, 30, 46 }, // f0 < fmax
|
||||
{ OP(0, 0, 0, OP_IF_A), -7, 0, 46 }, // f0 < fmax
|
||||
{ OP(0, 0, 0, OP_IFNZ_A), -7, 0, 46 }, // f0 < fmax
|
||||
};
|
||||
|
||||
test_t tests[] = {
|
||||
|
|
|
@ -129,7 +129,7 @@ static dstatement_t float_cossin_statements[] = {
|
|||
{ OP(0, 0, 0, OP_DIV_F_2), 20, 8, 20 }, // xn /= f
|
||||
{ OP(0, 0, 0, OP_ADD_F_2), 8, 12, 8 }, // f += inc
|
||||
{ OP(0, 0, 0, OP_LT_F_1), 8, 15, 23 }, // f0 < fmax
|
||||
{ OP(0, 0, 0, OP_IF_A), -7, 0, 23 }, // f0 < fmax
|
||||
{ OP(0, 0, 0, OP_IFNZ_A), -7, 0, 23 }, // f0 < fmax
|
||||
};
|
||||
|
||||
test_t tests[] = {
|
||||
|
|
Loading…
Reference in a new issue