@stdlib/blas-base-wasm-ddot 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/main.wat ADDED
@@ -0,0 +1,220 @@
1
+ ;; @license Apache-2.0
2
+ ;;
3
+ ;; Copyright (c) 2024 The Stdlib Authors.
4
+ ;;
5
+ ;; Licensed under the Apache License, Version 2.0 (the "License");
6
+ ;; you may not use this file except in compliance with the License.
7
+ ;; You may obtain a copy of the License at
8
+ ;;
9
+ ;; http://www.apache.org/licenses/LICENSE-2.0
10
+ ;;
11
+ ;; Unless required by applicable law or agreed to in writing, software
12
+ ;; distributed under the License is distributed on an "AS IS" BASIS,
13
+ ;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ ;; See the License for the specific language governing permissions and
15
+ ;; limitations under the License.
16
+
17
+ (module
18
+ (type (;0;) (func))
19
+ (type (;1;) (func (param i32 i32 i32 i32 i32) (result f64)))
20
+ (type (;2;) (func (param i32 i32 i32 i32 i32 i32 i32) (result f64)))
21
+ (import "env" "memory" (memory (;0;) 0))
22
+ (func (;0;) (type 0)
23
+ nop)
24
+ (func (;1;) (type 1) (param i32 i32 i32 i32 i32) (result f64)
25
+ local.get 0
26
+ local.get 1
27
+ local.get 2
28
+ i32.const 1
29
+ local.get 0
30
+ i32.sub
31
+ local.tee 0
32
+ local.get 2
33
+ i32.mul
34
+ i32.const 0
35
+ local.get 2
36
+ i32.const 0
37
+ i32.le_s
38
+ select
39
+ local.get 3
40
+ local.get 4
41
+ local.get 0
42
+ local.get 4
43
+ i32.mul
44
+ i32.const 0
45
+ local.get 4
46
+ i32.const 0
47
+ i32.le_s
48
+ select
49
+ call 2)
50
+ (func (;2;) (type 2) (param i32 i32 i32 i32 i32 i32 i32) (result f64)
51
+ (local i32 f64)
52
+ block ;; label = @1
53
+ local.get 0
54
+ i32.const 0
55
+ i32.le_s
56
+ if ;; label = @2
57
+ br 1 (;@1;)
58
+ end
59
+ local.get 2
60
+ i32.const 1
61
+ i32.ne
62
+ local.get 5
63
+ i32.const 1
64
+ i32.ne
65
+ i32.or
66
+ i32.eqz
67
+ if ;; label = @2
68
+ block ;; label = @3
69
+ local.get 0
70
+ i32.const 5
71
+ i32.rem_u
72
+ local.tee 5
73
+ i32.eqz
74
+ br_if 0 (;@3;)
75
+ loop ;; label = @4
76
+ local.get 5
77
+ local.get 7
78
+ i32.eq
79
+ br_if 1 (;@3;)
80
+ local.get 1
81
+ local.get 3
82
+ i32.const 3
83
+ i32.shl
84
+ i32.add
85
+ f64.load
86
+ local.get 4
87
+ local.get 6
88
+ i32.const 3
89
+ i32.shl
90
+ i32.add
91
+ f64.load
92
+ f64.mul
93
+ local.get 8
94
+ f64.add
95
+ local.set 8
96
+ local.get 7
97
+ i32.const 1
98
+ i32.add
99
+ local.set 7
100
+ local.get 6
101
+ i32.const 1
102
+ i32.add
103
+ local.set 6
104
+ local.get 3
105
+ i32.const 1
106
+ i32.add
107
+ local.set 3
108
+ br 0 (;@4;)
109
+ end
110
+ unreachable
111
+ end
112
+ local.get 0
113
+ i32.const 5
114
+ i32.lt_s
115
+ br_if 1 (;@1;)
116
+ loop ;; label = @3
117
+ local.get 0
118
+ local.get 5
119
+ i32.le_s
120
+ br_if 2 (;@1;)
121
+ local.get 8
122
+ local.get 1
123
+ local.get 3
124
+ i32.const 3
125
+ i32.shl
126
+ i32.add
127
+ local.tee 2
128
+ f64.load offset=32
129
+ local.get 4
130
+ local.get 6
131
+ i32.const 3
132
+ i32.shl
133
+ i32.add
134
+ local.tee 7
135
+ f64.load offset=32
136
+ f64.mul
137
+ local.get 2
138
+ f64.load offset=24
139
+ local.get 7
140
+ f64.load offset=24
141
+ f64.mul
142
+ local.get 2
143
+ f64.load offset=16
144
+ local.get 7
145
+ f64.load offset=16
146
+ f64.mul
147
+ local.get 2
148
+ f64.load
149
+ local.get 7
150
+ f64.load
151
+ f64.mul
152
+ local.get 2
153
+ f64.load offset=8
154
+ local.get 7
155
+ f64.load offset=8
156
+ f64.mul
157
+ f64.add
158
+ f64.add
159
+ f64.add
160
+ f64.add
161
+ f64.add
162
+ local.set 8
163
+ local.get 5
164
+ i32.const 5
165
+ i32.add
166
+ local.set 5
167
+ local.get 6
168
+ i32.const 5
169
+ i32.add
170
+ local.set 6
171
+ local.get 3
172
+ i32.const 5
173
+ i32.add
174
+ local.set 3
175
+ br 0 (;@3;)
176
+ end
177
+ unreachable
178
+ end
179
+ loop ;; label = @2
180
+ local.get 0
181
+ local.get 7
182
+ i32.eq
183
+ br_if 1 (;@1;)
184
+ local.get 1
185
+ local.get 3
186
+ i32.const 3
187
+ i32.shl
188
+ i32.add
189
+ f64.load
190
+ local.get 4
191
+ local.get 6
192
+ i32.const 3
193
+ i32.shl
194
+ i32.add
195
+ f64.load
196
+ f64.mul
197
+ local.get 8
198
+ f64.add
199
+ local.set 8
200
+ local.get 7
201
+ i32.const 1
202
+ i32.add
203
+ local.set 7
204
+ local.get 5
205
+ local.get 6
206
+ i32.add
207
+ local.set 6
208
+ local.get 2
209
+ local.get 3
210
+ i32.add
211
+ local.set 3
212
+ br 0 (;@2;)
213
+ end
214
+ unreachable
215
+ end
216
+ local.get 8)
217
+ (export "__wasm_call_ctors" (func 0))
218
+ (export "__wasm_apply_data_relocs" (func 0))
219
+ (export "c_ddot" (func 1))
220
+ (export "c_ddot_ndarray" (func 2)))