mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
[FunC] Deprecate pragma compute-asm-ltr
It changes all hashes, since the compiler needs to manipulate the stack in a different way now.
This commit is contained in:
parent
aaf3ca335d
commit
1e4b20a061
11 changed files with 41 additions and 71 deletions
|
@ -51,8 +51,6 @@ tuple test_tuple(int x) method_id(13) {
|
|||
return asm_func(x, x += 1, x, x, x~inc(x / 20), x, x = x * 2);
|
||||
}
|
||||
|
||||
#pragma compute-asm-ltr;
|
||||
|
||||
(int, int, int, int, int, int, int) test_call_asm_new(int x) method_id(18) {
|
||||
return asm_func(x, x~incWrap(x / 20), x, x = x * 2, x, x += 1, x);
|
||||
}
|
||||
|
@ -83,11 +81,11 @@ TESTCASE | 13 | 100 | [ 100 50 105 210 210 211 211 ]
|
|||
TESTCASE | 14 | 100 | 100 50 105 210 210 211 211
|
||||
TESTCASE | 15 | 100 | 100 50 105 210 210 211 211
|
||||
TESTCASE | 16 | 100 | 100 50 105 210 210 211 211
|
||||
TESTCASE | 17 | 100 | 100 50 105 210 210 211 211
|
||||
TESTCASE | 17 | 100 | 101 50 106 212 100 101 101
|
||||
TESTCASE | 18 | 100 | 210 210 211 211 100 50 105
|
||||
TESTCASE | 19 | 100 | 100 50 105 210 210 211 211
|
||||
TESTCASE | 20 | 80 | 80 89 1 8 8
|
||||
TESTCASE | 20 | 9 | 9 -40 -10 -1 13
|
||||
|
||||
@code_hash 67078680159561921827850021610104736412668316252257881932102553152922274405210
|
||||
@code_hash 91381947614024372269097215913018978221053550615790649489637387647848569490128
|
||||
-}
|
||||
|
|
|
@ -60,8 +60,6 @@ int foo(int x) {
|
|||
return (t, t2);
|
||||
}
|
||||
|
||||
#pragma compute-asm-ltr;
|
||||
|
||||
(tuple, tuple) test_new_1() method_id(21) {
|
||||
t = empty_tuple();
|
||||
tuple t2 = asmFunc1(foo(11), foo(22), foo(33));
|
||||
|
@ -105,11 +103,11 @@ int foo(int x) {
|
|||
{-
|
||||
method_id | in | out
|
||||
TESTCASE | 11 | | [ 11 22 33 ] [ 110 220 330 ]
|
||||
TESTCASE | 12 | | [ 33 22 11 ] [ 330 220 110 ]
|
||||
TESTCASE | 13 | | [ 22 33 11 ] [ 220 330 110 ]
|
||||
TESTCASE | 12 | | [ 11 22 33 ] [ 330 220 110 ]
|
||||
TESTCASE | 13 | | [ 11 22 33 ] [ 220 330 110 ]
|
||||
TESTCASE | 14 | | [ 11 22 33 44 55 ] [ 220 330 440 110 550 ]
|
||||
TESTCASE | 15 | | [ 33 22 ] [ 220 330 ]
|
||||
TESTCASE | 16 | | [ 22 33 11 ] [ 220 330 110 ]
|
||||
TESTCASE | 15 | | [ 22 33 ] [ 220 330 ]
|
||||
TESTCASE | 16 | | [ 11 22 33 ] [ 220 330 110 ]
|
||||
TESTCASE | 21 | | [ 11 22 33 ] [ 110 220 330 ]
|
||||
TESTCASE | 22 | | [ 11 22 33 ] [ 330 220 110 ]
|
||||
TESTCASE | 23 | | [ 11 22 33 ] [ 220 330 110 ]
|
||||
|
@ -117,5 +115,5 @@ TESTCASE | 24 | | [ 11 22 33 44 55 ] [ 220 330 440 110 550 ]
|
|||
TESTCASE | 25 | | [ 22 33 ] [ 220 330 ]
|
||||
TESTCASE | 26 | | [ 11 22 33 ] [ 220 330 110 ]
|
||||
|
||||
@code_hash 53895312198338603934600244087571743055624960603383611438828666636202841531600
|
||||
@code_hash 93068291567112337250118419287631047120002003622184251973082208096953112184588
|
||||
-}
|
||||
|
|
|
@ -152,8 +152,9 @@ TESTCASE | 103 | | [ 12 [] 34 91 ]
|
|||
//
|
||||
NEWC // _5
|
||||
ENDC // to_be_ref
|
||||
123 PUSHINT // to_be_ref _8=123
|
||||
NEWC // to_be_ref _8=123 _9
|
||||
NEWC // to_be_ref _8
|
||||
123 PUSHINT // to_be_ref _8 _9=123
|
||||
SWAP // to_be_ref _9=123 _8
|
||||
8 STU // to_be_ref in_c
|
||||
STREF // in_c
|
||||
ENDC // _16
|
||||
|
@ -186,13 +187,12 @@ TESTCASE | 103 | | [ 12 [] 34 91 ]
|
|||
16 PUSHINT // dict minv _57=16
|
||||
SDSKIPFIRST // dict minv
|
||||
...
|
||||
32 PUSHINT // dict minv1 minv2 minv3 found123 _78=456 dict _79=32
|
||||
32 PUSHINT // dict minv1 minv2 minv3 found123 found456 _83=32
|
||||
789 PUSHINT // dict minv1 minv2 minv3 found123 found456 _83=32 _84=789
|
||||
s0 s7 s7 XCHG3 // found456 minv1 minv2 minv3 found123 _84=789 dict _83=32
|
||||
DICTIGET
|
||||
NULLSWAPIFNOT // dict minv1 minv2 minv3 found123 _99 _100
|
||||
789 PUSHINT
|
||||
s2 POP
|
||||
s0 s6 XCHG
|
||||
32 PUSHINT // found456 minv1 minv2 minv3 found123 _83=789 dict _84=32
|
||||
NULLSWAPIFNOT // found456 minv1 minv2 minv3 found123 _101 _102
|
||||
NIP // found456 minv1 minv2 minv3 found123 found789
|
||||
...
|
||||
4 TUPLE // _86
|
||||
}>
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
;; But swapping arguments may sometimes lead to bytecode changes (see test2),
|
||||
;; both with compute-asm-ltr and without it.
|
||||
|
||||
#pragma compute-asm-ltr;
|
||||
|
||||
builder begin_cell() pure asm "NEWC";
|
||||
cell end_cell(builder b) pure asm "ENDC";
|
||||
slice begin_parse(cell c) pure asm "CTOS";
|
||||
|
|
|
@ -62,5 +62,5 @@ _ main() {
|
|||
{-
|
||||
TESTCASE | 0 | | 0
|
||||
|
||||
@code_hash 98157584761932576648981760908342408003231747902562138202913714302941716912743
|
||||
@code_hash 61273295789179921867241079778489100375537711211918844448475493726205774530743
|
||||
-}
|
||||
|
|
|
@ -52,5 +52,5 @@ _ main() {
|
|||
{-
|
||||
TESTCASE | 0 | | 0
|
||||
|
||||
@code_hash 35542701048549611407499491204004197688673151742407097578098250360682143458214
|
||||
@code_hash 13830542019509784148027107880226447201604257839069192762244575629978154217223
|
||||
-}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue