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

Replace instructions and and xor by nand or nor #19

Closed
jan-ferdinand opened this issue Aug 8, 2022 · 2 comments · Fixed by #181
Closed

Replace instructions and and xor by nand or nor #19

jan-ferdinand opened this issue Aug 8, 2022 · 2 comments · Fixed by #181
Labels
🕵 investigation This design change might improve the VM

Comments

@jan-ferdinand
Copy link
Member

The current set of binary instructions available in Triton VM, and and xor, is functionally complete, but not minimally so. Replacing them by either nand or nor

  • does not change completeness,
  • marginally decreases usability (or and not are not natively available anyway),
  • simplifies the instruction set architecture, and
  • simplifies the U32 Table.

(Originally issue number 41 in the internal issue tracker.)

@jan-ferdinand jan-ferdinand added 🤔 question More information is needed 🟢 prio: low Not at all urgent 🕵 investigation This design change might improve the VM 🖐 blocked Requires something else first. and removed 🤔 question More information is needed 🟢 prio: low Not at all urgent labels Aug 8, 2022
@jan-ferdinand
Copy link
Member Author

This is pretty tightly coupled with #8. Furthermore, we need a benchmark target before the question can be answered – the investigation is blocked by #7.

@jan-ferdinand
Copy link
Member Author

(Originally posted by @aszepieniec.)

Also worth noting, for u32s:

A + B == (A ^ B) + ((A & B) << 1)

and so

A ^ B == A + B - ((A & B) << 1)

Please verify. Credit goes to @bobbinth who, IIRC, credited Daniel Lubarov.

@jan-ferdinand jan-ferdinand removed the 🖐 blocked Requires something else first. label Dec 24, 2022
@jan-ferdinand jan-ferdinand linked a pull request Feb 16, 2023 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕵 investigation This design change might improve the VM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant