The synthesis
of target agnostic JIT
Boris Shingarov
www.shingarov.com
"Portable" VMs
- Impossible
- Beyond the "Uniprocessor Era"
Processor Description Languages
- G. Zimmerman.
The MIMOLA Design System:
A Computer Aided Digital Processor Design Method.
(Kiel Radioastronomical Observatory, 1979)
- High-Level Synthesis
- PDL → Silicon
- PDL → FPGA
- PDL → FSS Simulator
- PDL → Language Toolchain
PDL Example
- ArchC
- Open source
- SystemC modeling / simulation
- High-fidelity FSS (Syscall mode also possible)
- Runs unmodified Linux on ARM, SPARC, MIPS, PowerPC
Instruction semantics in ArchC
- Simulation-oriented PDL
- Arbitrary procedural code
- ACCGen Extension
- RTL-level declarative semantics
- Synthesize compiler backend from ArchC+ACCGen
Machine Description-based code generation
- Tree Matching
- Aho & Johnson, 1976
- Cattell, 1980
- Ganapathi & Fischer, 1985
- Aho & al., 1989
Experimental Implementation
- Pharo / Cog
- PetitParser for the ArchC grammar
- Structural description in Smalltalk objects
- Instruction encodings in Smalltalk objects
- RTL semantics in a logic database
Tree matching as backtracking
- Design goal: simplicity
- LaLonde & van Gulik, 1988
- Prolog/V by Mike Teng
- Squeak port by Bolot Kerimbaev
- Partial Pharo port
- Every instruction semantic statement is a logic rule
- ...semantic is... → assert
Future work
- Platform ABI
- Simulator Integration
- M5sim / GEM5
- ArchC SystemC
Future Work (cont.)
- Tree rewriting
- mov r1, r2
mov r2, r3
mov r3, r4
add r4, 1, r5
- costs