-
Notifications
You must be signed in to change notification settings - Fork 0
/
webassembly_data_types.html
executable file
·81 lines (75 loc) · 2.04 KB
/
webassembly_data_types.html
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
layout: toplevelcontent
title: WebAssembly Data Types.
description: WebAssembly Data Types.
keyword: webassembly data types
---
<h4>WebAssembly Data Types</h4>
<p>
WebAssembly (as of v1.0) has only four data types.
</p>
<ul class="list-marked">
<li>i32 : 32 Bit Integer</li>
<li>i64 : 64 Bit Integer</li>
<li>f32 : 32 Bit Floating Point Number</li>
<li>f64 : 64 Bit Floating Point Number</li>
</ul>
<p>
</p>
{% include aa1.html %}
<h5>Usage of i32 for addition</h5>
<br />
<div class="quote-bordered" style="text-align:left;background:black">
<pre><code style="color:white;">
(module
(func $addi32 (param $lhs i32) (param $rhs i32) (result i32)
get_local $lhs
get_local $rhs
i32.add)
(export "addi32" (func $addi32))
)
</code></pre>
</div>
<br />
<h5>Usage of i64 for addition</h5>
<br />
<div class="quote-bordered" style="text-align:left;background:black">
<pre><code style="color:white;">
(module
(func $addi64 (param $lhs i64) (param $rhs i64) (result i64)
get_local $lhs
get_local $rhs
i64.add)
(export "addi64" (func $addi64))
)
</code></pre>
</div>
<br />
<h5>Usage of f32 for addition</h5>
<br />
<div class="quote-bordered" style="text-align:left;background:black">
<pre><code style="color:white;">
(module
(func $add (param $lhs f32) (param $rhs f32) (result f32)
get_local $lhs
get_local $rhs
f32.add)
(export "addf32" (func $addf32))
)
</code></pre>
</div>
<br />
<h5>Usage of f64 for addition</h5>
<br />
<div class="quote-bordered" style="text-align:left;background:black">
<pre><code style="color:white;">
(module
(func $addf64 (param $lhs f64) (param $rhs f64) (result f64)
get_local $lhs
get_local $rhs
f64.add)
(export "addf64" (func $addf64))
)
</code></pre>
</div>
<p>