2006-09-20 04:56:20 +02:00
|
|
|
#ifndef _INCLUDE_SOURCEPAWN_JIT_X86_OPCODE_INFO_H_
|
|
|
|
#define _INCLUDE_SOURCEPAWN_JIT_X86_OPCODE_INFO_H_
|
|
|
|
|
|
|
|
#include "..\jit_helpers.h"
|
|
|
|
|
2006-09-20 09:07:49 +02:00
|
|
|
/**
|
|
|
|
* This outputs the execution function for a plugin.
|
|
|
|
* It also returns the 'return' offset, which is used for
|
|
|
|
* breaking out of the JIT during runtime.
|
|
|
|
*
|
|
|
|
* If 'never_inline' is true, it outputs slightly different code used for
|
|
|
|
* inlining the error checking routines.
|
|
|
|
*/
|
|
|
|
jitoffs_t Write_Execute_Function(JitWriter *jit, bool never_inline);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* These are for writing the PushN opcodes.
|
|
|
|
*/
|
2006-09-20 04:56:20 +02:00
|
|
|
void Macro_PushN_Addr(JitWriter *jit, int i);
|
|
|
|
void Macro_PushN_S(JitWriter *jit, int i);
|
|
|
|
void Macro_PushN_C(JitWriter *jit, int i);
|
|
|
|
void Macro_PushN(JitWriter *jit, int i);
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
OP_NONE, /* invalid opcode */
|
2006-09-20 05:56:24 +02:00
|
|
|
OP_LOAD_PRI, //DONE
|
|
|
|
OP_LOAD_ALT, //DONE
|
|
|
|
OP_LOAD_S_PRI, //DONE
|
|
|
|
OP_LOAD_S_ALT, //DONE
|
|
|
|
OP_LREF_PRI, //DONE
|
|
|
|
OP_LREF_ALT, //DONE
|
|
|
|
OP_LREF_S_PRI, //DONE
|
|
|
|
OP_LREF_S_ALT, //DONE
|
|
|
|
OP_LOAD_I,
|
2006-09-20 04:56:20 +02:00
|
|
|
OP_LODB_I,
|
2006-09-20 05:56:24 +02:00
|
|
|
OP_CONST_PRI, //DONE
|
|
|
|
OP_CONST_ALT, //DONE
|
|
|
|
OP_ADDR_PRI, //DONE
|
|
|
|
OP_ADDR_ALT, //DONE
|
|
|
|
OP_STOR_PRI, //DONE
|
|
|
|
OP_STOR_ALT, //DONE
|
|
|
|
OP_STOR_S_PRI, //DONE
|
|
|
|
OP_STOR_S_ALT, //DONE
|
|
|
|
OP_SREF_PRI, //DONE
|
|
|
|
OP_SREF_ALT, //DONE
|
|
|
|
OP_SREF_S_PRI, //DONE
|
|
|
|
OP_SREF_S_ALT, //DONE
|
|
|
|
OP_STOR_I,
|
2006-09-20 04:56:20 +02:00
|
|
|
OP_STRB_I,
|
2006-09-20 05:56:24 +02:00
|
|
|
OP_LIDX,
|
2006-09-20 04:56:20 +02:00
|
|
|
OP_LIDX_B,
|
2006-09-20 05:56:24 +02:00
|
|
|
OP_IDXADDR, //DONE
|
2006-09-20 04:56:20 +02:00
|
|
|
OP_IDXADDR_B,
|
2006-09-20 05:56:24 +02:00
|
|
|
OP_ALIGN_PRI, //DONE
|
|
|
|
OP_ALIGN_ALT, //DONE
|
2006-09-20 04:56:20 +02:00
|
|
|
OP_LCTRL,
|
|
|
|
OP_SCTRL,
|
2006-09-20 05:56:24 +02:00
|
|
|
OP_MOVE_PRI, //DONE
|
|
|
|
OP_MOVE_ALT, //DONE
|
|
|
|
OP_XCHG, //DONE
|
|
|
|
OP_PUSH_PRI, //DONE
|
|
|
|
OP_PUSH_ALT, //DONE
|
|
|
|
OP_PUSH_R, //DEPRECATED
|
|
|
|
OP_PUSH_C, //DONE
|
|
|
|
OP_PUSH, //DONE
|
|
|
|
OP_PUSH_S, //DONE
|
|
|
|
OP_POP_PRI, //DONE
|
|
|
|
OP_POP_ALT, //DONE
|
|
|
|
OP_STACK,
|
|
|
|
OP_HEAP,
|
|
|
|
OP_PROC, //DONE
|
2006-09-20 04:56:20 +02:00
|
|
|
OP_RET,
|
2006-09-20 05:56:24 +02:00
|
|
|
OP_RETN,
|
2006-09-20 04:56:20 +02:00
|
|
|
OP_CALL,
|
|
|
|
OP_CALL_PRI,
|
2006-09-20 05:56:24 +02:00
|
|
|
OP_JUMP,
|
|
|
|
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|
|
|
OP_SLEQ, //DONE
|
|
|
|
OP_SGRTR, //DONE
|
|
|
|
OP_SGEQ, //DONE
|
|
|
|
OP_EQ_C_PRI, //DONE
|
|
|
|
OP_EQ_C_ALT, //DONE
|
|
|
|
OP_INC_PRI, //DONE
|
|
|
|
OP_INC_ALT, //DONE
|
|
|
|
OP_INC, //DONE
|
|
|
|
OP_INC_S, //DONE
|
|
|
|
OP_INC_I, //DONE
|
|
|
|
OP_DEC_PRI, //DONE
|
|
|
|
OP_DEC_ALT, //DONE
|
|
|
|
OP_DEC, //DONE
|
|
|
|
OP_DEC_S, //DONE
|
|
|
|
OP_DEC_I, //DONE
|
|
|
|
OP_MOVS, //DONE
|
|
|
|
OP_CMPS,
|
|
|
|
OP_FILL, //DONE
|
|
|
|
OP_HALT,
|
2006-09-20 04:56:20 +02:00
|
|
|
OP_BOUNDS,
|
|
|
|
OP_SYSREQ_PRI,
|
|
|
|
OP_SYSREQ_C,
|
2006-09-20 05:56:24 +02:00
|
|
|
OP_FILE, //DEPRECATED
|
|
|
|
OP_LINE, //DEPRECATED
|
|
|
|
OP_SYMBOL, //DEPRECATED
|
|
|
|
OP_SRANGE, //DEPRECATED
|
2006-09-20 04:56:20 +02:00
|
|
|
OP_JUMP_PRI,
|
|
|
|
OP_SWITCH,
|
2006-09-20 05:56:24 +02:00
|
|
|
OP_CASETBL,
|
|
|
|
OP_SWAP_PRI, //DONE
|
|
|
|
OP_SWAP_ALT, //DONE
|
2006-09-20 06:14:53 +02:00
|
|
|
OP_PUSH_ADR, //DONE
|
2006-09-20 05:56:24 +02:00
|
|
|
OP_NOP, //DONE
|
2006-09-20 04:56:20 +02:00
|
|
|
OP_SYSREQ_N,
|
2006-09-20 05:56:24 +02:00
|
|
|
OP_SYMTAG, //DEPRECATED
|
2006-09-20 04:56:20 +02:00
|
|
|
OP_BREAK,
|
2006-09-20 05:56:24 +02:00
|
|
|
OP_PUSH2_C, //DONE
|
|
|
|
OP_PUSH2, //DONE
|
|
|
|
OP_PUSH2_S, //DONE
|
|
|
|
OP_PUSH2_ADR, //DONE
|
|
|
|
OP_PUSH3_C, //DONE
|
|
|
|
OP_PUSH3, //DONE
|
|
|
|
OP_PUSH3_S, //DONE
|
|
|
|
OP_PUSH3_ADR, //DONE
|
|
|
|
OP_PUSH4_C, //DONE
|
|
|
|
OP_PUSH4, //DONE
|
|
|
|
OP_PUSH4_S, //DONE
|
|
|
|
OP_PUSH4_ADR, //DONE
|
|
|
|
OP_PUSH5_C, //DONE
|
|
|
|
OP_PUSH5, //DONE
|
|
|
|
OP_PUSH5_S, //DONE
|
|
|
|
OP_PUSH5_ADR, //DONE
|
2006-09-20 06:14:53 +02:00
|
|
|
OP_LOAD_BOTH, //DONE
|
|
|
|
OP_LOAD_S_BOTH, //DONE
|
|
|
|
OP_CONST, //DONE
|
|
|
|
OP_CONST_S, //DONE
|
2006-09-20 04:56:20 +02:00
|
|
|
/* ----- */
|
2006-09-20 05:56:24 +02:00
|
|
|
OP_SYSREQ_D, //UNSUPPORTED
|
|
|
|
OP_SYSREQ_ND, //UNSUPPORTED
|
2006-09-20 04:56:20 +02:00
|
|
|
/* ----- */
|
2006-09-20 05:56:24 +02:00
|
|
|
OP_HEAP_PRI, //DONE
|
|
|
|
OP_PUSH_HEAP_C, //DONE
|
|
|
|
OP_POP_HEAP_PRI, //DONE
|
2006-09-20 04:56:20 +02:00
|
|
|
/* ----- */
|
|
|
|
OP_NUM_OPCODES
|
|
|
|
} OPCODE;
|
|
|
|
|
|
|
|
extern int OpAdvTable[];
|
|
|
|
|
|
|
|
#endif //_INCLUDE_SOURCEPAWN_JIT_X86_OPCODE_INFO_H_
|