Source file
src/simd/archsimd/other_gen_arm64.go
1
2
3
4
5 package archsimd
6
7
8
9 func BroadcastInt8x16(x int8) Int8x16 {
10 var z Int8x16
11 return z.SetElem(0, x).broadcast1To16()
12 }
13
14
15
16 func BroadcastInt16x8(x int16) Int16x8 {
17 var z Int16x8
18 return z.SetElem(0, x).broadcast1To8()
19 }
20
21
22
23 func BroadcastInt32x4(x int32) Int32x4 {
24 var z Int32x4
25 return z.SetElem(0, x).broadcast1To4()
26 }
27
28
29
30 func BroadcastInt64x2(x int64) Int64x2 {
31 var z Int64x2
32 return z.SetElem(0, x).broadcast1To2()
33 }
34
35
36
37 func BroadcastUint8x16(x uint8) Uint8x16 {
38 var z Uint8x16
39 return z.SetElem(0, x).broadcast1To16()
40 }
41
42
43
44 func BroadcastUint16x8(x uint16) Uint16x8 {
45 var z Uint16x8
46 return z.SetElem(0, x).broadcast1To8()
47 }
48
49
50
51 func BroadcastUint32x4(x uint32) Uint32x4 {
52 var z Uint32x4
53 return z.SetElem(0, x).broadcast1To4()
54 }
55
56
57
58 func BroadcastUint64x2(x uint64) Uint64x2 {
59 var z Uint64x2
60 return z.SetElem(0, x).broadcast1To2()
61 }
62
63
64
65 func BroadcastFloat32x4(x float32) Float32x4 {
66 var z Float32x4
67 return z.SetElem(0, x).broadcast1To4()
68 }
69
70
71
72 func BroadcastFloat64x2(x float64) Float64x2 {
73 var z Float64x2
74 return z.SetElem(0, x).broadcast1To2()
75 }
76
77
78 func (x Int8x16) String() string {
79 var s [16]int8
80 x.StoreArray(&s)
81 return sliceToString(s[:])
82 }
83
84
85 func (x Int16x8) String() string {
86 var s [8]int16
87 x.StoreArray(&s)
88 return sliceToString(s[:])
89 }
90
91
92 func (x Int32x4) String() string {
93 var s [4]int32
94 x.StoreArray(&s)
95 return sliceToString(s[:])
96 }
97
98
99 func (x Int64x2) String() string {
100 var s [2]int64
101 x.StoreArray(&s)
102 return sliceToString(s[:])
103 }
104
105
106 func (x Uint8x16) String() string {
107 var s [16]uint8
108 x.StoreArray(&s)
109 return sliceToString(s[:])
110 }
111
112
113 func (x Uint16x8) String() string {
114 var s [8]uint16
115 x.StoreArray(&s)
116 return sliceToString(s[:])
117 }
118
119
120 func (x Uint32x4) String() string {
121 var s [4]uint32
122 x.StoreArray(&s)
123 return sliceToString(s[:])
124 }
125
126
127 func (x Uint64x2) String() string {
128 var s [2]uint64
129 x.StoreArray(&s)
130 return sliceToString(s[:])
131 }
132
133
134 func (x Float32x4) String() string {
135 var s [4]float32
136 x.StoreArray(&s)
137 return sliceToString(s[:])
138 }
139
140
141 func (x Float64x2) String() string {
142 var s [2]float64
143 x.StoreArray(&s)
144 return sliceToString(s[:])
145 }
146
147
148
149 func (x Int8x16) HiToLo() Int8x16 {
150 var z Int8x16
151 return z.ToBits().ReshapeToUint64s().SetElem(0, x.ToBits().ReshapeToUint64s().GetElem(1)).ReshapeToUint8s().BitsToInt8()
152 }
153
154
155
156 func (x Int16x8) HiToLo() Int16x8 {
157 var z Int16x8
158 return z.ToBits().ReshapeToUint64s().SetElem(0, x.ToBits().ReshapeToUint64s().GetElem(1)).ReshapeToUint16s().BitsToInt16()
159 }
160
161
162
163 func (x Int32x4) HiToLo() Int32x4 {
164 var z Int32x4
165 return z.ToBits().ReshapeToUint64s().SetElem(0, x.ToBits().ReshapeToUint64s().GetElem(1)).ReshapeToUint32s().BitsToInt32()
166 }
167
168
169
170 func (x Int64x2) HiToLo() Int64x2 {
171 var z Int64x2
172 return z.ToBits().SetElem(0, x.ToBits().GetElem(1)).BitsToInt64()
173 }
174
175
176
177 func (x Uint8x16) HiToLo() Uint8x16 {
178 var z Uint8x16
179 return z.ReshapeToUint64s().SetElem(0, x.ReshapeToUint64s().GetElem(1)).ReshapeToUint8s()
180 }
181
182
183
184 func (x Uint16x8) HiToLo() Uint16x8 {
185 var z Uint16x8
186 return z.ReshapeToUint64s().SetElem(0, x.ReshapeToUint64s().GetElem(1)).ReshapeToUint16s()
187 }
188
189
190
191 func (x Uint32x4) HiToLo() Uint32x4 {
192 var z Uint32x4
193 return z.ReshapeToUint64s().SetElem(0, x.ReshapeToUint64s().GetElem(1)).ReshapeToUint32s()
194 }
195
196
197
198 func (x Uint64x2) HiToLo() Uint64x2 {
199 var z Uint64x2
200 return z.SetElem(0, x.GetElem(1))
201 }
202
203
204
205 func (x Float32x4) HiToLo() Float32x4 {
206 var z Float32x4
207 return z.ToBits().ReshapeToUint64s().SetElem(0, x.ToBits().ReshapeToUint64s().GetElem(1)).ReshapeToUint32s().BitsToFloat32()
208 }
209
210
211
212 func (x Float64x2) HiToLo() Float64x2 {
213 var z Float64x2
214 return z.ToBits().SetElem(0, x.ToBits().GetElem(1)).BitsToFloat64()
215 }
216
217
218 func (from Int8x16) ToMask() (to Mask8x16) {
219 return from.NotEqual(Int8x16{})
220 }
221
222
223 func (from Int16x8) ToMask() (to Mask16x8) {
224 return from.NotEqual(Int16x8{})
225 }
226
227
228 func (from Int32x4) ToMask() (to Mask32x4) {
229 return from.NotEqual(Int32x4{})
230 }
231
232
233 func (from Int64x2) ToMask() (to Mask64x2) {
234 return from.NotEqual(Int64x2{})
235 }
236
237
238
239
240 func (x Int8x16) RotateAllLeft(dist uint64) Int8x16 {
241 dist = dist & (8 - 1)
242 ndist := 8 - dist
243 return x.ToBits().ShiftAllLeft(dist).Or(x.ToBits().ShiftAllRight(ndist)).BitsToInt8()
244 }
245
246
247
248
249 func (x Int8x16) RotateAllRight(dist uint64) Int8x16 {
250 dist = dist & (8 - 1)
251 ndist := 8 - dist
252 return x.ToBits().ShiftAllLeft(ndist).Or(x.ToBits().ShiftAllRight(dist)).BitsToInt8()
253 }
254
255
256
257
258 func (x Int16x8) RotateAllLeft(dist uint64) Int16x8 {
259 dist = dist & (16 - 1)
260 ndist := 16 - dist
261 return x.ToBits().ShiftAllLeft(dist).Or(x.ToBits().ShiftAllRight(ndist)).BitsToInt16()
262 }
263
264
265
266
267 func (x Int16x8) RotateAllRight(dist uint64) Int16x8 {
268 dist = dist & (16 - 1)
269 ndist := 16 - dist
270 return x.ToBits().ShiftAllLeft(ndist).Or(x.ToBits().ShiftAllRight(dist)).BitsToInt16()
271 }
272
273
274
275
276 func (x Int32x4) RotateAllLeft(dist uint64) Int32x4 {
277 dist = dist & (32 - 1)
278 ndist := 32 - dist
279 return x.ToBits().ShiftAllLeft(dist).Or(x.ToBits().ShiftAllRight(ndist)).BitsToInt32()
280 }
281
282
283
284
285 func (x Int32x4) RotateAllRight(dist uint64) Int32x4 {
286 dist = dist & (32 - 1)
287 ndist := 32 - dist
288 return x.ToBits().ShiftAllLeft(ndist).Or(x.ToBits().ShiftAllRight(dist)).BitsToInt32()
289 }
290
291
292
293
294 func (x Int64x2) RotateAllLeft(dist uint64) Int64x2 {
295 dist = dist & (64 - 1)
296 ndist := 64 - dist
297 return x.ToBits().ShiftAllLeft(dist).Or(x.ToBits().ShiftAllRight(ndist)).BitsToInt64()
298 }
299
300
301
302
303 func (x Int64x2) RotateAllRight(dist uint64) Int64x2 {
304 dist = dist & (64 - 1)
305 ndist := 64 - dist
306 return x.ToBits().ShiftAllLeft(ndist).Or(x.ToBits().ShiftAllRight(dist)).BitsToInt64()
307 }
308
309
310
311
312 func (x Uint8x16) RotateAllLeft(dist uint64) Uint8x16 {
313 dist = dist & (8 - 1)
314 ndist := 8 - dist
315 return x.ShiftAllLeft(dist).Or(x.ShiftAllRight(ndist))
316 }
317
318
319
320
321 func (x Uint8x16) RotateAllRight(dist uint64) Uint8x16 {
322 dist = dist & (8 - 1)
323 ndist := 8 - dist
324 return x.ShiftAllLeft(ndist).Or(x.ShiftAllRight(dist))
325 }
326
327
328
329
330 func (x Uint16x8) RotateAllLeft(dist uint64) Uint16x8 {
331 dist = dist & (16 - 1)
332 ndist := 16 - dist
333 return x.ShiftAllLeft(dist).Or(x.ShiftAllRight(ndist))
334 }
335
336
337
338
339 func (x Uint16x8) RotateAllRight(dist uint64) Uint16x8 {
340 dist = dist & (16 - 1)
341 ndist := 16 - dist
342 return x.ShiftAllLeft(ndist).Or(x.ShiftAllRight(dist))
343 }
344
345
346
347
348 func (x Uint32x4) RotateAllLeft(dist uint64) Uint32x4 {
349 dist = dist & (32 - 1)
350 ndist := 32 - dist
351 return x.ShiftAllLeft(dist).Or(x.ShiftAllRight(ndist))
352 }
353
354
355
356
357 func (x Uint32x4) RotateAllRight(dist uint64) Uint32x4 {
358 dist = dist & (32 - 1)
359 ndist := 32 - dist
360 return x.ShiftAllLeft(ndist).Or(x.ShiftAllRight(dist))
361 }
362
363
364
365
366 func (x Uint64x2) RotateAllLeft(dist uint64) Uint64x2 {
367 dist = dist & (64 - 1)
368 ndist := 64 - dist
369 return x.ShiftAllLeft(dist).Or(x.ShiftAllRight(ndist))
370 }
371
372
373
374
375 func (x Uint64x2) RotateAllRight(dist uint64) Uint64x2 {
376 dist = dist & (64 - 1)
377 ndist := 64 - dist
378 return x.ShiftAllLeft(ndist).Or(x.ShiftAllRight(dist))
379 }
380
381
382
383
384 func (x Int8x16) ReduceSum() int8 {
385 return x.reduceSum().GetElem(0)
386 }
387
388
389
390
391 func (x Int16x8) ReduceSum() int16 {
392 return x.reduceSum().GetElem(0)
393 }
394
395
396
397
398 func (x Int32x4) ReduceSum() int32 {
399 return x.reduceSum().GetElem(0)
400 }
401
402
403
404
405 func (x Uint8x16) ReduceSum() uint8 {
406 return x.reduceSum().GetElem(0)
407 }
408
409
410
411
412 func (x Uint16x8) ReduceSum() uint16 {
413 return x.reduceSum().GetElem(0)
414 }
415
416
417
418
419 func (x Uint32x4) ReduceSum() uint32 {
420 return x.reduceSum().GetElem(0)
421 }
422
423
424
425
426 func (x Int8x16) ReduceMax() int8 {
427 return x.reduceMax().GetElem(0)
428 }
429
430
431
432
433 func (x Int8x16) ReduceMin() int8 {
434 return x.reduceMin().GetElem(0)
435 }
436
437
438
439
440 func (x Int16x8) ReduceMax() int16 {
441 return x.reduceMax().GetElem(0)
442 }
443
444
445
446
447 func (x Int16x8) ReduceMin() int16 {
448 return x.reduceMin().GetElem(0)
449 }
450
451
452
453
454 func (x Int32x4) ReduceMax() int32 {
455 return x.reduceMax().GetElem(0)
456 }
457
458
459
460
461 func (x Int32x4) ReduceMin() int32 {
462 return x.reduceMin().GetElem(0)
463 }
464
465
466
467
468 func (x Uint8x16) ReduceMax() uint8 {
469 return x.reduceMax().GetElem(0)
470 }
471
472
473
474
475 func (x Uint8x16) ReduceMin() uint8 {
476 return x.reduceMin().GetElem(0)
477 }
478
479
480
481
482 func (x Uint16x8) ReduceMax() uint16 {
483 return x.reduceMax().GetElem(0)
484 }
485
486
487
488
489 func (x Uint16x8) ReduceMin() uint16 {
490 return x.reduceMin().GetElem(0)
491 }
492
493
494
495
496 func (x Uint32x4) ReduceMax() uint32 {
497 return x.reduceMax().GetElem(0)
498 }
499
500
501
502
503 func (x Uint32x4) ReduceMin() uint32 {
504 return x.reduceMin().GetElem(0)
505 }
506
507
508
509
510 func (x Float32x4) ReduceMax() float32 {
511 return x.reduceMax().GetElem(0)
512 }
513
514
515
516
517 func (x Float32x4) ReduceMin() float32 {
518 return x.reduceMin().GetElem(0)
519 }
520
View as plain text