Skip to content

Support prims in the interpreter#6

Merged
janvrany merged 5 commits intoshingarov:masterfrom
janvrany:pr/support-prims-in-interpreter
Mar 14, 2025
Merged

Support prims in the interpreter#6
janvrany merged 5 commits intoshingarov:masterfrom
janvrany:pr/support-prims-in-interpreter

Conversation

@janvrany
Copy link
Copy Markdown
Collaborator

This PR adds basic support for "primitives" in the interpreter, that is, Ops (@not and so on) and externs (val zsail_sign_extend = "sign_extend" : (%bv, %i) -> %bv)

This commit refactors `JibOp` so it no longer an AST node but a subclass
of (new) `JibPrim`, a common base class for "ops" and `extern`s.

This seems to make more sense now with interpreter / type unification in
mind. A `JibPrim` knows its "signature" (a `Def_Val`) and knows how to
evaluate given argument values.
@janvrany janvrany force-pushed the pr/support-prims-in-interpreter branch from 41ca773 to 2a27fdf Compare March 14, 2025 11:21
@janvrany janvrany merged commit 2978623 into shingarov:master Mar 14, 2025
@janvrany janvrany deleted the pr/support-prims-in-interpreter branch March 14, 2025 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant