Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/system/lib/libc/emscripten_memcpy_bulkmem.S
6162 views
1
#ifdef __wasm64__
2
#define PTR i64
3
#else
4
#define PTR i32
5
#endif
6
7
.globl _emscripten_memcpy_bulkmem
8
_emscripten_memcpy_bulkmem:
9
.functype _emscripten_memcpy_bulkmem (PTR, PTR, PTR) -> (PTR)
10
local.get 2
11
#ifdef __wasm64__
12
i32.wrap_i64
13
#endif
14
// memory.copy traps on OOB zero-length copies, but memcpy must not.
15
if
16
local.get 0
17
local.get 1
18
local.get 2
19
memory.copy 0, 0
20
end_if
21
local.get 0
22
end_function
23
24
.section .custom_section.target_features,"",@
25
.int8 1
26
.int8 43
27
.int8 11
28
.ascii "bulk-memory"
29
30