0xPolygonMiden / compiler

Compiler from MidenIR to Miden Assembly

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing Miden VM ops counterparts in the IR, preventing their exposure to Rust via intrinsics

greenhat opened this issue · comments

While working on #151 I've noticed that there are some Miden VM operations that are not present in the IR. Which prevents us from exposing them to the user in Rust via intrinsic functions.

Here is a list of them:

Field Operations

  • ilog2
  • assert_eqw
  • eqw
  • ext2*

see Miden VM book

I/O

  • adv* (advice_provider)

see Miden VM book

Cryptographic operations

  • hash;
  • hperm;
  • hmerge;
  • mtree*;

see Miden VM book

Events, Tracing

Already planned in #33

  • emit;
  • trace;

see Miden VM book

Yep, I've added all the missing instructions in my local branch that refactors to use the changes in 0xPolygonMiden/miden-vm#1277, so once that is merged all of these will be represented in the MASM IR, and the arithmetic ops are surfaced in the HIR instruction set. The remainder we will need to determine how we want to surface/represen, i.e. in some cases we may want to surface them more or less directly as an intrinsic, and in others we may want to provide higher-level HIR instructions that then lower to some sequence of MASM ops, as we do with various instructions already.