From 173e41b2ebed59a716d299470de25e50aee3b921 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 26 Apr 2017 14:46:52 -0300 Subject: new opcode OP_ADDI (for immediate integer operand) (Experimental) --- lopcodes.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lopcodes.h') diff --git a/lopcodes.h b/lopcodes.h index ed3ea66d..c359581d 100644 --- a/lopcodes.h +++ b/lopcodes.h @@ -1,5 +1,5 @@ /* -** $Id: lopcodes.h,v 1.150 2017/04/20 19:53:55 roberto Exp roberto $ +** $Id: lopcodes.h,v 1.151 2017/04/24 20:26:39 roberto Exp roberto $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ @@ -90,7 +90,7 @@ enum OpMode {iABC, iABx, iAsBx, iAx}; /* basic instruction format */ #define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \ ((cast(Instruction, o)<>pos) & MASK1(size,0))) +#define getarg(i,pos,size) (cast(int, ((i)>>(pos)) & MASK1(size,0))) #define setarg(i,v,pos,size) ((i) = (((i)&MASK0(size,pos)) | \ ((cast(Instruction, v)<