项目
在 GitHub 查看
maekawatoshiki/sericum
关于
(Toy) Compiler Infrastructure influenced by LLVM written in Rust
编程语言与运行时实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Sericum
Compiler Infrastructure influenced by LLVM written in Rust
Do not expect too much stuff!
To Do
- Implement basic block parameters
- Make it possible to generate code for multiple targets without rebuilding sericum itself
- Verify IR
- More optimizations for IR
- Support returning struct as value
- Write documents
Build
Requirement: Rust nightly
cargo test --features x86_64 # build for x86_64
cargo test brainfuxk --features x86_64 --release -- --nocapture # this is fun. just try it.
cargo test --features aarch64 # build for aarch64. a few features are implemented.
cargo test --features riscv64 # currently doesn't work. need help.
Example
cargo test demo --features $ARCH -- --nocapture # $ARCH is x86_64 or aarch64
- Useful macro is available to describe IR
let fibo = sericum_ir!(m; define [i32] f [(i32)] {
entry:
cond = icmp le (%arg.0), (i32 2);
br (%cond) l1, l2;
l1:
ret (i32 1);
l2:
a1 = sub (%arg.0), (i32 1);
r1 = call f [(%a1)];
a2 = sub (%arg.0), (i32 2);
r2 = call f [(%a2)];
r3 = add (%r1), (%r2);
ret (%r3);
});
Make your own language using sericum as backend
./minilang and ./sericumcc may help you.
探索相关项目
加载中…