forked from openjdk/jdk
/
Double128Vector.java
794 lines (664 loc) · 25.9 KB
/
Double128Vector.java
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
/*
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.incubator.vector;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Objects;
import java.util.function.IntUnaryOperator;
import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.vector.VectorSupport;
import static jdk.internal.vm.vector.VectorSupport.*;
import static jdk.incubator.vector.VectorOperators.*;
// -- This file was mechanically generated: Do not edit! -- //
@SuppressWarnings("cast") // warning: redundant cast
final class Double128Vector extends DoubleVector {
static final DoubleSpecies VSPECIES =
(DoubleSpecies) DoubleVector.SPECIES_128;
static final VectorShape VSHAPE =
VSPECIES.vectorShape();
static final Class<Double128Vector> VCLASS = Double128Vector.class;
static final int VSIZE = VSPECIES.vectorBitSize();
static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM
static final Class<Double> ETYPE = double.class; // used by the JVM
Double128Vector(double[] v) {
super(v);
}
// For compatibility as Double128Vector::new,
// stored into species.vectorFactory.
Double128Vector(Object v) {
this((double[]) v);
}
static final Double128Vector ZERO = new Double128Vector(new double[VLENGTH]);
static final Double128Vector IOTA = new Double128Vector(VSPECIES.iotaArray());
static {
// Warm up a few species caches.
// If we do this too much we will
// get NPEs from bootstrap circularity.
VSPECIES.dummyVector();
VSPECIES.withLanes(LaneType.BYTE);
}
// Specialized extractors
@ForceInline
final @Override
public DoubleSpecies vspecies() {
// ISSUE: This should probably be a @Stable
// field inside AbstractVector, rather than
// a megamorphic method.
return VSPECIES;
}
@ForceInline
@Override
public final Class<Double> elementType() { return double.class; }
@ForceInline
@Override
public final int elementSize() { return Double.SIZE; }
@ForceInline
@Override
public final VectorShape shape() { return VSHAPE; }
@ForceInline
@Override
public final int length() { return VLENGTH; }
@ForceInline
@Override
public final int bitSize() { return VSIZE; }
@ForceInline
@Override
public final int byteSize() { return VSIZE / Byte.SIZE; }
/*package-private*/
@ForceInline
final @Override
double[] vec() {
return (double[])getPayload();
}
// Virtualized constructors
@Override
@ForceInline
public final Double128Vector broadcast(double e) {
return (Double128Vector) super.broadcastTemplate(e); // specialize
}
@Override
@ForceInline
public final Double128Vector broadcast(long e) {
return (Double128Vector) super.broadcastTemplate(e); // specialize
}
@Override
@ForceInline
Double128Mask maskFromArray(boolean[] bits) {
return new Double128Mask(bits);
}
@Override
@ForceInline
Double128Shuffle iotaShuffle() { return Double128Shuffle.IOTA; }
@ForceInline
Double128Shuffle iotaShuffle(int start, int step, boolean wrap) {
if (wrap) {
return (Double128Shuffle)VectorSupport.shuffleIota(ETYPE, Double128Shuffle.class, VSPECIES, VLENGTH, start, step, 1,
(l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l))));
} else {
return (Double128Shuffle)VectorSupport.shuffleIota(ETYPE, Double128Shuffle.class, VSPECIES, VLENGTH, start, step, 0,
(l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart)));
}
}
@Override
@ForceInline
Double128Shuffle shuffleFromBytes(byte[] reorder) { return new Double128Shuffle(reorder); }
@Override
@ForceInline
Double128Shuffle shuffleFromArray(int[] indexes, int i) { return new Double128Shuffle(indexes, i); }
@Override
@ForceInline
Double128Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Double128Shuffle(fn); }
// Make a vector of the same species but the given elements:
@ForceInline
final @Override
Double128Vector vectorFactory(double[] vec) {
return new Double128Vector(vec);
}
@ForceInline
final @Override
Byte128Vector asByteVectorRaw() {
return (Byte128Vector) super.asByteVectorRawTemplate(); // specialize
}
@ForceInline
final @Override
AbstractVector<?> asVectorRaw(LaneType laneType) {
return super.asVectorRawTemplate(laneType); // specialize
}
// Unary operator
@ForceInline
final @Override
Double128Vector uOp(FUnOp f) {
return (Double128Vector) super.uOpTemplate(f); // specialize
}
@ForceInline
final @Override
Double128Vector uOp(VectorMask<Double> m, FUnOp f) {
return (Double128Vector)
super.uOpTemplate((Double128Mask)m, f); // specialize
}
// Binary operator
@ForceInline
final @Override
Double128Vector bOp(Vector<Double> v, FBinOp f) {
return (Double128Vector) super.bOpTemplate((Double128Vector)v, f); // specialize
}
@ForceInline
final @Override
Double128Vector bOp(Vector<Double> v,
VectorMask<Double> m, FBinOp f) {
return (Double128Vector)
super.bOpTemplate((Double128Vector)v, (Double128Mask)m,
f); // specialize
}
// Ternary operator
@ForceInline
final @Override
Double128Vector tOp(Vector<Double> v1, Vector<Double> v2, FTriOp f) {
return (Double128Vector)
super.tOpTemplate((Double128Vector)v1, (Double128Vector)v2,
f); // specialize
}
@ForceInline
final @Override
Double128Vector tOp(Vector<Double> v1, Vector<Double> v2,
VectorMask<Double> m, FTriOp f) {
return (Double128Vector)
super.tOpTemplate((Double128Vector)v1, (Double128Vector)v2,
(Double128Mask)m, f); // specialize
}
@ForceInline
final @Override
double rOp(double v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
}
@Override
@ForceInline
public final <F>
Vector<F> convertShape(VectorOperators.Conversion<Double,F> conv,
VectorSpecies<F> rsp, int part) {
return super.convertShapeTemplate(conv, rsp, part); // specialize
}
@Override
@ForceInline
public final <F>
Vector<F> reinterpretShape(VectorSpecies<F> toSpecies, int part) {
return super.reinterpretShapeTemplate(toSpecies, part); // specialize
}
// Specialized algebraic operations:
// The following definition forces a specialized version of this
// crucial method into the v-table of this class. A call to add()
// will inline to a call to lanewise(ADD,), at which point the JIT
// intrinsic will have the opcode of ADD, plus all the metadata
// for this particular class, enabling it to generate precise
// code.
//
// There is probably no benefit to the JIT to specialize the
// masked or broadcast versions of the lanewise method.
@Override
@ForceInline
public Double128Vector lanewise(Unary op) {
return (Double128Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Double128Vector lanewise(Binary op, Vector<Double> v) {
return (Double128Vector) super.lanewiseTemplate(op, v); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Double128Vector
lanewise(VectorOperators.Ternary op, Vector<Double> v1, Vector<Double> v2) {
return (Double128Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Double128Vector addIndex(int scale) {
return (Double128Vector) super.addIndexTemplate(scale); // specialize
}
// Type specific horizontal reductions
@Override
@ForceInline
public final double reduceLanes(VectorOperators.Associative op) {
return super.reduceLanesTemplate(op); // specialized
}
@Override
@ForceInline
public final double reduceLanes(VectorOperators.Associative op,
VectorMask<Double> m) {
return super.reduceLanesTemplate(op, m); // specialized
}
@Override
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op) {
return (long) super.reduceLanesTemplate(op); // specialized
}
@Override
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Double> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
}
@Override
@ForceInline
public VectorShuffle<Double> toShuffle() {
double[] a = toArray();
int[] sa = new int[a.length];
for (int i = 0; i < a.length; i++) {
sa[i] = (int) a[i];
}
return VectorShuffle.fromArray(VSPECIES, sa, 0);
}
// Specialized unary testing
@Override
@ForceInline
public final Double128Mask test(Test op) {
return super.testTemplate(Double128Mask.class, op); // specialize
}
// Specialized comparisons
@Override
@ForceInline
public final Double128Mask compare(Comparison op, Vector<Double> v) {
return super.compareTemplate(Double128Mask.class, op, v); // specialize
}
@Override
@ForceInline
public final Double128Mask compare(Comparison op, double s) {
return super.compareTemplate(Double128Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Double128Mask compare(Comparison op, long s) {
return super.compareTemplate(Double128Mask.class, op, s); // specialize
}
@Override
@ForceInline
public Double128Vector blend(Vector<Double> v, VectorMask<Double> m) {
return (Double128Vector)
super.blendTemplate(Double128Mask.class,
(Double128Vector) v,
(Double128Mask) m); // specialize
}
@Override
@ForceInline
public Double128Vector slice(int origin, Vector<Double> v) {
return (Double128Vector) super.sliceTemplate(origin, v); // specialize
}
@Override
@ForceInline
public Double128Vector slice(int origin) {
return (Double128Vector) super.sliceTemplate(origin); // specialize
}
@Override
@ForceInline
public Double128Vector unslice(int origin, Vector<Double> w, int part) {
return (Double128Vector) super.unsliceTemplate(origin, w, part); // specialize
}
@Override
@ForceInline
public Double128Vector unslice(int origin, Vector<Double> w, int part, VectorMask<Double> m) {
return (Double128Vector)
super.unsliceTemplate(Double128Mask.class,
origin, w, part,
(Double128Mask) m); // specialize
}
@Override
@ForceInline
public Double128Vector unslice(int origin) {
return (Double128Vector) super.unsliceTemplate(origin); // specialize
}
@Override
@ForceInline
public Double128Vector rearrange(VectorShuffle<Double> s) {
return (Double128Vector)
super.rearrangeTemplate(Double128Shuffle.class,
(Double128Shuffle) s); // specialize
}
@Override
@ForceInline
public Double128Vector rearrange(VectorShuffle<Double> shuffle,
VectorMask<Double> m) {
return (Double128Vector)
super.rearrangeTemplate(Double128Shuffle.class,
(Double128Shuffle) shuffle,
(Double128Mask) m); // specialize
}
@Override
@ForceInline
public Double128Vector rearrange(VectorShuffle<Double> s,
Vector<Double> v) {
return (Double128Vector)
super.rearrangeTemplate(Double128Shuffle.class,
(Double128Shuffle) s,
(Double128Vector) v); // specialize
}
@Override
@ForceInline
public Double128Vector selectFrom(Vector<Double> v) {
return (Double128Vector)
super.selectFromTemplate((Double128Vector) v); // specialize
}
@Override
@ForceInline
public Double128Vector selectFrom(Vector<Double> v,
VectorMask<Double> m) {
return (Double128Vector)
super.selectFromTemplate((Double128Vector) v,
(Double128Mask) m); // specialize
}
@ForceInline
@Override
public double lane(int i) {
long bits;
switch(i) {
case 0: bits = laneHelper(0); break;
case 1: bits = laneHelper(1); break;
default: throw new IllegalArgumentException("Index " + i + " must be zero or positive, and less than " + VLENGTH);
}
return Double.longBitsToDouble(bits);
}
public long laneHelper(int i) {
return (long) VectorSupport.extract(
VCLASS, ETYPE, VLENGTH,
this, i,
(vec, ix) -> {
double[] vecarr = vec.vec();
return (long)Double.doubleToLongBits(vecarr[ix]);
});
}
@ForceInline
@Override
public Double128Vector withLane(int i, double e) {
switch(i) {
case 0: return withLaneHelper(0, e);
case 1: return withLaneHelper(1, e);
default: throw new IllegalArgumentException("Index " + i + " must be zero or positive, and less than " + VLENGTH);
}
}
public Double128Vector withLaneHelper(int i, double e) {
return VectorSupport.insert(
VCLASS, ETYPE, VLENGTH,
this, i, (long)Double.doubleToLongBits(e),
(v, ix, bits) -> {
double[] res = v.vec().clone();
res[ix] = Double.longBitsToDouble((long)bits);
return v.vectorFactory(res);
});
}
// Mask
static final class Double128Mask extends AbstractMask<Double> {
static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM
static final Class<Double> ETYPE = double.class; // used by the JVM
Double128Mask(boolean[] bits) {
this(bits, 0);
}
Double128Mask(boolean[] bits, int offset) {
super(prepare(bits, offset));
}
Double128Mask(boolean val) {
super(prepare(val));
}
private static boolean[] prepare(boolean[] bits, int offset) {
boolean[] newBits = new boolean[VSPECIES.laneCount()];
for (int i = 0; i < newBits.length; i++) {
newBits[i] = bits[offset + i];
}
return newBits;
}
private static boolean[] prepare(boolean val) {
boolean[] bits = new boolean[VSPECIES.laneCount()];
Arrays.fill(bits, val);
return bits;
}
@ForceInline
final @Override
public DoubleSpecies vspecies() {
// ISSUE: This should probably be a @Stable
// field inside AbstractMask, rather than
// a megamorphic method.
return VSPECIES;
}
@ForceInline
boolean[] getBits() {
return (boolean[])getPayload();
}
@Override
Double128Mask uOp(MUnOp f) {
boolean[] res = new boolean[vspecies().laneCount()];
boolean[] bits = getBits();
for (int i = 0; i < res.length; i++) {
res[i] = f.apply(i, bits[i]);
}
return new Double128Mask(res);
}
@Override
Double128Mask bOp(VectorMask<Double> m, MBinOp f) {
boolean[] res = new boolean[vspecies().laneCount()];
boolean[] bits = getBits();
boolean[] mbits = ((Double128Mask)m).getBits();
for (int i = 0; i < res.length; i++) {
res[i] = f.apply(i, bits[i], mbits[i]);
}
return new Double128Mask(res);
}
@ForceInline
@Override
public final
Double128Vector toVector() {
return (Double128Vector) super.toVectorTemplate(); // specialize
}
@Override
@ForceInline
public <E> VectorMask<E> cast(VectorSpecies<E> s) {
AbstractSpecies<E> species = (AbstractSpecies<E>) s;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
boolean[] maskArray = toArray();
// enum-switches don't optimize properly JDK-8161245
switch (species.laneType.switchKey) {
case LaneType.SK_BYTE:
return new Byte128Vector.Byte128Mask(maskArray).check(species);
case LaneType.SK_SHORT:
return new Short128Vector.Short128Mask(maskArray).check(species);
case LaneType.SK_INT:
return new Int128Vector.Int128Mask(maskArray).check(species);
case LaneType.SK_LONG:
return new Long128Vector.Long128Mask(maskArray).check(species);
case LaneType.SK_FLOAT:
return new Float128Vector.Float128Mask(maskArray).check(species);
case LaneType.SK_DOUBLE:
return new Double128Vector.Double128Mask(maskArray).check(species);
}
// Should not reach here.
throw new AssertionError(species);
}
// Unary operations
@Override
@ForceInline
public Double128Mask not() {
return xor(maskAll(true));
}
// Binary operations
@Override
@ForceInline
public Double128Mask and(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double128Mask m = (Double128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Double128Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ForceInline
public Double128Mask or(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double128Mask m = (Double128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Double128Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
/* package-private */
Double128Mask xor(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double128Mask m = (Double128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Double128Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Reductions
@Override
@ForceInline
public boolean anyTrue() {
return VectorSupport.test(BT_ne, Double128Mask.class, long.class, VLENGTH,
this, vspecies().maskAll(true),
(m, __) -> anyTrueHelper(((Double128Mask)m).getBits()));
}
@Override
@ForceInline
public boolean allTrue() {
return VectorSupport.test(BT_overflow, Double128Mask.class, long.class, VLENGTH,
this, vspecies().maskAll(true),
(m, __) -> allTrueHelper(((Double128Mask)m).getBits()));
}
@ForceInline
/*package-private*/
static Double128Mask maskAll(boolean bit) {
return VectorSupport.broadcastCoerced(Double128Mask.class, long.class, VLENGTH,
(bit ? -1 : 0), null,
(v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK));
}
private static final Double128Mask TRUE_MASK = new Double128Mask(true);
private static final Double128Mask FALSE_MASK = new Double128Mask(false);
}
// Shuffle
static final class Double128Shuffle extends AbstractShuffle<Double> {
static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM
static final Class<Double> ETYPE = double.class; // used by the JVM
Double128Shuffle(byte[] reorder) {
super(VLENGTH, reorder);
}
public Double128Shuffle(int[] reorder) {
super(VLENGTH, reorder);
}
public Double128Shuffle(int[] reorder, int i) {
super(VLENGTH, reorder, i);
}
public Double128Shuffle(IntUnaryOperator fn) {
super(VLENGTH, fn);
}
@Override
public DoubleSpecies vspecies() {
return VSPECIES;
}
static {
// There must be enough bits in the shuffle lanes to encode
// VLENGTH valid indexes and VLENGTH exceptional ones.
assert(VLENGTH < Byte.MAX_VALUE);
assert(Byte.MIN_VALUE <= -VLENGTH);
}
static final Double128Shuffle IOTA = new Double128Shuffle(IDENTITY);
@Override
@ForceInline
public Double128Vector toVector() {
return VectorSupport.shuffleToVector(VCLASS, ETYPE, Double128Shuffle.class, this, VLENGTH,
(s) -> ((Double128Vector)(((AbstractShuffle<Double>)(s)).toVectorTemplate())));
}
@Override
@ForceInline
public <F> VectorShuffle<F> cast(VectorSpecies<F> s) {
AbstractSpecies<F> species = (AbstractSpecies<F>) s;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorShuffle length and species length differ");
int[] shuffleArray = toArray();
// enum-switches don't optimize properly JDK-8161245
switch (species.laneType.switchKey) {
case LaneType.SK_BYTE:
return new Byte128Vector.Byte128Shuffle(shuffleArray).check(species);
case LaneType.SK_SHORT:
return new Short128Vector.Short128Shuffle(shuffleArray).check(species);
case LaneType.SK_INT:
return new Int128Vector.Int128Shuffle(shuffleArray).check(species);
case LaneType.SK_LONG:
return new Long128Vector.Long128Shuffle(shuffleArray).check(species);
case LaneType.SK_FLOAT:
return new Float128Vector.Float128Shuffle(shuffleArray).check(species);
case LaneType.SK_DOUBLE:
return new Double128Vector.Double128Shuffle(shuffleArray).check(species);
}
// Should not reach here.
throw new AssertionError(species);
}
@ForceInline
@Override
public Double128Shuffle rearrange(VectorShuffle<Double> shuffle) {
Double128Shuffle s = (Double128Shuffle) shuffle;
byte[] reorder1 = reorder();
byte[] reorder2 = s.reorder();
byte[] r = new byte[reorder1.length];
for (int i = 0; i < reorder1.length; i++) {
int ssi = reorder2[i];
r[i] = reorder1[ssi]; // throws on exceptional index
}
return new Double128Shuffle(r);
}
}
// ================================================
// Specialized low-level memory operations.
@ForceInline
@Override
final
DoubleVector fromArray0(double[] a, int offset) {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
DoubleVector fromByteArray0(byte[] a, int offset) {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
DoubleVector fromByteBuffer0(ByteBuffer bb, int offset) {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(double[] a, int offset) {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset) {
super.intoByteArray0Template(a, offset); // specialize
}
// End of specialized low-level memory operations.
// ================================================
}