summaryrefslogtreecommitdiffstats
path: root/contrib/restricted/emscripten/system/lib/libc/emscripten_memset_bulkmem.S
blob: ba8d91bb0ae8f0912b49b168b2d2f7455bff63c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifdef __wasm64__
#define PTR i64
#else
#define PTR i32
#endif

.globl _emscripten_memset_bulkmem
_emscripten_memset_bulkmem:
  .functype _emscripten_memset_bulkmem (PTR, i32, PTR) -> (PTR)
  local.get 2
#ifdef __wasm64__
  i32.wrap_i64
#endif
  // memory.fill traps on OOB zero-length sets, but memset must not.
  if
   local.get 0
   local.get 1
   local.get 2
   memory.fill 0
  end_if
  local.get 0
  end_function

.section .custom_section.target_features,"",@
.int8 1
.int8 43
.int8 11
.ascii "bulk-memory"