Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit fleshes out the implementation of inline assembly that we had essentially stubbed out prior to this. The following are provided as part of this implementation: * A representation of the Miden Assembly instruction set, in crate, with the ops we intend to support in the near term. This is used to represent the contents of inline assembly, and is also used in the upcoming codegen backend as the target IR for Miden Assembly, as it is a flatter representation similar to Miden IR. The intent is to also implement a tiny evaluator for this subset of Miden Assembly for use in tests without having to emit MASM files, and run the Miden VM which is much more expensive. It also allows us to track the subset of Miden Assembly which we support in the compiler, as well as represent experimental changes that have not yet been implemented upstream. * `MasmBuilder`, which is constructed from an `InstBuilder` via `inline_asm`, and plays a similar role to `FunctionBuilder`+`InstBuilder`, but in terms of Miden Assembly, in the context of constructing a single inline assembly block. * Improved pretty printing of inline assembly. Now, an inline assembly block is printed like so (this block adds the two inputs, and squares the result, which is returned as the result of the inline assembly block): ```hir asm (v1, v2) { add mul.2 } : felt ``` * A generic data structure for use in representing the operand stack, and the common operations which are performed on it. This is used to validate inline assembly, as well as keep track of values during code generation. It will also likely be used for whatever evaluator we throw together for use in testing.
- Loading branch information