Debian Codegraph @

src/simd/archsimd/maskmerge_gen_amd64.go

raw
1 // Code generated by 'tmplgen'; DO NOT EDIT.
2
3 //go:build goexperiment.simd
4
5 package archsimd
6
7 // Masked returns x but with elements zeroed where mask is false.
8 //
9 // Emulated, CPU Feature: AVX
10 func (x Int8x16) Masked(mask Mask8x16) Int8x16 {
11 im := mask.ToInt8x16()
12 return im.And(x)
13 }
14
15 // Merge returns x but with elements set to y where mask is false.
16 //
17 // Emulated, CPU Feature: AVX
18 func (x Int8x16) Merge(y Int8x16, mask Mask8x16) Int8x16 {
19 im := mask.ToInt8x16()
20 return y.blend(x, im)
21 }
22
23 // Masked returns x but with elements zeroed where mask is false.
24 //
25 // Emulated, CPU Feature: AVX
26 func (x Int16x8) Masked(mask Mask16x8) Int16x8 {
27 im := mask.ToInt16x8()
28 return im.And(x)
29 }
30
31 // Merge returns x but with elements set to y where mask is false.
32 //
33 // Emulated, CPU Feature: AVX
34 func (x Int16x8) Merge(y Int16x8, mask Mask16x8) Int16x8 {
35 im := mask.ToInt16x8().AsInt8x16()
36 ix := x.AsInt8x16()
37 iy := y.AsInt8x16()
38 return iy.blend(ix, im).AsInt16x8()
39 }
40
41 // Masked returns x but with elements zeroed where mask is false.
42 //
43 // Emulated, CPU Feature: AVX
44 func (x Int32x4) Masked(mask Mask32x4) Int32x4 {
45 im := mask.ToInt32x4()
46 return im.And(x)
47 }
48
49 // Merge returns x but with elements set to y where mask is false.
50 //
51 // Emulated, CPU Feature: AVX
52 func (x Int32x4) Merge(y Int32x4, mask Mask32x4) Int32x4 {
53 im := mask.ToInt32x4().AsInt8x16()
54 ix := x.AsInt8x16()
55 iy := y.AsInt8x16()
56 return iy.blend(ix, im).AsInt32x4()
57 }
58
59 // Masked returns x but with elements zeroed where mask is false.
60 //
61 // Emulated, CPU Feature: AVX
62 func (x Int64x2) Masked(mask Mask64x2) Int64x2 {
63 im := mask.ToInt64x2()
64 return im.And(x)
65 }
66
67 // Merge returns x but with elements set to y where mask is false.
68 //
69 // Emulated, CPU Feature: AVX
70 func (x Int64x2) Merge(y Int64x2, mask Mask64x2) Int64x2 {
71 im := mask.ToInt64x2().AsInt8x16()
72 ix := x.AsInt8x16()
73 iy := y.AsInt8x16()
74 return iy.blend(ix, im).AsInt64x2()
75 }
76
77 // Masked returns x but with elements zeroed where mask is false.
78 //
79 // Emulated, CPU Feature: AVX
80 func (x Uint8x16) Masked(mask Mask8x16) Uint8x16 {
81 im := mask.ToInt8x16()
82 return x.AsInt8x16().And(im).AsUint8x16()
83 }
84
85 // Merge returns x but with elements set to y where mask is false.
86 //
87 // Emulated, CPU Feature: AVX
88 func (x Uint8x16) Merge(y Uint8x16, mask Mask8x16) Uint8x16 {
89 im := mask.ToInt8x16()
90 ix := x.AsInt8x16()
91 iy := y.AsInt8x16()
92 return iy.blend(ix, im).AsUint8x16()
93 }
94
95 // Masked returns x but with elements zeroed where mask is false.
96 //
97 // Emulated, CPU Feature: AVX
98 func (x Uint16x8) Masked(mask Mask16x8) Uint16x8 {
99 im := mask.ToInt16x8()
100 return x.AsInt16x8().And(im).AsUint16x8()
101 }
102
103 // Merge returns x but with elements set to y where mask is false.
104 //
105 // Emulated, CPU Feature: AVX
106 func (x Uint16x8) Merge(y Uint16x8, mask Mask16x8) Uint16x8 {
107 im := mask.ToInt16x8().AsInt8x16()
108 ix := x.AsInt8x16()
109 iy := y.AsInt8x16()
110 return iy.blend(ix, im).AsUint16x8()
111 }
112
113 // Masked returns x but with elements zeroed where mask is false.
114 //
115 // Emulated, CPU Feature: AVX
116 func (x Uint32x4) Masked(mask Mask32x4) Uint32x4 {
117 im := mask.ToInt32x4()
118 return x.AsInt32x4().And(im).AsUint32x4()
119 }
120
121 // Merge returns x but with elements set to y where mask is false.
122 //
123 // Emulated, CPU Feature: AVX
124 func (x Uint32x4) Merge(y Uint32x4, mask Mask32x4) Uint32x4 {
125 im := mask.ToInt32x4().AsInt8x16()
126 ix := x.AsInt8x16()
127 iy := y.AsInt8x16()
128 return iy.blend(ix, im).AsUint32x4()
129 }
130
131 // Masked returns x but with elements zeroed where mask is false.
132 //
133 // Emulated, CPU Feature: AVX
134 func (x Uint64x2) Masked(mask Mask64x2) Uint64x2 {
135 im := mask.ToInt64x2()
136 return x.AsInt64x2().And(im).AsUint64x2()
137 }
138
139 // Merge returns x but with elements set to y where mask is false.
140 //
141 // Emulated, CPU Feature: AVX
142 func (x Uint64x2) Merge(y Uint64x2, mask Mask64x2) Uint64x2 {
143 im := mask.ToInt64x2().AsInt8x16()
144 ix := x.AsInt8x16()
145 iy := y.AsInt8x16()
146 return iy.blend(ix, im).AsUint64x2()
147 }
148
149 // Masked returns x but with elements zeroed where mask is false.
150 //
151 // Emulated, CPU Feature: AVX
152 func (x Float32x4) Masked(mask Mask32x4) Float32x4 {
153 im := mask.ToInt32x4()
154 return x.AsInt32x4().And(im).AsFloat32x4()
155 }
156
157 // Merge returns x but with elements set to y where mask is false.
158 //
159 // Emulated, CPU Feature: AVX
160 func (x Float32x4) Merge(y Float32x4, mask Mask32x4) Float32x4 {
161 im := mask.ToInt32x4().AsInt8x16()
162 ix := x.AsInt8x16()
163 iy := y.AsInt8x16()
164 return iy.blend(ix, im).AsFloat32x4()
165 }
166
167 // Masked returns x but with elements zeroed where mask is false.
168 //
169 // Emulated, CPU Feature: AVX
170 func (x Float64x2) Masked(mask Mask64x2) Float64x2 {
171 im := mask.ToInt64x2()
172 return x.AsInt64x2().And(im).AsFloat64x2()
173 }
174
175 // Merge returns x but with elements set to y where mask is false.
176 //
177 // Emulated, CPU Feature: AVX
178 func (x Float64x2) Merge(y Float64x2, mask Mask64x2) Float64x2 {
179 im := mask.ToInt64x2().AsInt8x16()
180 ix := x.AsInt8x16()
181 iy := y.AsInt8x16()
182 return iy.blend(ix, im).AsFloat64x2()
183 }
184
185 // Masked returns x but with elements zeroed where mask is false.
186 //
187 // Emulated, CPU Feature: AVX2
188 func (x Int8x32) Masked(mask Mask8x32) Int8x32 {
189 im := mask.ToInt8x32()
190 return im.And(x)
191 }
192
193 // Merge returns x but with elements set to y where mask is false.
194 //
195 // Emulated, CPU Feature: AVX2
196 func (x Int8x32) Merge(y Int8x32, mask Mask8x32) Int8x32 {
197 im := mask.ToInt8x32()
198 return y.blend(x, im)
199 }
200
201 // Masked returns x but with elements zeroed where mask is false.
202 //
203 // Emulated, CPU Feature: AVX2
204 func (x Int16x16) Masked(mask Mask16x16) Int16x16 {
205 im := mask.ToInt16x16()
206 return im.And(x)
207 }
208
209 // Merge returns x but with elements set to y where mask is false.
210 //
211 // Emulated, CPU Feature: AVX2
212 func (x Int16x16) Merge(y Int16x16, mask Mask16x16) Int16x16 {
213 im := mask.ToInt16x16().AsInt8x32()
214 ix := x.AsInt8x32()
215 iy := y.AsInt8x32()
216 return iy.blend(ix, im).AsInt16x16()
217 }
218
219 // Masked returns x but with elements zeroed where mask is false.
220 //
221 // Emulated, CPU Feature: AVX2
222 func (x Int32x8) Masked(mask Mask32x8) Int32x8 {
223 im := mask.ToInt32x8()
224 return im.And(x)
225 }
226
227 // Merge returns x but with elements set to y where mask is false.
228 //
229 // Emulated, CPU Feature: AVX2
230 func (x Int32x8) Merge(y Int32x8, mask Mask32x8) Int32x8 {
231 im := mask.ToInt32x8().AsInt8x32()
232 ix := x.AsInt8x32()
233 iy := y.AsInt8x32()
234 return iy.blend(ix, im).AsInt32x8()
235 }
236
237 // Masked returns x but with elements zeroed where mask is false.
238 //
239 // Emulated, CPU Feature: AVX2
240 func (x Int64x4) Masked(mask Mask64x4) Int64x4 {
241 im := mask.ToInt64x4()
242 return im.And(x)
243 }
244
245 // Merge returns x but with elements set to y where mask is false.
246 //
247 // Emulated, CPU Feature: AVX2
248 func (x Int64x4) Merge(y Int64x4, mask Mask64x4) Int64x4 {
249 im := mask.ToInt64x4().AsInt8x32()
250 ix := x.AsInt8x32()
251 iy := y.AsInt8x32()
252 return iy.blend(ix, im).AsInt64x4()
253 }
254
255 // Masked returns x but with elements zeroed where mask is false.
256 //
257 // Emulated, CPU Feature: AVX2
258 func (x Uint8x32) Masked(mask Mask8x32) Uint8x32 {
259 im := mask.ToInt8x32()
260 return x.AsInt8x32().And(im).AsUint8x32()
261 }
262
263 // Merge returns x but with elements set to y where mask is false.
264 //
265 // Emulated, CPU Feature: AVX2
266 func (x Uint8x32) Merge(y Uint8x32, mask Mask8x32) Uint8x32 {
267 im := mask.ToInt8x32()
268 ix := x.AsInt8x32()
269 iy := y.AsInt8x32()
270 return iy.blend(ix, im).AsUint8x32()
271 }
272
273 // Masked returns x but with elements zeroed where mask is false.
274 //
275 // Emulated, CPU Feature: AVX2
276 func (x Uint16x16) Masked(mask Mask16x16) Uint16x16 {
277 im := mask.ToInt16x16()
278 return x.AsInt16x16().And(im).AsUint16x16()
279 }
280
281 // Merge returns x but with elements set to y where mask is false.
282 //
283 // Emulated, CPU Feature: AVX2
284 func (x Uint16x16) Merge(y Uint16x16, mask Mask16x16) Uint16x16 {
285 im := mask.ToInt16x16().AsInt8x32()
286 ix := x.AsInt8x32()
287 iy := y.AsInt8x32()
288 return iy.blend(ix, im).AsUint16x16()
289 }
290
291 // Masked returns x but with elements zeroed where mask is false.
292 //
293 // Emulated, CPU Feature: AVX2
294 func (x Uint32x8) Masked(mask Mask32x8) Uint32x8 {
295 im := mask.ToInt32x8()
296 return x.AsInt32x8().And(im).AsUint32x8()
297 }
298
299 // Merge returns x but with elements set to y where mask is false.
300 //
301 // Emulated, CPU Feature: AVX2
302 func (x Uint32x8) Merge(y Uint32x8, mask Mask32x8) Uint32x8 {
303 im := mask.ToInt32x8().AsInt8x32()
304 ix := x.AsInt8x32()
305 iy := y.AsInt8x32()
306 return iy.blend(ix, im).AsUint32x8()
307 }
308
309 // Masked returns x but with elements zeroed where mask is false.
310 //
311 // Emulated, CPU Feature: AVX2
312 func (x Uint64x4) Masked(mask Mask64x4) Uint64x4 {
313 im := mask.ToInt64x4()
314 return x.AsInt64x4().And(im).AsUint64x4()
315 }
316
317 // Merge returns x but with elements set to y where mask is false.
318 //
319 // Emulated, CPU Feature: AVX2
320 func (x Uint64x4) Merge(y Uint64x4, mask Mask64x4) Uint64x4 {
321 im := mask.ToInt64x4().AsInt8x32()
322 ix := x.AsInt8x32()
323 iy := y.AsInt8x32()
324 return iy.blend(ix, im).AsUint64x4()
325 }
326
327 // Masked returns x but with elements zeroed where mask is false.
328 //
329 // Emulated, CPU Feature: AVX2
330 func (x Float32x8) Masked(mask Mask32x8) Float32x8 {
331 im := mask.ToInt32x8()
332 return x.AsInt32x8().And(im).AsFloat32x8()
333 }
334
335 // Merge returns x but with elements set to y where mask is false.
336 //
337 // Emulated, CPU Feature: AVX2
338 func (x Float32x8) Merge(y Float32x8, mask Mask32x8) Float32x8 {
339 im := mask.ToInt32x8().AsInt8x32()
340 ix := x.AsInt8x32()
341 iy := y.AsInt8x32()
342 return iy.blend(ix, im).AsFloat32x8()
343 }
344
345 // Masked returns x but with elements zeroed where mask is false.
346 //
347 // Emulated, CPU Feature: AVX2
348 func (x Float64x4) Masked(mask Mask64x4) Float64x4 {
349 im := mask.ToInt64x4()
350 return x.AsInt64x4().And(im).AsFloat64x4()
351 }
352
353 // Merge returns x but with elements set to y where mask is false.
354 //
355 // Emulated, CPU Feature: AVX2
356 func (x Float64x4) Merge(y Float64x4, mask Mask64x4) Float64x4 {
357 im := mask.ToInt64x4().AsInt8x32()
358 ix := x.AsInt8x32()
359 iy := y.AsInt8x32()
360 return iy.blend(ix, im).AsFloat64x4()
361 }
362
363 // Masked returns x but with elements zeroed where mask is false.
364 //
365 // Emulated, CPU Feature: AVX512
366 func (x Int8x64) Masked(mask Mask8x64) Int8x64 {
367 im := mask.ToInt8x64()
368 return im.And(x)
369 }
370
371 // Merge returns x but with elements set to y where mask is false.
372 //
373 // Emulated, CPU Feature: AVX512
374 func (x Int8x64) Merge(y Int8x64, mask Mask8x64) Int8x64 {
375 return y.blendMasked(x, mask)
376 }
377
378 // Masked returns x but with elements zeroed where mask is false.
379 //
380 // Emulated, CPU Feature: AVX512
381 func (x Int16x32) Masked(mask Mask16x32) Int16x32 {
382 im := mask.ToInt16x32()
383 return im.And(x)
384 }
385
386 // Merge returns x but with elements set to y where mask is false.
387 //
388 // Emulated, CPU Feature: AVX512
389 func (x Int16x32) Merge(y Int16x32, mask Mask16x32) Int16x32 {
390 return y.blendMasked(x, mask)
391 }
392
393 // Masked returns x but with elements zeroed where mask is false.
394 //
395 // Emulated, CPU Feature: AVX512
396 func (x Int32x16) Masked(mask Mask32x16) Int32x16 {
397 im := mask.ToInt32x16()
398 return im.And(x)
399 }
400
401 // Merge returns x but with elements set to y where mask is false.
402 //
403 // Emulated, CPU Feature: AVX512
404 func (x Int32x16) Merge(y Int32x16, mask Mask32x16) Int32x16 {
405 return y.blendMasked(x, mask)
406 }
407
408 // Masked returns x but with elements zeroed where mask is false.
409 //
410 // Emulated, CPU Feature: AVX512
411 func (x Int64x8) Masked(mask Mask64x8) Int64x8 {
412 im := mask.ToInt64x8()
413 return im.And(x)
414 }
415
416 // Merge returns x but with elements set to y where mask is false.
417 //
418 // Emulated, CPU Feature: AVX512
419 func (x Int64x8) Merge(y Int64x8, mask Mask64x8) Int64x8 {
420 return y.blendMasked(x, mask)
421 }
422
423 // Masked returns x but with elements zeroed where mask is false.
424 //
425 // Emulated, CPU Feature: AVX512
426 func (x Uint8x64) Masked(mask Mask8x64) Uint8x64 {
427 im := mask.ToInt8x64()
428 return x.AsInt8x64().And(im).AsUint8x64()
429 }
430
431 // Merge returns x but with elements set to y where mask is false.
432 //
433 // Emulated, CPU Feature: AVX512
434 func (x Uint8x64) Merge(y Uint8x64, mask Mask8x64) Uint8x64 {
435 ix := x.AsInt8x64()
436 iy := y.AsInt8x64()
437 return iy.blendMasked(ix, mask).AsUint8x64()
438 }
439
440 // Masked returns x but with elements zeroed where mask is false.
441 //
442 // Emulated, CPU Feature: AVX512
443 func (x Uint16x32) Masked(mask Mask16x32) Uint16x32 {
444 im := mask.ToInt16x32()
445 return x.AsInt16x32().And(im).AsUint16x32()
446 }
447
448 // Merge returns x but with elements set to y where mask is false.
449 //
450 // Emulated, CPU Feature: AVX512
451 func (x Uint16x32) Merge(y Uint16x32, mask Mask16x32) Uint16x32 {
452 ix := x.AsInt16x32()
453 iy := y.AsInt16x32()
454 return iy.blendMasked(ix, mask).AsUint16x32()
455 }
456
457 // Masked returns x but with elements zeroed where mask is false.
458 //
459 // Emulated, CPU Feature: AVX512
460 func (x Uint32x16) Masked(mask Mask32x16) Uint32x16 {
461 im := mask.ToInt32x16()
462 return x.AsInt32x16().And(im).AsUint32x16()
463 }
464
465 // Merge returns x but with elements set to y where mask is false.
466 //
467 // Emulated, CPU Feature: AVX512
468 func (x Uint32x16) Merge(y Uint32x16, mask Mask32x16) Uint32x16 {
469 ix := x.AsInt32x16()
470 iy := y.AsInt32x16()
471 return iy.blendMasked(ix, mask).AsUint32x16()
472 }
473
474 // Masked returns x but with elements zeroed where mask is false.
475 //
476 // Emulated, CPU Feature: AVX512
477 func (x Uint64x8) Masked(mask Mask64x8) Uint64x8 {
478 im := mask.ToInt64x8()
479 return x.AsInt64x8().And(im).AsUint64x8()
480 }
481
482 // Merge returns x but with elements set to y where mask is false.
483 //
484 // Emulated, CPU Feature: AVX512
485 func (x Uint64x8) Merge(y Uint64x8, mask Mask64x8) Uint64x8 {
486 ix := x.AsInt64x8()
487 iy := y.AsInt64x8()
488 return iy.blendMasked(ix, mask).AsUint64x8()
489 }
490
491 // Masked returns x but with elements zeroed where mask is false.
492 //
493 // Emulated, CPU Feature: AVX512
494 func (x Float32x16) Masked(mask Mask32x16) Float32x16 {
495 im := mask.ToInt32x16()
496 return x.AsInt32x16().And(im).AsFloat32x16()
497 }
498
499 // Merge returns x but with elements set to y where mask is false.
500 //
501 // Emulated, CPU Feature: AVX512
502 func (x Float32x16) Merge(y Float32x16, mask Mask32x16) Float32x16 {
503 ix := x.AsInt32x16()
504 iy := y.AsInt32x16()
505 return iy.blendMasked(ix, mask).AsFloat32x16()
506 }
507
508 // Masked returns x but with elements zeroed where mask is false.
509 //
510 // Emulated, CPU Feature: AVX512
511 func (x Float64x8) Masked(mask Mask64x8) Float64x8 {
512 im := mask.ToInt64x8()
513 return x.AsInt64x8().And(im).AsFloat64x8()
514 }
515
516 // Merge returns x but with elements set to y where mask is false.
517 //
518 // Emulated, CPU Feature: AVX512
519 func (x Float64x8) Merge(y Float64x8, mask Mask64x8) Float64x8 {
520 ix := x.AsInt64x8()
521 iy := y.AsInt64x8()
522 return iy.blendMasked(ix, mask).AsFloat64x8()
523 }