Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement codegen #27

Merged
merged 48 commits into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
023b0f3
feat: export inline asm block/op formatting primitives
bitwalker Sep 22, 2023
da003b2
feat: implement stackification analyses
bitwalker Sep 22, 2023
c89499d
feat: improve ergonomics of immediate values
bitwalker Sep 23, 2023
476c1e1
feat: add push2 meta instruction to masm isa
bitwalker Sep 23, 2023
560ac29
fix: use smallvec for masm block contents
bitwalker Sep 23, 2023
062c639
fix: make dfg.inst return instruction, and dfg.inst_node the node
bitwalker Sep 23, 2023
e790175
feat: extend masm ir for use in codegen
bitwalker Sep 23, 2023
47ec6f8
feat: impelement most of the stackification pass
bitwalker Sep 23, 2023
541a67e
feat: implement lowering of global values
bitwalker Sep 24, 2023
fa6ebfa
feat: implement lowering of inline assembly
bitwalker Sep 24, 2023
242e5e3
feat: rewrite type layout functionality
bitwalker Oct 9, 2023
a108dea
test: add tests for inline-asm stack, fix bugs
bitwalker Oct 9, 2023
1d1b915
feat: masm imports
bitwalker Oct 9, 2023
b87d5d8
fix: make store/memcpy primops
bitwalker Oct 9, 2023
35c7487
chore: fix clippy warnings/errors
bitwalker Oct 9, 2023
26bf7eb
feat: add assert_eq_imm builder
bitwalker Oct 9, 2023
b73090c
fix: ret instruction was incorrectly given a result type
bitwalker Oct 9, 2023
5072e5d
fix: items in arenamap must remain addressable even when removed
bitwalker Oct 9, 2023
e0cdeb0
feat: improve ergonomics of a few key hir types
bitwalker Oct 9, 2023
198d660
feat: introduce program builder
bitwalker Oct 9, 2023
81deee2
test: clean up hir tests
bitwalker Oct 9, 2023
0d7a097
test: inline blocks pass
bitwalker Oct 9, 2023
460b1b5
test: split critical edges pass
bitwalker Oct 9, 2023
9219f09
test: treeify pass
bitwalker Oct 9, 2023
4c12592
chore: update masm ir program/module/function items
bitwalker Oct 9, 2023
1adf881
feat: add nativeptr type to masm ir
bitwalker Oct 9, 2023
8a71b62
refactor: rewrite operand stack impl for codegen
bitwalker Oct 9, 2023
c9babdd
wip(stackify): implement lowering of instructions, with helpers
bitwalker Oct 9, 2023
3fdb51c
fix(stackify): update pass, fix various bugs uncovered in testing
bitwalker Oct 9, 2023
f12926a
feat: implement masm ir emulator for testing
bitwalker Oct 9, 2023
c86df15
test: implement codegen frontend and tests
bitwalker Oct 9, 2023
a379215
chore: update cranelift deps
bitwalker Oct 9, 2023
133b0dc
test: add analysis tests
bitwalker Oct 9, 2023
476df0a
fix: a few load related bugs
bitwalker Oct 10, 2023
3a8e369
fix: stackify bug in loop exit edge handling
bitwalker Oct 10, 2023
88c95ad
feat: add debugging utilities to test emulator harness
bitwalker Oct 10, 2023
513d85c
fix: bug in treeify pass due to shallow instruction cloning
bitwalker Oct 11, 2023
334df7a
fix: missing liveness data for branch arguments
bitwalker Oct 11, 2023
e529b0d
fix: bug in construction of sum_matrix test function
bitwalker Oct 11, 2023
ee4f9c2
fix: mishandling of mem_loadw/mem_storew semantics
bitwalker Oct 11, 2023
661b43c
fix: don't emit redundant u32.assert for known u32 values
bitwalker Oct 11, 2023
1d1af4e
fix: bug in depgraph node index oracle
bitwalker Oct 11, 2023
f8b8b2f
fix: a variety of operand stack bugs
bitwalker Oct 11, 2023
e0c1688
feat: improve debugging facilities of the test emulator
bitwalker Oct 11, 2023
32ff39b
chore: clean up clippy warnings
bitwalker Oct 11, 2023
befd696
feat: impl display trait for function
bitwalker Oct 11, 2023
f1b1f35
feat: prettify assertions on textual ir
bitwalker Oct 11, 2023
d33a7b7
chore: clean up emulator dispatch loop code
bitwalker Oct 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 48 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[workspace]
resolver = "2"
members = [
"codegen/*",
"hir",
"hir-analysis",
"hir-pass",
Expand Down Expand Up @@ -29,11 +30,12 @@ publish = false
anyhow = "1.0"
bitflags = "1.3"
clap = { version = "4.1", features = ["derive"] }
cranelift-entity = "0.95"
cranelift-bforest = "0.95"
cranelift-entity = "0.100"
cranelift-bforest = "0.100"
env_logger = "0.9"
intrusive-collections = "0.9"
log = "0.4"
paste = "1.0"
parking_lot = "0.12"
parking_lot_core = "0.9"
pretty_assertions = "1.0"
Expand Down
25 changes: 25 additions & 0 deletions codegen/masm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
name = "miden-codegen-masm"
version.workspace = true
rust-version.workspace = true
authors.workspace = true
repository.workspace = true
categories.workspace = true
keywords.workspace = true
license.workspace = true
readme.workspace = true
edition.workspace = true

[dependencies]
anyhow.workspace = true
thiserror.workspace = true
cranelift-entity.workspace = true
intrusive-collections.workspace = true
miden-diagnostics.workspace = true
miden-hir = { path = "../../hir" }
miden-hir-analysis = { path = "../../hir-analysis" }
miden-hir-pass = { path = "../../hir-pass" }
miden-hir-transform = { path = "../../hir-transform" }
paste.workspace = true
rustc-hash.workspace = true
smallvec.workspace = true
Loading
Loading