// opcodes.h -- opcode encodings
//
// Author: Ian.Piumarta@inria.fr
//
// Last edited: Thu Feb 25 19:50:59 1999 by piumarta (Ian Piumarta) on pingu

#ifndef _opcodes_h_
#define _opcodes_h_

#include "config.h"

#define _DO_OPCODES() \
  /* regular opcodes */ \
  _DO(OpJmp) _DO(OpJmpChk) _DO(OpJmpT) _DO(OpJmpF) \
  _DO(OpLdSelf) _DO(OpLdTrue) _DO(OpLdFalse) _DO(OpLdNil) \
  _DO(OpLdMinusOne) _DO(OpLdZero) _DO(OpLdOne) _DO(OpLdTwo)  \
  _DO(OpLdInst) _DO(OpLdTemp) _DO(OpLdLit) _DO(OpLdLitInd) \
  _DO(OpLdThisContext) \
  _DO(OpStInst) _DO(OpStTemp) _DO(OpStLitInd) \
  _DO(OpPopInst) _DO(OpPopTemp) _DO(OpPopLitInd) \
  _DO(OpRetSelf) _DO(OpRetTrue) _DO(OpRetFalse) _DO(OpRetNil) \
  _DO(OpMethodRet) _DO(OpBlockRet) \
  _DO(OpQkRetSelf) _DO(OpQkRetTrue) _DO(OpQkRetFalse) _DO(OpQkRetNil) \
  _DO(OpQkRetTop) \
  _DO(OpSend) _DO(OpSuper) \
  _DO(OpPop) _DO(OpDup) \
  /* special sends */ \
  _DO(OpAdd) _DO(OpSubtract) \
  _DO(OpLess) _DO(OpGreater) _DO(OpLessEqual) _DO(OpGreaterEqual) \
  _DO(OpEqual) _DO(OpNotEqual) \
  _DO(OpMultiply) _DO(OpDivide) _DO(OpMod) \
  _DO(OpMakePoint) \
  _DO(OpBitShift) \
  _DO(OpDiv) \
  _DO(OpBitAnd) _DO(OpBitOr) \
  _DO(OpAt) _DO(OpAtPut) \
  _DO(OpSize) _DO(OpNext) _DO(OpNextPut) _DO(OpAtEnd) \
  _DO(OpEquivalent) \
  _DO(OpClass) \
  _DO(OpBlockCopy) _DO(OpValue) _DO(OpValueWithArg) \
  _DO(OpDo) \
  _DO(OpNew) _DO(OpNewWithArg) \
  _DO(OpPointX) _DO(OpPointY) \
  /* prologue opcodes */ \
  _DO(OpPrimitivePushSelf) \
  _DO(OpPrimitivePushTrue) _DO(OpPrimitivePushFalse) _DO(OpPrimitivePushNil) \
  _DO(OpPrimitivePushMinusOne) _DO(OpPrimitivePushZero) \
  _DO(OpPrimitivePushOne) _DO(OpPrimitivePushTwo) \
  _DO(OpPrimitiveLoadInstVar) \
  _DO(OpPrimitive) _DO(OpActivate) _DO(OpQkActivate) \
  /* rewritten opcodes */ \
  _DO(OpLinkedSend) _DO(OpLinkedSuper) \
  _DO(OpCheckClass) _DO(OpCheckCompact) _DO(OpCheckImmediate) \
  _DO(OpRelink) \
  _DO(OpCheckImmediate_0_0) \
  _DO(OpReserve)

enum {
  OpIllegal= 0,
# define _DO(X) X,
  _DO_OPCODES()
# undef _DO
};


#ifdef THREADED
  extern void **opcodeTable;
# define OP(X)	((word)opcodeTable[X])
#else
# define OP(X)	(X)
#endif


#endif _opcodes_h_

