MIR means Medium Internal Representation. MIR project goal is to provide a basis to implement fast and lightweight interpreters and JITs. Plans to try MIR light-weight JIT first for CRuby or/and MRuby implementation. Each module can contain functions and declarations and data. Each function has a signature (parameters and return types), local variables (including function arguments) and instructions. Each local variable has a type which can be only a 64-bit integer, float, double, or long double. Each instruction has an opcode and operands. Operand can be a local variable (or a function argument), immediate, memory, label, or reference. The immediate operand can be a 64-bit integer, float, double, or long double value. There are conversion instructions for conversion between different 32- and 64-bit signed and unsigned values, float, double, and long double values. There are return instructions working on 32- and 64-bit integer values, float, double, and long double values.
Features
- MIR is strongly typed
- MIR can represent machine 32-bit and 64-bit insns of different architectures
- MIR.md contains detail description of MIR and its API. Here is a brief MIR description:
- Each module can contain functions and some declarations and data
- opcode describes what the instruction does
- There are function and procedural call instructions