Download Latest Version localedata.jar (843.2 kB)
Email in envelope

Get an email when there's a new version of Supernova Rom

Home / cm / android / system / dalvik / vm / mterp / x86-atom
Name Modified Size InfoDownloads / Week
Parent folder
bincmp.S 2011-11-26 1.8 kB
binop2addr.S 2011-11-26 1.8 kB
binop.S 2011-11-26 1.6 kB
binopD2addr.S 2011-11-26 2.7 kB
binopD.S 2011-11-26 2.3 kB
binopDivRemLong2Addr.S 2011-11-26 2.2 kB
binopDivRemLong.S 2011-11-26 2.0 kB
binopDLit8.S 2011-11-26 2.5 kB
binopDLit16.S 2011-11-26 2.5 kB
binopF2addr.S 2011-11-26 1.7 kB
binopF.S 2011-11-26 1.6 kB
binopLit8.S 2011-11-26 1.6 kB
binopLit8S.S 2011-11-26 1.6 kB
binopLit16.S 2011-11-26 1.8 kB
binopS2addr.S 2011-11-26 1.7 kB
binopS.S 2011-11-26 1.6 kB
binopWide2addr.S 2011-11-26 1.7 kB
binopWide.S 2011-11-26 1.7 kB
entry.S 2011-11-26 10.2 kB
footer.S 2011-11-26 28.1 kB
header.S 2011-11-26 12.1 kB
OP_SGET_CHAR.S 2011-11-26 726 Bytes
OP_SGET_OBJECT.S 2011-11-26 728 Bytes
OP_SGET_OBJECT_VOLATILE.S 2011-11-26 25 Bytes
OP_SGET_SHORT.S 2011-11-26 727 Bytes
OP_SGET_VOLATILE.S 2011-11-26 25 Bytes
OP_SGET_WIDE.S 2011-11-26 2.8 kB
OP_SHL_INT.S 2011-11-26 753 Bytes
OP_SHL_INT_2ADDR.S 2011-11-26 764 Bytes
OP_SHL_INT_LIT8.S 2011-11-26 762 Bytes
OP_SHL_LONG.S 2011-11-26 1.6 kB
OP_SHL_LONG_2ADDR.S 2011-11-26 1.7 kB
OP_SHR_INT.S 2011-11-26 753 Bytes
OP_SHR_INT_2ADDR.S 2011-11-26 764 Bytes
OP_SHR_INT_LIT8.S 2011-11-26 762 Bytes
OP_SHR_LONG.S 2011-11-26 2.2 kB
OP_SHR_LONG_2ADDR.S 2011-11-26 2.2 kB
OP_SPARSE_SWITCH.S 2011-11-26 780 Bytes
OP_SPUT.S 2011-11-26 2.7 kB
OP_SPUT_BOOLEAN.S 2011-11-26 729 Bytes
OP_SPUT_BYTE.S 2011-11-26 726 Bytes
OP_SPUT_CHAR.S 2011-11-26 726 Bytes
OP_SPUT_OBJECT.S 2011-11-26 3.1 kB
OP_SPUT_OBJECT_VOLATILE.S 2011-11-26 32 Bytes
OP_SPUT_SHORT.S 2011-11-26 727 Bytes
OP_SPUT_VOLATILE.S 2011-11-26 25 Bytes
OP_SPUT_WIDE.S 2011-11-26 2.8 kB
OP_SUB_DOUBLE.S 2011-11-26 762 Bytes
OP_SUB_DOUBLE_2ADDR.S 2011-11-26 773 Bytes
OP_SUB_FLOAT.S 2011-11-26 760 Bytes
OP_SUB_FLOAT_2ADDR.S 2011-11-26 771 Bytes
OP_SUB_INT.S 2011-11-26 754 Bytes
OP_SUB_INT_2ADDR.S 2011-11-26 765 Bytes
OP_SUB_INT_LIT8.S 2011-11-26 763 Bytes
OP_SUB_LONG.S 2011-11-26 761 Bytes
OP_SUB_LONG_2ADDR.S 2011-11-26 772 Bytes
OP_THROW.S 2011-11-26 1.4 kB
OP_THROW_VERIFICATION_ERROR.S 2011-11-26 1.7 kB
OP_UNUSED_3E.S 2011-11-26 725 Bytes
OP_UNUSED_3F.S 2011-11-26 725 Bytes
OP_UNUSED_7A.S 2011-11-26 725 Bytes
OP_UNUSED_40.S 2011-11-26 725 Bytes
OP_UNUSED_41.S 2011-11-26 725 Bytes
OP_UNUSED_42.S 2011-11-26 725 Bytes
OP_UNUSED_43.S 2011-11-26 725 Bytes
OP_UNUSED_73.S 2011-11-26 725 Bytes
OP_UNUSED_79.S 2011-11-26 725 Bytes
OP_UNUSED_E3.S 2011-11-26 725 Bytes
OP_UNUSED_E4.S 2011-11-26 725 Bytes
OP_UNUSED_E5.S 2011-11-26 725 Bytes
OP_UNUSED_E6.S 2011-11-26 725 Bytes
OP_UNUSED_E7.S 2011-11-26 725 Bytes
OP_UNUSED_F1.S 2011-11-26 725 Bytes
OP_UNUSED_FC.S 2011-11-26 725 Bytes
OP_UNUSED_FD.S 2011-11-26 725 Bytes
OP_UNUSED_FE.S 2011-11-26 725 Bytes
OP_UNUSED_FF.S 2011-11-26 725 Bytes
OP_USHR_INT.S 2011-11-26 754 Bytes
OP_USHR_INT_2ADDR.S 2011-11-26 765 Bytes
OP_USHR_INT_LIT8.S 2011-11-26 763 Bytes
OP_USHR_LONG.S 2011-11-26 1.6 kB
OP_USHR_LONG_2ADDR.S 2011-11-26 1.7 kB
OP_XOR_INT.S 2011-11-26 753 Bytes
OP_XOR_INT_2ADDR.S 2011-11-26 764 Bytes
OP_XOR_INT_LIT8.S 2011-11-26 762 Bytes
OP_XOR_INT_LIT16.S 2011-11-26 764 Bytes
OP_XOR_LONG.S 2011-11-26 759 Bytes
OP_XOR_LONG_2ADDR.S 2011-11-26 770 Bytes
stub.S 2011-11-26 1.1 kB
TODO.txt 2011-11-26 104 Bytes
unop.S 2011-11-26 1.8 kB
unopWide.S 2011-11-26 1.8 kB
unused.S 2011-11-26 933 Bytes
zcmp.S 2011-11-26 1.9 kB
OP_ADD_DOUBLE.S 2011-11-26 762 Bytes
OP_ADD_DOUBLE_2ADDR.S 2011-11-26 773 Bytes
OP_ADD_FLOAT.S 2011-11-26 760 Bytes
OP_ADD_FLOAT_2ADDR.S 2011-11-26 771 Bytes
OP_ADD_INT.S 2011-11-26 754 Bytes
OP_ADD_INT_2ADDR.S 2011-11-26 765 Bytes
OP_ADD_INT_LIT8.S 2011-11-26 763 Bytes
OP_ADD_INT_LIT16.S 2011-11-26 765 Bytes
OP_ADD_LONG.S 2011-11-26 760 Bytes
OP_ADD_LONG_2ADDR.S 2011-11-26 771 Bytes
OP_AGET.S 2011-11-26 2.6 kB
OP_AGET_BOOLEAN.S 2011-11-26 758 Bytes
OP_AGET_BYTE.S 2011-11-26 756 Bytes
OP_AGET_CHAR.S 2011-11-26 756 Bytes
OP_AGET_OBJECT.S 2011-11-26 728 Bytes
OP_AGET_SHORT.S 2011-11-26 757 Bytes
OP_AGET_WIDE.S 2011-11-26 1.9 kB
OP_AND_INT.S 2011-11-26 754 Bytes
OP_AND_INT_2ADDR.S 2011-11-26 765 Bytes
OP_AND_INT_LIT8.S 2011-11-26 763 Bytes
OP_AND_INT_LIT16.S 2011-11-26 765 Bytes
OP_AND_LONG.S 2011-11-26 759 Bytes
OP_AND_LONG_2ADDR.S 2011-11-26 770 Bytes
OP_APUT.S 2011-11-26 2.4 kB
OP_APUT_BOOLEAN.S 2011-11-26 775 Bytes
OP_APUT_BYTE.S 2011-11-26 772 Bytes
OP_APUT_CHAR.S 2011-11-26 771 Bytes
OP_APUT_OBJECT.S 2011-11-26 3.9 kB
OP_APUT_SHORT.S 2011-11-26 772 Bytes
OP_APUT_WIDE.S 2011-11-26 1.9 kB
OP_ARRAY_LENGTH.S 2011-11-26 1.6 kB
OP_CHECK_CAST.S 2011-11-26 4.9 kB
OP_CMP_LONG.S 2011-11-26 2.0 kB
OP_CMPG_DOUBLE.S 2011-11-26 761 Bytes
OP_CMPG_FLOAT.S 2011-11-26 750 Bytes
OP_CMPL_DOUBLE.S 2011-11-26 748 Bytes
OP_CMPL_FLOAT.S 2011-11-26 2.6 kB
OP_CONST.S 2011-11-26 1.4 kB
OP_CONST_4.S 2011-11-26 1.4 kB
OP_CONST_16.S 2011-11-26 1.3 kB
OP_CONST_CLASS.S 2011-11-26 2.9 kB
OP_CONST_HIGH16.S 2011-11-26 1.4 kB
OP_CONST_STRING.S 2011-11-26 2.8 kB
OP_CONST_STRING_JUMBO.S 2011-11-26 3.0 kB
OP_CONST_WIDE.S 2011-11-26 1.8 kB
OP_CONST_WIDE_16.S 2011-11-26 1.5 kB
OP_CONST_WIDE_32.S 2011-11-26 1.6 kB
OP_CONST_WIDE_HIGH16.S 2011-11-26 1.4 kB
OP_DIV_DOUBLE.S 2011-11-26 1.4 kB
OP_DIV_DOUBLE_2ADDR.S 2011-11-26 1.4 kB
OP_DIV_FLOAT.S 2011-11-26 1.4 kB
OP_DIV_FLOAT_2ADDR.S 2011-11-26 1.4 kB
OP_DIV_INT.S 2011-11-26 723 Bytes
OP_DIV_INT_2ADDR.S 2011-11-26 734 Bytes
OP_DIV_INT_LIT8.S 2011-11-26 732 Bytes
OP_DIV_INT_LIT16.S 2011-11-26 734 Bytes
OP_DIV_LONG.S 2011-11-26 733 Bytes
OP_DIV_LONG_2ADDR.S 2011-11-26 744 Bytes
OP_DOUBLE_TO_FLOAT.S 2011-11-26 1.3 kB
OP_DOUBLE_TO_INT.S 2011-11-26 2.7 kB
OP_DOUBLE_TO_LONG.S 2011-11-26 3.0 kB
OP_EXECUTE_INLINE.S 2011-11-26 3.4 kB
OP_EXECUTE_INLINE_RANGE.S 2011-11-26 2.9 kB
OP_FILL_ARRAY_DATA.S 2011-11-26 1.9 kB
OP_FILLED_NEW_ARRAY.S 2011-11-26 7.5 kB
OP_FILLED_NEW_ARRAY_RANGE.S 2011-11-26 769 Bytes
OP_FLOAT_TO_DOUBLE.S 2011-11-26 1.3 kB
OP_FLOAT_TO_INT.S 2011-11-26 2.9 kB
OP_FLOAT_TO_LONG.S 2011-11-26 3.0 kB
OP_GOTO.S 2011-11-26 1.3 kB
OP_GOTO_16.S 2011-11-26 1.3 kB
OP_GOTO_32.S 2011-11-26 1.5 kB
OP_IF_EQ.S 2011-11-26 739 Bytes
OP_IF_EQZ.S 2011-11-26 738 Bytes
OP_IF_GE.S 2011-11-26 738 Bytes
OP_IF_GEZ.S 2011-11-26 737 Bytes
OP_IF_GT.S 2011-11-26 739 Bytes
OP_IF_GTZ.S 2011-11-26 738 Bytes
OP_IF_LE.S 2011-11-26 738 Bytes
OP_IF_LEZ.S 2011-11-26 737 Bytes
OP_IF_LT.S 2011-11-26 739 Bytes
OP_IF_LTZ.S 2011-11-26 738 Bytes
OP_IF_NE.S 2011-11-26 738 Bytes
OP_IF_NEZ.S 2011-11-26 737 Bytes
OP_IGET.S 2011-11-26 3.4 kB
OP_IGET_BOOLEAN.S 2011-11-26 729 Bytes
OP_IGET_BYTE.S 2011-11-26 726 Bytes
OP_IGET_CHAR.S 2011-11-26 726 Bytes
OP_IGET_OBJECT.S 2011-11-26 728 Bytes
OP_IGET_OBJECT_QUICK.S 2011-11-26 740 Bytes
OP_IGET_OBJECT_VOLATILE.S 2011-11-26 25 Bytes
OP_IGET_QUICK.S 2011-11-26 1.6 kB
OP_IGET_SHORT.S 2011-11-26 727 Bytes
OP_IGET_VOLATILE.S 2011-11-26 25 Bytes
OP_IGET_WIDE.S 2011-11-26 3.2 kB
OP_IGET_WIDE_QUICK.S 2011-11-26 1.6 kB
OP_INSTANCE_OF.S 2011-11-26 5.1 kB
OP_INT_TO_BYTE.S 2011-11-26 781 Bytes
OP_INT_TO_CHAR.S 2011-11-26 780 Bytes
OP_INT_TO_DOUBLE.S 2011-11-26 1.5 kB
OP_INT_TO_FLOAT.S 2011-11-26 1.4 kB
OP_INT_TO_LONG.S 2011-11-26 1.5 kB
OP_INT_TO_SHORT.S 2011-11-26 782 Bytes
OP_INVOKE_DIRECT.S 2011-11-26 4.3 kB
OP_INVOKE_DIRECT_EMPTY.S 2011-11-26 860 Bytes
OP_INVOKE_DIRECT_RANGE.S 2011-11-26 782 Bytes
OP_INVOKE_INTERFACE.S 2011-11-26 3.7 kB
OP_INVOKE_INTERFACE_RANGE.S 2011-11-26 788 Bytes
OP_INVOKE_STATIC.S 2011-11-26 3.3 kB
OP_INVOKE_STATIC_RANGE.S 2011-11-26 767 Bytes
OP_INVOKE_SUPER.S 2011-11-26 4.7 kB
OP_INVOKE_SUPER_QUICK.S 2011-11-26 1.8 kB
OP_INVOKE_SUPER_QUICK_RANGE.S 2011-11-26 792 Bytes
OP_INVOKE_SUPER_RANGE.S 2011-11-26 780 Bytes
OP_INVOKE_VIRTUAL.S 2011-11-26 4.4 kB
OP_INVOKE_VIRTUAL_QUICK.S 2011-11-26 1.6 kB
OP_INVOKE_VIRTUAL_QUICK_RANGE.S 2011-11-26 796 Bytes
OP_INVOKE_VIRTUAL_RANGE.S 2011-11-26 784 Bytes
OP_IPUT.S 2011-11-26 3.4 kB
OP_IPUT_BOOLEAN.S 2011-11-26 729 Bytes
OP_IPUT_BYTE.S 2011-11-26 726 Bytes
OP_IPUT_CHAR.S 2011-11-26 726 Bytes
OP_IPUT_OBJECT.S 2011-11-26 3.7 kB
OP_IPUT_OBJECT_QUICK.S 2011-11-26 1.9 kB
OP_IPUT_OBJECT_VOLATILE.S 2011-11-26 32 Bytes
OP_IPUT_QUICK.S 2011-11-26 1.5 kB
OP_IPUT_SHORT.S 2011-11-26 727 Bytes
OP_IPUT_VOLATILE.S 2011-11-26 25 Bytes
OP_IPUT_WIDE.S 2011-11-26 3.1 kB
OP_IPUT_WIDE_QUICK.S 2011-11-26 1.6 kB
OP_LONG_TO_DOUBLE.S 2011-11-26 1.5 kB
OP_LONG_TO_FLOAT.S 2011-11-26 1.5 kB
OP_LONG_TO_INT.S 2011-11-26 728 Bytes
OP_MONITOR_ENTER.S 2011-11-26 2.3 kB
OP_MONITOR_EXIT.S 2011-11-26 2.0 kB
OP_MOVE.S 2011-11-26 1.5 kB
OP_MOVE_16.S 2011-11-26 1.4 kB
OP_MOVE_EXCEPTION.S 2011-11-26 1.5 kB
OP_MOVE_FROM16.S 2011-11-26 1.3 kB
OP_MOVE_OBJECT.S 2011-11-26 728 Bytes
OP_MOVE_OBJECT_16.S 2011-11-26 734 Bytes
OP_MOVE_OBJECT_FROM16.S 2011-11-26 742 Bytes
OP_MOVE_RESULT.S 2011-11-26 1.6 kB
OP_MOVE_RESULT_OBJECT.S 2011-11-26 742 Bytes
OP_MOVE_RESULT_WIDE.S 2011-11-26 1.6 kB
OP_MOVE_WIDE.S 2011-11-26 1.4 kB
OP_MOVE_WIDE_16.S 2011-11-26 1.4 kB
OP_MOVE_WIDE_FROM16.S 2011-11-26 1.3 kB
OP_MUL_DOUBLE.S 2011-11-26 762 Bytes
OP_MUL_DOUBLE_2ADDR.S 2011-11-26 773 Bytes
OP_MUL_FLOAT.S 2011-11-26 756 Bytes
OP_MUL_FLOAT_2ADDR.S 2011-11-26 767 Bytes
OP_MUL_INT.S 2011-11-26 754 Bytes
OP_MUL_INT_2ADDR.S 2011-11-26 765 Bytes
OP_MUL_INT_LIT8.S 2011-11-26 763 Bytes
OP_MUL_INT_LIT16.S 2011-11-26 765 Bytes
OP_MUL_LONG.S 2011-11-26 2.4 kB
OP_MUL_LONG_2ADDR.S 2011-11-26 2.4 kB
OP_NEG_DOUBLE.S 2011-11-26 796 Bytes
OP_NEG_FLOAT.S 2011-11-26 765 Bytes
OP_NEG_INT.S 2011-11-26 749 Bytes
OP_NEG_LONG.S 2011-11-26 808 Bytes
OP_NEW_ARRAY.S 2011-11-26 3.9 kB
OP_NEW_INSTANCE.S 2011-11-26 5.7 kB
OP_NOP.S 2011-11-26 1.1 kB
OP_NOT_INT.S 2011-11-26 749 Bytes
OP_NOT_LONG.S 2011-11-26 763 Bytes
OP_OR_INT.S 2011-11-26 747 Bytes
OP_OR_INT_2ADDR.S 2011-11-26 758 Bytes
OP_OR_INT_LIT8.S 2011-11-26 756 Bytes
OP_OR_INT_LIT16.S 2011-11-26 758 Bytes
OP_OR_LONG.S 2011-11-26 755 Bytes
OP_OR_LONG_2ADDR.S 2011-11-26 766 Bytes
OP_PACKED_SWITCH.S 2011-11-26 2.2 kB
OP_REM_DOUBLE.S 2011-11-26 2.1 kB
OP_REM_DOUBLE_2ADDR.S 2011-11-26 2.1 kB
OP_REM_FLOAT.S 2011-11-26 1.7 kB
OP_REM_FLOAT_2ADDR.S 2011-11-26 1.8 kB
OP_REM_INT.S 2011-11-26 735 Bytes
OP_REM_INT_2ADDR.S 2011-11-26 746 Bytes
OP_REM_INT_LIT8.S 2011-11-26 744 Bytes
OP_REM_INT_LIT16.S 2011-11-26 746 Bytes
OP_REM_LONG.S 2011-11-26 753 Bytes
OP_REM_LONG_2ADDR.S 2011-11-26 764 Bytes
OP_RETURN.S 2011-11-26 732 Bytes
OP_RETURN_COMMON.S 2011-11-26 1.2 kB
OP_RETURN_OBJECT.S 2011-11-26 739 Bytes
OP_RETURN_VOID.S 2011-11-26 738 Bytes
OP_RETURN_WIDE.S 2011-11-26 1.2 kB
OP_RSUB_INT.S 2011-11-26 1.5 kB
OP_RSUB_INT_LIT8.S 2011-11-26 1.4 kB
OP_SGET.S 2011-11-26 2.7 kB
OP_SGET_BOOLEAN.S 2011-11-26 729 Bytes
OP_SGET_BYTE.S 2011-11-26 726 Bytes
Totals: 288 Items   430.0 kB 0
Dalvik "mterp" README

NOTE: Find rebuilding instructions at the bottom of this file.


==== Overview ====

This is the source code for the Dalvik interpreter.  The core of the
original version was implemented as a single C function, but to improve
performance we rewrote it in assembly.  To make this and future assembly
ports easier and less error-prone, we used a modular approach that allows
development of platform-specific code one opcode at a time.

The original all-in-one-function C version still exists as the "portable"
interpreter, and is generated using the same sources and tools that
generate the platform-specific versions.  One form of the portable
interpreter includes support for profiling and debugging features, and
is included even if we have a platform-optimized implementation.

Every configuration has a "config-*" file that controls how the sources
are generated.  The sources are written into the "out" directory, where
they are picked up by the Android build system.

The best way to become familiar with the interpreter is to look at the
generated files in the "out" directory, such as out/InterpC-portstd.c,
rather than trying to look at the various component pieces in (say)
armv5te.


==== Platform-specific source generation ====

The architecture-specific config files determine what goes into two
generated output files (InterpC-<arch>.c, InterpAsm-<arch>.S).  The goal is
to make it easy to swap C and assembly sources during initial development
and testing, and to provide a way to use architecture-specific versions of
some operations (e.g. making use of PLD instructions on ARMv6 or avoiding
CLZ on ARMv4T).

Two basic assumptions are made about the operation of the interpreter:

 - The assembly version uses fixed-size areas for each instruction
   (e.g. 64 bytes).  "Overflow" code is tacked on to the end.
 - When a C implementation is desired, the assembly version packs all
   local state into a "glue" struct, and passes that into the C function.
   Updates to the state are pulled out of the "glue" on return.

The "arch" value should indicate an architecture family with common
programming characteristics, so "armv5te" would work for all ARMv5TE CPUs,
but might not be backward- or forward-compatible.  (We *might* want to
specify the ABI model as well, e.g. "armv5te-eabi", but currently that adds
verbosity without value.)


==== Config file format ====

The config files are parsed from top to bottom.  Each line in the file
may be blank, hold a comment (line starts with '#'), or be a command.

The commands are:

  handler-size <bytes>

    Specify the size of the assembly region, in bytes.  On most platforms
    this will need to be a power of 2.

  import <filename>

    The specified file is included immediately, in its entirety.  No
    substitutions are performed.  ".c" and ".h" files are copied to the
    C output, ".S" files are copied to the asm output.

  asm-stub <filename>

    The named file will be included whenever an assembly "stub" is needed.
    Text substitution is performed on the opcode name.

  op-start <directory>

    Indicates the start of the opcode list.  Must precede any "op"
    commands.  The specified directory is the default location to pull
    instruction files from.

  op <opcode> <directory>

    Can only appear after "op-start" and before "op-end".  Overrides the
    default source file location of the specified opcode.  The opcode
    definition will come from the specified file, e.g. "op OP_NOP armv5te"
    will load from "armv5te/OP_NOP.S".  A substitution dictionary will be
    applied (see below).

  op-end

    Indicates the end of the opcode list.  All 256 opcodes are emitted
    when this is seen, followed by any code that didn't fit inside the
    fixed-size instruction handler space.


The order of "op" directives is not significant; the generation tool will
extract ordering info from the VM sources.

Typically the form in which most opcodes currently exist is used in
the "op-start" directive.  For a new port you would start with "c",
and add architecture-specific "op" entries as you write instructions.
When complete it will default to the target architecture, and you insert
"c" ops to stub out platform-specific code.

For the <directory> specified in the "op" command, the "c" directory
is special in two ways: (1) the sources are assumed to be C code, and
will be inserted into the generated C file; (2) when a C implementation
is emitted, a "glue stub" is emitted in the assembly source file.
(The generator script always emits 256 assembly instructions, unless
"asm-stub" was left blank, in which case it only emits some labels.)


==== Instruction file format ====

The assembly instruction files are simply fragments of assembly sources.
The starting label will be provided by the generation tool, as will
declarations for the segment type and alignment.  The expected target
assembler is GNU "as", but others will work (may require fiddling with
some of the pseudo-ops emitted by the generation tool).

The C files do a bunch of fancy things with macros in an attempt to share
code with the portable interpreter.  (This is expected to be reduced in
the future.)

A substitution dictionary is applied to all opcode fragments as they are
appended to the output.  Substitutions can look like "$value" or "${value}".

The dictionary always includes:

  $opcode - opcode name, e.g. "OP_NOP"
  $opnum - opcode number, e.g. 0 for OP_NOP
  $handler_size_bytes - max size of an instruction handler, in bytes
  $handler_size_bits - max size of an instruction handler, log 2

Both C and assembly sources will be passed through the C pre-processor,
so you can take advantage of C-style comments and preprocessor directives
like "#define".

Some generator operations are available.

  %include "filename" [subst-dict]

    Includes the file, which should look like "armv5te/OP_NOP.S".  You can
    specify values for the substitution dictionary, using standard Python
    syntax.  For example, this:
      %include "armv5te/unop.S" {"result":"r1"}
    would insert "armv5te/unop.S" at the current file position, replacing
    occurrences of "$result" with "r1".

  %default <subst-dict>

    Specify default substitution dictionary values, using standard Python
    syntax.  Useful if you want to have a "base" version and variants.

  %break

    Identifies the split between the main portion of the instruction
    handler (which must fit in "handler-size" bytes) and the "sister"
    code, which is appended to the end of the instruction handler block.

  %verify "message"

    Leave a note to yourself about what needs to be tested.  (This may
    turn into something more interesting someday; for now, it just gets
    stripped out before the output is generated.)

The generation tool does *not* print a warning if your instructions
exceed "handler-size", but the VM will abort on startup if it detects an
oversized handler.  On architectures with fixed-width instructions this
is easy to work with, on others this you will need to count bytes.


==== Using C constants from assembly sources ====

The file "common/asm-constants.h" has some definitions for constant
values, structure sizes, and struct member offsets.  The format is fairly
restricted, as simple macros are used to massage it for use with both C
(where it is verified) and assembly (where the definitions are used).

If a constant in the file becomes out of sync, the VM will log an error
message and abort during startup.


==== Development tips ====

If you need to debug the initial piece of an opcode handler, and your
debug code expands it beyond the handler size limit, you can insert a
generic header at the top:

    b       ${opcode}_start
%break
${opcode}_start:

If you already have a %break, it's okay to leave it in place -- the second
%break is ignored.


==== Rebuilding ====

If you change any of the source file fragments, you need to rebuild the
combined source files in the "out" directory.  Make sure the files in
"out" are editable, then:

    $ cd mterp
    $ ./rebuild.sh

As of this writing, this requires Python 2.5. You may see inscrutible
error messages or just general failure if you have a different version
of Python installed.

The ultimate goal is to have the build system generate the necessary
output files without requiring this separate step, but we're not yet
ready to require Python in the build.
Source: README.txt, updated 2011-11-26