[TM-368] New duupX
Description
We have duupX
which is equivalent to DUU*P
macro from Michelson. Its implementation in Michelson has changed because there are new instructions. If number of U
s is greater than 2, it is implemented as DIP (n - 1) { DUP }; DIG n
. It is more efficient. For DUUP
the old implementation is still better.
Note that DIG n
can be replaced with DIG (n -1)
. n
-th and (n-1)
-th items are the same. I use the most efficient implementation in Lorentz, even though it slightly differs from DUUP
.
So this MR:
- Updates
duupX
in Lorentz. - Updates macro expansion (to be precisely the same as in Michelson).
Related issue(s)
https://issues.serokell.io/issue/TM-368
✅ Checklist for your Merge Request
Related changes (conditional)
-
Tests (see short guidelines)
-
If I added new functionality, I added tests covering it. -
If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
-
-
Documentation
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.