Skip to content

Instantly share code, notes, and snippets.

@alexcrichton
Created August 30, 2024 16:27
Show Gist options
  • Save alexcrichton/72adef3c6406420b94d9c5a7ddaf4510 to your computer and use it in GitHub Desktop.
Save alexcrichton/72adef3c6406420b94d9c5a7ddaf4510 to your computer and use it in GitHub Desktop.
128.cwasm: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <wasm[0]::function[0]>:
0: 55 push %rbp
1: 48 89 e5 mov %rsp,%rbp
4: 4c 8b 4f 58 mov 0x58(%rdi),%r9
8: 4d 8b 09 mov (%r9),%r9
b: 45 8b d0 mov %r8d,%r10d
e: 4b 8b 04 11 mov (%r9,%r10,1),%rax
12: 8b f1 mov %ecx,%esi
14: 4d 8d 1c 31 lea (%r9,%rsi,1),%r11
18: 49 8b 34 31 mov (%r9,%rsi,1),%rsi
1c: 4c 8d 04 30 lea (%rax,%rsi,1),%r8
20: 8b f2 mov %edx,%esi
22: 4d 89 04 31 mov %r8,(%r9,%rsi,1)
26: 4b 8b 4c 11 08 mov 0x8(%r9,%r10,1),%rcx
2b: 48 31 ff xor %rdi,%rdi
2e: 49 03 4b 08 add 0x8(%r11),%rcx
32: 48 83 d7 00 adc $0x0,%rdi
36: 49 39 c0 cmp %rax,%r8
39: 40 0f 92 c0 rex setb %al
3d: 48 0f b6 d0 movzbq %al,%rdx
41: 48 31 c0 xor %rax,%rax
44: 48 01 d1 add %rdx,%rcx
47: 48 11 c7 adc %rax,%rdi
4a: 49 89 4c 31 08 mov %rcx,0x8(%r9,%rsi,1)
4f: 4b 8b 54 11 10 mov 0x10(%r9,%r10,1),%rdx
54: 48 31 c0 xor %rax,%rax
57: 49 03 53 10 add 0x10(%r11),%rdx
5b: 48 83 d0 00 adc $0x0,%rax
5f: 48 01 fa add %rdi,%rdx
62: 48 83 d0 00 adc $0x0,%rax
66: 49 89 54 31 10 mov %rdx,0x10(%r9,%rsi,1)
6b: 4f 8b 54 11 18 mov 0x18(%r9,%r10,1),%r10
70: 4d 03 53 18 add 0x18(%r11),%r10
74: 48 89 c7 mov %rax,%rdi
77: 48 11 c7 adc %rax,%rdi
7a: 49 01 c2 add %rax,%r10
7d: 48 83 d7 00 adc $0x0,%rdi
81: 4d 89 54 31 18 mov %r10,0x18(%r9,%rsi,1)
86: 48 89 ec mov %rbp,%rsp
89: 5d pop %rbp
8a: c3 ret
000000000000008b <signatures[0]::wasm_to_array_trampoline>:
8b: 55 push %rbp
8c: 48 89 e5 mov %rsp,%rbp
8f: 48 83 ec 30 sub $0x30,%rsp
93: 49 89 d3 mov %rdx,%r11
96: 4c 8b 4e 08 mov 0x8(%rsi),%r9
9a: 48 89 ea mov %rbp,%rdx
9d: 48 8b 12 mov (%rdx),%rdx
a0: 49 89 51 18 mov %rdx,0x18(%r9)
a4: 48 89 ea mov %rbp,%rdx
a7: 4c 8b 52 08 mov 0x8(%rdx),%r10
ab: 4d 89 51 20 mov %r10,0x20(%r9)
af: 48 8d 14 24 lea (%rsp),%rdx
b3: 4d 89 d9 mov %r11,%r9
b6: 44 89 0a mov %r9d,(%rdx)
b9: 89 4a 10 mov %ecx,0x10(%rdx)
bc: 44 89 42 20 mov %r8d,0x20(%rdx)
c0: 48 8b 47 08 mov 0x8(%rdi),%rax
c4: b9 03 00 00 00 mov $0x3,%ecx
c9: ff d0 call *%rax
cb: 48 83 c4 30 add $0x30,%rsp
cf: 48 89 ec mov %rbp,%rsp
d2: 5d pop %rbp
d3: c3 ret
...
(module
(type (;0;) (func (param i32 i32 i32)))
(import "env" "__linear_memory" (memory (;0;) 0))
(func (;0;) (type 0) (param i32 i32 i32)
(local i64 i64)
local.get 0
local.get 2
i64.load
local.tee 3
local.get 1
i64.load
i64.add
local.tee 4
i64.store
local.get 0
local.get 2
i64.load offset=8
i64.const 0
local.get 1
i64.load offset=8
i64.const 0
i64.add128
local.get 4
local.get 3
i64.lt_u
i64.extend_i32_u
i64.const 0
i64.add128
local.set 3
i64.store offset=8
local.get 0
local.get 2
i64.load offset=16
i64.const 0
local.get 1
i64.load offset=16
i64.const 0
i64.add128
local.get 3
i64.const 0
i64.add128
local.set 3
i64.store offset=16
local.get 0
local.get 2
i64.load offset=24
local.get 3
local.get 1
i64.load offset=24
local.get 3
i64.add128
local.get 3
i64.const 0
i64.add128
drop
i64.store offset=24
)
(@custom "linking" (after code) "\02\08\88\80\80\80\00\01\00\00\00\03add")
(@producers
(processed-by "rustc" "1.82.0-dev")
)
(@custom "target_features" (after code) "\05+\07alex128+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext")
)
carry.cwasm: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <wasm[0]::function[0]>:
0: 55 push %rbp
1: 48 89 e5 mov %rsp,%rbp
4: 48 8b 7f 58 mov 0x58(%rdi),%rdi
8: 48 8b 3f mov (%rdi),%rdi
b: 45 8b c0 mov %r8d,%r8d
e: 4e 8b 0c 07 mov (%rdi,%r8,1),%r9
12: 8b c9 mov %ecx,%ecx
14: 48 8d 04 0f lea (%rdi,%rcx,1),%rax
18: 4c 03 0c 0f add (%rdi,%rcx,1),%r9
1c: 40 0f 92 c1 rex setb %cl
20: 8b d2 mov %edx,%edx
22: 4c 89 0c 17 mov %r9,(%rdi,%rdx,1)
26: 4e 8b 5c 07 08 mov 0x8(%rdi,%r8,1),%r11
2b: 0f b6 f1 movzbl %cl,%esi
2e: 83 c6 ff add $0xffffffff,%esi
31: 4c 13 58 08 adc 0x8(%rax),%r11
35: 41 0f 92 c1 setb %r9b
39: 4c 89 5c 17 08 mov %r11,0x8(%rdi,%rdx,1)
3e: 4a 8b 74 07 10 mov 0x10(%rdi,%r8,1),%rsi
43: 41 0f b6 c9 movzbl %r9b,%ecx
47: 83 c1 ff add $0xffffffff,%ecx
4a: 48 13 70 10 adc 0x10(%rax),%rsi
4e: 41 0f 92 c1 setb %r9b
52: 48 89 74 17 10 mov %rsi,0x10(%rdi,%rdx,1)
57: 4a 8b 4c 07 18 mov 0x18(%rdi,%r8,1),%rcx
5c: 45 0f b6 c1 movzbl %r9b,%r8d
60: 41 83 c0 ff add $0xffffffff,%r8d
64: 48 13 48 18 adc 0x18(%rax),%rcx
68: 41 0f 92 c1 setb %r9b
6c: 48 89 4c 17 18 mov %rcx,0x18(%rdi,%rdx,1)
71: 48 89 ec mov %rbp,%rsp
74: 5d pop %rbp
75: c3 ret
0000000000000076 <signatures[0]::wasm_to_array_trampoline>:
76: 55 push %rbp
77: 48 89 e5 mov %rsp,%rbp
7a: 48 83 ec 30 sub $0x30,%rsp
7e: 49 89 d3 mov %rdx,%r11
81: 4c 8b 4e 08 mov 0x8(%rsi),%r9
85: 48 89 ea mov %rbp,%rdx
88: 48 8b 12 mov (%rdx),%rdx
8b: 49 89 51 18 mov %rdx,0x18(%r9)
8f: 48 89 ea mov %rbp,%rdx
92: 4c 8b 52 08 mov 0x8(%rdx),%r10
96: 4d 89 51 20 mov %r10,0x20(%r9)
9a: 48 8d 14 24 lea (%rsp),%rdx
9e: 4d 89 d9 mov %r11,%r9
a1: 44 89 0a mov %r9d,(%rdx)
a4: 89 4a 10 mov %ecx,0x10(%rdx)
a7: 44 89 42 20 mov %r8d,0x20(%rdx)
ab: 48 8b 47 08 mov 0x8(%rdi),%rax
af: b9 03 00 00 00 mov $0x3,%ecx
b4: ff d0 call *%rax
b6: 48 83 c4 30 add $0x30,%rsp
ba: 48 89 ec mov %rbp,%rsp
bd: 5d pop %rbp
be: c3 ret
...
(module
(type (;0;) (func (param i32 i32 i32)))
(import "env" "__linear_memory" (memory (;0;) 0))
(func (;0;) (type 0) (param i32 i32 i32)
(local i32)
local.get 0
local.get 2
i64.load
local.get 1
i64.load
i64.add_overflow_u
local.set 3
i64.store
local.get 0
local.get 2
i64.load offset=8
local.get 1
i64.load offset=8
local.get 3
i64.add_with_carry_u
local.set 3
i64.store offset=8
local.get 0
local.get 2
i64.load offset=16
local.get 1
i64.load offset=16
local.get 3
i64.add_with_carry_u
local.set 3
i64.store offset=16
local.get 0
local.get 2
i64.load offset=24
local.get 1
i64.load offset=24
local.get 3
i64.add_with_carry_u
drop
i64.store offset=24
)
(@custom "linking" (after code) "\02\08\88\80\80\80\00\01\00\00\00\03add")
(@producers
(processed-by "rustc" "1.82.0-dev")
)
(@custom "target_features" (after code) "\06+\0aalex-carry+\0dalex-overflow+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment