From 0dbf0c5953a3d72deebc7e41840a0e73b46de8bc Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 6 May 2002 12:51:41 -0300 Subject: new format for test intructions (handle NaN correctly) --- lopcodes.h | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'lopcodes.h') diff --git a/lopcodes.h b/lopcodes.h index 627bf54e..79dae70c 100644 --- a/lopcodes.h +++ b/lopcodes.h @@ -1,5 +1,5 @@ /* -** $Id: lopcodes.h,v 1.94 2002/04/09 19:47:44 roberto Exp roberto $ +** $Id: lopcodes.h,v 1.95 2002/04/24 20:07:46 roberto Exp roberto $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ @@ -81,19 +81,19 @@ enum OpMode {iABC, iABx, iAsBx}; /* basic instruction format */ #define GETARG_A(i) (cast(int, (i)>>POS_A)) #define SETARG_A(i,u) ((i) = (((i)&MASK0(SIZE_A,POS_A)) | \ - (cast(Instruction, u)<>POS_B) & MASK1(SIZE_B,0))) #define SETARG_B(i,b) ((i) = (((i)&MASK0(SIZE_B,POS_B)) | \ - (cast(Instruction, b)<>POS_C) & MASK1(SIZE_C,0))) #define SETARG_C(i,b) ((i) = (((i)&MASK0(SIZE_C,POS_C)) | \ - (cast(Instruction, b)<>POS_Bx) & MASK1(SIZE_Bx,0))) #define SETARG_Bx(i,b) ((i) = (((i)&MASK0(SIZE_Bx,POS_Bx)) | \ - (cast(Instruction, b)< R/K(C)) then pc++ */ -OP_TESTGE,/* A C if not (R(A) >= R/K(C)) then pc++ */ +OP_EQ,/* A B C if ((R(A) == R/K(C)) ~= B) then pc++ */ +OP_CMP,/* A B C if not (R(A) R/K(C)) then pc++ (see note) */ -OP_TESTT,/* A B if (R(B)) then R(A) := R(B) else pc++ */ -OP_TESTF,/* A B if not (R(B)) then R(A) := R(B) else pc++ */ +OP_TEST,/* A B C if (R(C) <=> B) then R(A) := R(C) else pc++ */ OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */ OP_TAILCALL,/* A B return R(A)(R(A+1), ... ,R(A+B-1)) */ -OP_RETURN,/* A B return R(A), ... ,R(A+B-2) (see (3)) */ +OP_RETURN,/* A B return R(A), ... ,R(A+B-2) (see note) */ OP_FORLOOP,/* A sBx R(A)+=R(A+2); if R(A)