Movsucator is an LLVM-based compiler targeting a MOV-only instruction set architecture, demonstrating that MOV is Turing-complete. This project implements a complete backend for LLVM that translates LLVM IR into a sequence of MOV instructions.
- MOV-only instruction set implementation
- LLVM 17.0.6 integration
- Custom register allocation
- Memory operation support
- Basic calling convention implementation
- MOV-based arithmetic operations
- Stack frame management
- LLVM 17.0.6
- CMake (3.13.4 or higher)
- Ninja build system
- C++17 compatible compiler
- Clone the repository:
git clone https://github.com/yourusername/movsucator.git
cd movsucator
- Build LLVM and Movsucator:
# Build everything (LLVM + Movsucator)
./build.sh
# Build only Movsucator (if LLVM is already built)
./build.sh --target-only
# Skip running tests
./build.sh --skip-tests
# Clean build
./build.sh --clean
movsucator/
├── CMakeLists.txt # Main CMake configuration
├── build.sh # Build script
├── lib/
│ └── Target/
│ └── Movsucator/ # Movsucator backend implementation
│ ├── MCTargetDesc/ # Machine code description
│ ├── TargetInfo/ # Target information
│ └── ... # Other target-specific files
├── include/ # Public headers
├── test/ # Test files
│ └── CodeGen/
│ └── Movsucator/ # LLVM IR test cases
└── docs/ # Documentation
The project includes several test cases in the test/CodeGen/Movsucator
directory:
arithmetic.ll
: Tests for MOV-based arithmetic operationsmemory.ll
: Tests for memory operationscontrolflow.ll
: Tests for control flow constructs
Run tests using:
./build.sh --skip-llvm
cd test/CodeGen/Movsucator
../../../llvm-project/build/bin/llvm-lit .
- ✅ Basic target infrastructure setup
- ✅ Register definitions and classes
- ✅ Basic MOV instruction definitions
- ✅ Memory operations support
- ✅ MOV-based arithmetic operations
- ✅ Stack frame management
⚠️ ABI implementation (in progress)⚠️ Conditional operations (planned)
Contributions are welcome! Please read the contributing guidelines before submitting pull requests.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- LLVM Team for the excellent compiler infrastructure
- Stephen Dolan for the proof that MOV is Turing-complete