x86-codegen

Work in progress, nowhere close to completion

An experimental x86 code generator written in Rust. Consists of a dynamic assembler and an IR stage.

Progress

  • Dynamic assembler with encoder generator
    • Encoder generator
      • Instruction field support
        • REX
        • ModRM
        • SIB
        • VEX2
        • VEX3
        • immediate bytes
        • Legacy prefixes?
      • Labels
        • rel32 jumps
        • Other types of jumps?
      • Memory alignment padding pseudo instruction
      • Compile time code generation for constant bytes
    • Dynamic Assembler
      • Basic instruction encoders
      • Support for more 64bit instructions
      • SETcc instructions for logical expression evaluation
      • SSE instructions
  • IR
    • Expression evaluater
      • Arithmetic expressions
      • Logical and relational expressions
        • AND, OR
        • <=, <, ==, >, >=, !=
      • Expression simplification
      • Floating point expressions (requires SSE instructions)
    • Statement builder
      • Branching constructs
      • Looping constructs
    • Optimizers
      • Context dependend encoder