forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmath.wast
More file actions
50 lines (48 loc) · 2.07 KB
/
math.wast
File metadata and controls
50 lines (48 loc) · 2.07 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
;;-------------------------------------------------------------------------------------------------------
;; Copyright (C) Microsoft. All rights reserved.
;; Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
;;-------------------------------------------------------------------------------------------------------
(module
(func (export "ctz") (param $a i32) (result i32)
(i32.ctz (get_local $a))
)
(func (export "i32_div_s") (param $x i32) (param $y i32) (result i32)
(i32.div_s (get_local $x) (get_local $y))
)
(func (export "i32_div_s_by_two") (param $x i32) (result i32)
(i32.div_s (get_local $x) (i32.const 2))
)
(func (export "i32_div_s_over") (result i32)
(i32.div_s (i32.const 0x80000000 ) (i32.const 0xffffffff))
)
(func (export "i32_div_s_zero") (param $x i32) (result i32)
(i32.div_s (get_local $x) (i32.const 0))
)
(func (export "i32_div_u") (param $x i32) (param $y i32) (result i32)
(i32.div_u (get_local $x) (get_local $y))
)
(func (export "i32_rem_s") (param $x i32) (param $y i32) (result i32)
(i32.rem_s (get_local $x) (get_local $y))
)
(func (export "i32_rem_u") (param $x i32) (param $y i32) (result i32)
(i32.rem_u (get_local $x) (get_local $y))
)
(func (export "ctzI64") (param $a i64) (result i64)
(i64.ctz (get_local $a))
)
(func (export "i64_div_s") (param $x i64) (param $y i64) (result i64)
(i64.div_s (get_local $x) (get_local $y))
)
(func (export "i64_div_u") (param $x i64) (param $y i64) (result i64)
(i64.div_u (get_local $x) (get_local $y))
)
(func (export "i64_rem_s") (param $x i64) (param $y i64) (result i64)
(i64.rem_s (get_local $x) (get_local $y))
)
(func (export "i64_rem_u") (param $x i64) (param $y i64) (result i64)
(i64.rem_u (get_local $x) (get_local $y))
)
(func (export "i64_div_s_over") (result i64)
(i64.div_s (i64.const 0x8000000000000000 ) (i64.const 0xffffffffffffffff)) ;; overflow
)
)