From 455c03321c804fd49113446e92d4279e6e51bbec Mon Sep 17 00:00:00 2001 From: Borja Ferrer Date: Sat, 9 Dec 2006 01:47:07 +0000 Subject: [PATCH] added stradjust.pri opcode to the JIT --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40206 --- sourcepawn/jit/x86/jit_x86.cpp | 8 ++++++++ sourcepawn/jit/x86/opcode_helpers.h | 1 + sourcepawn/jit/x86/opcode_switch.inc | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/sourcepawn/jit/x86/jit_x86.cpp b/sourcepawn/jit/x86/jit_x86.cpp index aedd936a..44d5b33f 100644 --- a/sourcepawn/jit/x86/jit_x86.cpp +++ b/sourcepawn/jit/x86/jit_x86.cpp @@ -1750,6 +1750,14 @@ inline void WriteOp_Tracker_Pop_SetHeap(JitWriter *jit) IA32_Pop_Reg(jit, AMX_REG_PRI); } +inline void WriteOp_Stradjust_Pri(JitWriter *jit) +{ + //add eax, 4 + //sar eax, 2 + IA32_Add_Rm_Imm8(jit, AMX_REG_PRI, 4, MOD_REG); + IA32_Sar_Rm_Imm8(jit, AMX_REG_PRI, 2, MOD_REG); +} + /************************************************* ************************************************* * JIT PROPER ************************************ diff --git a/sourcepawn/jit/x86/opcode_helpers.h b/sourcepawn/jit/x86/opcode_helpers.h index 2036ead4..f8045c16 100644 --- a/sourcepawn/jit/x86/opcode_helpers.h +++ b/sourcepawn/jit/x86/opcode_helpers.h @@ -260,6 +260,7 @@ typedef enum OP_TRACKER_POP_SETHEAP, //VERIFIED OP_GENARRAY, //VERIFIED OP_GENARRAY_Z, //-VERIFIED (not tested for 1D arrays) + OP_STRADJUST_PRI, //VERIFIED /* ----- */ OP_NUM_OPCODES } OPCODE; diff --git a/sourcepawn/jit/x86/opcode_switch.inc b/sourcepawn/jit/x86/opcode_switch.inc index 7e1ebc0b..69a3db23 100644 --- a/sourcepawn/jit/x86/opcode_switch.inc +++ b/sourcepawn/jit/x86/opcode_switch.inc @@ -673,6 +673,11 @@ WriteOp_GenArray(jit, true); break; } + case OP_STRADJUST_PRI: + { + WriteOp_Stradjust_Pri(jit); + break; + } #if defined USE_UNGEN_OPCODES #include "ungen_opcode_switch.inc" #endif