Commit Graph

3 Commits

Author SHA1 Message Date
jooris 6f6c84eac4 feat: differentiate between signed and unsigned multiplication
- Split `BinaryOp::Mul` into `BinaryOp::SMul` and `BinaryOp::UMul` in
the IR.
- Implement x86_64 codegen for `UMul` using the `mulq` instruction.
- Update `X86Backend` to use `imulq` specifically for `SMul`.
- Update constant folding and IR printer to support the new
multiplication operations.
- Optimize function epilogue by omitting the final `jmp` on fallthrough.
- Update `main` test case to use `build_umul`.
2026-04-27 13:36:17 +02:00
jooris 5b8a0cb398 feat: add basic block reordering pass and improve codegen naming
- Implement `reorder_blocks` (BBR) pass using DFS to maximize
fallthroughs.
- Update x86_64 backend to use actual function names in call
instructions instead of generic IDs.
- Replace the GCD test case in main with an iterative factorial test
module.
- Remove redundant validation check at the end of the optimization
pipeline.
2026-04-27 10:56:47 +02:00
jooris 9d94e3b81b init: initial commit of the Scarlett framework
- Initialize Rust project configuration (Cargo) and .gitignore
- Implement core Intermediate Representation (IR), printer, and builder
utilities
- Add IR validation module for type checking and constraint verification
- Introduce optimization passes: Mem2Reg, Constant Folding, Copy
Propagation, Dead Code Elimination, and SSA Destruction
- Implement x86_64 backend for assembly code generation
- Add a C test harness and main entry point to generate, compile, and
test a GCD assembly function
2026-04-26 19:28:32 +02:00