Skip to content

Commit 187fba9

Browse files
committed
optimize decoding
1 parent 8fc4556 commit 187fba9

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
cmds = [
2+
"echo Because this test does not have inputs, we should not see any decoding whatsoever.",
3+
"forc build --path {root} --release --ir final --asm final --bytecode | filter-fn {name} __entry",
4+
]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
source: test/src/snapshot/mod.rs
3+
---
4+
Because this test does not have inputs, we should not see any decoding whatsoever.
5+
6+
7+
> forc build --path test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_empty --release --ir final --asm final --bytecode | filter-fn main_args_empty __entry
8+
9+
pub entry fn __entry() -> () {
10+
local u64 item_
11+
12+
entry():
13+
v0 = call main_0()
14+
v1 = get_local __ptr u64, item_
15+
store v0 to v1
16+
v2 = get_local __ptr u64, item_
17+
v3 = cast_ptr v2 to ptr
18+
v4 = const u64 8
19+
retd v3 v4
20+
}
21+
22+
23+
move $$locbase $sp ; save locals base register for function __entry
24+
cfei i8 ; allocate 8 bytes for locals and 0 slots for call arguments
25+
jal $$reta $pc i4 ; [call]: call main_0
26+
sw $$locbase $$retv i0 ; store word
27+
movi $r0 i8 ; initialize constant into register
28+
retd $$locbase $r0

0 commit comments

Comments
 (0)