< prev index next >

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

Print this page

219 
220     @ForceInline
221     final @Override
222     Short128Vector tOp(Vector<Short> v1, Vector<Short> v2, FTriOp f) {
223         return (Short128Vector)
224             super.tOpTemplate((Short128Vector)v1, (Short128Vector)v2,
225                               f);  // specialize
226     }
227 
228     @ForceInline
229     final @Override
230     Short128Vector tOp(Vector<Short> v1, Vector<Short> v2,
231                      VectorMask<Short> m, FTriOp f) {
232         return (Short128Vector)
233             super.tOpTemplate((Short128Vector)v1, (Short128Vector)v2,
234                               (Short128Mask)m, f);  // specialize
235     }
236 
237     @ForceInline
238     final @Override
239     short rOp(short 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<Short,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 Short128Vector lanewise(Unary op) {
273         return (Short128Vector) super.lanewiseTemplate(op);  // specialize
274     }
275 






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






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







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








298     @Override
299     @ForceInline
300     public final
301     Short128Vector addIndex(int scale) {
302         return (Short128Vector) super.addIndexTemplate(scale);  // specialize
303     }
304 
305     // Type specific horizontal reductions
306 
307     @Override
308     @ForceInline
309     public final short reduceLanes(VectorOperators.Associative op) {
310         return super.reduceLanesTemplate(op);  // specialized
311     }
312 
313     @Override
314     @ForceInline
315     public final short reduceLanes(VectorOperators.Associative op,
316                                     VectorMask<Short> 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<Short> m) {
330         return (long) super.reduceLanesTemplate(op, m);  // specialized
331     }
332 
333     @ForceInline
334     public VectorShuffle<Short> toShuffle() {
335         return super.toShuffleTemplate(Short128Shuffle.class); // specialize
336     }
337 
338     // Specialized unary testing
339 
340     @Override
341     @ForceInline
342     public final Short128Mask test(Test op) {
343         return super.testTemplate(Short128Mask.class, op);  // specialize
344     }
345 
346     // Specialized comparisons
347 
348     @Override
349     @ForceInline
350     public final Short128Mask compare(Comparison op, Vector<Short> v) {
351         return super.compareTemplate(Short128Mask.class, op, v);  // specialize
352     }
353 
354     @Override
355     @ForceInline
356     public final Short128Mask compare(Comparison op, short s) {
357         return super.compareTemplate(Short128Mask.class, op, s);  // specialize
358     }
359 
360     @Override
361     @ForceInline
362     public final Short128Mask compare(Comparison op, long s) {
363         return super.compareTemplate(Short128Mask.class, op, s);  // specialize
364     }
365 







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

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

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

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










680         }
681 
682         // Reductions
683 
684         @Override
685         @ForceInline
686         public boolean anyTrue() {
687             return VectorSupport.test(BT_ne, Short128Mask.class, short.class, VLENGTH,
688                                          this, vspecies().maskAll(true),
689                                          (m, __) -> anyTrueHelper(((Short128Mask)m).getBits()));
690         }
691 
692         @Override
693         @ForceInline
694         public boolean allTrue() {
695             return VectorSupport.test(BT_overflow, Short128Mask.class, short.class, VLENGTH,
696                                          this, vspecies().maskAll(true),
697                                          (m, __) -> allTrueHelper(((Short128Mask)m).getBits()));
698         }
699 

770             byte[] r = new byte[reorder1.length];
771             for (int i = 0; i < reorder1.length; i++) {
772                 int ssi = reorder2[i];
773                 r[i] = reorder1[ssi];  // throws on exceptional index
774             }
775             return new Short128Shuffle(r);
776         }
777     }
778 
779     // ================================================
780 
781     // Specialized low-level memory operations.
782 
783     @ForceInline
784     @Override
785     final
786     ShortVector fromArray0(short[] a, int offset) {
787         return super.fromArray0Template(a, offset);  // specialize
788     }
789 








790     @ForceInline
791     @Override
792     final
793     ShortVector fromCharArray0(char[] a, int offset) {
794         return super.fromCharArray0Template(a, offset);  // specialize
795     }
796 







797 
798     @ForceInline
799     @Override
800     final
801     ShortVector fromByteArray0(byte[] a, int offset) {
802         return super.fromByteArray0Template(a, offset);  // specialize
803     }
804 







805     @ForceInline
806     @Override
807     final
808     ShortVector fromByteBuffer0(ByteBuffer bb, int offset) {
809         return super.fromByteBuffer0Template(bb, offset);  // specialize
810     }
811 







812     @ForceInline
813     @Override
814     final
815     void intoArray0(short[] a, int offset) {
816         super.intoArray0Template(a, offset);  // specialize
817     }
818 









819     @ForceInline
820     @Override
821     final
822     void intoByteArray0(byte[] a, int offset) {
823         super.intoByteArray0Template(a, offset);  // specialize
824     }
825 





















826     // End of specialized low-level memory operations.
827 
828     // ================================================
829 
830 }

219 
220     @ForceInline
221     final @Override
222     Short128Vector tOp(Vector<Short> v1, Vector<Short> v2, FTriOp f) {
223         return (Short128Vector)
224             super.tOpTemplate((Short128Vector)v1, (Short128Vector)v2,
225                               f);  // specialize
226     }
227 
228     @ForceInline
229     final @Override
230     Short128Vector tOp(Vector<Short> v1, Vector<Short> v2,
231                      VectorMask<Short> m, FTriOp f) {
232         return (Short128Vector)
233             super.tOpTemplate((Short128Vector)v1, (Short128Vector)v2,
234                               (Short128Mask)m, f);  // specialize
235     }
236 
237     @ForceInline
238     final @Override
239     short rOp(short v, VectorMask<Short> 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<Short,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 Short128Vector lanewise(Unary op) {
273         return (Short128Vector) super.lanewiseTemplate(op);  // specialize
274     }
275 
276     @Override
277     @ForceInline
278     public Short128Vector lanewise(Unary op, VectorMask<Short> m) {
279         return (Short128Vector) super.lanewiseTemplate(op, Short128Mask.class, (Short128Mask) m);  // specialize
280     }
281 
282     @Override
283     @ForceInline
284     public Short128Vector lanewise(Binary op, Vector<Short> v) {
285         return (Short128Vector) super.lanewiseTemplate(op, v);  // specialize
286     }
287 
288     @Override
289     @ForceInline
290     public Short128Vector lanewise(Binary op, Vector<Short> v, VectorMask<Short> m) {
291         return (Short128Vector) super.lanewiseTemplate(op, Short128Mask.class, v, (Short128Mask) m);  // specialize
292     }
293 
294     /*package-private*/
295     @Override
296     @ForceInline Short128Vector
297     lanewiseShift(VectorOperators.Binary op, int e) {
298         return (Short128Vector) super.lanewiseShiftTemplate(op, e);  // specialize
299     }
300 
301     /*package-private*/
302     @Override
303     @ForceInline Short128Vector
304     lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Short> m) {
305         return (Short128Vector) super.lanewiseShiftTemplate(op, Short128Mask.class, e, (Short128Mask) m);  // specialize
306     }
307 
308     /*package-private*/
309     @Override
310     @ForceInline
311     public final
312     Short128Vector
313     lanewise(Ternary op, Vector<Short> v1, Vector<Short> v2) {
314         return (Short128Vector) super.lanewiseTemplate(op, v1, v2);  // specialize
315     }
316 
317     @Override
318     @ForceInline
319     public final
320     Short128Vector
321     lanewise(Ternary op, Vector<Short> v1, Vector<Short> v2, VectorMask<Short> m) {
322         return (Short128Vector) super.lanewiseTemplate(op, Short128Mask.class, v1, v2, (Short128Mask) m);  // specialize
323     }
324 
325     @Override
326     @ForceInline
327     public final
328     Short128Vector addIndex(int scale) {
329         return (Short128Vector) super.addIndexTemplate(scale);  // specialize
330     }
331 
332     // Type specific horizontal reductions
333 
334     @Override
335     @ForceInline
336     public final short reduceLanes(VectorOperators.Associative op) {
337         return super.reduceLanesTemplate(op);  // specialized
338     }
339 
340     @Override
341     @ForceInline
342     public final short reduceLanes(VectorOperators.Associative op,
343                                     VectorMask<Short> m) {
344         return super.reduceLanesTemplate(op, Short128Mask.class, (Short128Mask) 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<Short> m) {
357         return (long) super.reduceLanesTemplate(op, Short128Mask.class, (Short128Mask) m);  // specialized
358     }
359 
360     @ForceInline
361     public VectorShuffle<Short> toShuffle() {
362         return super.toShuffleTemplate(Short128Shuffle.class); // specialize
363     }
364 
365     // Specialized unary testing
366 
367     @Override
368     @ForceInline
369     public final Short128Mask test(Test op) {
370         return super.testTemplate(Short128Mask.class, op);  // specialize
371     }
372 
373     // Specialized comparisons
374 
375     @Override
376     @ForceInline
377     public final Short128Mask compare(Comparison op, Vector<Short> v) {
378         return super.compareTemplate(Short128Mask.class, op, v);  // specialize
379     }
380 
381     @Override
382     @ForceInline
383     public final Short128Mask compare(Comparison op, short s) {
384         return super.compareTemplate(Short128Mask.class, op, s);  // specialize
385     }
386 
387     @Override
388     @ForceInline
389     public final Short128Mask compare(Comparison op, long s) {
390         return super.compareTemplate(Short128Mask.class, op, s);  // specialize
391     }
392 
393     @Override
394     @ForceInline
395     public final Short128Mask compare(Comparison op, Vector<Short> v, VectorMask<Short> m) {
396         return super.compareTemplate(Short128Mask.class, op, v, (Short128Mask) m);
397     }
398 
399 
400     @Override
401     @ForceInline
402     public Short128Vector blend(Vector<Short> v, VectorMask<Short> m) {
403         return (Short128Vector)
404             super.blendTemplate(Short128Mask.class,
405                                 (Short128Vector) v,
406                                 (Short128Mask) m);  // specialize
407     }
408 
409     @Override
410     @ForceInline
411     public Short128Vector slice(int origin, Vector<Short> v) {
412         return (Short128Vector) super.sliceTemplate(origin, v);  // specialize
413     }
414 
415     @Override
416     @ForceInline
417     public Short128Vector slice(int origin) {
418         return (Short128Vector) super.sliceTemplate(origin);  // specialize
419     }

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

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




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

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