misc/liblua/lopcodes.c
author unc0rr
Mon, 04 Jun 2012 22:43:56 +0400
changeset 7178 c61cfc9eb29d
parent 2812 0a24853de796
child 10017 de822cd3df3a
permissions -rw-r--r--
Don't make unnecessary calls to TestWhip, TestFirePunch, TestBaseballBat and TestHammer functions as they have no need to take Targ parameter into account and thus may only be called once per position
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2812
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
     1
/*
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
     2
** $Id: lopcodes.c,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
     3
** See Copyright Notice in lua.h
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
     4
*/
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
     5
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
     6
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
     7
#define lopcodes_c
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
     8
#define LUA_CORE
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
     9
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    10
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    11
#include "lopcodes.h"
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    12
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    13
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    14
/* ORDER OP */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    15
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    16
const char *const luaP_opnames[NUM_OPCODES+1] = {
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    17
  "MOVE",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    18
  "LOADK",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    19
  "LOADBOOL",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    20
  "LOADNIL",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    21
  "GETUPVAL",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    22
  "GETGLOBAL",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    23
  "GETTABLE",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    24
  "SETGLOBAL",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    25
  "SETUPVAL",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    26
  "SETTABLE",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    27
  "NEWTABLE",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    28
  "SELF",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    29
  "ADD",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    30
  "SUB",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    31
  "MUL",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    32
  "DIV",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    33
  "MOD",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    34
  "POW",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    35
  "UNM",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    36
  "NOT",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    37
  "LEN",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    38
  "CONCAT",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    39
  "JMP",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    40
  "EQ",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    41
  "LT",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    42
  "LE",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    43
  "TEST",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    44
  "TESTSET",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    45
  "CALL",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    46
  "TAILCALL",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    47
  "RETURN",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    48
  "FORLOOP",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    49
  "FORPREP",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    50
  "TFORLOOP",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    51
  "SETLIST",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    52
  "CLOSE",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    53
  "CLOSURE",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    54
  "VARARG",
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    55
  NULL
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    56
};
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    57
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    58
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    59
#define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m))
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    60
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    61
const lu_byte luaP_opmodes[NUM_OPCODES] = {
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    62
/*       T  A    B       C     mode		   opcode	*/
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    63
  opmode(0, 1, OpArgR, OpArgN, iABC) 		/* OP_MOVE */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    64
 ,opmode(0, 1, OpArgK, OpArgN, iABx)		/* OP_LOADK */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    65
 ,opmode(0, 1, OpArgU, OpArgU, iABC)		/* OP_LOADBOOL */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    66
 ,opmode(0, 1, OpArgR, OpArgN, iABC)		/* OP_LOADNIL */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    67
 ,opmode(0, 1, OpArgU, OpArgN, iABC)		/* OP_GETUPVAL */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    68
 ,opmode(0, 1, OpArgK, OpArgN, iABx)		/* OP_GETGLOBAL */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    69
 ,opmode(0, 1, OpArgR, OpArgK, iABC)		/* OP_GETTABLE */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    70
 ,opmode(0, 0, OpArgK, OpArgN, iABx)		/* OP_SETGLOBAL */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    71
 ,opmode(0, 0, OpArgU, OpArgN, iABC)		/* OP_SETUPVAL */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    72
 ,opmode(0, 0, OpArgK, OpArgK, iABC)		/* OP_SETTABLE */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    73
 ,opmode(0, 1, OpArgU, OpArgU, iABC)		/* OP_NEWTABLE */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    74
 ,opmode(0, 1, OpArgR, OpArgK, iABC)		/* OP_SELF */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    75
 ,opmode(0, 1, OpArgK, OpArgK, iABC)		/* OP_ADD */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    76
 ,opmode(0, 1, OpArgK, OpArgK, iABC)		/* OP_SUB */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    77
 ,opmode(0, 1, OpArgK, OpArgK, iABC)		/* OP_MUL */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    78
 ,opmode(0, 1, OpArgK, OpArgK, iABC)		/* OP_DIV */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    79
 ,opmode(0, 1, OpArgK, OpArgK, iABC)		/* OP_MOD */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    80
 ,opmode(0, 1, OpArgK, OpArgK, iABC)		/* OP_POW */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    81
 ,opmode(0, 1, OpArgR, OpArgN, iABC)		/* OP_UNM */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    82
 ,opmode(0, 1, OpArgR, OpArgN, iABC)		/* OP_NOT */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    83
 ,opmode(0, 1, OpArgR, OpArgN, iABC)		/* OP_LEN */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    84
 ,opmode(0, 1, OpArgR, OpArgR, iABC)		/* OP_CONCAT */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    85
 ,opmode(0, 0, OpArgR, OpArgN, iAsBx)		/* OP_JMP */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    86
 ,opmode(1, 0, OpArgK, OpArgK, iABC)		/* OP_EQ */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    87
 ,opmode(1, 0, OpArgK, OpArgK, iABC)		/* OP_LT */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    88
 ,opmode(1, 0, OpArgK, OpArgK, iABC)		/* OP_LE */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    89
 ,opmode(1, 1, OpArgR, OpArgU, iABC)		/* OP_TEST */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    90
 ,opmode(1, 1, OpArgR, OpArgU, iABC)		/* OP_TESTSET */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    91
 ,opmode(0, 1, OpArgU, OpArgU, iABC)		/* OP_CALL */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    92
 ,opmode(0, 1, OpArgU, OpArgU, iABC)		/* OP_TAILCALL */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    93
 ,opmode(0, 0, OpArgU, OpArgN, iABC)		/* OP_RETURN */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    94
 ,opmode(0, 1, OpArgR, OpArgN, iAsBx)		/* OP_FORLOOP */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    95
 ,opmode(0, 1, OpArgR, OpArgN, iAsBx)		/* OP_FORPREP */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    96
 ,opmode(1, 0, OpArgN, OpArgU, iABC)		/* OP_TFORLOOP */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    97
 ,opmode(0, 0, OpArgU, OpArgU, iABC)		/* OP_SETLIST */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    98
 ,opmode(0, 0, OpArgN, OpArgN, iABC)		/* OP_CLOSE */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
    99
 ,opmode(0, 1, OpArgU, OpArgN, iABx)		/* OP_CLOSURE */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
   100
 ,opmode(0, 1, OpArgU, OpArgN, iABC)		/* OP_VARARG */
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
   101
};
0a24853de796 add liblua to sources for macosx
koda
parents:
diff changeset
   102