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

[META][MC] Support new / updated instructions from 1.6 ISA #444

Open
6 tasks
asl opened this issue Mar 19, 2024 · 4 comments
Open
6 tasks

[META][MC] Support new / updated instructions from 1.6 ISA #444

asl opened this issue Mar 19, 2024 · 4 comments

Comments

@asl
Copy link
Collaborator Author

asl commented Apr 2, 2024

@asl asl changed the title [MC] Support new / updated instructions [MC] Support new / updated instructions from 1.6 ISA Apr 2, 2024
@asl asl changed the title [MC] Support new / updated instructions from 1.6 ISA [META][MC] Support new / updated instructions from 1.6 ISA May 7, 2024
@atrosinenko
Copy link
Collaborator

@sayon @akiramenai @hedgar2017 asm_instruction definition in the spec mentions a number of instructions:

  • OpContextSetErgsPerPubdataByte was removed in 1.5.0 - should it be completely removed from the MC layer or is some kind of compatibility with pre-1.5.0 ISA expected (such as disassembling machine code)
  • the asm syntax for OpIncrementTxNumber was defined by previous version of the spec (with context.inc_tx_num mnemonic) but not by the current one - what mnemonic to use in the new asm syntax?
  • the asm syntax for OpAuxMutating is not defined neither now nor before - should it be ignored for now?

@atrosinenko
Copy link
Collaborator

@sayon The new spec on OpLoad lists the following variants of syntax:

    ldm in1, out1
    ldm.h to access heap (default)
    ldm.ah to access auxheap
    ldm.st to access static memory page

If ldm in1, out1 and ldm.h in1, out1 are aliases, which should be used by default (that is, for printing) or is ldm in1, out1 line (no modifiers at all) provided for illustration purpose only and should be rejected by the parser?

@sayon
Copy link

sayon commented May 23, 2024

  1. Note: this is for VM 1.5, not 1.6. 1.6 will come in more distant future.

OpContextSetErgsPerPubdataByte was removed in 1.5.0 - should it be completely removed from the MC layer or is some kind of compatibility with pre-1.5.0 ISA expected (such as disassembling machine code)

This instruction is not replaced with anything, just removed, and there is a placeholder instead in the VM code called smth like AuxMutating0. My vote is for leaving it in the ISA but emitting a legacy warning when trying to compile a code with it. The mnemonic is stpub.

the asm syntax for OpIncrementTxNumber was defined by previous version of the spec (with context.inc_tx_num mnemonic) but not by the current one - what mnemonic to use in the new asm syntax?

Thank you, this was not intentional. The mnemonic isinctx, i will restore it in the next iteration.

the asm syntax for OpAuxMutating is not defined neither now nor before - should it be ignored for now?

Yes, please ignore as it is a placeholder. This was not clear in the moment when spec was written.

As for the default modifiers, I think here is what we can do, universally (@akiramenai @hedgar2017 correct me if you disagree):

  1. For printing, be maximally explicit, include all modifiers that make sense. Therefore, ldm.h for printing.
  2. Accept both ldm and ldm.h.

I see it as an instance of the "in module interfaces, be relaxed on inputs, strict on the outputs" system design principle.

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

No branches or pull requests

3 participants