1// Copyright 2016 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_WASM_WASM_EXTERNAL_REFS_H_
6#define V8_WASM_WASM_EXTERNAL_REFS_H_
7
8#include <stdint.h>
9
10#include "src/globals.h"
11
12namespace v8 {
13namespace internal {
14namespace wasm {
15
16V8_EXPORT_PRIVATE void f32_trunc_wrapper(Address data);
17
18V8_EXPORT_PRIVATE void f32_floor_wrapper(Address data);
19
20V8_EXPORT_PRIVATE void f32_ceil_wrapper(Address data);
21
22V8_EXPORT_PRIVATE void f32_nearest_int_wrapper(Address data);
23
24V8_EXPORT_PRIVATE void f64_trunc_wrapper(Address data);
25
26V8_EXPORT_PRIVATE void f64_floor_wrapper(Address data);
27
28V8_EXPORT_PRIVATE void f64_ceil_wrapper(Address data);
29
30V8_EXPORT_PRIVATE void f64_nearest_int_wrapper(Address data);
31
32V8_EXPORT_PRIVATE void int64_to_float32_wrapper(Address data);
33
34V8_EXPORT_PRIVATE void uint64_to_float32_wrapper(Address data);
35
36V8_EXPORT_PRIVATE void int64_to_float64_wrapper(Address data);
37
38V8_EXPORT_PRIVATE void uint64_to_float64_wrapper(Address data);
39
40V8_EXPORT_PRIVATE int32_t float32_to_int64_wrapper(Address data);
41
42V8_EXPORT_PRIVATE int32_t float32_to_uint64_wrapper(Address data);
43
44V8_EXPORT_PRIVATE int32_t float64_to_int64_wrapper(Address data);
45
46V8_EXPORT_PRIVATE int32_t float64_to_uint64_wrapper(Address data);
47
48V8_EXPORT_PRIVATE int32_t int64_div_wrapper(Address data);
49
50V8_EXPORT_PRIVATE int32_t int64_mod_wrapper(Address data);
51
52V8_EXPORT_PRIVATE int32_t uint64_div_wrapper(Address data);
53
54V8_EXPORT_PRIVATE int32_t uint64_mod_wrapper(Address data);
55
56V8_EXPORT_PRIVATE uint32_t word32_ctz_wrapper(Address data);
57
58V8_EXPORT_PRIVATE uint32_t word64_ctz_wrapper(Address data);
59
60V8_EXPORT_PRIVATE uint32_t word32_popcnt_wrapper(Address data);
61
62V8_EXPORT_PRIVATE uint32_t word64_popcnt_wrapper(Address data);
63
64V8_EXPORT_PRIVATE uint32_t word32_rol_wrapper(Address data);
65
66V8_EXPORT_PRIVATE uint32_t word32_ror_wrapper(Address data);
67
68V8_EXPORT_PRIVATE void float64_pow_wrapper(Address data);
69
70void memory_copy_wrapper(Address dst, Address src, uint32_t size);
71
72void memory_fill_wrapper(Address dst, uint32_t value, uint32_t size);
73
74using WasmTrapCallbackForTesting = void (*)();
75
76V8_EXPORT_PRIVATE void set_trap_callback_for_testing(
77 WasmTrapCallbackForTesting callback);
78
79V8_EXPORT_PRIVATE void call_trap_callback_for_testing();
80
81} // namespace wasm
82} // namespace internal
83} // namespace v8
84
85#endif // V8_WASM_WASM_EXTERNAL_REFS_H_
86