From 0c17c6dc24fa1dc38ee5c61a78b59e40174aa1ee Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 2 Jan 2022 21:06:14 +0900 Subject: [PATCH] [gamecode] Rename the old opcodes To reflect their basis on v6 progs instructions, they sport the v6p tag where the p is for "plus" due to the QuakeForge extensions. --- include/QF/pr_comp.h | 594 ++++++++++++++-------------- libs/gamecode/pr_debug.c | 4 +- libs/gamecode/pr_exec.c | 600 ++++++++++++++-------------- libs/gamecode/pr_opcode.c | 744 +++++++++++++++++------------------ tools/qfcc/include/opcodes.h | 35 +- tools/qfcc/source/emit.c | 2 +- tools/qfcc/source/opcodes.c | 28 +- 7 files changed, 1004 insertions(+), 1003 deletions(-) diff --git a/include/QF/pr_comp.h b/include/QF/pr_comp.h index 971584070..f51ce2693 100644 --- a/include/QF/pr_comp.h +++ b/include/QF/pr_comp.h @@ -89,355 +89,355 @@ extern const char * const pr_type_name[ev_type_count]; typedef enum { - OP_DONE, - OP_MUL_F, - OP_MUL_V, - OP_MUL_FV, - OP_MUL_VF, - OP_DIV_F, - OP_ADD_F, - OP_ADD_V, - OP_SUB_F, - OP_SUB_V, + OP_DONE_v6p, + OP_MUL_F_v6p, + OP_MUL_V_v6p, + OP_MUL_FV_v6p, + OP_MUL_VF_v6p, + OP_DIV_F_v6p, + OP_ADD_F_v6p, + OP_ADD_V_v6p, + OP_SUB_F_v6p, + OP_SUB_V_v6p, - OP_EQ_F, - OP_EQ_V, - OP_EQ_S, - OP_EQ_E, - OP_EQ_FN, + OP_EQ_F_v6p, + OP_EQ_V_v6p, + OP_EQ_S_v6p, + OP_EQ_E_v6p, + OP_EQ_FN_v6p, - OP_NE_F, - OP_NE_V, - OP_NE_S, - OP_NE_E, - OP_NE_FN, + OP_NE_F_v6p, + OP_NE_V_v6p, + OP_NE_S_v6p, + OP_NE_E_v6p, + OP_NE_FN_v6p, - OP_LE_F, - OP_GE_F, - OP_LT_F, - OP_GT_F, + OP_LE_F_v6p, + OP_GE_F_v6p, + OP_LT_F_v6p, + OP_GT_F_v6p, - OP_LOAD_F, - OP_LOAD_V, - OP_LOAD_S, - OP_LOAD_ENT, - OP_LOAD_FLD, - OP_LOAD_FN, + OP_LOAD_F_v6p, + OP_LOAD_V_v6p, + OP_LOAD_S_v6p, + OP_LOAD_ENT_v6p, + OP_LOAD_FLD_v6p, + OP_LOAD_FN_v6p, - OP_ADDRESS, + OP_ADDRESS_v6p, - OP_STORE_F, - OP_STORE_V, - OP_STORE_S, - OP_STORE_ENT, - OP_STORE_FLD, - OP_STORE_FN, + OP_STORE_F_v6p, + OP_STORE_V_v6p, + OP_STORE_S_v6p, + OP_STORE_ENT_v6p, + OP_STORE_FLD_v6p, + OP_STORE_FN_v6p, - OP_STOREP_F, - OP_STOREP_V, - OP_STOREP_S, - OP_STOREP_ENT, - OP_STOREP_FLD, - OP_STOREP_FN, + OP_STOREP_F_v6p, + OP_STOREP_V_v6p, + OP_STOREP_S_v6p, + OP_STOREP_ENT_v6p, + OP_STOREP_FLD_v6p, + OP_STOREP_FN_v6p, - OP_RETURN, - OP_NOT_F, - OP_NOT_V, - OP_NOT_S, - OP_NOT_ENT, - OP_NOT_FN, - OP_IF, - OP_IFNOT, - OP_CALL0, - OP_CALL1, - OP_CALL2, - OP_CALL3, - OP_CALL4, - OP_CALL5, - OP_CALL6, - OP_CALL7, - OP_CALL8, - OP_STATE, - OP_GOTO, - OP_AND, - OP_OR, + OP_RETURN_v6p, + OP_NOT_F_v6p, + OP_NOT_V_v6p, + OP_NOT_S_v6p, + OP_NOT_ENT_v6p, + OP_NOT_FN_v6p, + OP_IF_v6p, + OP_IFNOT_v6p, + OP_CALL0_v6p, + OP_CALL1_v6p, + OP_CALL2_v6p, + OP_CALL3_v6p, + OP_CALL4_v6p, + OP_CALL5_v6p, + OP_CALL6_v6p, + OP_CALL7_v6p, + OP_CALL8_v6p, + OP_STATE_v6p, + OP_GOTO_v6p, + OP_AND_v6p, + OP_OR_v6p, - OP_BITAND, - OP_BITOR, // end of v6 opcodes + OP_BITAND_v6p, + OP_BITOR_v6p, // end of v6 opcodes - OP_ADD_S, - OP_LE_S, - OP_GE_S, - OP_LT_S, - OP_GT_S, + OP_ADD_S_v6p, + OP_LE_S_v6p, + OP_GE_S_v6p, + OP_LT_S_v6p, + OP_GT_S_v6p, - OP_ADD_I, - OP_SUB_I, - OP_MUL_I, - OP_DIV_I, - OP_BITAND_I, - OP_BITOR_I, - OP_GE_I, - OP_LE_I, - OP_GT_I, - OP_LT_I, - OP_AND_I, - OP_OR_I, - OP_NOT_I, - OP_EQ_I, - OP_NE_I, - OP_STORE_I, - OP_STOREP_I, - OP_LOAD_I, + OP_ADD_I_v6p, + OP_SUB_I_v6p, + OP_MUL_I_v6p, + OP_DIV_I_v6p, + OP_BITAND_I_v6p, + OP_BITOR_I_v6p, + OP_GE_I_v6p, + OP_LE_I_v6p, + OP_GT_I_v6p, + OP_LT_I_v6p, + OP_AND_I_v6p, + OP_OR_I_v6p, + OP_NOT_I_v6p, + OP_EQ_I_v6p, + OP_NE_I_v6p, + OP_STORE_I_v6p, + OP_STOREP_I_v6p, + OP_LOAD_I_v6p, - OP_CONV_IF, - OP_CONV_FI, + OP_CONV_IF_v6p, + OP_CONV_FI_v6p, - OP_BITXOR_F, - OP_BITXOR_I, - OP_BITNOT_F, - OP_BITNOT_I, + OP_BITXOR_F_v6p, + OP_BITXOR_I_v6p, + OP_BITNOT_F_v6p, + OP_BITNOT_I_v6p, - OP_SHL_F, - OP_SHR_F, - OP_SHL_I, - OP_SHR_I, + OP_SHL_F_v6p, + OP_SHR_F_v6p, + OP_SHL_I_v6p, + OP_SHR_I_v6p, - OP_REM_F, - OP_REM_I, + OP_REM_F_v6p, + OP_REM_I_v6p, - OP_LOADB_F, - OP_LOADB_V, - OP_LOADB_S, - OP_LOADB_ENT, - OP_LOADB_FLD, - OP_LOADB_FN, - OP_LOADB_I, - OP_LOADB_P, + OP_LOADB_F_v6p, + OP_LOADB_V_v6p, + OP_LOADB_S_v6p, + OP_LOADB_ENT_v6p, + OP_LOADB_FLD_v6p, + OP_LOADB_FN_v6p, + OP_LOADB_I_v6p, + OP_LOADB_P_v6p, - OP_STOREB_F, - OP_STOREB_V, - OP_STOREB_S, - OP_STOREB_ENT, - OP_STOREB_FLD, - OP_STOREB_FN, - OP_STOREB_I, - OP_STOREB_P, + OP_STOREB_F_v6p, + OP_STOREB_V_v6p, + OP_STOREB_S_v6p, + OP_STOREB_ENT_v6p, + OP_STOREB_FLD_v6p, + OP_STOREB_FN_v6p, + OP_STOREB_I_v6p, + OP_STOREB_P_v6p, - OP_ADDRESS_VOID, - OP_ADDRESS_F, - OP_ADDRESS_V, - OP_ADDRESS_S, - OP_ADDRESS_ENT, - OP_ADDRESS_FLD, - OP_ADDRESS_FN, - OP_ADDRESS_I, - OP_ADDRESS_P, + OP_ADDRESS_VOID_v6p, + OP_ADDRESS_F_v6p, + OP_ADDRESS_V_v6p, + OP_ADDRESS_S_v6p, + OP_ADDRESS_ENT_v6p, + OP_ADDRESS_FLD_v6p, + OP_ADDRESS_FN_v6p, + OP_ADDRESS_I_v6p, + OP_ADDRESS_P_v6p, - OP_LEA, + OP_LEA_v6p, - OP_IFBE, - OP_IFB, - OP_IFAE, - OP_IFA, + OP_IFBE_v6p, + OP_IFB_v6p, + OP_IFAE_v6p, + OP_IFA_v6p, - OP_JUMP, - OP_JUMPB, + OP_JUMP_v6p, + OP_JUMPB_v6p, - OP_LT_U, - OP_GT_U, - OP_LE_U, - OP_GE_U, + OP_LT_U_v6p, + OP_GT_U_v6p, + OP_LE_U_v6p, + OP_GE_U_v6p, - OP_LOADBI_F, - OP_LOADBI_V, - OP_LOADBI_S, - OP_LOADBI_ENT, - OP_LOADBI_FLD, - OP_LOADBI_FN, - OP_LOADBI_I, - OP_LOADBI_P, + OP_LOADBI_F_v6p, + OP_LOADBI_V_v6p, + OP_LOADBI_S_v6p, + OP_LOADBI_ENT_v6p, + OP_LOADBI_FLD_v6p, + OP_LOADBI_FN_v6p, + OP_LOADBI_I_v6p, + OP_LOADBI_P_v6p, - OP_STOREBI_F, - OP_STOREBI_V, - OP_STOREBI_S, - OP_STOREBI_ENT, - OP_STOREBI_FLD, - OP_STOREBI_FN, - OP_STOREBI_I, - OP_STOREBI_P, + OP_STOREBI_F_v6p, + OP_STOREBI_V_v6p, + OP_STOREBI_S_v6p, + OP_STOREBI_ENT_v6p, + OP_STOREBI_FLD_v6p, + OP_STOREBI_FN_v6p, + OP_STOREBI_I_v6p, + OP_STOREBI_P_v6p, - OP_LEAI, + OP_LEAI_v6p, - OP_LOAD_P, - OP_STORE_P, - OP_STOREP_P, - OP_NOT_P, - OP_EQ_P, - OP_NE_P, - OP_LE_P, - OP_GE_P, - OP_LT_P, - OP_GT_P, + OP_LOAD_P_v6p, + OP_STORE_P_v6p, + OP_STOREP_P_v6p, + OP_NOT_P_v6p, + OP_EQ_P_v6p, + OP_NE_P_v6p, + OP_LE_P_v6p, + OP_GE_P_v6p, + OP_LT_P_v6p, + OP_GT_P_v6p, - OP_MOVEI, - OP_MOVEP, - OP_MOVEPI, + OP_MOVEI_v6p, + OP_MOVEP_v6p, + OP_MOVEPI_v6p, - OP_SHR_U, + OP_SHR_U_v6p, - OP_STATE_F, + OP_STATE_F_v6p, - OP_ADD_Q, - OP_SUB_Q, - OP_MUL_Q, - OP_MUL_QF, - OP_MUL_FQ, - OP_MUL_QV, - OP_CONJ_Q, - OP_NOT_Q, - OP_EQ_Q, - OP_NE_Q, - OP_STORE_Q, - OP_STOREB_Q, - OP_STOREBI_Q, - OP_STOREP_Q, - OP_LOAD_Q, - OP_LOADB_Q, - OP_LOADBI_Q, - OP_ADDRESS_Q, + OP_ADD_Q_v6p, + OP_SUB_Q_v6p, + OP_MUL_Q_v6p, + OP_MUL_QF_v6p, + OP_MUL_FQ_v6p, + OP_MUL_QV_v6p, + OP_CONJ_Q_v6p, + OP_NOT_Q_v6p, + OP_EQ_Q_v6p, + OP_NE_Q_v6p, + OP_STORE_Q_v6p, + OP_STOREB_Q_v6p, + OP_STOREBI_Q_v6p, + OP_STOREP_Q_v6p, + OP_LOAD_Q_v6p, + OP_LOADB_Q_v6p, + OP_LOADBI_Q_v6p, + OP_ADDRESS_Q_v6p, - OP_RCALL0, - OP_RCALL1, - OP_RCALL2, - OP_RCALL3, - OP_RCALL4, - OP_RCALL5, - OP_RCALL6, - OP_RCALL7, - OP_RCALL8, + OP_RCALL0_v6p, + OP_RCALL1_v6p, + OP_RCALL2_v6p, + OP_RCALL3_v6p, + OP_RCALL4_v6p, + OP_RCALL5_v6p, + OP_RCALL6_v6p, + OP_RCALL7_v6p, + OP_RCALL8_v6p, - OP_RETURN_V, + OP_RETURN_V_v6p, - OP_PUSH_S, - OP_PUSH_F, - OP_PUSH_V, - OP_PUSH_ENT, - OP_PUSH_FLD, - OP_PUSH_FN, - OP_PUSH_P, - OP_PUSH_Q, - OP_PUSH_I, - OP_PUSH_D, + OP_PUSH_S_v6p, + OP_PUSH_F_v6p, + OP_PUSH_V_v6p, + OP_PUSH_ENT_v6p, + OP_PUSH_FLD_v6p, + OP_PUSH_FN_v6p, + OP_PUSH_P_v6p, + OP_PUSH_Q_v6p, + OP_PUSH_I_v6p, + OP_PUSH_D_v6p, - OP_PUSHB_S, - OP_PUSHB_F, - OP_PUSHB_V, - OP_PUSHB_ENT, - OP_PUSHB_FLD, - OP_PUSHB_FN, - OP_PUSHB_P, - OP_PUSHB_Q, - OP_PUSHB_I, - OP_PUSHB_D, + OP_PUSHB_S_v6p, + OP_PUSHB_F_v6p, + OP_PUSHB_V_v6p, + OP_PUSHB_ENT_v6p, + OP_PUSHB_FLD_v6p, + OP_PUSHB_FN_v6p, + OP_PUSHB_P_v6p, + OP_PUSHB_Q_v6p, + OP_PUSHB_I_v6p, + OP_PUSHB_D_v6p, - OP_PUSHBI_S, - OP_PUSHBI_F, - OP_PUSHBI_V, - OP_PUSHBI_ENT, - OP_PUSHBI_FLD, - OP_PUSHBI_FN, - OP_PUSHBI_P, - OP_PUSHBI_Q, - OP_PUSHBI_I, - OP_PUSHBI_D, + OP_PUSHBI_S_v6p, + OP_PUSHBI_F_v6p, + OP_PUSHBI_V_v6p, + OP_PUSHBI_ENT_v6p, + OP_PUSHBI_FLD_v6p, + OP_PUSHBI_FN_v6p, + OP_PUSHBI_P_v6p, + OP_PUSHBI_Q_v6p, + OP_PUSHBI_I_v6p, + OP_PUSHBI_D_v6p, - OP_POP_S, - OP_POP_F, - OP_POP_V, - OP_POP_ENT, - OP_POP_FLD, - OP_POP_FN, - OP_POP_P, - OP_POP_Q, - OP_POP_I, - OP_POP_D, + OP_POP_S_v6p, + OP_POP_F_v6p, + OP_POP_V_v6p, + OP_POP_ENT_v6p, + OP_POP_FLD_v6p, + OP_POP_FN_v6p, + OP_POP_P_v6p, + OP_POP_Q_v6p, + OP_POP_I_v6p, + OP_POP_D_v6p, - OP_POPB_S, - OP_POPB_F, - OP_POPB_V, - OP_POPB_ENT, - OP_POPB_FLD, - OP_POPB_FN, - OP_POPB_P, - OP_POPB_Q, - OP_POPB_I, - OP_POPB_D, + OP_POPB_S_v6p, + OP_POPB_F_v6p, + OP_POPB_V_v6p, + OP_POPB_ENT_v6p, + OP_POPB_FLD_v6p, + OP_POPB_FN_v6p, + OP_POPB_P_v6p, + OP_POPB_Q_v6p, + OP_POPB_I_v6p, + OP_POPB_D_v6p, - OP_POPBI_S, - OP_POPBI_F, - OP_POPBI_V, - OP_POPBI_ENT, - OP_POPBI_FLD, - OP_POPBI_FN, - OP_POPBI_P, - OP_POPBI_Q, - OP_POPBI_I, - OP_POPBI_D, + OP_POPBI_S_v6p, + OP_POPBI_F_v6p, + OP_POPBI_V_v6p, + OP_POPBI_ENT_v6p, + OP_POPBI_FLD_v6p, + OP_POPBI_FN_v6p, + OP_POPBI_P_v6p, + OP_POPBI_Q_v6p, + OP_POPBI_I_v6p, + OP_POPBI_D_v6p, - OP_ADD_D, - OP_SUB_D, - OP_MUL_D, - OP_MUL_QD, - OP_MUL_DQ, - OP_MUL_VD, - OP_MUL_DV, - OP_DIV_D, - OP_REM_D, - OP_GE_D, - OP_LE_D, - OP_GT_D, - OP_LT_D, - OP_NOT_D, - OP_EQ_D, - OP_NE_D, - OP_CONV_FD, - OP_CONV_DF, - OP_CONV_ID, - OP_CONV_DI, - OP_STORE_D, - OP_STOREB_D, - OP_STOREBI_D, - OP_STOREP_D, - OP_LOAD_D, - OP_LOADB_D, - OP_LOADBI_D, - OP_ADDRESS_D, + OP_ADD_D_v6p, + OP_SUB_D_v6p, + OP_MUL_D_v6p, + OP_MUL_QD_v6p, + OP_MUL_DQ_v6p, + OP_MUL_VD_v6p, + OP_MUL_DV_v6p, + OP_DIV_D_v6p, + OP_REM_D_v6p, + OP_GE_D_v6p, + OP_LE_D_v6p, + OP_GT_D_v6p, + OP_LT_D_v6p, + OP_NOT_D_v6p, + OP_EQ_D_v6p, + OP_NE_D_v6p, + OP_CONV_FD_v6p, + OP_CONV_DF_v6p, + OP_CONV_ID_v6p, + OP_CONV_DI_v6p, + OP_STORE_D_v6p, + OP_STOREB_D_v6p, + OP_STOREBI_D_v6p, + OP_STOREP_D_v6p, + OP_LOAD_D_v6p, + OP_LOADB_D_v6p, + OP_LOADBI_D_v6p, + OP_ADDRESS_D_v6p, - OP_MOD_I, - OP_MOD_F, - OP_MOD_D, + OP_MOD_I_v6p, + OP_MOD_F_v6p, + OP_MOD_D_v6p, - OP_MEMSETI, - OP_MEMSETP, - OP_MEMSETPI, -} pr_opcode_e; + OP_MEMSETI_v6p, + OP_MEMSETP_v6p, + OP_MEMSETPI_v6p, +} pr_opcode_v6p_e; #define OP_BREAK 0x8000 -typedef struct opcode_s { +typedef struct v6p_opcode_s { const char *name; const char *opname; etype_t type_a, type_b, type_c; unsigned int min_version; const char *fmt; -} opcode_t; +} v6p_opcode_t; -extern const opcode_t pr_opcodes[]; -const opcode_t *PR_Opcode (pr_short_t opcode) __attribute__((const)); +extern const v6p_opcode_t pr_v6p_opcodes[]; +const v6p_opcode_t *PR_v6p_Opcode (pr_ushort_t opcode) __attribute__((const)); void PR_Opcode_Init (void); // idempotent typedef struct dstatement_s { - pr_opcode_e op:16; + pr_opcode_v6p_e op:16; pr_ushort_t a,b,c; } GCC_STRUCT dstatement_t; diff --git a/libs/gamecode/pr_debug.c b/libs/gamecode/pr_debug.c index a720a863d..9b8d11fde 100644 --- a/libs/gamecode/pr_debug.c +++ b/libs/gamecode/pr_debug.c @@ -1482,7 +1482,7 @@ PR_PrintStatement (progs_t *pr, dstatement_t *s, int contents) int addr = s - pr->pr_statements; int dump_code = contents & 2; const char *fmt; - const opcode_t *op; + const v6p_opcode_t *op; dfunction_t *call_func = 0; pr_def_t *parm_def = 0; pr_auxfunction_t *aux_func = 0; @@ -1508,7 +1508,7 @@ PR_PrintStatement (progs_t *pr, dstatement_t *s, int contents) return; } - op = PR_Opcode (s->op); + op = PR_v6p_Opcode (s->op); if (!op) { Sys_Printf ("%sUnknown instruction %d\n", res->line->str, s->op); return; diff --git a/libs/gamecode/pr_exec.c b/libs/gamecode/pr_exec.c index fa226a417..ae6b3df4e 100644 --- a/libs/gamecode/pr_exec.c +++ b/libs/gamecode/pr_exec.c @@ -355,23 +355,23 @@ signal_hook (int sig, void *data) op_c = pr->pr_globals + st->c; switch (st->op) { - case OP_DIV_F: + case OP_DIV_F_v6p: if ((OPA(int) & 0x80000000) ^ (OPB(int) & 0x80000000)) OPC(int) = 0xff7fffff; else OPC(int) = 0x7f7fffff; return 1; - case OP_DIV_I: + case OP_DIV_I_v6p: if (OPA(int) & 0x80000000) OPC(int) = -0x80000000; else OPC(int) = 0x7fffffff; return 1; - case OP_MOD_I: - case OP_MOD_F: - case OP_REM_I: - case OP_REM_F: + case OP_MOD_I_v6p: + case OP_MOD_F_v6p: + case OP_REM_I_v6p: + case OP_REM_F_v6p: OPC(int) = 0x00000000; return 1; default: @@ -481,50 +481,50 @@ pr_exec_quakec (progs_t *pr, int exitdepth) } } - pr_opcode_e op = st->op & ~OP_BREAK; + pr_opcode_v6p_e op = st->op & ~OP_BREAK; switch (op) { - case OP_ADD_D: + case OP_ADD_D_v6p: OPC(double) = OPA(double) + OPB(double); break; - case OP_ADD_F: + case OP_ADD_F_v6p: OPC(float) = OPA(float) + OPB(float); break; - case OP_ADD_V: + case OP_ADD_V_v6p: VectorAdd (&OPA(float), &OPB(float), &OPC(float)); break; - case OP_ADD_Q: + case OP_ADD_Q_v6p: QuatAdd (&OPA(float), &OPB(float), &OPC(float)); break; - case OP_ADD_S: + case OP_ADD_S_v6p: OPC(string) = PR_CatStrings (pr, PR_GetString (pr, OPA(string)), PR_GetString (pr, OPB(string))); break; - case OP_SUB_D: + case OP_SUB_D_v6p: OPC(double) = OPA(double) - OPB(double); break; - case OP_SUB_F: + case OP_SUB_F_v6p: OPC(float) = OPA(float) - OPB(float); break; - case OP_SUB_V: + case OP_SUB_V_v6p: VectorSubtract (&OPA(float), &OPB(float), &OPC(float)); break; - case OP_SUB_Q: + case OP_SUB_Q_v6p: QuatSubtract (&OPA(float), &OPB(float), &OPC(float)); break; - case OP_MUL_D: + case OP_MUL_D_v6p: OPC(double) = OPA(double) * OPB(double); break; - case OP_MUL_F: + case OP_MUL_F_v6p: OPC(float) = OPA(float) * OPB(float); break; - case OP_MUL_V: + case OP_MUL_V_v6p: OPC(float) = DotProduct (&OPA(float), &OPB(float)); break; - case OP_MUL_DV: + case OP_MUL_DV_v6p: { // avoid issues with the likes of x = x.x * x; // makes for faster code, too @@ -532,7 +532,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) VectorScale (&OPB(float), scale, &OPC(float)); } break; - case OP_MUL_VD: + case OP_MUL_VD_v6p: { // avoid issues with the likes of x = x * x.x; // makes for faster code, too @@ -540,7 +540,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) VectorScale (&OPA(float), scale, &OPC(float)); } break; - case OP_MUL_FV: + case OP_MUL_FV_v6p: { // avoid issues with the likes of x = x.x * x; // makes for faster code, too @@ -548,7 +548,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) VectorScale (&OPB(float), scale, &OPC(float)); } break; - case OP_MUL_VF: + case OP_MUL_VF_v6p: { // avoid issues with the likes of x = x * x.x; // makes for faster code, too @@ -556,13 +556,13 @@ pr_exec_quakec (progs_t *pr, int exitdepth) VectorScale (&OPA(float), scale, &OPC(float)); } break; - case OP_MUL_Q: + case OP_MUL_Q_v6p: QuatMult (&OPA(float), &OPB(float), &OPC(float)); break; - case OP_MUL_QV: + case OP_MUL_QV_v6p: QuatMultVec (&OPA(float), &OPB(float), &OPC(float)); break; - case OP_MUL_DQ: + case OP_MUL_DQ_v6p: { // avoid issues with the likes of x = x.s * x; // makes for faster code, too @@ -570,7 +570,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) QuatScale (&OPB(float), scale, &OPC(float)); } break; - case OP_MUL_QD: + case OP_MUL_QD_v6p: { // avoid issues with the likes of x = x * x.s; // makes for faster code, too @@ -578,7 +578,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) QuatScale (&OPA(float), scale, &OPC(float)); } break; - case OP_MUL_FQ: + case OP_MUL_FQ_v6p: { // avoid issues with the likes of x = x.s * x; // makes for faster code, too @@ -586,7 +586,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) QuatScale (&OPB(float), scale, &OPC(float)); } break; - case OP_MUL_QF: + case OP_MUL_QF_v6p: { // avoid issues with the likes of x = x * x.s; // makes for faster code, too @@ -594,160 +594,160 @@ pr_exec_quakec (progs_t *pr, int exitdepth) QuatScale (&OPA(float), scale, &OPC(float)); } break; - case OP_CONJ_Q: + case OP_CONJ_Q_v6p: QuatConj (&OPA(float), &OPC(float)); break; - case OP_DIV_D: + case OP_DIV_D_v6p: OPC(double) = OPA(double) / OPB(double); break; - case OP_DIV_F: + case OP_DIV_F_v6p: OPC(float) = OPA(float) / OPB(float); break; - case OP_BITAND: + case OP_BITAND_v6p: OPC(float) = (int) OPA(float) & (int) OPB(float); break; - case OP_BITOR: + case OP_BITOR_v6p: OPC(float) = (int) OPA(float) | (int) OPB(float); break; - case OP_BITXOR_F: + case OP_BITXOR_F_v6p: OPC(float) = (int) OPA(float) ^ (int) OPB(float); break; - case OP_BITNOT_F: + case OP_BITNOT_F_v6p: OPC(float) = ~ (int) OPA(float); break; - case OP_SHL_F: + case OP_SHL_F_v6p: OPC(float) = (int) OPA(float) << (int) OPB(float); break; - case OP_SHR_F: + case OP_SHR_F_v6p: OPC(float) = (int) OPA(float) >> (int) OPB(float); break; - case OP_SHL_I: + case OP_SHL_I_v6p: OPC(int) = OPA(int) << OPB(int); break; - case OP_SHR_I: + case OP_SHR_I_v6p: OPC(int) = OPA(int) >> OPB(int); break; - case OP_SHR_U: + case OP_SHR_U_v6p: OPC(uint) = OPA(uint) >> OPB(int); break; - case OP_GE_F: + case OP_GE_F_v6p: OPC(float) = OPA(float) >= OPB(float); break; - case OP_LE_F: + case OP_LE_F_v6p: OPC(float) = OPA(float) <= OPB(float); break; - case OP_GT_F: + case OP_GT_F_v6p: OPC(float) = OPA(float) > OPB(float); break; - case OP_LT_F: + case OP_LT_F_v6p: OPC(float) = OPA(float) < OPB(float); break; - case OP_AND: // OPA and OPB have to be float for -0.0 + case OP_AND_v6p: // OPA and OPB have to be float for -0.0 OPC(int) = FNZ (OPA(uint)) && FNZ (OPB(uint)); break; - case OP_OR: // OPA and OPB have to be float for -0.0 + case OP_OR_v6p: // OPA and OPB have to be float for -0.0 OPC(int) = FNZ (OPA(uint)) || FNZ (OPB(uint)); break; - case OP_NOT_F: + case OP_NOT_F_v6p: OPC(int) = !FNZ (OPA(uint)); break; - case OP_NOT_V: + case OP_NOT_V_v6p: OPC(int) = VectorIsZero (&OPA(float)); break; - case OP_NOT_Q: + case OP_NOT_Q_v6p: OPC(int) = QuatIsZero (&OPA(float)); break; - case OP_NOT_S: + case OP_NOT_S_v6p: OPC(int) = !OPA(string) || !*PR_GetString (pr, OPA(string)); break; - case OP_NOT_FN: + case OP_NOT_FN_v6p: OPC(int) = !OPA(uint); break; - case OP_NOT_ENT: + case OP_NOT_ENT_v6p: OPC(int) = !OPA(uint); break; - case OP_EQ_F: + case OP_EQ_F_v6p: OPC(int) = OPA(float) == OPB(float); break; - case OP_EQ_V: + case OP_EQ_V_v6p: OPC(int) = VectorCompare (&OPA(float), &OPB(float)); break; - case OP_EQ_Q: + case OP_EQ_Q_v6p: OPC(int) = QuatCompare (&OPA(float), &OPB(float)); break; - case OP_EQ_E: + case OP_EQ_E_v6p: OPC(int) = OPA(int) == OPB(int); break; - case OP_EQ_FN: + case OP_EQ_FN_v6p: OPC(int) = OPA(uint) == OPB(uint); break; - case OP_NE_F: + case OP_NE_F_v6p: OPC(int) = OPA(float) != OPB(float); break; - case OP_NE_V: + case OP_NE_V_v6p: OPC(int) = !VectorCompare (&OPA(float), &OPB(float)); break; - case OP_NE_Q: + case OP_NE_Q_v6p: OPC(int) = !QuatCompare (&OPA(float), &OPB(float)); break; - case OP_LE_S: - case OP_GE_S: - case OP_LT_S: - case OP_GT_S: - case OP_NE_S: - case OP_EQ_S: + case OP_LE_S_v6p: + case OP_GE_S_v6p: + case OP_LT_S_v6p: + case OP_GT_S_v6p: + case OP_NE_S_v6p: + case OP_EQ_S_v6p: { int cmp = strcmp (PR_GetString (pr, OPA(string)), PR_GetString (pr, OPB(string))); switch (st->op) { - case OP_LE_S: cmp = (cmp <= 0); break; - case OP_GE_S: cmp = (cmp >= 0); break; - case OP_LT_S: cmp = (cmp < 0); break; - case OP_GT_S: cmp = (cmp > 0); break; - case OP_NE_S: break; - case OP_EQ_S: cmp = !cmp; break; + case OP_LE_S_v6p: cmp = (cmp <= 0); break; + case OP_GE_S_v6p: cmp = (cmp >= 0); break; + case OP_LT_S_v6p: cmp = (cmp < 0); break; + case OP_GT_S_v6p: cmp = (cmp > 0); break; + case OP_NE_S_v6p: break; + case OP_EQ_S_v6p: cmp = !cmp; break; default: break; } OPC(int) = cmp; } break; - case OP_NE_E: + case OP_NE_E_v6p: OPC(int) = OPA(int) != OPB(int); break; - case OP_NE_FN: + case OP_NE_FN_v6p: OPC(int) = OPA(uint) != OPB(uint); break; // ================== - case OP_STORE_F: - case OP_STORE_ENT: - case OP_STORE_FLD: // integers - case OP_STORE_S: - case OP_STORE_FN: // pointers - case OP_STORE_I: - case OP_STORE_P: + case OP_STORE_F_v6p: + case OP_STORE_ENT_v6p: + case OP_STORE_FLD_v6p: // integers + case OP_STORE_S_v6p: + case OP_STORE_FN_v6p: // pointers + case OP_STORE_I_v6p: + case OP_STORE_P_v6p: OPB(int) = OPA(int); break; - case OP_STORE_V: + case OP_STORE_V_v6p: VectorCopy (&OPA(float), &OPB(float)); break; - case OP_STORE_Q: + case OP_STORE_Q_v6p: QuatCopy (&OPA(float), &OPB(float)); break; - case OP_STORE_D: + case OP_STORE_D_v6p: OPB(double) = OPA(double); break; - case OP_STOREP_F: - case OP_STOREP_ENT: - case OP_STOREP_FLD: // integers - case OP_STOREP_S: - case OP_STOREP_FN: // pointers - case OP_STOREP_I: - case OP_STOREP_P: + case OP_STOREP_F_v6p: + case OP_STOREP_ENT_v6p: + case OP_STOREP_FLD_v6p: // integers + case OP_STOREP_S_v6p: + case OP_STOREP_FN_v6p: // pointers + case OP_STOREP_I_v6p: + case OP_STOREP_P_v6p: pointer = OPB(int); if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_integer); @@ -755,7 +755,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) ptr = pr->pr_globals + pointer; ptr->integer_var = OPA(int); break; - case OP_STOREP_V: + case OP_STOREP_V_v6p: pointer = OPB(int); if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_vector); @@ -763,7 +763,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) ptr = pr->pr_globals + pointer; VectorCopy (&OPA(float), &ptr->vector_var); break; - case OP_STOREP_Q: + case OP_STOREP_Q_v6p: pointer = OPB(int); if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_quat); @@ -771,7 +771,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) ptr = pr->pr_globals + pointer; QuatCopy (&OPA(float), &ptr->quat_var); break; - case OP_STOREP_D: + case OP_STOREP_D_v6p: pointer = OPB(int); if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_double); @@ -780,7 +780,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) *(double *) ptr = OPA(double); break; - case OP_ADDRESS: + case OP_ADDRESS_v6p: if (pr_boundscheck->int_val) { if (OPA(uint) >= pr->pr_edict_area_size) PR_RunError (pr, "Progs attempted to address an out " @@ -794,27 +794,27 @@ pr_exec_quakec (progs_t *pr, int exitdepth) fldofs = OPA(uint) + OPB(int); OPC(int) = &pr->pr_edict_area[fldofs] - pr->pr_globals; break; - case OP_ADDRESS_VOID: - case OP_ADDRESS_F: - case OP_ADDRESS_V: - case OP_ADDRESS_Q: - case OP_ADDRESS_S: - case OP_ADDRESS_ENT: - case OP_ADDRESS_FLD: - case OP_ADDRESS_FN: - case OP_ADDRESS_I: - case OP_ADDRESS_P: - case OP_ADDRESS_D: + case OP_ADDRESS_VOID_v6p: + case OP_ADDRESS_F_v6p: + case OP_ADDRESS_V_v6p: + case OP_ADDRESS_Q_v6p: + case OP_ADDRESS_S_v6p: + case OP_ADDRESS_ENT_v6p: + case OP_ADDRESS_FLD_v6p: + case OP_ADDRESS_FN_v6p: + case OP_ADDRESS_I_v6p: + case OP_ADDRESS_P_v6p: + case OP_ADDRESS_D_v6p: OPC(int) = st->a; break; - case OP_LOAD_F: - case OP_LOAD_FLD: - case OP_LOAD_ENT: - case OP_LOAD_S: - case OP_LOAD_FN: - case OP_LOAD_I: - case OP_LOAD_P: + case OP_LOAD_F_v6p: + case OP_LOAD_FLD_v6p: + case OP_LOAD_ENT_v6p: + case OP_LOAD_S_v6p: + case OP_LOAD_FN_v6p: + case OP_LOAD_I_v6p: + case OP_LOAD_P_v6p: if (pr_boundscheck->int_val) { if (OPA(uint) >= pr->pr_edict_area_size) PR_RunError (pr, "Progs attempted to read an out of " @@ -826,7 +826,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) fldofs = OPA(uint) + OPB(int); OPC(int) = pr->pr_edict_area[fldofs].integer_var; break; - case OP_LOAD_V: + case OP_LOAD_V_v6p: if (pr_boundscheck->int_val) { if (OPA(uint) >= pr->pr_edict_area_size) PR_RunError (pr, "Progs attempted to read an out of " @@ -838,7 +838,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) fldofs = OPA(uint) + OPB(int); memcpy (op_c, &pr->pr_edict_area[fldofs], 3 * sizeof (*op_c)); break; - case OP_LOAD_Q: + case OP_LOAD_Q_v6p: if (pr_boundscheck->int_val) { if (OPA(uint) >= pr->pr_edict_area_size) PR_RunError (pr, "Progs attempted to read an out of " @@ -850,7 +850,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) fldofs = OPA(uint) + OPB(int); memcpy (op_c, &pr->pr_edict_area[fldofs], 4 * sizeof (*op_c)); break; - case OP_LOAD_D: + case OP_LOAD_D_v6p: if (pr_boundscheck->int_val) { if (OPA(uint) >= pr->pr_edict_area_size) PR_RunError (pr, "Progs attempted to read an out of " @@ -863,13 +863,13 @@ pr_exec_quakec (progs_t *pr, int exitdepth) memcpy (op_c, &pr->pr_edict_area[fldofs], sizeof (double)); break; - case OP_LOADB_F: - case OP_LOADB_S: - case OP_LOADB_ENT: - case OP_LOADB_FLD: - case OP_LOADB_FN: - case OP_LOADB_I: - case OP_LOADB_P: + case OP_LOADB_F_v6p: + case OP_LOADB_S_v6p: + case OP_LOADB_ENT_v6p: + case OP_LOADB_FLD_v6p: + case OP_LOADB_FN_v6p: + case OP_LOADB_I_v6p: + case OP_LOADB_P_v6p: pointer = OPA(int) + OPB(int); if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_integer); @@ -877,7 +877,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) ptr = pr->pr_globals + pointer; OPC(int) = ptr->integer_var; break; - case OP_LOADB_V: + case OP_LOADB_V_v6p: pointer = OPA(int) + OPB(int); if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_vector); @@ -885,7 +885,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) ptr = pr->pr_globals + pointer; VectorCopy (&ptr->vector_var, &OPC(float)); break; - case OP_LOADB_Q: + case OP_LOADB_Q_v6p: pointer = OPA(int) + OPB(int); if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_quat); @@ -893,7 +893,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) ptr = pr->pr_globals + pointer; QuatCopy (&ptr->quat_var, &OPC(float)); break; - case OP_LOADB_D: + case OP_LOADB_D_v6p: pointer = OPA(int) + OPB(int); if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_double); @@ -902,13 +902,13 @@ pr_exec_quakec (progs_t *pr, int exitdepth) OPC(double) = *(double *) ptr; break; - case OP_LOADBI_F: - case OP_LOADBI_S: - case OP_LOADBI_ENT: - case OP_LOADBI_FLD: - case OP_LOADBI_FN: - case OP_LOADBI_I: - case OP_LOADBI_P: + case OP_LOADBI_F_v6p: + case OP_LOADBI_S_v6p: + case OP_LOADBI_ENT_v6p: + case OP_LOADBI_FLD_v6p: + case OP_LOADBI_FN_v6p: + case OP_LOADBI_I_v6p: + case OP_LOADBI_P_v6p: pointer = OPA(int) + (short) st->b; if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_integer); @@ -916,7 +916,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) ptr = pr->pr_globals + pointer; OPC(int) = ptr->integer_var; break; - case OP_LOADBI_V: + case OP_LOADBI_V_v6p: pointer = OPA(int) + (short) st->b; if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_vector); @@ -924,7 +924,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) ptr = pr->pr_globals + pointer; VectorCopy (&ptr->vector_var, &OPC(float)); break; - case OP_LOADBI_Q: + case OP_LOADBI_Q_v6p: pointer = OPA(int) + (short) st->b; if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_quat); @@ -932,7 +932,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) ptr = pr->pr_globals + pointer; QuatCopy (&ptr->quat_var, &OPC(float)); break; - case OP_LOADBI_D: + case OP_LOADBI_D_v6p: pointer = OPA(int) + (short) st->b; if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_quat); @@ -941,23 +941,23 @@ pr_exec_quakec (progs_t *pr, int exitdepth) OPC(double) = *(double *) ptr; break; - case OP_LEA: + case OP_LEA_v6p: pointer = OPA(int) + OPB(int); OPC(int) = pointer; break; - case OP_LEAI: + case OP_LEAI_v6p: pointer = OPA(int) + (short) st->b; OPC(int) = pointer; break; - case OP_STOREB_F: - case OP_STOREB_S: - case OP_STOREB_ENT: - case OP_STOREB_FLD: - case OP_STOREB_FN: - case OP_STOREB_I: - case OP_STOREB_P: + case OP_STOREB_F_v6p: + case OP_STOREB_S_v6p: + case OP_STOREB_ENT_v6p: + case OP_STOREB_FLD_v6p: + case OP_STOREB_FN_v6p: + case OP_STOREB_I_v6p: + case OP_STOREB_P_v6p: pointer = OPB(int) + OPC(int); if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_integer); @@ -965,7 +965,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) ptr = pr->pr_globals + pointer; ptr->integer_var = OPA(int); break; - case OP_STOREB_V: + case OP_STOREB_V_v6p: pointer = OPB(int) + OPC(int); if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_vector); @@ -973,7 +973,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) ptr = pr->pr_globals + pointer; VectorCopy (&OPA(float), &ptr->vector_var); break; - case OP_STOREB_Q: + case OP_STOREB_Q_v6p: pointer = OPB(int) + OPC(int); if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_quat); @@ -981,7 +981,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) ptr = pr->pr_globals + pointer; QuatCopy (&OPA(float), &ptr->quat_var); break; - case OP_STOREB_D: + case OP_STOREB_D_v6p: pointer = OPB(int) + OPC(int); if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_quat); @@ -990,13 +990,13 @@ pr_exec_quakec (progs_t *pr, int exitdepth) *(double *) ptr = OPA(double); break; - case OP_STOREBI_F: - case OP_STOREBI_S: - case OP_STOREBI_ENT: - case OP_STOREBI_FLD: - case OP_STOREBI_FN: - case OP_STOREBI_I: - case OP_STOREBI_P: + case OP_STOREBI_F_v6p: + case OP_STOREBI_S_v6p: + case OP_STOREBI_ENT_v6p: + case OP_STOREBI_FLD_v6p: + case OP_STOREBI_FN_v6p: + case OP_STOREBI_I_v6p: + case OP_STOREBI_P_v6p: pointer = OPB(int) + (short) st->c; if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_integer); @@ -1004,7 +1004,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) ptr = pr->pr_globals + pointer; ptr->integer_var = OPA(int); break; - case OP_STOREBI_V: + case OP_STOREBI_V_v6p: pointer = OPB(int) + (short) st->c; if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_vector); @@ -1012,7 +1012,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) ptr = pr->pr_globals + pointer; VectorCopy (&OPA(float), &ptr->vector_var); break; - case OP_STOREBI_Q: + case OP_STOREBI_Q_v6p: pointer = OPB(int) + (short) st->c; if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_quat); @@ -1020,7 +1020,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) ptr = pr->pr_globals + pointer; QuatCopy (&OPA(float), &ptr->quat_var); break; - case OP_STOREBI_D: + case OP_STOREBI_D_v6p: pointer = OPB(int) + (short) st->c; if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_quat); @@ -1029,13 +1029,13 @@ pr_exec_quakec (progs_t *pr, int exitdepth) *(double *) ptr = OPA(double); break; - case OP_PUSH_F: - case OP_PUSH_FLD: - case OP_PUSH_ENT: - case OP_PUSH_S: - case OP_PUSH_FN: - case OP_PUSH_I: - case OP_PUSH_P: + case OP_PUSH_F_v6p: + case OP_PUSH_FLD_v6p: + case OP_PUSH_ENT_v6p: + case OP_PUSH_S_v6p: + case OP_PUSH_FN_v6p: + case OP_PUSH_I_v6p: + case OP_PUSH_P_v6p: { pointer_t stack = *pr->globals.stack - 1; pr_type_t *stk = pr->pr_globals + stack; @@ -1046,7 +1046,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) *pr->globals.stack = stack; } break; - case OP_PUSH_V: + case OP_PUSH_V_v6p: { pointer_t stack = *pr->globals.stack - 3; pr_type_t *stk = pr->pr_globals + stack; @@ -1057,7 +1057,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) *pr->globals.stack = stack; } break; - case OP_PUSH_Q: + case OP_PUSH_Q_v6p: { pointer_t stack = *pr->globals.stack - 4; pr_type_t *stk = pr->pr_globals + stack; @@ -1069,13 +1069,13 @@ pr_exec_quakec (progs_t *pr, int exitdepth) } break; - case OP_PUSHB_F: - case OP_PUSHB_S: - case OP_PUSHB_ENT: - case OP_PUSHB_FLD: - case OP_PUSHB_FN: - case OP_PUSHB_I: - case OP_PUSHB_P: + case OP_PUSHB_F_v6p: + case OP_PUSHB_S_v6p: + case OP_PUSHB_ENT_v6p: + case OP_PUSHB_FLD_v6p: + case OP_PUSHB_FN_v6p: + case OP_PUSHB_I_v6p: + case OP_PUSHB_P_v6p: { pointer_t stack = *pr->globals.stack - 1; pr_type_t *stk = pr->pr_globals + stack; @@ -1092,7 +1092,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) *pr->globals.stack = stack; } break; - case OP_PUSHB_V: + case OP_PUSHB_V_v6p: { pointer_t stack = *pr->globals.stack - 3; pr_type_t *stk = pr->pr_globals + stack; @@ -1109,7 +1109,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) *pr->globals.stack = stack; } break; - case OP_PUSHB_Q: + case OP_PUSHB_Q_v6p: { pointer_t stack = *pr->globals.stack - 4; pr_type_t *stk = pr->pr_globals + stack; @@ -1127,13 +1127,13 @@ pr_exec_quakec (progs_t *pr, int exitdepth) } break; - case OP_PUSHBI_F: - case OP_PUSHBI_S: - case OP_PUSHBI_ENT: - case OP_PUSHBI_FLD: - case OP_PUSHBI_FN: - case OP_PUSHBI_I: - case OP_PUSHBI_P: + case OP_PUSHBI_F_v6p: + case OP_PUSHBI_S_v6p: + case OP_PUSHBI_ENT_v6p: + case OP_PUSHBI_FLD_v6p: + case OP_PUSHBI_FN_v6p: + case OP_PUSHBI_I_v6p: + case OP_PUSHBI_P_v6p: { pointer_t stack = *pr->globals.stack - 1; pr_type_t *stk = pr->pr_globals + stack; @@ -1150,7 +1150,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) *pr->globals.stack = stack; } break; - case OP_PUSHBI_V: + case OP_PUSHBI_V_v6p: { pointer_t stack = *pr->globals.stack - 3; pr_type_t *stk = pr->pr_globals + stack; @@ -1167,7 +1167,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) *pr->globals.stack = stack; } break; - case OP_PUSHBI_Q: + case OP_PUSHBI_Q_v6p: { pointer_t stack = *pr->globals.stack - 4; pr_type_t *stk = pr->pr_globals + stack; @@ -1185,13 +1185,13 @@ pr_exec_quakec (progs_t *pr, int exitdepth) } break; - case OP_POP_F: - case OP_POP_FLD: - case OP_POP_ENT: - case OP_POP_S: - case OP_POP_FN: - case OP_POP_I: - case OP_POP_P: + case OP_POP_F_v6p: + case OP_POP_FLD_v6p: + case OP_POP_ENT_v6p: + case OP_POP_S_v6p: + case OP_POP_FN_v6p: + case OP_POP_I_v6p: + case OP_POP_P_v6p: { pointer_t stack = *pr->globals.stack; pr_type_t *stk = pr->pr_globals + stack; @@ -1202,7 +1202,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) *pr->globals.stack = stack + 1; } break; - case OP_POP_V: + case OP_POP_V_v6p: { pointer_t stack = *pr->globals.stack; pr_type_t *stk = pr->pr_globals + stack; @@ -1213,7 +1213,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) *pr->globals.stack = stack + 3; } break; - case OP_POP_Q: + case OP_POP_Q_v6p: { pointer_t stack = *pr->globals.stack; pr_type_t *stk = pr->pr_globals + stack; @@ -1225,13 +1225,13 @@ pr_exec_quakec (progs_t *pr, int exitdepth) } break; - case OP_POPB_F: - case OP_POPB_S: - case OP_POPB_ENT: - case OP_POPB_FLD: - case OP_POPB_FN: - case OP_POPB_I: - case OP_POPB_P: + case OP_POPB_F_v6p: + case OP_POPB_S_v6p: + case OP_POPB_ENT_v6p: + case OP_POPB_FLD_v6p: + case OP_POPB_FN_v6p: + case OP_POPB_I_v6p: + case OP_POPB_P_v6p: { pointer_t stack = *pr->globals.stack; pr_type_t *stk = pr->pr_globals + stack; @@ -1248,7 +1248,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) *pr->globals.stack = stack + 1; } break; - case OP_POPB_V: + case OP_POPB_V_v6p: { pointer_t stack = *pr->globals.stack; pr_type_t *stk = pr->pr_globals + stack; @@ -1265,7 +1265,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) *pr->globals.stack = stack + 3; } break; - case OP_POPB_Q: + case OP_POPB_Q_v6p: { pointer_t stack = *pr->globals.stack; pr_type_t *stk = pr->pr_globals + stack; @@ -1283,13 +1283,13 @@ pr_exec_quakec (progs_t *pr, int exitdepth) } break; - case OP_POPBI_F: - case OP_POPBI_S: - case OP_POPBI_ENT: - case OP_POPBI_FLD: - case OP_POPBI_FN: - case OP_POPBI_I: - case OP_POPBI_P: + case OP_POPBI_F_v6p: + case OP_POPBI_S_v6p: + case OP_POPBI_ENT_v6p: + case OP_POPBI_FLD_v6p: + case OP_POPBI_FN_v6p: + case OP_POPBI_I_v6p: + case OP_POPBI_P_v6p: { pointer_t stack = *pr->globals.stack; pr_type_t *stk = pr->pr_globals + stack; @@ -1306,7 +1306,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) *pr->globals.stack = stack + 1; } break; - case OP_POPBI_V: + case OP_POPBI_V_v6p: { pointer_t stack = *pr->globals.stack; pr_type_t *stk = pr->pr_globals + stack; @@ -1323,7 +1323,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) *pr->globals.stack = stack + 3; } break; - case OP_POPBI_Q: + case OP_POPBI_Q_v6p: { pointer_t stack = *pr->globals.stack; pr_type_t *stk = pr->pr_globals + stack; @@ -1342,47 +1342,47 @@ pr_exec_quakec (progs_t *pr, int exitdepth) break; // ================== - case OP_IFNOT: + case OP_IFNOT_v6p: if (!OPA(int)) { pr->pr_xstatement += (short)st->b - 1; // offset the st++ st = pr->pr_statements + pr->pr_xstatement; } break; - case OP_IF: + case OP_IF_v6p: if (OPA(int)) { pr->pr_xstatement += (short)st->b - 1; // offset the st++ st = pr->pr_statements + pr->pr_xstatement; } break; - case OP_IFBE: + case OP_IFBE_v6p: if (OPA(int) <= 0) { pr->pr_xstatement += (short)st->b - 1; // offset the st++ st = pr->pr_statements + pr->pr_xstatement; } break; - case OP_IFB: + case OP_IFB_v6p: if (OPA(int) < 0) { pr->pr_xstatement += (short)st->b - 1; // offset the st++ st = pr->pr_statements + pr->pr_xstatement; } break; - case OP_IFAE: + case OP_IFAE_v6p: if (OPA(int) >= 0) { pr->pr_xstatement += (short)st->b - 1; // offset the st++ st = pr->pr_statements + pr->pr_xstatement; } break; - case OP_IFA: + case OP_IFA_v6p: if (OPA(int) > 0) { pr->pr_xstatement += (short)st->b - 1; // offset the st++ st = pr->pr_statements + pr->pr_xstatement; } break; - case OP_GOTO: + case OP_GOTO_v6p: pr->pr_xstatement += (short)st->a - 1; // offset the st++ st = pr->pr_statements + pr->pr_xstatement; break; - case OP_JUMP: + case OP_JUMP_v6p: if (pr_boundscheck->int_val && (OPA(uint) >= pr->progs->numstatements)) { PR_RunError (pr, "Invalid jump destination"); @@ -1390,7 +1390,7 @@ pr_exec_quakec (progs_t *pr, int exitdepth) pr->pr_xstatement = OPA(uint) - 1; // offset the st++ st = pr->pr_statements + pr->pr_xstatement; break; - case OP_JUMPB: + case OP_JUMPB_v6p: pointer = st->a + OPB(int); if (pr_boundscheck->int_val) { PR_BoundsCheck (pr, pointer, ev_integer); @@ -1405,40 +1405,40 @@ pr_exec_quakec (progs_t *pr, int exitdepth) st = pr->pr_statements + pr->pr_xstatement; break; - case OP_RCALL2: - case OP_RCALL3: - case OP_RCALL4: - case OP_RCALL5: - case OP_RCALL6: - case OP_RCALL7: - case OP_RCALL8: + case OP_RCALL2_v6p: + case OP_RCALL3_v6p: + case OP_RCALL4_v6p: + case OP_RCALL5_v6p: + case OP_RCALL6_v6p: + case OP_RCALL7_v6p: + case OP_RCALL8_v6p: pr->pr_params[1] = op_c; goto op_rcall; - case OP_RCALL1: + case OP_RCALL1_v6p: pr->pr_params[1] = pr->pr_real_params[1]; op_rcall: pr->pr_params[0] = op_b; - pr->pr_argc = st->op - OP_RCALL1 + 1; + pr->pr_argc = st->op - OP_RCALL1_v6p + 1; goto op_call; - case OP_CALL0: - case OP_CALL1: - case OP_CALL2: - case OP_CALL3: - case OP_CALL4: - case OP_CALL5: - case OP_CALL6: - case OP_CALL7: - case OP_CALL8: + case OP_CALL0_v6p: + case OP_CALL1_v6p: + case OP_CALL2_v6p: + case OP_CALL3_v6p: + case OP_CALL4_v6p: + case OP_CALL5_v6p: + case OP_CALL6_v6p: + case OP_CALL7_v6p: + case OP_CALL8_v6p: PR_RESET_PARAMS (pr); - pr->pr_argc = st->op - OP_CALL0; + pr->pr_argc = st->op - OP_CALL0_v6p; op_call: pr->pr_xfunction->profile += profile - startprofile; startprofile = profile; PR_CallFunction (pr, OPA(uint)); st = pr->pr_statements + pr->pr_xstatement; break; - case OP_DONE: - case OP_RETURN: + case OP_DONE_v6p: + case OP_RETURN_v6p: if (!st->a) memset (&R_INT (pr), 0, pr->pr_param_size * sizeof (*op_a)); @@ -1446,7 +1446,7 @@ op_call: memcpy (&R_INT (pr), op_a, pr->pr_param_size * sizeof (*op_a)); // fallthrough - case OP_RETURN_V: + case OP_RETURN_V_v6p: pr->pr_xfunction->profile += profile - startprofile; startprofile = profile; PR_LeaveFunction (pr, pr->pr_depth == exitdepth); @@ -1458,7 +1458,7 @@ op_call: goto exit_program; } break; - case OP_STATE: + case OP_STATE_v6p: { int self = *pr->globals.self; int nextthink = pr->fields.nextthink + self; @@ -1470,7 +1470,7 @@ op_call: pr->pr_edict_area[think].func_var = OPB(uint); } break; - case OP_STATE_F: + case OP_STATE_F_v6p: { int self = *pr->globals.self; int nextthink = pr->fields.nextthink + self; @@ -1482,19 +1482,19 @@ op_call: pr->pr_edict_area[think].func_var = OPB(uint); } break; - case OP_ADD_I: + case OP_ADD_I_v6p: OPC(int) = OPA(int) + OPB(int); break; - case OP_SUB_I: + case OP_SUB_I_v6p: OPC(int) = OPA(int) - OPB(int); break; - case OP_MUL_I: + case OP_MUL_I_v6p: OPC(int) = OPA(int) * OPB(int); break; - case OP_DIV_I: + case OP_DIV_I_v6p: OPC(int) = OPA(int) / OPB(int); break; - case OP_MOD_I: + case OP_MOD_I_v6p: { // implement true modulo for integers: // 5 mod 3 = 2 @@ -1512,10 +1512,10 @@ op_call: OPC(int) = c + (mask & b); } break; - case OP_REM_I: + case OP_REM_I_v6p: OPC(int) = OPA(int) % OPB(int); break; - case OP_MOD_D: + case OP_MOD_D_v6p: { double a = OPA(double); double b = OPB(double); @@ -1523,98 +1523,98 @@ op_call: OPC(double) = a - b * floor (a / b); } break; - case OP_REM_D: + case OP_REM_D_v6p: { double a = OPA(double); double b = OPB(double); OPC(double) = a - b * trunc (a / b); } break; - case OP_MOD_F: + case OP_MOD_F_v6p: { float a = OPA(float); float b = OPB(float); OPC(float) = a - b * floorf (a / b); } break; - case OP_REM_F: + case OP_REM_F_v6p: { float a = OPA(float); float b = OPB(float); OPC(float) = a - b * truncf (a / b); } break; - case OP_CONV_IF: + case OP_CONV_IF_v6p: OPC(float) = OPA(int); break; - case OP_CONV_FI: + case OP_CONV_FI_v6p: OPC(int) = OPA(float); break; - case OP_BITAND_I: + case OP_BITAND_I_v6p: OPC(int) = OPA(int) & OPB(int); break; - case OP_BITOR_I: + case OP_BITOR_I_v6p: OPC(int) = OPA(int) | OPB(int); break; - case OP_BITXOR_I: + case OP_BITXOR_I_v6p: OPC(int) = OPA(int) ^ OPB(int); break; - case OP_BITNOT_I: + case OP_BITNOT_I_v6p: OPC(int) = ~OPA(int); break; - case OP_GE_I: - case OP_GE_P: + case OP_GE_I_v6p: + case OP_GE_P_v6p: OPC(int) = OPA(int) >= OPB(int); break; - case OP_GE_U: + case OP_GE_U_v6p: OPC(int) = OPA(uint) >= OPB(uint); break; - case OP_LE_I: - case OP_LE_P: + case OP_LE_I_v6p: + case OP_LE_P_v6p: OPC(int) = OPA(int) <= OPB(int); break; - case OP_LE_U: + case OP_LE_U_v6p: OPC(int) = OPA(uint) <= OPB(uint); break; - case OP_GT_I: - case OP_GT_P: + case OP_GT_I_v6p: + case OP_GT_P_v6p: OPC(int) = OPA(int) > OPB(int); break; - case OP_GT_U: + case OP_GT_U_v6p: OPC(int) = OPA(uint) > OPB(uint); break; - case OP_LT_I: - case OP_LT_P: + case OP_LT_I_v6p: + case OP_LT_P_v6p: OPC(int) = OPA(int) < OPB(int); break; - case OP_LT_U: + case OP_LT_U_v6p: OPC(int) = OPA(uint) < OPB(uint); break; - case OP_AND_I: + case OP_AND_I_v6p: OPC(int) = OPA(int) && OPB(int); break; - case OP_OR_I: + case OP_OR_I_v6p: OPC(int) = OPA(int) || OPB(int); break; - case OP_NOT_I: - case OP_NOT_P: + case OP_NOT_I_v6p: + case OP_NOT_P_v6p: OPC(int) = !OPA(int); break; - case OP_EQ_I: - case OP_EQ_P: + case OP_EQ_I_v6p: + case OP_EQ_P_v6p: OPC(int) = OPA(int) == OPB(int); break; - case OP_NE_I: - case OP_NE_P: + case OP_NE_I_v6p: + case OP_NE_P_v6p: OPC(int) = OPA(int) != OPB(int); break; - case OP_MOVEI: + case OP_MOVEI_v6p: memmove (op_c, op_a, st->b * 4); break; - case OP_MOVEP: + case OP_MOVEP_v6p: if (pr_boundscheck->int_val) { PR_BoundsCheckSize (pr, OPC(int), OPB(uint)); PR_BoundsCheckSize (pr, OPA(int), OPB(uint)); @@ -1623,7 +1623,7 @@ op_call: pr->pr_globals + OPA(int), OPB(uint) * 4); break; - case OP_MOVEPI: + case OP_MOVEPI_v6p: if (pr_boundscheck->int_val) { PR_BoundsCheckSize (pr, OPC(int), st->b); PR_BoundsCheckSize (pr, OPA(int), st->b); @@ -1632,61 +1632,61 @@ op_call: pr->pr_globals + OPA(int), st->b * 4); break; - case OP_MEMSETI: + case OP_MEMSETI_v6p: pr_memset (op_c, OPA(int), st->b); break; - case OP_MEMSETP: + case OP_MEMSETP_v6p: if (pr_boundscheck->int_val) { PR_BoundsCheckSize (pr, OPC(pointer), OPB(int)); } pr_memset (pr->pr_globals + OPC(pointer), OPA(int), OPB(int)); break; - case OP_MEMSETPI: + case OP_MEMSETPI_v6p: if (pr_boundscheck->int_val) { PR_BoundsCheckSize (pr, OPC(pointer), st->b); } pr_memset (pr->pr_globals + OPC(pointer), OPA(int), st->b); break; - case OP_GE_D: + case OP_GE_D_v6p: OPC(float) = OPA(double) >= OPB(double); break; - case OP_LE_D: + case OP_LE_D_v6p: OPC(float) = OPA(double) <= OPB(double); break; - case OP_GT_D: + case OP_GT_D_v6p: OPC(float) = OPA(double) > OPB(double); break; - case OP_LT_D: + case OP_LT_D_v6p: OPC(float) = OPA(double) < OPB(double); break; - case OP_NOT_D: + case OP_NOT_D_v6p: OPC(int) = (op_a[0].integer_var || (op_a[1].integer_var & ~0x80000000u)); break; - case OP_EQ_D: + case OP_EQ_D_v6p: OPC(int) = OPA(double) == OPB(double); break; - case OP_NE_D: + case OP_NE_D_v6p: OPC(int) = OPA(double) != OPB(double); break; - case OP_CONV_ID: + case OP_CONV_ID_v6p: OPC(double) = OPA(int); break; - case OP_CONV_DI: + case OP_CONV_DI_v6p: OPC(int) = OPA(double); break; - case OP_CONV_FD: + case OP_CONV_FD_v6p: OPC(double) = OPA(float); break; - case OP_CONV_DF: + case OP_CONV_DF_v6p: OPC(float) = OPA(double); break; // LordHavoc: to be enabled when Progs version 7 (or whatever it will be numbered) is finalized /* - case OP_BOUNDCHECK: + case OP_BOUNDCHECK_v6p: if (OPA(int) < 0 || OPA(int) >= st->b) { PR_RunError (pr, "Progs boundcheck failed at line number " "%d, value is < 0 or >= %d", st->b, st->c); diff --git a/libs/gamecode/pr_opcode.c b/libs/gamecode/pr_opcode.c index 955cc0796..17d640575 100644 --- a/libs/gamecode/pr_opcode.c +++ b/libs/gamecode/pr_opcode.c @@ -95,1431 +95,1431 @@ VISIBLE const char * const pr_type_name[ev_type_count] = { // c operand c // x place holder for P (padding) // 0-7 parameter index (for P) -VISIBLE const opcode_t pr_opcodes[] = { - // OP_DONE is actually the same as OP_RETURN, the types are bogus - [OP_DONE] = {"", "done", +VISIBLE const v6p_opcode_t pr_v6p_opcodes[] = { + // OP_DONE_v6p is actually the same as OP_RETURN_v6p, the types are bogus + [OP_DONE_v6p] = {"", "done", ev_entity, ev_field, ev_void, PROG_ID_VERSION, "%Va", }, - [OP_MUL_D] = {"*", "mul.d", + [OP_MUL_D_v6p] = {"*", "mul.d", ev_double, ev_double, ev_double, PROG_VERSION, }, - [OP_MUL_F] = {"*", "mul.f", + [OP_MUL_F_v6p] = {"*", "mul.f", ev_float, ev_float, ev_float, PROG_ID_VERSION, }, - [OP_MUL_V] = {"*", "mul.v", + [OP_MUL_V_v6p] = {"*", "mul.v", ev_vector, ev_vector, ev_float, PROG_ID_VERSION, }, - [OP_MUL_FV] = {"*", "mul.fv", + [OP_MUL_FV_v6p] = {"*", "mul.fv", ev_float, ev_vector, ev_vector, PROG_ID_VERSION, }, - [OP_MUL_VF] = {"*", "mul.vf", + [OP_MUL_VF_v6p] = {"*", "mul.vf", ev_vector, ev_float, ev_vector, PROG_ID_VERSION, }, - [OP_MUL_DV] = {"*", "mul.dv", + [OP_MUL_DV_v6p] = {"*", "mul.dv", ev_double, ev_vector, ev_vector, PROG_ID_VERSION, }, - [OP_MUL_VD] = {"*", "mul.vd", + [OP_MUL_VD_v6p] = {"*", "mul.vd", ev_vector, ev_double, ev_vector, PROG_ID_VERSION, }, - [OP_MUL_Q] = {"*", "mul.q", + [OP_MUL_Q_v6p] = {"*", "mul.q", ev_quat, ev_quat, ev_quat, PROG_VERSION, }, - [OP_MUL_FQ] = {"*", "mul.fq", + [OP_MUL_FQ_v6p] = {"*", "mul.fq", ev_float, ev_quat, ev_quat, PROG_VERSION, }, - [OP_MUL_QF] = {"*", "mul.qf", + [OP_MUL_QF_v6p] = {"*", "mul.qf", ev_quat, ev_float, ev_quat, PROG_VERSION, }, - [OP_MUL_DQ] = {"*", "mul.dq", + [OP_MUL_DQ_v6p] = {"*", "mul.dq", ev_double, ev_quat, ev_quat, PROG_VERSION, }, - [OP_MUL_QD] = {"*", "mul.qd", + [OP_MUL_QD_v6p] = {"*", "mul.qd", ev_quat, ev_double, ev_quat, PROG_VERSION, }, - [OP_MUL_QV] = {"*", "mul.qv", + [OP_MUL_QV_v6p] = {"*", "mul.qv", ev_quat, ev_vector, ev_vector, PROG_VERSION, }, - [OP_CONJ_Q] = {"~", "conj.q", + [OP_CONJ_Q_v6p] = {"~", "conj.q", ev_quat, ev_invalid, ev_quat, PROG_VERSION, "%Ga, %gc", }, - [OP_DIV_F] = {"/", "div.f", + [OP_DIV_F_v6p] = {"/", "div.f", ev_float, ev_float, ev_float, PROG_ID_VERSION, }, - [OP_DIV_D] = {"/", "div.d", + [OP_DIV_D_v6p] = {"/", "div.d", ev_double, ev_double, ev_double, PROG_VERSION, }, - [OP_REM_D] = {"%", "rem.d", + [OP_REM_D_v6p] = {"%", "rem.d", ev_double, ev_double, ev_double, PROG_VERSION, }, - [OP_MOD_D] = {"%%", "mod.d", + [OP_MOD_D_v6p] = {"%%", "mod.d", ev_double, ev_double, ev_double, PROG_VERSION, }, - [OP_ADD_D] = {"+", "add.d", + [OP_ADD_D_v6p] = {"+", "add.d", ev_double, ev_double, ev_double, PROG_VERSION, }, - [OP_ADD_F] = {"+", "add.f", + [OP_ADD_F_v6p] = {"+", "add.f", ev_float, ev_float, ev_float, PROG_ID_VERSION, }, - [OP_ADD_V] = {"+", "add.v", + [OP_ADD_V_v6p] = {"+", "add.v", ev_vector, ev_vector, ev_vector, PROG_ID_VERSION, }, - [OP_ADD_Q] = {"+", "add.q", + [OP_ADD_Q_v6p] = {"+", "add.q", ev_quat, ev_quat, ev_quat, PROG_VERSION, }, - [OP_ADD_S] = {"+", "add.s", + [OP_ADD_S_v6p] = {"+", "add.s", ev_string, ev_string, ev_string, PROG_VERSION, }, - [OP_SUB_D] = {"-", "sub.d", + [OP_SUB_D_v6p] = {"-", "sub.d", ev_double, ev_double, ev_double, PROG_VERSION, }, - [OP_SUB_F] = {"-", "sub.f", + [OP_SUB_F_v6p] = {"-", "sub.f", ev_float, ev_float, ev_float, PROG_ID_VERSION, }, - [OP_SUB_V] = {"-", "sub.v", + [OP_SUB_V_v6p] = {"-", "sub.v", ev_vector, ev_vector, ev_vector, PROG_ID_VERSION, }, - [OP_SUB_Q] = {"-", "sub.q", + [OP_SUB_Q_v6p] = {"-", "sub.q", ev_quat, ev_quat, ev_quat, PROG_VERSION, }, - [OP_EQ_D] = {"==", "eq.d", + [OP_EQ_D_v6p] = {"==", "eq.d", ev_double, ev_double, ev_integer, PROG_VERSION, }, - [OP_EQ_F] = {"==", "eq.f", + [OP_EQ_F_v6p] = {"==", "eq.f", ev_float, ev_float, ev_integer, PROG_ID_VERSION, }, - [OP_EQ_V] = {"==", "eq.v", + [OP_EQ_V_v6p] = {"==", "eq.v", ev_vector, ev_vector, ev_integer, PROG_ID_VERSION, }, - [OP_EQ_Q] = {"==", "eq.q", + [OP_EQ_Q_v6p] = {"==", "eq.q", ev_quat, ev_quat, ev_integer, PROG_VERSION, }, - [OP_EQ_S] = {"==", "eq.s", + [OP_EQ_S_v6p] = {"==", "eq.s", ev_string, ev_string, ev_integer, PROG_ID_VERSION, }, - [OP_EQ_E] = {"==", "eq.e", + [OP_EQ_E_v6p] = {"==", "eq.e", ev_entity, ev_entity, ev_integer, PROG_ID_VERSION, }, - [OP_EQ_FN] = {"==", "eq.fn", + [OP_EQ_FN_v6p] = {"==", "eq.fn", ev_func, ev_func, ev_integer, PROG_ID_VERSION, }, - [OP_NE_D] = {"!=", "ne.d", + [OP_NE_D_v6p] = {"!=", "ne.d", ev_double, ev_double, ev_integer, PROG_VERSION, }, - [OP_NE_F] = {"!=", "ne.f", + [OP_NE_F_v6p] = {"!=", "ne.f", ev_float, ev_float, ev_integer, PROG_ID_VERSION, }, - [OP_NE_V] = {"!=", "ne.v", + [OP_NE_V_v6p] = {"!=", "ne.v", ev_vector, ev_vector, ev_integer, PROG_ID_VERSION, }, - [OP_NE_Q] = {"!=", "ne.q", + [OP_NE_Q_v6p] = {"!=", "ne.q", ev_quat, ev_quat, ev_integer, PROG_VERSION, }, - [OP_NE_S] = {"!=", "ne.s", + [OP_NE_S_v6p] = {"!=", "ne.s", ev_string, ev_string, ev_integer, PROG_ID_VERSION, }, - [OP_NE_E] = {"!=", "ne.e", + [OP_NE_E_v6p] = {"!=", "ne.e", ev_entity, ev_entity, ev_integer, PROG_ID_VERSION, }, - [OP_NE_FN] = {"!=", "ne.fn", + [OP_NE_FN_v6p] = {"!=", "ne.fn", ev_func, ev_func, ev_integer, PROG_ID_VERSION, }, - [OP_LE_D] = {"<=", "le.d", + [OP_LE_D_v6p] = {"<=", "le.d", ev_double, ev_double, ev_integer, PROG_VERSION, }, - [OP_LE_F] = {"<=", "le.f", + [OP_LE_F_v6p] = {"<=", "le.f", ev_float, ev_float, ev_integer, PROG_ID_VERSION, }, - [OP_GE_D] = {">=", "ge.d", + [OP_GE_D_v6p] = {">=", "ge.d", ev_double, ev_double, ev_integer, PROG_VERSION, }, - [OP_GE_F] = {">=", "ge.f", + [OP_GE_F_v6p] = {">=", "ge.f", ev_float, ev_float, ev_integer, PROG_ID_VERSION, }, - [OP_LE_S] = {"<=", "le.s", + [OP_LE_S_v6p] = {"<=", "le.s", ev_string, ev_string, ev_integer, PROG_VERSION, }, - [OP_GE_S] = {">=", "ge.s", + [OP_GE_S_v6p] = {">=", "ge.s", ev_string, ev_string, ev_integer, PROG_VERSION, }, - [OP_LT_D] = {"<", "lt.d", + [OP_LT_D_v6p] = {"<", "lt.d", ev_double, ev_double, ev_integer, PROG_VERSION, }, - [OP_LT_F] = {"<", "lt.f", + [OP_LT_F_v6p] = {"<", "lt.f", ev_float, ev_float, ev_integer, PROG_ID_VERSION, }, - [OP_GT_D] = {">", "gt.d", + [OP_GT_D_v6p] = {">", "gt.d", ev_double, ev_double, ev_integer, PROG_VERSION, }, - [OP_GT_F] = {">", "gt.f", + [OP_GT_F_v6p] = {">", "gt.f", ev_float, ev_float, ev_integer, PROG_ID_VERSION, }, - [OP_LT_S] = {"<", "lt.s", + [OP_LT_S_v6p] = {"<", "lt.s", ev_string, ev_string, ev_integer, PROG_VERSION, }, - [OP_GT_S] = {">", "gt.s", + [OP_GT_S_v6p] = {">", "gt.s", ev_string, ev_string, ev_integer, PROG_VERSION, }, - [OP_LOAD_F] = {".", "load.f", + [OP_LOAD_F_v6p] = {".", "load.f", ev_entity, ev_field, ev_float, PROG_ID_VERSION, "%Ga.%Gb(%Ec), %gc",//FIXME %E more flexible? }, - [OP_LOAD_D] = {".", "load.d", + [OP_LOAD_D_v6p] = {".", "load.d", ev_entity, ev_field, ev_double, PROG_VERSION, "%Ga.%Gb(%Ec), %gc", }, - [OP_LOAD_V] = {".", "load.v", + [OP_LOAD_V_v6p] = {".", "load.v", ev_entity, ev_field, ev_vector, PROG_ID_VERSION, "%Ga.%Gb(%Ec), %gc", }, - [OP_LOAD_Q] = {".", "load.q", + [OP_LOAD_Q_v6p] = {".", "load.q", ev_entity, ev_field, ev_quat, PROG_VERSION, "%Ga.%Gb(%Ec), %gc", }, - [OP_LOAD_S] = {".", "load.s", + [OP_LOAD_S_v6p] = {".", "load.s", ev_entity, ev_field, ev_string, PROG_ID_VERSION, "%Ga.%Gb(%Ec), %gc", }, - [OP_LOAD_ENT] = {".", "load.ent", + [OP_LOAD_ENT_v6p] = {".", "load.ent", ev_entity, ev_field, ev_entity, PROG_ID_VERSION, "%Ga.%Gb(%Ec), %gc", }, - [OP_LOAD_FLD] = {".", "load.fld", + [OP_LOAD_FLD_v6p] = {".", "load.fld", ev_entity, ev_field, ev_field, PROG_ID_VERSION, "%Ga.%Gb(%Ec), %gc", }, - [OP_LOAD_FN] = {".", "load.fn", + [OP_LOAD_FN_v6p] = {".", "load.fn", ev_entity, ev_field, ev_func, PROG_ID_VERSION, "%Ga.%Gb(%Ec), %gc", }, - [OP_LOAD_I] = {".", "load.i", + [OP_LOAD_I_v6p] = {".", "load.i", ev_entity, ev_field, ev_integer, PROG_VERSION, "%Ga.%Gb(%Ec), %gc", }, - [OP_LOAD_P] = {".", "load.p", + [OP_LOAD_P_v6p] = {".", "load.p", ev_entity, ev_field, ev_pointer, PROG_VERSION, "%Ga.%Gb(%Ec), %gc", }, - [OP_LOADB_D] = {".", "loadb.d", + [OP_LOADB_D_v6p] = {".", "loadb.d", ev_pointer, ev_integer, ev_double, PROG_VERSION, "*(%Ga + %Gb), %gc", }, - [OP_LOADB_F] = {".", "loadb.f", + [OP_LOADB_F_v6p] = {".", "loadb.f", ev_pointer, ev_integer, ev_float, PROG_VERSION, "*(%Ga + %Gb), %gc", }, - [OP_LOADB_V] = {".", "loadb.v", + [OP_LOADB_V_v6p] = {".", "loadb.v", ev_pointer, ev_integer, ev_vector, PROG_VERSION, "*(%Ga + %Gb), %gc", }, - [OP_LOADB_Q] = {".", "loadb.q", + [OP_LOADB_Q_v6p] = {".", "loadb.q", ev_pointer, ev_integer, ev_quat, PROG_VERSION, "*(%Ga + %Gb), %gc", }, - [OP_LOADB_S] = {".", "loadb.s", + [OP_LOADB_S_v6p] = {".", "loadb.s", ev_pointer, ev_integer, ev_string, PROG_VERSION, "*(%Ga + %Gb), %gc", }, - [OP_LOADB_ENT] = {".", "loadb.ent", + [OP_LOADB_ENT_v6p] = {".", "loadb.ent", ev_pointer, ev_integer, ev_entity, PROG_VERSION, "*(%Ga + %Gb), %gc", }, - [OP_LOADB_FLD] = {".", "loadb.fld", + [OP_LOADB_FLD_v6p] = {".", "loadb.fld", ev_pointer, ev_integer, ev_field, PROG_VERSION, "*(%Ga + %Gb), %gc", }, - [OP_LOADB_FN] = {".", "loadb.fn", + [OP_LOADB_FN_v6p] = {".", "loadb.fn", ev_pointer, ev_integer, ev_func, PROG_VERSION, "*(%Ga + %Gb), %gc", }, - [OP_LOADB_I] = {".", "loadb.i", + [OP_LOADB_I_v6p] = {".", "loadb.i", ev_pointer, ev_integer, ev_integer, PROG_VERSION, "*(%Ga + %Gb), %gc", }, - [OP_LOADB_P] = {".", "loadb.p", + [OP_LOADB_P_v6p] = {".", "loadb.p", ev_pointer, ev_integer, ev_pointer, PROG_VERSION, "*(%Ga + %Gb), %gc", }, - [OP_LOADBI_D] = {".", "loadbi.d", + [OP_LOADBI_D_v6p] = {".", "loadbi.d", ev_pointer, ev_short, ev_double, PROG_VERSION, "*(%Ga + %sb), %gc", }, - [OP_LOADBI_F] = {".", "loadbi.f", + [OP_LOADBI_F_v6p] = {".", "loadbi.f", ev_pointer, ev_short, ev_float, PROG_VERSION, "*(%Ga + %sb), %gc", }, - [OP_LOADBI_V] = {".", "loadbi.v", + [OP_LOADBI_V_v6p] = {".", "loadbi.v", ev_pointer, ev_short, ev_vector, PROG_VERSION, "*(%Ga + %sb), %gc", }, - [OP_LOADBI_Q] = {".", "loadbi.q", + [OP_LOADBI_Q_v6p] = {".", "loadbi.q", ev_pointer, ev_short, ev_quat, PROG_VERSION, "*(%Ga + %sb), %gc", }, - [OP_LOADBI_S] = {".", "loadbi.s", + [OP_LOADBI_S_v6p] = {".", "loadbi.s", ev_pointer, ev_short, ev_string, PROG_VERSION, "*(%Ga + %sb), %gc", }, - [OP_LOADBI_ENT] = {".", "loadbi.ent", + [OP_LOADBI_ENT_v6p] = {".", "loadbi.ent", ev_pointer, ev_short, ev_entity, PROG_VERSION, "*(%Ga + %sb), %gc", }, - [OP_LOADBI_FLD] = {".", "loadbi.fld", + [OP_LOADBI_FLD_v6p] = {".", "loadbi.fld", ev_pointer, ev_short, ev_field, PROG_VERSION, "*(%Ga + %sb), %gc", }, - [OP_LOADBI_FN] = {".", "loadbi.fn", + [OP_LOADBI_FN_v6p] = {".", "loadbi.fn", ev_pointer, ev_short, ev_func, PROG_VERSION, "*(%Ga + %sb), %gc", }, - [OP_LOADBI_I] = {".", "loadbi.i", + [OP_LOADBI_I_v6p] = {".", "loadbi.i", ev_pointer, ev_short, ev_integer, PROG_VERSION, "*(%Ga + %sb), %gc", }, - [OP_LOADBI_P] = {".", "loadbi.p", + [OP_LOADBI_P_v6p] = {".", "loadbi.p", ev_pointer, ev_short, ev_pointer, PROG_VERSION, "*(%Ga + %sb), %gc", }, - [OP_ADDRESS] = {"&", "address", + [OP_ADDRESS_v6p] = {"&", "address", ev_entity, ev_field, ev_pointer, PROG_ID_VERSION, "%Ga.%Gb(%Ec), %gc", }, - [OP_ADDRESS_VOID] = {"&", "address", + [OP_ADDRESS_VOID_v6p] = {"&", "address", ev_void, ev_invalid, ev_pointer, PROG_VERSION, "%Ga, %gc", }, - [OP_ADDRESS_D] = {"&", "address.d", + [OP_ADDRESS_D_v6p] = {"&", "address.d", ev_double, ev_invalid, ev_pointer, PROG_VERSION, "%Ga, %gc", }, - [OP_ADDRESS_F] = {"&", "address.f", + [OP_ADDRESS_F_v6p] = {"&", "address.f", ev_float, ev_invalid, ev_pointer, PROG_VERSION, "%Ga, %gc", }, - [OP_ADDRESS_V] = {"&", "address.v", + [OP_ADDRESS_V_v6p] = {"&", "address.v", ev_vector, ev_invalid, ev_pointer, PROG_VERSION, "%Ga, %gc", }, - [OP_ADDRESS_Q] = {"&", "address.q", + [OP_ADDRESS_Q_v6p] = {"&", "address.q", ev_quat, ev_invalid, ev_pointer, PROG_VERSION, "%Ga, %gc", }, - [OP_ADDRESS_S] = {"&", "address.s", + [OP_ADDRESS_S_v6p] = {"&", "address.s", ev_string, ev_invalid, ev_pointer, PROG_VERSION, "%Ga, %gc", }, - [OP_ADDRESS_ENT] = {"&", "address.ent", + [OP_ADDRESS_ENT_v6p] = {"&", "address.ent", ev_entity, ev_invalid, ev_pointer, PROG_VERSION, "%Ga, %gc", }, - [OP_ADDRESS_FLD] = {"&", "address.fld", + [OP_ADDRESS_FLD_v6p] = {"&", "address.fld", ev_field, ev_invalid, ev_pointer, PROG_VERSION, "%Ga, %gc", }, - [OP_ADDRESS_FN] = {"&", "address.fn", + [OP_ADDRESS_FN_v6p] = {"&", "address.fn", ev_func, ev_invalid, ev_pointer, PROG_VERSION, "%Ga, %gc", }, - [OP_ADDRESS_I] = {"&", "address.i", + [OP_ADDRESS_I_v6p] = {"&", "address.i", ev_integer, ev_invalid, ev_pointer, PROG_VERSION, "%Ga, %gc", }, - [OP_ADDRESS_P] = {"&", "address.p", + [OP_ADDRESS_P_v6p] = {"&", "address.p", ev_pointer, ev_invalid, ev_pointer, PROG_VERSION, "%Ga, %gc", }, - [OP_LEA] = {"&", "lea", + [OP_LEA_v6p] = {"&", "lea", ev_pointer, ev_integer, ev_pointer, PROG_VERSION, "(%Ga + %Gb), %gc", }, - [OP_LEAI] = {"&", "leai", + [OP_LEAI_v6p] = {"&", "leai", ev_pointer, ev_short, ev_pointer, PROG_VERSION, "(%Ga + %sb), %gc", }, - [OP_CONV_IF] = {"", "conv.if", + [OP_CONV_IF_v6p] = {"", "conv.if", ev_integer, ev_invalid, ev_float, PROG_VERSION, "%Ga, %gc", }, - [OP_CONV_FI] = {"", "conv.fi", + [OP_CONV_FI_v6p] = {"", "conv.fi", ev_float, ev_invalid, ev_integer, PROG_VERSION, "%Ga, %gc", }, - [OP_CONV_ID] = {"", "conv.id", + [OP_CONV_ID_v6p] = {"", "conv.id", ev_integer, ev_invalid, ev_double, PROG_VERSION, "%Ga, %gc", }, - [OP_CONV_DI] = {"", "conv.di", + [OP_CONV_DI_v6p] = {"", "conv.di", ev_double, ev_invalid, ev_integer, PROG_VERSION, "%Ga, %gc", }, - [OP_CONV_FD] = {"", "conv.fd", + [OP_CONV_FD_v6p] = {"", "conv.fd", ev_float, ev_invalid, ev_double, PROG_VERSION, "%Ga, %gc", }, - [OP_CONV_DF] = {"", "conv.df", + [OP_CONV_DF_v6p] = {"", "conv.df", ev_double, ev_invalid, ev_float, PROG_VERSION, "%Ga, %gc", }, - [OP_STORE_D] = {"=", "store.d", + [OP_STORE_D_v6p] = {"=", "store.d", ev_double, ev_double, ev_invalid, PROG_VERSION, "%Ga, %gb", }, - [OP_STORE_F] = {"=", "store.f", + [OP_STORE_F_v6p] = {"=", "store.f", ev_float, ev_float, ev_invalid, PROG_ID_VERSION, "%Ga, %gb", }, - [OP_STORE_V] = {"=", "store.v", + [OP_STORE_V_v6p] = {"=", "store.v", ev_vector, ev_vector, ev_invalid, PROG_ID_VERSION, "%Ga, %gb", }, - [OP_STORE_Q] = {"=", "store.q", + [OP_STORE_Q_v6p] = {"=", "store.q", ev_quat, ev_quat, ev_invalid, PROG_VERSION, "%Ga, %gb", }, - [OP_STORE_S] = {"=", "store.s", + [OP_STORE_S_v6p] = {"=", "store.s", ev_string, ev_string, ev_invalid, PROG_ID_VERSION, "%Ga, %gb", }, - [OP_STORE_ENT] = {"=", "store.ent", + [OP_STORE_ENT_v6p] = {"=", "store.ent", ev_entity, ev_entity, ev_invalid, PROG_ID_VERSION, "%Ga, %gb", }, - [OP_STORE_FLD] = {"=", "store.fld", + [OP_STORE_FLD_v6p] = {"=", "store.fld", ev_field, ev_field, ev_invalid, PROG_ID_VERSION, "%Ga, %gb", }, - [OP_STORE_FN] = {"=", "store.fn", + [OP_STORE_FN_v6p] = {"=", "store.fn", ev_func, ev_func, ev_invalid, PROG_ID_VERSION, "%Ga, %gb", }, - [OP_STORE_I] = {"=", "store.i", + [OP_STORE_I_v6p] = {"=", "store.i", ev_integer, ev_integer, ev_invalid, PROG_VERSION, "%Ga, %gb", }, - [OP_STORE_P] = {"=", "store.p", + [OP_STORE_P_v6p] = {"=", "store.p", ev_pointer, ev_pointer, ev_invalid, PROG_VERSION, "%Ga, %gb", }, - [OP_STOREP_D] = {".=", "storep.d", + [OP_STOREP_D_v6p] = {".=", "storep.d", ev_double, ev_pointer, ev_invalid, PROG_ID_VERSION, "%Ga, *%Gb", }, - [OP_STOREP_F] = {".=", "storep.f", + [OP_STOREP_F_v6p] = {".=", "storep.f", ev_float, ev_pointer, ev_invalid, PROG_ID_VERSION, "%Ga, *%Gb", }, - [OP_STOREP_V] = {".=", "storep.v", + [OP_STOREP_V_v6p] = {".=", "storep.v", ev_vector, ev_pointer, ev_invalid, PROG_ID_VERSION, "%Ga, *%Gb", }, - [OP_STOREP_Q] = {".=", "storep.q", + [OP_STOREP_Q_v6p] = {".=", "storep.q", ev_quat, ev_pointer, ev_invalid, PROG_VERSION, "%Ga, *%Gb", }, - [OP_STOREP_S] = {".=", "storep.s", + [OP_STOREP_S_v6p] = {".=", "storep.s", ev_string, ev_pointer, ev_invalid, PROG_ID_VERSION, "%Ga, *%Gb", }, - [OP_STOREP_ENT] = {".=", "storep.ent", + [OP_STOREP_ENT_v6p] = {".=", "storep.ent", ev_entity, ev_pointer, ev_invalid, PROG_ID_VERSION, "%Ga, *%Gb", }, - [OP_STOREP_FLD] = {".=", "storep.fld", + [OP_STOREP_FLD_v6p] = {".=", "storep.fld", ev_field, ev_pointer, ev_invalid, PROG_ID_VERSION, "%Ga, *%Gb", }, - [OP_STOREP_FN] = {".=", "storep.fn", + [OP_STOREP_FN_v6p] = {".=", "storep.fn", ev_func, ev_pointer, ev_invalid, PROG_ID_VERSION, "%Ga, *%Gb", }, - [OP_STOREP_I] = {".=", "storep.i", + [OP_STOREP_I_v6p] = {".=", "storep.i", ev_integer, ev_pointer, ev_invalid, PROG_VERSION, "%Ga, *%Gb", }, - [OP_STOREP_P] = {".=", "storep.p", + [OP_STOREP_P_v6p] = {".=", "storep.p", ev_pointer, ev_pointer, ev_invalid, PROG_VERSION, "%Ga, *%Gb", }, - [OP_STOREB_D] = {".=", "storeb.d", + [OP_STOREB_D_v6p] = {".=", "storeb.d", ev_double, ev_pointer, ev_integer, PROG_VERSION, "%Ga, *(%Gb + %Gc)", }, - [OP_STOREB_F] = {".=", "storeb.f", + [OP_STOREB_F_v6p] = {".=", "storeb.f", ev_float, ev_pointer, ev_integer, PROG_VERSION, "%Ga, *(%Gb + %Gc)", }, - [OP_STOREB_V] = {".=", "storeb.v", + [OP_STOREB_V_v6p] = {".=", "storeb.v", ev_vector, ev_pointer, ev_integer, PROG_VERSION, "%Ga, *(%Gb + %Gc)", }, - [OP_STOREB_Q] = {".=", "storeb.q", + [OP_STOREB_Q_v6p] = {".=", "storeb.q", ev_quat, ev_pointer, ev_integer, PROG_VERSION, "%Ga, *(%Gb + %Gc)", }, - [OP_STOREB_S] = {".=", "storeb.s", + [OP_STOREB_S_v6p] = {".=", "storeb.s", ev_string, ev_pointer, ev_integer, PROG_VERSION, "%Ga, *(%Gb + %Gc)", }, - [OP_STOREB_ENT] = {".=", "storeb.ent", + [OP_STOREB_ENT_v6p] = {".=", "storeb.ent", ev_entity, ev_pointer, ev_integer, PROG_VERSION, "%Ga, *(%Gb + %Gc)", }, - [OP_STOREB_FLD] = {".=", "storeb.fld", + [OP_STOREB_FLD_v6p] = {".=", "storeb.fld", ev_field, ev_pointer, ev_integer, PROG_VERSION, "%Ga, *(%Gb + %Gc)", }, - [OP_STOREB_FN] = {".=", "storeb.fn", + [OP_STOREB_FN_v6p] = {".=", "storeb.fn", ev_func, ev_pointer, ev_integer, PROG_VERSION, "%Ga, *(%Gb + %Gc)", }, - [OP_STOREB_I] = {".=", "storeb.i", + [OP_STOREB_I_v6p] = {".=", "storeb.i", ev_integer, ev_pointer, ev_integer, PROG_VERSION, "%Ga, *(%Gb + %Gc)", }, - [OP_STOREB_P] = {".=", "storeb.p", + [OP_STOREB_P_v6p] = {".=", "storeb.p", ev_pointer, ev_pointer, ev_integer, PROG_VERSION, "%Ga, *(%Gb + %Gc)", }, - [OP_STOREBI_D] = {".=", "storebi.d", + [OP_STOREBI_D_v6p] = {".=", "storebi.d", ev_double, ev_pointer, ev_short, PROG_VERSION, "%Ga, *(%Gb + %sc)", }, - [OP_STOREBI_F] = {".=", "storebi.f", + [OP_STOREBI_F_v6p] = {".=", "storebi.f", ev_float, ev_pointer, ev_short, PROG_VERSION, "%Ga, *(%Gb + %sc)", }, - [OP_STOREBI_V] = {".=", "storebi.v", + [OP_STOREBI_V_v6p] = {".=", "storebi.v", ev_vector, ev_pointer, ev_short, PROG_VERSION, "%Ga, *(%Gb + %sc)", }, - [OP_STOREBI_Q] = {".=", "storebi.q", + [OP_STOREBI_Q_v6p] = {".=", "storebi.q", ev_quat, ev_pointer, ev_short, PROG_VERSION, "%Ga, *(%Gb + %sc)", }, - [OP_STOREBI_S] = {".=", "storebi.s", + [OP_STOREBI_S_v6p] = {".=", "storebi.s", ev_string, ev_pointer, ev_short, PROG_VERSION, "%Ga, *(%Gb + %sc)", }, - [OP_STOREBI_ENT] = {".=", "storebi.ent", + [OP_STOREBI_ENT_v6p] = {".=", "storebi.ent", ev_entity, ev_pointer, ev_short, PROG_VERSION, "%Ga, *(%Gb + %sc)", }, - [OP_STOREBI_FLD] = {".=", "storebi.fld", + [OP_STOREBI_FLD_v6p] = {".=", "storebi.fld", ev_field, ev_pointer, ev_short, PROG_VERSION, "%Ga, *(%Gb + %sc)", }, - [OP_STOREBI_FN] = {".=", "storebi.fn", + [OP_STOREBI_FN_v6p] = {".=", "storebi.fn", ev_func, ev_pointer, ev_short, PROG_VERSION, "%Ga, *(%Gb + %sc)", }, - [OP_STOREBI_I] = {".=", "storebi.i", + [OP_STOREBI_I_v6p] = {".=", "storebi.i", ev_integer, ev_pointer, ev_short, PROG_VERSION, "%Ga, *(%Gb + %sc)", }, - [OP_STOREBI_P] = {".=", "storebi.p", + [OP_STOREBI_P_v6p] = {".=", "storebi.p", ev_pointer, ev_pointer, ev_short, PROG_VERSION, "%Ga, *(%Gb + %sc)", }, - [OP_RETURN] = {"", "return", + [OP_RETURN_v6p] = {"", "return", ev_void, ev_invalid, ev_invalid, PROG_ID_VERSION, "%Ra", }, - [OP_RETURN_V] = {"", "return", + [OP_RETURN_V_v6p] = {"", "return", ev_invalid, ev_invalid, ev_invalid, PROG_VERSION, "", }, - [OP_NOT_D] = {"!", "not.d", + [OP_NOT_D_v6p] = {"!", "not.d", ev_double, ev_invalid, ev_integer, PROG_VERSION, "%Ga, %gc", }, - [OP_NOT_F] = {"!", "not.f", + [OP_NOT_F_v6p] = {"!", "not.f", ev_float, ev_invalid, ev_integer, PROG_ID_VERSION, "%Ga, %gc", }, - [OP_NOT_V] = {"!", "not.v", + [OP_NOT_V_v6p] = {"!", "not.v", ev_vector, ev_invalid, ev_integer, PROG_ID_VERSION, "%Ga, %gc", }, - [OP_NOT_Q] = {"!", "not.q", + [OP_NOT_Q_v6p] = {"!", "not.q", ev_quat, ev_invalid, ev_integer, PROG_VERSION, "%Ga, %gc", }, - [OP_NOT_S] = {"!", "not.s", + [OP_NOT_S_v6p] = {"!", "not.s", ev_string, ev_invalid, ev_integer, PROG_ID_VERSION, "%Ga, %gc", }, - [OP_NOT_ENT] = {"!", "not.ent", + [OP_NOT_ENT_v6p] = {"!", "not.ent", ev_entity, ev_invalid, ev_integer, PROG_ID_VERSION, "%Ga, %gc", }, - [OP_NOT_FN] = {"!", "not.fn", + [OP_NOT_FN_v6p] = {"!", "not.fn", ev_func, ev_invalid, ev_integer, PROG_ID_VERSION, "%Ga, %gc", }, - [OP_NOT_P] = {"!", "not.p", + [OP_NOT_P_v6p] = {"!", "not.p", ev_pointer, ev_invalid, ev_integer, PROG_VERSION, "%Ga, %gc", }, - [OP_IF] = {"", "if", + [OP_IF_v6p] = {"", "if", ev_integer, ev_short, ev_invalid, PROG_ID_VERSION, "%Ga branch %sb (%Ob)", }, - [OP_IFNOT] = {"", "ifnot", + [OP_IFNOT_v6p] = {"", "ifnot", ev_integer, ev_short, ev_invalid, PROG_ID_VERSION, "%Ga branch %sb (%Ob)", }, - [OP_IFBE] = {"", "ifbe", + [OP_IFBE_v6p] = {"", "ifbe", ev_integer, ev_short, ev_invalid, PROG_VERSION, "%Ga branch %sb (%Ob)", }, - [OP_IFB] = {"", "ifb", + [OP_IFB_v6p] = {"", "ifb", ev_integer, ev_short, ev_invalid, PROG_VERSION, "%Ga branch %sb (%Ob)", }, - [OP_IFAE] = {"", "ifae", + [OP_IFAE_v6p] = {"", "ifae", ev_integer, ev_short, ev_invalid, PROG_VERSION, "%Ga branch %sb (%Ob)", }, - [OP_IFA] = {"", "ifa", + [OP_IFA_v6p] = {"", "ifa", ev_integer, ev_short, ev_invalid, PROG_VERSION, "%Ga branch %sb (%Ob)", }, // calls returns REG_RETURN - [OP_CALL0] = {"", "call0", + [OP_CALL0_v6p] = {"", "call0", ev_func, ev_invalid, ev_invalid, PROG_ID_VERSION, "%Fa ()", }, - [OP_CALL1] = {"", "call1", + [OP_CALL1_v6p] = {"", "call1", ev_func, ev_invalid, ev_invalid, PROG_ID_VERSION, "%Fa (%P0x)", }, - [OP_CALL2] = {"", "call2", + [OP_CALL2_v6p] = {"", "call2", ev_func, ev_invalid, ev_invalid, PROG_ID_VERSION, "%Fa (%P0x, %P1x)", }, - [OP_CALL3] = {"", "call3", + [OP_CALL3_v6p] = {"", "call3", ev_func, ev_invalid, ev_invalid, PROG_ID_VERSION, "%Fa (%P0x, %P1x, %P2x)", }, - [OP_CALL4] = {"", "call4", + [OP_CALL4_v6p] = {"", "call4", ev_func, ev_invalid, ev_invalid, PROG_ID_VERSION, "%Fa (%P0x, %P1x, %P2x, %P3x)", }, - [OP_CALL5] = {"", "call5", + [OP_CALL5_v6p] = {"", "call5", ev_func, ev_invalid, ev_invalid, PROG_ID_VERSION, "%Fa (%P0x, %P1x, %P2x, %P3x, %P4x)", }, - [OP_CALL6] = {"", "call6", + [OP_CALL6_v6p] = {"", "call6", ev_func, ev_invalid, ev_invalid, PROG_ID_VERSION, "%Fa (%P0x, %P1x, %P2x, %P3x, %P4x, %P5x)", }, - [OP_CALL7] = {"", "call7", + [OP_CALL7_v6p] = {"", "call7", ev_func, ev_invalid, ev_invalid, PROG_ID_VERSION, "%Fa (%P0x, %P1x, %P2x, %P3x, %P4x, %P5x, %P6x)", }, - [OP_CALL8] = {"", "call8", + [OP_CALL8_v6p] = {"", "call8", ev_func, ev_invalid, ev_invalid, PROG_ID_VERSION, "%Fa (%P0x, %P1x, %P2x, %P3x, %P4x, %P5x, %P6x, %P7x)", }, - [OP_RCALL0] = {"", 0, + [OP_RCALL0_v6p] = {"", 0, ev_invalid, ev_invalid, ev_invalid, ~0, // not a valid instruction 0, }, - [OP_RCALL1] = {"", "rcall1", + [OP_RCALL1_v6p] = {"", "rcall1", ev_func, ev_void, ev_invalid, PROG_VERSION, "%Fa (%P0b)", }, - [OP_RCALL2] = {"", "rcall2", + [OP_RCALL2_v6p] = {"", "rcall2", ev_func, ev_void, ev_void, PROG_VERSION, "%Fa (%P0b, %P1c)", }, - [OP_RCALL3] = {"", "rcall3", + [OP_RCALL3_v6p] = {"", "rcall3", ev_func, ev_void, ev_void, PROG_VERSION, "%Fa (%P0b, %P1c, %P2x)", }, - [OP_RCALL4] = {"", "rcall4", + [OP_RCALL4_v6p] = {"", "rcall4", ev_func, ev_void, ev_void, PROG_VERSION, "%Fa (%P0b, %P1c, %P2x, %P3x)", }, - [OP_RCALL5] = {"", "rcall5", + [OP_RCALL5_v6p] = {"", "rcall5", ev_func, ev_void, ev_void, PROG_VERSION, "%Fa (%P0b, %P1c, %P2x, %P3x, %P4x)", }, - [OP_RCALL6] = {"", "rcall6", + [OP_RCALL6_v6p] = {"", "rcall6", ev_func, ev_void, ev_void, PROG_VERSION, "%Fa (%P0b, %P1c, %P2x, %P3x, %P4x, %P5x)", }, - [OP_RCALL7] = {"", "rcall7", + [OP_RCALL7_v6p] = {"", "rcall7", ev_func, ev_void, ev_void, PROG_VERSION, "%Fa (%P0b, %P1c, %P2x, %P3x, %P4x, %P5x, %P6x)", }, - [OP_RCALL8] = {"", "rcall8", + [OP_RCALL8_v6p] = {"", "rcall8", ev_func, ev_void, ev_void, PROG_VERSION, "%Fa (%P0b, %P1c, %P2x, %P3x, %P4x, %P5x, %P6x, %P7x)", }, - [OP_STATE] = {"", "state", + [OP_STATE_v6p] = {"", "state", ev_float, ev_func, ev_invalid, PROG_ID_VERSION, "%Ga, %Gb", }, - [OP_STATE_F] = {"", "state.f", + [OP_STATE_F_v6p] = {"", "state.f", ev_float, ev_func, ev_float, PROG_VERSION, "%Ga, %Gb, %Gc", }, - [OP_GOTO] = {"", "goto", + [OP_GOTO_v6p] = {"", "goto", ev_short, ev_invalid, ev_invalid, PROG_ID_VERSION, "branch %sa (%Oa)", }, - [OP_JUMP] = {"", "jump", + [OP_JUMP_v6p] = {"", "jump", ev_integer, ev_invalid, ev_invalid, PROG_VERSION, "%Ga", }, - [OP_JUMPB] = {"", "jumpb", + [OP_JUMPB_v6p] = {"", "jumpb", ev_void, ev_integer, ev_invalid, PROG_VERSION, "%Ga[%Gb]", }, - [OP_AND] = {"&&", "and.f", + [OP_AND_v6p] = {"&&", "and.f", ev_float, ev_float, ev_integer, PROG_ID_VERSION, }, - [OP_OR] = {"||", "or.f", + [OP_OR_v6p] = {"||", "or.f", ev_float, ev_float, ev_integer, PROG_ID_VERSION, }, - [OP_SHL_F] = {"<<", "shl.f", + [OP_SHL_F_v6p] = {"<<", "shl.f", ev_float, ev_float, ev_float, PROG_VERSION, }, - [OP_SHR_F] = {">>", "shr.f", + [OP_SHR_F_v6p] = {">>", "shr.f", ev_float, ev_float, ev_float, PROG_VERSION, }, - [OP_SHL_I] = {"<<", "shl.i", + [OP_SHL_I_v6p] = {"<<", "shl.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_SHR_I] = {">>", "shr.i", + [OP_SHR_I_v6p] = {">>", "shr.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_SHR_U] = {">>", "shr.u", + [OP_SHR_U_v6p] = {">>", "shr.u", ev_uinteger, ev_integer, ev_uinteger, PROG_VERSION, }, - [OP_BITAND] = {"&", "bitand", + [OP_BITAND_v6p] = {"&", "bitand", ev_float, ev_float, ev_float, PROG_ID_VERSION, }, - [OP_BITOR] = {"|", "bitor", + [OP_BITOR_v6p] = {"|", "bitor", ev_float, ev_float, ev_float, PROG_ID_VERSION, }, - [OP_ADD_I] = {"+", "add.i", + [OP_ADD_I_v6p] = {"+", "add.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_SUB_I] = {"-", "sub.i", + [OP_SUB_I_v6p] = {"-", "sub.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_MUL_I] = {"*", "mul.i", + [OP_MUL_I_v6p] = {"*", "mul.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_DIV_I] = {"/", "div.i", + [OP_DIV_I_v6p] = {"/", "div.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_REM_I] = {"%", "rem.i", + [OP_REM_I_v6p] = {"%", "rem.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_MOD_I] = {"%%", "mod.i", + [OP_MOD_I_v6p] = {"%%", "mod.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_BITAND_I] = {"&", "bitand.i", + [OP_BITAND_I_v6p] = {"&", "bitand.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_BITOR_I] = {"|", "bitor.i", + [OP_BITOR_I_v6p] = {"|", "bitor.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_REM_F] = {"%", "rem.f", + [OP_REM_F_v6p] = {"%", "rem.f", ev_float, ev_float, ev_float, PROG_VERSION, }, - [OP_MOD_F] = {"%%", "mod.f", + [OP_MOD_F_v6p] = {"%%", "mod.f", ev_float, ev_float, ev_float, PROG_VERSION, }, - [OP_GE_I] = {">=", "ge.i", + [OP_GE_I_v6p] = {">=", "ge.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_LE_I] = {"<=", "le.i", + [OP_LE_I_v6p] = {"<=", "le.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_GT_I] = {">", "gt.i", + [OP_GT_I_v6p] = {">", "gt.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_LT_I] = {"<", "lt.i", + [OP_LT_I_v6p] = {"<", "lt.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_AND_I] = {"&&", "and.i", + [OP_AND_I_v6p] = {"&&", "and.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_OR_I] = {"||", "or.i", + [OP_OR_I_v6p] = {"||", "or.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_NOT_I] = {"!", "not.i", + [OP_NOT_I_v6p] = {"!", "not.i", ev_integer, ev_invalid, ev_integer, PROG_VERSION, "%Ga, %gc", }, - [OP_EQ_I] = {"==", "eq.i", + [OP_EQ_I_v6p] = {"==", "eq.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_NE_I] = {"!=", "ne.i", + [OP_NE_I_v6p] = {"!=", "ne.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_GE_U] = {">=", "ge.u", + [OP_GE_U_v6p] = {">=", "ge.u", ev_uinteger, ev_uinteger, ev_integer, PROG_VERSION, }, - [OP_LE_U] = {"<=", "le.u", + [OP_LE_U_v6p] = {"<=", "le.u", ev_uinteger, ev_uinteger, ev_integer, PROG_VERSION, }, - [OP_GT_U] = {">", "gt.u", + [OP_GT_U_v6p] = {">", "gt.u", ev_uinteger, ev_uinteger, ev_integer, PROG_VERSION, }, - [OP_LT_U] = {"<", "lt.u", + [OP_LT_U_v6p] = {"<", "lt.u", ev_uinteger, ev_uinteger, ev_integer, PROG_VERSION, }, - [OP_BITXOR_F] = {"^", "bitxor.f", + [OP_BITXOR_F_v6p] = {"^", "bitxor.f", ev_float, ev_float, ev_float, PROG_VERSION, }, - [OP_BITNOT_F] = {"~", "bitnot.f", + [OP_BITNOT_F_v6p] = {"~", "bitnot.f", ev_float, ev_invalid, ev_float, PROG_VERSION, "%Ga, %gc", }, - [OP_BITXOR_I] = {"^", "bitxor.i", + [OP_BITXOR_I_v6p] = {"^", "bitxor.i", ev_integer, ev_integer, ev_integer, PROG_VERSION, }, - [OP_BITNOT_I] = {"~", "bitnot.i", + [OP_BITNOT_I_v6p] = {"~", "bitnot.i", ev_integer, ev_invalid, ev_integer, PROG_VERSION, "%Ga, %gc", }, - [OP_GE_P] = {">=", "ge.p", + [OP_GE_P_v6p] = {">=", "ge.p", ev_pointer, ev_pointer, ev_integer, PROG_VERSION, }, - [OP_LE_P] = {"<=", "le.p", + [OP_LE_P_v6p] = {"<=", "le.p", ev_pointer, ev_pointer, ev_integer, PROG_VERSION, }, - [OP_GT_P] = {">", "gt.p", + [OP_GT_P_v6p] = {">", "gt.p", ev_pointer, ev_pointer, ev_integer, PROG_VERSION, }, - [OP_LT_P] = {"<", "lt.p", + [OP_LT_P_v6p] = {"<", "lt.p", ev_pointer, ev_pointer, ev_integer, PROG_VERSION, }, - [OP_EQ_P] = {"==", "eq.p", + [OP_EQ_P_v6p] = {"==", "eq.p", ev_pointer, ev_pointer, ev_integer, PROG_VERSION, }, - [OP_NE_P] = {"!=", "ne.p", + [OP_NE_P_v6p] = {"!=", "ne.p", ev_pointer, ev_pointer, ev_integer, PROG_VERSION, }, - [OP_MOVEI] = {"", "movei", + [OP_MOVEI_v6p] = {"", "movei", ev_void, ev_short, ev_void, PROG_VERSION, "%Ga, %sb, %gc", }, - [OP_MOVEP] = {"", "movep", + [OP_MOVEP_v6p] = {"", "movep", ev_pointer, ev_integer, ev_pointer, PROG_VERSION, "%Ga, %Gb, %Gc", }, - [OP_MOVEPI] = {"", "movepi", + [OP_MOVEPI_v6p] = {"", "movepi", ev_pointer, ev_short, ev_pointer, PROG_VERSION, "%Ga, %sb, %Gc", }, - [OP_MEMSETI] = {"", "memseti", + [OP_MEMSETI_v6p] = {"", "memseti", ev_integer, ev_short, ev_void, PROG_VERSION, "%Ga, %sb, %gc", }, - [OP_MEMSETP] = {"", "memsetp", + [OP_MEMSETP_v6p] = {"", "memsetp", ev_integer, ev_integer, ev_pointer, PROG_VERSION, "%Ga, %Gb, %Gc", }, - [OP_MEMSETPI] = {"", "memsetpi", + [OP_MEMSETPI_v6p] = {"", "memsetpi", ev_integer, ev_short, ev_pointer, PROG_VERSION, "%Ga, %sb, %Gc", }, - [OP_PUSH_S] = {"", "push.s", + [OP_PUSH_S_v6p] = {"", "push.s", ev_string, ev_invalid, ev_invalid, PROG_VERSION, "%Ga", }, - [OP_PUSH_F] = {"", "push.f", + [OP_PUSH_F_v6p] = {"", "push.f", ev_float, ev_invalid, ev_invalid, PROG_VERSION, "%Ga", }, - [OP_PUSH_V] = {"", "push.v", + [OP_PUSH_V_v6p] = {"", "push.v", ev_vector, ev_invalid, ev_invalid, PROG_VERSION, "%Ga", }, - [OP_PUSH_ENT] = {"", "push.ent", + [OP_PUSH_ENT_v6p] = {"", "push.ent", ev_entity, ev_invalid, ev_invalid, PROG_VERSION, "%Ga", }, - [OP_PUSH_FLD] = {"", "push.fld", + [OP_PUSH_FLD_v6p] = {"", "push.fld", ev_field, ev_invalid, ev_invalid, PROG_VERSION, "%Ga", }, - [OP_PUSH_FN] = {"", "push.fn", + [OP_PUSH_FN_v6p] = {"", "push.fn", ev_func, ev_invalid, ev_invalid, PROG_VERSION, "%Ga", }, - [OP_PUSH_P] = {"", "push.p", + [OP_PUSH_P_v6p] = {"", "push.p", ev_pointer, ev_invalid, ev_invalid, PROG_VERSION, "%Ga", }, - [OP_PUSH_Q] = {"", "push.q", + [OP_PUSH_Q_v6p] = {"", "push.q", ev_quat, ev_invalid, ev_invalid, PROG_VERSION, "%Ga", }, - [OP_PUSH_I] = {"", "push.i", + [OP_PUSH_I_v6p] = {"", "push.i", ev_integer, ev_invalid, ev_invalid, PROG_VERSION, "%Ga", }, - [OP_PUSH_D] = {"", "push.d", + [OP_PUSH_D_v6p] = {"", "push.d", ev_double, ev_invalid, ev_invalid, PROG_VERSION, "%Ga", }, - [OP_PUSHB_S] = {"", "pushb.s", + [OP_PUSHB_S_v6p] = {"", "pushb.s", ev_pointer, ev_integer, ev_string, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_PUSHB_F] = {"", "pushb.f", + [OP_PUSHB_F_v6p] = {"", "pushb.f", ev_pointer, ev_integer, ev_float, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_PUSHB_V] = {"", "pushb.v", + [OP_PUSHB_V_v6p] = {"", "pushb.v", ev_pointer, ev_integer, ev_vector, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_PUSHB_ENT] = {"", "pushb.ent", + [OP_PUSHB_ENT_v6p] = {"", "pushb.ent", ev_pointer, ev_integer, ev_entity, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_PUSHB_FLD] = {"", "pushb.fld", + [OP_PUSHB_FLD_v6p] = {"", "pushb.fld", ev_pointer, ev_integer, ev_field, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_PUSHB_FN] = {"", "pushb.fn", + [OP_PUSHB_FN_v6p] = {"", "pushb.fn", ev_pointer, ev_integer, ev_func, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_PUSHB_P] = {"", "pushb.p", + [OP_PUSHB_P_v6p] = {"", "pushb.p", ev_pointer, ev_integer, ev_pointer, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_PUSHB_Q] = {"", "pushb.q", + [OP_PUSHB_Q_v6p] = {"", "pushb.q", ev_pointer, ev_integer, ev_quat, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_PUSHB_I] = {"", "pushb.i", + [OP_PUSHB_I_v6p] = {"", "pushb.i", ev_pointer, ev_integer, ev_integer, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_PUSHB_D] = {"", "pushb.d", + [OP_PUSHB_D_v6p] = {"", "pushb.d", ev_pointer, ev_integer, ev_double, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_PUSHBI_S] = {"", "pushbi.s", + [OP_PUSHBI_S_v6p] = {"", "pushbi.s", ev_pointer, ev_short, ev_string, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_PUSHBI_F] = {"", "pushbi.f", + [OP_PUSHBI_F_v6p] = {"", "pushbi.f", ev_pointer, ev_short, ev_float, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_PUSHBI_V] = {"", "pushbi.v", + [OP_PUSHBI_V_v6p] = {"", "pushbi.v", ev_pointer, ev_short, ev_vector, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_PUSHBI_ENT] = {"", "pushbi.ent", + [OP_PUSHBI_ENT_v6p] = {"", "pushbi.ent", ev_pointer, ev_short, ev_entity, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_PUSHBI_FLD] = {"", "pushbi.fld", + [OP_PUSHBI_FLD_v6p] = {"", "pushbi.fld", ev_pointer, ev_short, ev_field, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_PUSHBI_FN] = {"", "pushbi.fn", + [OP_PUSHBI_FN_v6p] = {"", "pushbi.fn", ev_pointer, ev_short, ev_func, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_PUSHBI_P] = {"", "pushbi.p", + [OP_PUSHBI_P_v6p] = {"", "pushbi.p", ev_pointer, ev_short, ev_pointer, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_PUSHBI_Q] = {"", "pushbi.q", + [OP_PUSHBI_Q_v6p] = {"", "pushbi.q", ev_pointer, ev_short, ev_quat, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_PUSHBI_I] = {"", "pushbi.i", + [OP_PUSHBI_I_v6p] = {"", "pushbi.i", ev_pointer, ev_short, ev_integer, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_PUSHBI_D] = {"", "pushbi.d", + [OP_PUSHBI_D_v6p] = {"", "pushbi.d", ev_pointer, ev_short, ev_double, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_POP_S] = {"", "pop.s", + [OP_POP_S_v6p] = {"", "pop.s", ev_string, ev_invalid, ev_invalid, PROG_VERSION, "%ga", }, - [OP_POP_F] = {"", "pop.f", + [OP_POP_F_v6p] = {"", "pop.f", ev_float, ev_invalid, ev_invalid, PROG_VERSION, "%ga", }, - [OP_POP_V] = {"", "pop.v", + [OP_POP_V_v6p] = {"", "pop.v", ev_vector, ev_invalid, ev_invalid, PROG_VERSION, "%ga", }, - [OP_POP_ENT] = {"", "pop.ent", + [OP_POP_ENT_v6p] = {"", "pop.ent", ev_entity, ev_invalid, ev_invalid, PROG_VERSION, "%ga", }, - [OP_POP_FLD] = {"", "pop.fld", + [OP_POP_FLD_v6p] = {"", "pop.fld", ev_field, ev_invalid, ev_invalid, PROG_VERSION, "%ga", }, - [OP_POP_FN] = {"", "pop.fn", + [OP_POP_FN_v6p] = {"", "pop.fn", ev_func, ev_invalid, ev_invalid, PROG_VERSION, "%ga", }, - [OP_POP_P] = {"", "pop.p", + [OP_POP_P_v6p] = {"", "pop.p", ev_pointer, ev_invalid, ev_invalid, PROG_VERSION, "%ga", }, - [OP_POP_Q] = {"", "pop.q", + [OP_POP_Q_v6p] = {"", "pop.q", ev_quat, ev_invalid, ev_invalid, PROG_VERSION, "%ga", }, - [OP_POP_I] = {"", "pop.i", + [OP_POP_I_v6p] = {"", "pop.i", ev_integer, ev_invalid, ev_invalid, PROG_VERSION, "%ga", }, - [OP_POP_D] = {"", "pop.d", + [OP_POP_D_v6p] = {"", "pop.d", ev_double, ev_invalid, ev_invalid, PROG_VERSION, "%ga", }, - [OP_POPB_S] = {"", "popb.s", + [OP_POPB_S_v6p] = {"", "popb.s", ev_pointer, ev_integer, ev_string, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_POPB_F] = {"", "popb.f", + [OP_POPB_F_v6p] = {"", "popb.f", ev_pointer, ev_integer, ev_float, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_POPB_V] = {"", "popb.v", + [OP_POPB_V_v6p] = {"", "popb.v", ev_pointer, ev_integer, ev_vector, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_POPB_ENT] = {"", "popb.ent", + [OP_POPB_ENT_v6p] = {"", "popb.ent", ev_pointer, ev_integer, ev_entity, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_POPB_FLD] = {"", "popb.fld", + [OP_POPB_FLD_v6p] = {"", "popb.fld", ev_pointer, ev_integer, ev_field, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_POPB_FN] = {"", "popb.fn", + [OP_POPB_FN_v6p] = {"", "popb.fn", ev_pointer, ev_integer, ev_func, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_POPB_P] = {"", "popb.p", + [OP_POPB_P_v6p] = {"", "popb.p", ev_pointer, ev_integer, ev_pointer, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_POPB_Q] = {"", "popb.q", + [OP_POPB_Q_v6p] = {"", "popb.q", ev_pointer, ev_integer, ev_quat, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_POPB_I] = {"", "popb.i", + [OP_POPB_I_v6p] = {"", "popb.i", ev_pointer, ev_integer, ev_integer, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_POPB_D] = {"", "popb.d", + [OP_POPB_D_v6p] = {"", "popb.d", ev_pointer, ev_integer, ev_double, PROG_VERSION, "*(%Ga + %Gb)", }, - [OP_POPBI_S] = {"", "popbi.s", + [OP_POPBI_S_v6p] = {"", "popbi.s", ev_pointer, ev_short, ev_string, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_POPBI_F] = {"", "popbi.f", + [OP_POPBI_F_v6p] = {"", "popbi.f", ev_pointer, ev_short, ev_float, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_POPBI_V] = {"", "popbi.v", + [OP_POPBI_V_v6p] = {"", "popbi.v", ev_pointer, ev_short, ev_vector, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_POPBI_ENT] = {"", "popbi.ent", + [OP_POPBI_ENT_v6p] = {"", "popbi.ent", ev_pointer, ev_short, ev_entity, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_POPBI_FLD] = {"", "popbi.fld", + [OP_POPBI_FLD_v6p] = {"", "popbi.fld", ev_pointer, ev_short, ev_field, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_POPBI_FN] = {"", "popbi.fn", + [OP_POPBI_FN_v6p] = {"", "popbi.fn", ev_pointer, ev_short, ev_func, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_POPBI_P] = {"", "popbi.p", + [OP_POPBI_P_v6p] = {"", "popbi.p", ev_pointer, ev_short, ev_pointer, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_POPBI_Q] = {"", "popbi.q", + [OP_POPBI_Q_v6p] = {"", "popbi.q", ev_pointer, ev_short, ev_quat, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_POPBI_I] = {"", "popbi.i", + [OP_POPBI_I_v6p] = {"", "popbi.i", ev_pointer, ev_short, ev_integer, PROG_VERSION, "*(%Ga + %sb)", }, - [OP_POPBI_D] = {"", "popbi.d", + [OP_POPBI_D_v6p] = {"", "popbi.d", ev_pointer, ev_short, ev_double, PROG_VERSION, "*(%Ga + %sb)", }, // end of table - [OP_MEMSETPI+1] = {0}, //XXX FIXME relies on OP_MEMSETPI being last + [OP_MEMSETPI_v6p+1] = {0}, //XXX FIXME relies on OP_MEMSETPI_v6p being last }; -const opcode_t * -PR_Opcode (pr_short_t opcode) +const v6p_opcode_t * +PR_v6p_Opcode (pr_ushort_t opcode) { - if (opcode < 0 - || opcode >= (int) (sizeof (pr_opcodes) / sizeof (pr_opcodes[0])) - 1) { + size_t opcode_count = sizeof (pr_v6p_opcodes) / sizeof (pr_v6p_opcodes[0]); + if (opcode >= opcode_count - 1) { return 0; } - return &pr_opcodes[opcode]; + return &pr_v6p_opcodes[opcode]; } VISIBLE void @@ -1528,7 +1528,7 @@ PR_Opcode_Init (void) } static inline void -check_branch (progs_t *pr, dstatement_t *st, const opcode_t *op, short offset) +check_branch (progs_t *pr, dstatement_t *st, const v6p_opcode_t *op, short offset) { pr_int_t address = st - pr->pr_statements; @@ -1544,7 +1544,7 @@ is_vector_parameter_store (progs_t *pr, dstatement_t *st, { int i; - if (st->op != OP_STORE_V) + if (st->op != OP_STORE_V_v6p) return 0; if (operand != st->a) return 0; @@ -1557,7 +1557,7 @@ is_vector_parameter_store (progs_t *pr, dstatement_t *st, #define ISDENORM(x) ((x) && !((x) & 0x7f800000)) static inline void -check_global (progs_t *pr, dstatement_t *st, const opcode_t *op, etype_t type, +check_global (progs_t *pr, dstatement_t *st, const v6p_opcode_t *op, etype_t type, unsigned short operand, int check_denorm) { const char *msg; @@ -1615,7 +1615,7 @@ error: } static void -check_global_size (progs_t *pr, dstatement_t *st, const opcode_t *op, +check_global_size (progs_t *pr, dstatement_t *st, const v6p_opcode_t *op, unsigned short size, unsigned short operand) { const char *msg; @@ -1633,7 +1633,7 @@ error: int PR_Check_Opcodes (progs_t *pr) { - const opcode_t *op; + const v6p_opcode_t *op; dstatement_t *st; int state_ok = 0; int pushpop_ok = 0; @@ -1653,13 +1653,13 @@ PR_Check_Opcodes (progs_t *pr) if (0 && !pr_boundscheck->int_val) { for (i = 0, st = pr->pr_statements; i < pr->progs->numstatements; st++, i++) { - op = PR_Opcode (st->op); + op = PR_v6p_Opcode (st->op); if (!op) { PR_Error (pr, "PR_Check_Opcodes: unknown opcode %d at " "statement %ld", st->op, (long)(st - pr->pr_statements)); } - if ((st->op == OP_STATE || st->op == OP_STATE_F) && !state_ok) { + if ((st->op == OP_STATE_v6p || st->op == OP_STATE_F_v6p) && !state_ok) { PR_Error (pr, "PR_Check_Opcodes: %s used with missing fields " "or globals", op->opname); } @@ -1672,43 +1672,43 @@ PR_Check_Opcodes (progs_t *pr) } else { for (i = 0, st = pr->pr_statements; i < pr->progs->numstatements; st++, i++) { - op = PR_Opcode (st->op); + op = PR_v6p_Opcode (st->op); if (!op) { PR_Error (pr, "PR_Check_Opcodes: unknown opcode %d at " "statement %ld", st->op, (long)(st - pr->pr_statements)); } switch (st->op) { - case OP_IF: - case OP_IFNOT: + case OP_IF_v6p: + case OP_IFNOT_v6p: check_global (pr, st, op, op->type_a, st->a, 1); check_branch (pr, st, op, st->b); break; - case OP_GOTO: + case OP_GOTO_v6p: check_branch (pr, st, op, st->a); break; - case OP_DONE: - case OP_RETURN: + case OP_DONE_v6p: + case OP_RETURN_v6p: check_global (pr, st, op, ev_integer, st->a, 1); check_global (pr, st, op, ev_void, st->b, 0); check_global (pr, st, op, ev_void, st->c, 0); break; - case OP_RCALL1: + case OP_RCALL1_v6p: check_global (pr, st, op, ev_void, st->c, 1); - case OP_RCALL2: - case OP_RCALL3: - case OP_RCALL4: - case OP_RCALL5: - case OP_RCALL6: - case OP_RCALL7: - case OP_RCALL8: - if (st->op > OP_RCALL1) + case OP_RCALL2_v6p: + case OP_RCALL3_v6p: + case OP_RCALL4_v6p: + case OP_RCALL5_v6p: + case OP_RCALL6_v6p: + case OP_RCALL7_v6p: + case OP_RCALL8_v6p: + if (st->op > OP_RCALL1_v6p) check_global (pr, st, op, ev_integer, st->c, 1); check_global (pr, st, op, ev_integer, st->b, 1); check_global (pr, st, op, ev_func, st->a, 1); break; - case OP_STATE: - case OP_STATE_F: + case OP_STATE_v6p: + case OP_STATE_F_v6p: if (!state_ok) { PR_Error (pr, "PR_Check_Opcodes: %s used with missing " "fields or globals", op->opname); @@ -1717,70 +1717,70 @@ PR_Check_Opcodes (progs_t *pr) check_global (pr, st, op, op->type_b, st->b, 1); check_global (pr, st, op, op->type_c, st->c, 1); break; - case OP_MOVEI: + case OP_MOVEI_v6p: check_global_size (pr, st, op, st->b, st->a); check_global_size (pr, st, op, st->b, st->c); break; - case OP_MEMSETI: + case OP_MEMSETI_v6p: check_global_size (pr, st, op, st->b, st->c); break; - case OP_PUSHB_F: - case OP_PUSHB_S: - case OP_PUSHB_ENT: - case OP_PUSHB_FLD: - case OP_PUSHB_FN: - case OP_PUSHB_I: - case OP_PUSHB_P: - case OP_PUSHB_V: - case OP_PUSHB_Q: - case OP_PUSHBI_F: - case OP_PUSHBI_S: - case OP_PUSHBI_ENT: - case OP_PUSHBI_FLD: - case OP_PUSHBI_FN: - case OP_PUSHBI_I: - case OP_PUSHBI_P: - case OP_PUSHBI_V: - case OP_PUSHBI_Q: + case OP_PUSHB_F_v6p: + case OP_PUSHB_S_v6p: + case OP_PUSHB_ENT_v6p: + case OP_PUSHB_FLD_v6p: + case OP_PUSHB_FN_v6p: + case OP_PUSHB_I_v6p: + case OP_PUSHB_P_v6p: + case OP_PUSHB_V_v6p: + case OP_PUSHB_Q_v6p: + case OP_PUSHBI_F_v6p: + case OP_PUSHBI_S_v6p: + case OP_PUSHBI_ENT_v6p: + case OP_PUSHBI_FLD_v6p: + case OP_PUSHBI_FN_v6p: + case OP_PUSHBI_I_v6p: + case OP_PUSHBI_P_v6p: + case OP_PUSHBI_V_v6p: + case OP_PUSHBI_Q_v6p: // op->type_c is used for selecting the operator during // compilation, but is invalid when running check_global (pr, st, op, op->type_a, st->a, 1); check_global (pr, st, op, op->type_b, st->b, 1); check_global (pr, st, op, ev_invalid, st->c, 1); break; - case OP_POP_F: - case OP_POP_FLD: - case OP_POP_ENT: - case OP_POP_S: - case OP_POP_FN: - case OP_POP_I: - case OP_POP_P: - case OP_POP_V: - case OP_POP_Q: + case OP_POP_F_v6p: + case OP_POP_FLD_v6p: + case OP_POP_ENT_v6p: + case OP_POP_S_v6p: + case OP_POP_FN_v6p: + case OP_POP_I_v6p: + case OP_POP_P_v6p: + case OP_POP_V_v6p: + case OP_POP_Q_v6p: // don't want to check for denormal floats, otherwise - // OP_POP_* could use the defualt rule + // OP_POP__v6p* could use the defualt rule check_global (pr, st, op, op->type_a, st->a, 0); check_global (pr, st, op, ev_invalid, st->b, 1); check_global (pr, st, op, ev_invalid, st->c, 1); break; - case OP_POPB_F: - case OP_POPB_S: - case OP_POPB_ENT: - case OP_POPB_FLD: - case OP_POPB_FN: - case OP_POPB_I: - case OP_POPB_P: - case OP_POPB_V: - case OP_POPB_Q: - case OP_POPBI_F: - case OP_POPBI_S: - case OP_POPBI_ENT: - case OP_POPBI_FLD: - case OP_POPBI_FN: - case OP_POPBI_I: - case OP_POPBI_P: - case OP_POPBI_V: - case OP_POPBI_Q: + case OP_POPB_F_v6p: + case OP_POPB_S_v6p: + case OP_POPB_ENT_v6p: + case OP_POPB_FLD_v6p: + case OP_POPB_FN_v6p: + case OP_POPB_I_v6p: + case OP_POPB_P_v6p: + case OP_POPB_V_v6p: + case OP_POPB_Q_v6p: + case OP_POPBI_F_v6p: + case OP_POPBI_S_v6p: + case OP_POPBI_ENT_v6p: + case OP_POPBI_FLD_v6p: + case OP_POPBI_FN_v6p: + case OP_POPBI_I_v6p: + case OP_POPBI_P_v6p: + case OP_POPBI_V_v6p: + case OP_POPBI_Q_v6p: // op->type_c is used for selecting the operator during // compilation, but is invalid when running check_global (pr, st, op, op->type_a, st->a, 1); @@ -1790,7 +1790,7 @@ PR_Check_Opcodes (progs_t *pr) default: check_global (pr, st, op, op->type_a, st->a, 1); check_global (pr, st, op, op->type_b, st->b, - (op - pr_opcodes) != OP_STORE_F); + (op - pr_v6p_opcodes) != OP_STORE_F_v6p); check_global (pr, st, op, op->type_c, st->c, 0); break; } diff --git a/tools/qfcc/include/opcodes.h b/tools/qfcc/include/opcodes.h index 2ffbe04c8..f6a95f75a 100644 --- a/tools/qfcc/include/opcodes.h +++ b/tools/qfcc/include/opcodes.h @@ -31,27 +31,28 @@ #ifndef __opcodes_h #define __opcodes_h -extern struct opcode_s *op_done; -extern struct opcode_s *op_return; -extern struct opcode_s *op_return_v; -extern struct opcode_s *op_if; -extern struct opcode_s *op_ifnot; -extern struct opcode_s *op_ifbe; -extern struct opcode_s *op_ifb; -extern struct opcode_s *op_ifae; -extern struct opcode_s *op_ifa; -extern struct opcode_s *op_state; -extern struct opcode_s *op_state_f; -extern struct opcode_s *op_goto; -extern struct opcode_s *op_jump; -extern struct opcode_s *op_jumpb; +extern struct v6p_opcode_s *op_done; +extern struct v6p_opcode_s *op_return; +extern struct v6p_opcode_s *op_return_v; +extern struct v6p_opcode_s *op_if; +extern struct v6p_opcode_s *op_ifnot; +extern struct v6p_opcode_s *op_ifbe; +extern struct v6p_opcode_s *op_ifb; +extern struct v6p_opcode_s *op_ifae; +extern struct v6p_opcode_s *op_ifa; +extern struct v6p_opcode_s *op_state; +extern struct v6p_opcode_s *op_state_f; +extern struct v6p_opcode_s *op_goto; +extern struct v6p_opcode_s *op_jump; +extern struct v6p_opcode_s *op_jumpb; struct operand_s; -extern struct opcode_s *opcode_map; +extern struct v6p_opcode_s *opcode_map; -struct opcode_s *opcode_find (const char *name, struct operand_s *op_a, - struct operand_s *op_b, struct operand_s *op_c); +struct v6p_opcode_s *opcode_find (const char *name, struct operand_s *op_a, + struct operand_s *op_b, + struct operand_s *op_c); void opcode_init (void); #endif//__opcodes_h diff --git a/tools/qfcc/source/emit.c b/tools/qfcc/source/emit.c index c2dac98ec..48e89b422 100644 --- a/tools/qfcc/source/emit.c +++ b/tools/qfcc/source/emit.c @@ -185,7 +185,7 @@ emit_statement (statement_t *statement) { const char *opcode = statement->opcode; def_t *def_a, *def_b, *def_c; - opcode_t *op; + v6p_opcode_t *op; dstatement_t *s; def_a = get_operand_def (statement->expr, statement->opa); diff --git a/tools/qfcc/source/opcodes.c b/tools/qfcc/source/opcodes.c index bf962ec96..8ad5358d9 100644 --- a/tools/qfcc/source/opcodes.c +++ b/tools/qfcc/source/opcodes.c @@ -49,14 +49,14 @@ hashtab_t *opcode_type_table; hashtab_t *opcode_void_table; -opcode_t *opcode_map; +v6p_opcode_t *opcode_map; #define ROTL(x,n) ((((unsigned)(x))<<(n))|((unsigned)(x))>>(32-n)) static uintptr_t get_hash (const void *_op, void *_tab) { - opcode_t *op = (opcode_t *) _op; + v6p_opcode_t *op = (v6p_opcode_t *) _op; uintptr_t hash; hash = ROTL (~op->type_a, 8) + ROTL (~op->type_b, 16) @@ -67,8 +67,8 @@ get_hash (const void *_op, void *_tab) static int compare (const void *_opa, const void *_opb, void *unused) { - opcode_t *opa = (opcode_t *) _opa; - opcode_t *opb = (opcode_t *) _opb; + v6p_opcode_t *opa = (v6p_opcode_t *) _opa; + v6p_opcode_t *opb = (v6p_opcode_t *) _opb; int cmp; cmp = (opa->type_a == opb->type_a) @@ -80,7 +80,7 @@ compare (const void *_opa, const void *_opb, void *unused) static const char * get_key (const void *op, void *unused) { - return ((opcode_t *) op)->name; + return ((v6p_opcode_t *) op)->name; } static int @@ -92,13 +92,13 @@ check_operand_type (etype_t ot1, etype_t ot2) return 0; } -opcode_t * +v6p_opcode_t * opcode_find (const char *name, operand_t *op_a, operand_t *op_b, operand_t *op_c) { - opcode_t search_op = {}; - opcode_t *op; - opcode_t *sop; + v6p_opcode_t search_op = {}; + v6p_opcode_t *op; + v6p_opcode_t *sop; void **op_list; int i; @@ -126,8 +126,8 @@ opcode_find (const char *name, operand_t *op_a, operand_t *op_b, void opcode_init (void) { - const opcode_t *op; - opcode_t *mop; + const v6p_opcode_t *op; + v6p_opcode_t *mop; if (opcode_type_table) { Hash_FlushTable (opcode_void_table); @@ -140,14 +140,14 @@ opcode_init (void) } int num_opcodes = 0; - for (op = pr_opcodes; op->name; op++) { + for (op = pr_v6p_opcodes; op->name; op++) { num_opcodes++; } if (!opcode_map) { - opcode_map = calloc (num_opcodes, sizeof (opcode_t)); + opcode_map = calloc (num_opcodes, sizeof (v6p_opcode_t)); } for (int i = 0; i < num_opcodes; i++) { - op = pr_opcodes + i; + op = pr_v6p_opcodes + i; if (op->min_version > options.code.progsversion) continue; mop = opcode_map + i;