< prev index next >

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java

Print this page

219 
220     @ForceInline
221     final @Override
222     Int128Vector tOp(Vector<Integer> v1, Vector<Integer> v2, FTriOp f) {
223         return (Int128Vector)
224             super.tOpTemplate((Int128Vector)v1, (Int128Vector)v2,
225                               f);  // specialize
226     }
227 
228     @ForceInline
229     final @Override
230     Int128Vector tOp(Vector<Integer> v1, Vector<Integer> v2,
231                      VectorMask<Integer> m, FTriOp f) {
232         return (Int128Vector)
233             super.tOpTemplate((Int128Vector)v1, (Int128Vector)v2,
234                               (Int128Mask)m, f);  // specialize
235     }
236 
237     @ForceInline
238     final @Override
239     int rOp(int v, FBinOp f) {
240         return super.rOpTemplate(v, f);  // specialize
241     }
242 
243     @Override
244     @ForceInline
245     public final <F>
246     Vector<F> convertShape(VectorOperators.Conversion<Integer,F> conv,
247                            VectorSpecies<F> rsp, int part) {
248         return super.convertShapeTemplate(conv, rsp, part);  // specialize
249     }
250 
251     @Override
252     @ForceInline
253     public final <F>
254     Vector<F> reinterpretShape(VectorSpecies<F> toSpecies, int part) {
255         return super.reinterpretShapeTemplate(toSpecies, part);  // specialize
256     }
257 
258     // Specialized algebraic operations:
259 
260     // The following definition forces a specialized version of this
261     // crucial method into the v-table of this class.  A call to add()
262     // will inline to a call to lanewise(ADD,), at which point the JIT
263     // intrinsic will have the opcode of ADD, plus all the metadata
264     // for this particular class, enabling it to generate precise
265     // code.
266     //
267     // There is probably no benefit to the JIT to specialize the
268     // masked or broadcast versions of the lanewise method.
269 
270     @Override
271     @ForceInline
272     public Int128Vector lanewise(Unary op) {
273         return (Int128Vector) super.lanewiseTemplate(op);  // specialize
274     }
275 






276     @Override
277     @ForceInline
278     public Int128Vector lanewise(Binary op, Vector<Integer> v) {
279         return (Int128Vector) super.lanewiseTemplate(op, v);  // specialize
280     }
281 






282     /*package-private*/
283     @Override
284     @ForceInline Int128Vector
285     lanewiseShift(VectorOperators.Binary op, int e) {
286         return (Int128Vector) super.lanewiseShiftTemplate(op, e);  // specialize
287     }
288 







289     /*package-private*/
290     @Override
291     @ForceInline
292     public final
293     Int128Vector
294     lanewise(VectorOperators.Ternary op, Vector<Integer> v1, Vector<Integer> v2) {
295         return (Int128Vector) super.lanewiseTemplate(op, v1, v2);  // specialize
296     }
297 








298     @Override
299     @ForceInline
300     public final
301     Int128Vector addIndex(int scale) {
302         return (Int128Vector) super.addIndexTemplate(scale);  // specialize
303     }
304 
305     // Type specific horizontal reductions
306 
307     @Override
308     @ForceInline
309     public final int reduceLanes(VectorOperators.Associative op) {
310         return super.reduceLanesTemplate(op);  // specialized
311     }
312 
313     @Override
314     @ForceInline
315     public final int reduceLanes(VectorOperators.Associative op,
316                                     VectorMask<Integer> m) {
317         return super.reduceLanesTemplate(op, m);  // specialized
318     }
319 
320     @Override
321     @ForceInline
322     public final long reduceLanesToLong(VectorOperators.Associative op) {
323         return (long) super.reduceLanesTemplate(op);  // specialized
324     }
325 
326     @Override
327     @ForceInline
328     public final long reduceLanesToLong(VectorOperators.Associative op,
329                                         VectorMask<Integer> m) {
330         return (long) super.reduceLanesTemplate(op, m);  // specialized
331     }
332 
333     @ForceInline
334     public VectorShuffle<Integer> toShuffle() {
335         return super.toShuffleTemplate(Int128Shuffle.class); // specialize
336     }
337 
338     // Specialized unary testing
339 
340     @Override
341     @ForceInline
342     public final Int128Mask test(Test op) {
343         return super.testTemplate(Int128Mask.class, op);  // specialize
344     }
345 
346     // Specialized comparisons
347 
348     @Override
349     @ForceInline
350     public final Int128Mask compare(Comparison op, Vector<Integer> v) {
351         return super.compareTemplate(Int128Mask.class, op, v);  // specialize
352     }
353 
354     @Override
355     @ForceInline
356     public final Int128Mask compare(Comparison op, int s) {
357         return super.compareTemplate(Int128Mask.class, op, s);  // specialize
358     }
359 
360     @Override
361     @ForceInline
362     public final Int128Mask compare(Comparison op, long s) {
363         return super.compareTemplate(Int128Mask.class, op, s);  // specialize
364     }
365 







366     @Override
367     @ForceInline
368     public Int128Vector blend(Vector<Integer> v, VectorMask<Integer> m) {
369         return (Int128Vector)
370             super.blendTemplate(Int128Mask.class,
371                                 (Int128Vector) v,
372                                 (Int128Mask) m);  // specialize
373     }
374 
375     @Override
376     @ForceInline
377     public Int128Vector slice(int origin, Vector<Integer> v) {
378         return (Int128Vector) super.sliceTemplate(origin, v);  // specialize
379     }
380 
381     @Override
382     @ForceInline
383     public Int128Vector slice(int origin) {
384         return (Int128Vector) super.sliceTemplate(origin);  // specialize
385     }

402     @Override
403     @ForceInline
404     public Int128Vector unslice(int origin) {
405         return (Int128Vector) super.unsliceTemplate(origin);  // specialize
406     }
407 
408     @Override
409     @ForceInline
410     public Int128Vector rearrange(VectorShuffle<Integer> s) {
411         return (Int128Vector)
412             super.rearrangeTemplate(Int128Shuffle.class,
413                                     (Int128Shuffle) s);  // specialize
414     }
415 
416     @Override
417     @ForceInline
418     public Int128Vector rearrange(VectorShuffle<Integer> shuffle,
419                                   VectorMask<Integer> m) {
420         return (Int128Vector)
421             super.rearrangeTemplate(Int128Shuffle.class,

422                                     (Int128Shuffle) shuffle,
423                                     (Int128Mask) m);  // specialize
424     }
425 
426     @Override
427     @ForceInline
428     public Int128Vector rearrange(VectorShuffle<Integer> s,
429                                   Vector<Integer> v) {
430         return (Int128Vector)
431             super.rearrangeTemplate(Int128Shuffle.class,
432                                     (Int128Shuffle) s,
433                                     (Int128Vector) v);  // specialize
434     }
435 
436     @Override
437     @ForceInline
438     public Int128Vector selectFrom(Vector<Integer> v) {
439         return (Int128Vector)
440             super.selectFromTemplate((Int128Vector) v);  // specialize
441     }

571 
572         /**
573          * Helper function for lane-wise mask conversions.
574          * This function kicks in after intrinsic failure.
575          */
576         @ForceInline
577         private final <E>
578         VectorMask<E> defaultMaskCast(AbstractSpecies<E> dsp) {
579             if (length() != dsp.laneCount())
580                 throw new IllegalArgumentException("VectorMask length and species length differ");
581             boolean[] maskArray = toArray();
582             return  dsp.maskFactory(maskArray).check(dsp);
583         }
584 
585         @Override
586         @ForceInline
587         public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
588             AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
589             if (length() != species.laneCount())
590                 throw new IllegalArgumentException("VectorMask length and species length differ");
591             if (VSIZE == species.vectorBitSize()) {
592                 Class<?> dtype = species.elementType();
593                 Class<?> dmtype = species.maskType();
594                 return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
595                     this.getClass(), ETYPE, VLENGTH,
596                     dmtype, dtype, VLENGTH,
597                     this, species,
598                     Int128Mask::defaultMaskCast);
599             }
600             return this.defaultMaskCast(species);
601         }
602 
603         @Override
604         @ForceInline
605         public Int128Mask eq(VectorMask<Integer> mask) {
606             Objects.requireNonNull(mask);
607             Int128Mask m = (Int128Mask)mask;
608             return xor(m.not());
609         }
610 
611         // Unary operations
612 
613         @Override
614         @ForceInline
615         public Int128Mask not() {
616             return xor(maskAll(true));
617         }
618 
619         // Binary operations
620 
621         @Override
622         @ForceInline
623         public Int128Mask and(VectorMask<Integer> mask) {
624             Objects.requireNonNull(mask);
625             Int128Mask m = (Int128Mask)mask;
626             return VectorSupport.binaryOp(VECTOR_OP_AND, Int128Mask.class, int.class, VLENGTH,
627                                              this, m,
628                                              (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
629         }
630 
631         @Override
632         @ForceInline
633         public Int128Mask or(VectorMask<Integer> mask) {
634             Objects.requireNonNull(mask);
635             Int128Mask m = (Int128Mask)mask;
636             return VectorSupport.binaryOp(VECTOR_OP_OR, Int128Mask.class, int.class, VLENGTH,
637                                              this, m,
638                                              (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
639         }
640 
641         @ForceInline
642         /* package-private */
643         Int128Mask xor(VectorMask<Integer> mask) {
644             Objects.requireNonNull(mask);
645             Int128Mask m = (Int128Mask)mask;
646             return VectorSupport.binaryOp(VECTOR_OP_XOR, Int128Mask.class, int.class, VLENGTH,
647                                           this, m,
648                                           (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
649         }
650 
651         // Mask Query operations
652 
653         @Override
654         @ForceInline
655         public int trueCount() {
656             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int128Mask.class, int.class, VLENGTH, this,
657                                                       (m) -> trueCountHelper(((Int128Mask)m).getBits()));
658         }
659 
660         @Override
661         @ForceInline
662         public int firstTrue() {
663             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int128Mask.class, int.class, VLENGTH, this,
664                                                       (m) -> firstTrueHelper(((Int128Mask)m).getBits()));
665         }
666 
667         @Override
668         @ForceInline
669         public int lastTrue() {
670             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int128Mask.class, int.class, VLENGTH, this,
671                                                       (m) -> lastTrueHelper(((Int128Mask)m).getBits()));










672         }
673 
674         // Reductions
675 
676         @Override
677         @ForceInline
678         public boolean anyTrue() {
679             return VectorSupport.test(BT_ne, Int128Mask.class, int.class, VLENGTH,
680                                          this, vspecies().maskAll(true),
681                                          (m, __) -> anyTrueHelper(((Int128Mask)m).getBits()));
682         }
683 
684         @Override
685         @ForceInline
686         public boolean allTrue() {
687             return VectorSupport.test(BT_overflow, Int128Mask.class, int.class, VLENGTH,
688                                          this, vspecies().maskAll(true),
689                                          (m, __) -> allTrueHelper(((Int128Mask)m).getBits()));
690         }
691 

762             byte[] r = new byte[reorder1.length];
763             for (int i = 0; i < reorder1.length; i++) {
764                 int ssi = reorder2[i];
765                 r[i] = reorder1[ssi];  // throws on exceptional index
766             }
767             return new Int128Shuffle(r);
768         }
769     }
770 
771     // ================================================
772 
773     // Specialized low-level memory operations.
774 
775     @ForceInline
776     @Override
777     final
778     IntVector fromArray0(int[] a, int offset) {
779         return super.fromArray0Template(a, offset);  // specialize
780     }
781 














782 
783 
784     @ForceInline
785     @Override
786     final
787     IntVector fromByteArray0(byte[] a, int offset) {
788         return super.fromByteArray0Template(a, offset);  // specialize
789     }
790 







791     @ForceInline
792     @Override
793     final
794     IntVector fromByteBuffer0(ByteBuffer bb, int offset) {
795         return super.fromByteBuffer0Template(bb, offset);  // specialize
796     }
797 







798     @ForceInline
799     @Override
800     final
801     void intoArray0(int[] a, int offset) {
802         super.intoArray0Template(a, offset);  // specialize
803     }
804 















805     @ForceInline
806     @Override
807     final
808     void intoByteArray0(byte[] a, int offset) {
809         super.intoByteArray0Template(a, offset);  // specialize
810     }
811 















812     // End of specialized low-level memory operations.
813 
814     // ================================================
815 
816 }

219 
220     @ForceInline
221     final @Override
222     Int128Vector tOp(Vector<Integer> v1, Vector<Integer> v2, FTriOp f) {
223         return (Int128Vector)
224             super.tOpTemplate((Int128Vector)v1, (Int128Vector)v2,
225                               f);  // specialize
226     }
227 
228     @ForceInline
229     final @Override
230     Int128Vector tOp(Vector<Integer> v1, Vector<Integer> v2,
231                      VectorMask<Integer> m, FTriOp f) {
232         return (Int128Vector)
233             super.tOpTemplate((Int128Vector)v1, (Int128Vector)v2,
234                               (Int128Mask)m, f);  // specialize
235     }
236 
237     @ForceInline
238     final @Override
239     int rOp(int v, VectorMask<Integer> m, FBinOp f) {
240         return super.rOpTemplate(v, m, f);  // specialize
241     }
242 
243     @Override
244     @ForceInline
245     public final <F>
246     Vector<F> convertShape(VectorOperators.Conversion<Integer,F> conv,
247                            VectorSpecies<F> rsp, int part) {
248         return super.convertShapeTemplate(conv, rsp, part);  // specialize
249     }
250 
251     @Override
252     @ForceInline
253     public final <F>
254     Vector<F> reinterpretShape(VectorSpecies<F> toSpecies, int part) {
255         return super.reinterpretShapeTemplate(toSpecies, part);  // specialize
256     }
257 
258     // Specialized algebraic operations:
259 
260     // The following definition forces a specialized version of this
261     // crucial method into the v-table of this class.  A call to add()
262     // will inline to a call to lanewise(ADD,), at which point the JIT
263     // intrinsic will have the opcode of ADD, plus all the metadata
264     // for this particular class, enabling it to generate precise
265     // code.
266     //
267     // There is probably no benefit to the JIT to specialize the
268     // masked or broadcast versions of the lanewise method.
269 
270     @Override
271     @ForceInline
272     public Int128Vector lanewise(Unary op) {
273         return (Int128Vector) super.lanewiseTemplate(op);  // specialize
274     }
275 
276     @Override
277     @ForceInline
278     public Int128Vector lanewise(Unary op, VectorMask<Integer> m) {
279         return (Int128Vector) super.lanewiseTemplate(op, Int128Mask.class, (Int128Mask) m);  // specialize
280     }
281 
282     @Override
283     @ForceInline
284     public Int128Vector lanewise(Binary op, Vector<Integer> v) {
285         return (Int128Vector) super.lanewiseTemplate(op, v);  // specialize
286     }
287 
288     @Override
289     @ForceInline
290     public Int128Vector lanewise(Binary op, Vector<Integer> v, VectorMask<Integer> m) {
291         return (Int128Vector) super.lanewiseTemplate(op, Int128Mask.class, v, (Int128Mask) m);  // specialize
292     }
293 
294     /*package-private*/
295     @Override
296     @ForceInline Int128Vector
297     lanewiseShift(VectorOperators.Binary op, int e) {
298         return (Int128Vector) super.lanewiseShiftTemplate(op, e);  // specialize
299     }
300 
301     /*package-private*/
302     @Override
303     @ForceInline Int128Vector
304     lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Integer> m) {
305         return (Int128Vector) super.lanewiseShiftTemplate(op, Int128Mask.class, e, (Int128Mask) m);  // specialize
306     }
307 
308     /*package-private*/
309     @Override
310     @ForceInline
311     public final
312     Int128Vector
313     lanewise(Ternary op, Vector<Integer> v1, Vector<Integer> v2) {
314         return (Int128Vector) super.lanewiseTemplate(op, v1, v2);  // specialize
315     }
316 
317     @Override
318     @ForceInline
319     public final
320     Int128Vector
321     lanewise(Ternary op, Vector<Integer> v1, Vector<Integer> v2, VectorMask<Integer> m) {
322         return (Int128Vector) super.lanewiseTemplate(op, Int128Mask.class, v1, v2, (Int128Mask) m);  // specialize
323     }
324 
325     @Override
326     @ForceInline
327     public final
328     Int128Vector addIndex(int scale) {
329         return (Int128Vector) super.addIndexTemplate(scale);  // specialize
330     }
331 
332     // Type specific horizontal reductions
333 
334     @Override
335     @ForceInline
336     public final int reduceLanes(VectorOperators.Associative op) {
337         return super.reduceLanesTemplate(op);  // specialized
338     }
339 
340     @Override
341     @ForceInline
342     public final int reduceLanes(VectorOperators.Associative op,
343                                     VectorMask<Integer> m) {
344         return super.reduceLanesTemplate(op, Int128Mask.class, (Int128Mask) m);  // specialized
345     }
346 
347     @Override
348     @ForceInline
349     public final long reduceLanesToLong(VectorOperators.Associative op) {
350         return (long) super.reduceLanesTemplate(op);  // specialized
351     }
352 
353     @Override
354     @ForceInline
355     public final long reduceLanesToLong(VectorOperators.Associative op,
356                                         VectorMask<Integer> m) {
357         return (long) super.reduceLanesTemplate(op, Int128Mask.class, (Int128Mask) m);  // specialized
358     }
359 
360     @ForceInline
361     public VectorShuffle<Integer> toShuffle() {
362         return super.toShuffleTemplate(Int128Shuffle.class); // specialize
363     }
364 
365     // Specialized unary testing
366 
367     @Override
368     @ForceInline
369     public final Int128Mask test(Test op) {
370         return super.testTemplate(Int128Mask.class, op);  // specialize
371     }
372 
373     // Specialized comparisons
374 
375     @Override
376     @ForceInline
377     public final Int128Mask compare(Comparison op, Vector<Integer> v) {
378         return super.compareTemplate(Int128Mask.class, op, v);  // specialize
379     }
380 
381     @Override
382     @ForceInline
383     public final Int128Mask compare(Comparison op, int s) {
384         return super.compareTemplate(Int128Mask.class, op, s);  // specialize
385     }
386 
387     @Override
388     @ForceInline
389     public final Int128Mask compare(Comparison op, long s) {
390         return super.compareTemplate(Int128Mask.class, op, s);  // specialize
391     }
392 
393     @Override
394     @ForceInline
395     public final Int128Mask compare(Comparison op, Vector<Integer> v, VectorMask<Integer> m) {
396         return super.compareTemplate(Int128Mask.class, op, v, (Int128Mask) m);
397     }
398 
399 
400     @Override
401     @ForceInline
402     public Int128Vector blend(Vector<Integer> v, VectorMask<Integer> m) {
403         return (Int128Vector)
404             super.blendTemplate(Int128Mask.class,
405                                 (Int128Vector) v,
406                                 (Int128Mask) m);  // specialize
407     }
408 
409     @Override
410     @ForceInline
411     public Int128Vector slice(int origin, Vector<Integer> v) {
412         return (Int128Vector) super.sliceTemplate(origin, v);  // specialize
413     }
414 
415     @Override
416     @ForceInline
417     public Int128Vector slice(int origin) {
418         return (Int128Vector) super.sliceTemplate(origin);  // specialize
419     }

436     @Override
437     @ForceInline
438     public Int128Vector unslice(int origin) {
439         return (Int128Vector) super.unsliceTemplate(origin);  // specialize
440     }
441 
442     @Override
443     @ForceInline
444     public Int128Vector rearrange(VectorShuffle<Integer> s) {
445         return (Int128Vector)
446             super.rearrangeTemplate(Int128Shuffle.class,
447                                     (Int128Shuffle) s);  // specialize
448     }
449 
450     @Override
451     @ForceInline
452     public Int128Vector rearrange(VectorShuffle<Integer> shuffle,
453                                   VectorMask<Integer> m) {
454         return (Int128Vector)
455             super.rearrangeTemplate(Int128Shuffle.class,
456                                     Int128Mask.class,
457                                     (Int128Shuffle) shuffle,
458                                     (Int128Mask) m);  // specialize
459     }
460 
461     @Override
462     @ForceInline
463     public Int128Vector rearrange(VectorShuffle<Integer> s,
464                                   Vector<Integer> v) {
465         return (Int128Vector)
466             super.rearrangeTemplate(Int128Shuffle.class,
467                                     (Int128Shuffle) s,
468                                     (Int128Vector) v);  // specialize
469     }
470 
471     @Override
472     @ForceInline
473     public Int128Vector selectFrom(Vector<Integer> v) {
474         return (Int128Vector)
475             super.selectFromTemplate((Int128Vector) v);  // specialize
476     }

606 
607         /**
608          * Helper function for lane-wise mask conversions.
609          * This function kicks in after intrinsic failure.
610          */
611         @ForceInline
612         private final <E>
613         VectorMask<E> defaultMaskCast(AbstractSpecies<E> dsp) {
614             if (length() != dsp.laneCount())
615                 throw new IllegalArgumentException("VectorMask length and species length differ");
616             boolean[] maskArray = toArray();
617             return  dsp.maskFactory(maskArray).check(dsp);
618         }
619 
620         @Override
621         @ForceInline
622         public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
623             AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
624             if (length() != species.laneCount())
625                 throw new IllegalArgumentException("VectorMask length and species length differ");
626 
627             return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
628                 this.getClass(), ETYPE, VLENGTH,
629                 species.maskType(), species.elementType(), VLENGTH,
630                 this, species,
631                 (m, s) -> s.maskFactory(m.toArray()).check(s));




632         }
633 
634         @Override
635         @ForceInline
636         public Int128Mask eq(VectorMask<Integer> mask) {
637             Objects.requireNonNull(mask);
638             Int128Mask m = (Int128Mask)mask;
639             return xor(m.not());
640         }
641 
642         // Unary operations
643 
644         @Override
645         @ForceInline
646         public Int128Mask not() {
647             return xor(maskAll(true));
648         }
649 
650         // Binary operations
651 
652         @Override
653         @ForceInline
654         public Int128Mask and(VectorMask<Integer> mask) {
655             Objects.requireNonNull(mask);
656             Int128Mask m = (Int128Mask)mask;
657             return VectorSupport.binaryOp(VECTOR_OP_AND, Int128Mask.class, null, int.class, VLENGTH,
658                                           this, m, null,
659                                           (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
660         }
661 
662         @Override
663         @ForceInline
664         public Int128Mask or(VectorMask<Integer> mask) {
665             Objects.requireNonNull(mask);
666             Int128Mask m = (Int128Mask)mask;
667             return VectorSupport.binaryOp(VECTOR_OP_OR, Int128Mask.class, null, int.class, VLENGTH,
668                                           this, m, null,
669                                           (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
670         }
671 
672         @ForceInline
673         /* package-private */
674         Int128Mask xor(VectorMask<Integer> mask) {
675             Objects.requireNonNull(mask);
676             Int128Mask m = (Int128Mask)mask;
677             return VectorSupport.binaryOp(VECTOR_OP_XOR, Int128Mask.class, null, int.class, VLENGTH,
678                                           this, m, null,
679                                           (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
680         }
681 
682         // Mask Query operations
683 
684         @Override
685         @ForceInline
686         public int trueCount() {
687             return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int128Mask.class, int.class, VLENGTH, this,
688                                                       (m) -> trueCountHelper(m.getBits()));
689         }
690 
691         @Override
692         @ForceInline
693         public int firstTrue() {
694             return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int128Mask.class, int.class, VLENGTH, this,
695                                                       (m) -> firstTrueHelper(m.getBits()));
696         }
697 
698         @Override
699         @ForceInline
700         public int lastTrue() {
701             return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int128Mask.class, int.class, VLENGTH, this,
702                                                       (m) -> lastTrueHelper(m.getBits()));
703         }
704 
705         @Override
706         @ForceInline
707         public long toLong() {
708             if (length() > Long.SIZE) {
709                 throw new UnsupportedOperationException("too many lanes for one long");
710             }
711             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Int128Mask.class, int.class, VLENGTH, this,
712                                                       (m) -> toLongHelper(m.getBits()));
713         }
714 
715         // Reductions
716 
717         @Override
718         @ForceInline
719         public boolean anyTrue() {
720             return VectorSupport.test(BT_ne, Int128Mask.class, int.class, VLENGTH,
721                                          this, vspecies().maskAll(true),
722                                          (m, __) -> anyTrueHelper(((Int128Mask)m).getBits()));
723         }
724 
725         @Override
726         @ForceInline
727         public boolean allTrue() {
728             return VectorSupport.test(BT_overflow, Int128Mask.class, int.class, VLENGTH,
729                                          this, vspecies().maskAll(true),
730                                          (m, __) -> allTrueHelper(((Int128Mask)m).getBits()));
731         }
732 

803             byte[] r = new byte[reorder1.length];
804             for (int i = 0; i < reorder1.length; i++) {
805                 int ssi = reorder2[i];
806                 r[i] = reorder1[ssi];  // throws on exceptional index
807             }
808             return new Int128Shuffle(r);
809         }
810     }
811 
812     // ================================================
813 
814     // Specialized low-level memory operations.
815 
816     @ForceInline
817     @Override
818     final
819     IntVector fromArray0(int[] a, int offset) {
820         return super.fromArray0Template(a, offset);  // specialize
821     }
822 
823     @ForceInline
824     @Override
825     final
826     IntVector fromArray0(int[] a, int offset, VectorMask<Integer> m) {
827         return super.fromArray0Template(Int128Mask.class, a, offset, (Int128Mask) m);  // specialize
828     }
829 
830     @ForceInline
831     @Override
832     final
833     IntVector fromArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Integer> m) {
834         return super.fromArray0Template(Int128Mask.class, a, offset, indexMap, mapOffset, (Int128Mask) m);
835     }
836 
837 
838 
839     @ForceInline
840     @Override
841     final
842     IntVector fromByteArray0(byte[] a, int offset) {
843         return super.fromByteArray0Template(a, offset);  // specialize
844     }
845 
846     @ForceInline
847     @Override
848     final
849     IntVector fromByteArray0(byte[] a, int offset, VectorMask<Integer> m) {
850         return super.fromByteArray0Template(Int128Mask.class, a, offset, (Int128Mask) m);  // specialize
851     }
852 
853     @ForceInline
854     @Override
855     final
856     IntVector fromByteBuffer0(ByteBuffer bb, int offset) {
857         return super.fromByteBuffer0Template(bb, offset);  // specialize
858     }
859 
860     @ForceInline
861     @Override
862     final
863     IntVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Integer> m) {
864         return super.fromByteBuffer0Template(Int128Mask.class, bb, offset, (Int128Mask) m);  // specialize
865     }
866 
867     @ForceInline
868     @Override
869     final
870     void intoArray0(int[] a, int offset) {
871         super.intoArray0Template(a, offset);  // specialize
872     }
873 
874     @ForceInline
875     @Override
876     final
877     void intoArray0(int[] a, int offset, VectorMask<Integer> m) {
878         super.intoArray0Template(Int128Mask.class, a, offset, (Int128Mask) m);
879     }
880 
881     @ForceInline
882     @Override
883     final
884     void intoArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Integer> m) {
885         super.intoArray0Template(Int128Mask.class, a, offset, indexMap, mapOffset, (Int128Mask) m);
886     }
887 
888 
889     @ForceInline
890     @Override
891     final
892     void intoByteArray0(byte[] a, int offset) {
893         super.intoByteArray0Template(a, offset);  // specialize
894     }
895 
896     @ForceInline
897     @Override
898     final
899     void intoByteArray0(byte[] a, int offset, VectorMask<Integer> m) {
900         super.intoByteArray0Template(Int128Mask.class, a, offset, (Int128Mask) m);  // specialize
901     }
902 
903     @ForceInline
904     @Override
905     final
906     void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Integer> m) {
907         super.intoByteBuffer0Template(Int128Mask.class, bb, offset, (Int128Mask) m);
908     }
909 
910 
911     // End of specialized low-level memory operations.
912 
913     // ================================================
914 
915 }
< prev index next >