@stdlib/blas-base-wasm-sdsdot 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,239 @@
1
+ ;; @license Apache-2.0
2
+ ;;
3
+ ;; Copyright (c) 2025 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 f32 i32 i32 i32 i32) (result f32)))
20
+ (type (;2;) (func (param i32 f32 i32 i32 i32 i32 i32 i32) (result f32)))
21
+ (import "env" "memory" (memory (;0;) 0))
22
+ (func (;0;) (type 0)
23
+ nop)
24
+ (func (;1;) (type 1) (param i32 f32 i32 i32 i32 i32) (result f32)
25
+ local.get 0
26
+ local.get 1
27
+ local.get 2
28
+ local.get 3
29
+ i32.const 1
30
+ local.get 0
31
+ i32.sub
32
+ local.tee 0
33
+ local.get 3
34
+ i32.mul
35
+ i32.const 0
36
+ local.get 3
37
+ i32.const 0
38
+ i32.le_s
39
+ select
40
+ local.get 4
41
+ local.get 5
42
+ local.get 0
43
+ local.get 5
44
+ i32.mul
45
+ i32.const 0
46
+ local.get 5
47
+ i32.const 0
48
+ i32.le_s
49
+ select
50
+ call 2)
51
+ (func (;2;) (type 2) (param i32 f32 i32 i32 i32 i32 i32 i32) (result f32)
52
+ (local i32 f64)
53
+ local.get 0
54
+ i32.const 0
55
+ i32.gt_s
56
+ if (result f32) ;; label = @1
57
+ local.get 1
58
+ f64.promote_f32
59
+ local.set 9
60
+ block ;; label = @2
61
+ local.get 3
62
+ i32.const 1
63
+ i32.ne
64
+ local.get 6
65
+ i32.const 1
66
+ i32.ne
67
+ i32.or
68
+ i32.eqz
69
+ if ;; label = @3
70
+ block ;; label = @4
71
+ local.get 0
72
+ i32.const 5
73
+ i32.rem_u
74
+ local.tee 6
75
+ i32.eqz
76
+ br_if 0 (;@4;)
77
+ loop ;; label = @5
78
+ local.get 6
79
+ local.get 8
80
+ i32.eq
81
+ br_if 1 (;@4;)
82
+ local.get 2
83
+ local.get 4
84
+ i32.const 2
85
+ i32.shl
86
+ i32.add
87
+ f32.load
88
+ f64.promote_f32
89
+ local.get 5
90
+ local.get 7
91
+ i32.const 2
92
+ i32.shl
93
+ i32.add
94
+ f32.load
95
+ f64.promote_f32
96
+ f64.mul
97
+ local.get 9
98
+ f64.add
99
+ local.set 9
100
+ local.get 8
101
+ i32.const 1
102
+ i32.add
103
+ local.set 8
104
+ local.get 7
105
+ i32.const 1
106
+ i32.add
107
+ local.set 7
108
+ local.get 4
109
+ i32.const 1
110
+ i32.add
111
+ local.set 4
112
+ br 0 (;@5;)
113
+ end
114
+ unreachable
115
+ end
116
+ local.get 0
117
+ i32.const 4
118
+ i32.le_s
119
+ br_if 1 (;@2;)
120
+ loop ;; label = @4
121
+ local.get 0
122
+ local.get 6
123
+ i32.le_s
124
+ br_if 2 (;@2;)
125
+ local.get 9
126
+ local.get 2
127
+ local.get 4
128
+ i32.const 2
129
+ i32.shl
130
+ i32.add
131
+ local.tee 3
132
+ f32.load offset=16
133
+ f64.promote_f32
134
+ local.get 5
135
+ local.get 7
136
+ i32.const 2
137
+ i32.shl
138
+ i32.add
139
+ local.tee 8
140
+ f32.load offset=16
141
+ f64.promote_f32
142
+ f64.mul
143
+ local.get 3
144
+ f32.load offset=12
145
+ f64.promote_f32
146
+ local.get 8
147
+ f32.load offset=12
148
+ f64.promote_f32
149
+ f64.mul
150
+ local.get 3
151
+ f32.load offset=8
152
+ f64.promote_f32
153
+ local.get 8
154
+ f32.load offset=8
155
+ f64.promote_f32
156
+ f64.mul
157
+ local.get 3
158
+ f32.load
159
+ f64.promote_f32
160
+ local.get 8
161
+ f32.load
162
+ f64.promote_f32
163
+ f64.mul
164
+ local.get 3
165
+ f32.load offset=4
166
+ f64.promote_f32
167
+ local.get 8
168
+ f32.load offset=4
169
+ f64.promote_f32
170
+ f64.mul
171
+ f64.add
172
+ f64.add
173
+ f64.add
174
+ f64.add
175
+ f64.add
176
+ local.set 9
177
+ local.get 6
178
+ i32.const 5
179
+ i32.add
180
+ local.set 6
181
+ local.get 7
182
+ i32.const 5
183
+ i32.add
184
+ local.set 7
185
+ local.get 4
186
+ i32.const 5
187
+ i32.add
188
+ local.set 4
189
+ br 0 (;@4;)
190
+ end
191
+ unreachable
192
+ end
193
+ loop ;; label = @3
194
+ local.get 0
195
+ local.get 8
196
+ i32.eq
197
+ br_if 1 (;@2;)
198
+ local.get 2
199
+ local.get 4
200
+ i32.const 2
201
+ i32.shl
202
+ i32.add
203
+ f32.load
204
+ f64.promote_f32
205
+ local.get 5
206
+ local.get 7
207
+ i32.const 2
208
+ i32.shl
209
+ i32.add
210
+ f32.load
211
+ f64.promote_f32
212
+ f64.mul
213
+ local.get 9
214
+ f64.add
215
+ local.set 9
216
+ local.get 8
217
+ i32.const 1
218
+ i32.add
219
+ local.set 8
220
+ local.get 6
221
+ local.get 7
222
+ i32.add
223
+ local.set 7
224
+ local.get 3
225
+ local.get 4
226
+ i32.add
227
+ local.set 4
228
+ br 0 (;@3;)
229
+ end
230
+ unreachable
231
+ end
232
+ local.get 9
233
+ f32.demote_f64
234
+ else
235
+ local.get 1
236
+ end)
237
+ (export "__wasm_call_ctors" (func 0))
238
+ (export "c_sdsdot" (func 1))
239
+ (export "c_sdsdot_ndarray" (func 2)))