< prev index next >

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

Print this page

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






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






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







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








298     @Override
299     @ForceInline
300     public final
301     Short64Vector addIndex(int scale) {
302         return (Short64Vector) 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(Short64Shuffle.class); // specialize
336     }
337 
338     // Specialized unary testing
339 
340     @Override
341     @ForceInline
342     public final Short64Mask test(Test op) {
343         return super.testTemplate(Short64Mask.class, op);  // specialize
344     }
345 
346     // Specialized comparisons
347 
348     @Override
349     @ForceInline
350     public final Short64Mask compare(Comparison op, Vector<Short> v) {
351         return super.compareTemplate(Short64Mask.class, op, v);  // specialize
352     }
353 
354     @Override
355     @ForceInline
356     public final Short64Mask compare(Comparison op, short s) {
357         return super.compareTemplate(Short64Mask.class, op, s);  // specialize
358     }
359 
360     @Override
361     @ForceInline
362     public final Short64Mask compare(Comparison op, long s) {
363         return super.compareTemplate(Short64Mask.class, op, s);  // specialize
364     }
365 







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

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

422                                     (Short64Shuffle) shuffle,
423                                     (Short64Mask) m);  // specialize
424     }
425 
426     @Override
427     @ForceInline
428     public Short64Vector rearrange(VectorShuffle<Short> s,
429                                   Vector<Short> v) {
430         return (Short64Vector)
431             super.rearrangeTemplate(Short64Shuffle.class,
432                                     (Short64Shuffle) s,
433                                     (Short64Vector) v);  // specialize
434     }
435 
436     @Override
437     @ForceInline
438     public Short64Vector selectFrom(Vector<Short> v) {
439         return (Short64Vector)
440             super.selectFromTemplate((Short64Vector) 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                     Short64Mask::defaultMaskCast);
599             }
600             return this.defaultMaskCast(species);
601         }
602 
603         @Override
604         @ForceInline
605         public Short64Mask eq(VectorMask<Short> mask) {
606             Objects.requireNonNull(mask);
607             Short64Mask m = (Short64Mask)mask;
608             return xor(m.not());
609         }
610 
611         // Unary operations
612 
613         @Override
614         @ForceInline
615         public Short64Mask not() {
616             return xor(maskAll(true));
617         }
618 
619         // Binary operations
620 
621         @Override
622         @ForceInline
623         public Short64Mask and(VectorMask<Short> mask) {
624             Objects.requireNonNull(mask);
625             Short64Mask m = (Short64Mask)mask;
626             return VectorSupport.binaryOp(VECTOR_OP_AND, Short64Mask.class, short.class, VLENGTH,
627                                              this, m,
628                                              (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
629         }
630 
631         @Override
632         @ForceInline
633         public Short64Mask or(VectorMask<Short> mask) {
634             Objects.requireNonNull(mask);
635             Short64Mask m = (Short64Mask)mask;
636             return VectorSupport.binaryOp(VECTOR_OP_OR, Short64Mask.class, short.class, VLENGTH,
637                                              this, m,
638                                              (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
639         }
640 
641         @ForceInline
642         /* package-private */
643         Short64Mask xor(VectorMask<Short> mask) {
644             Objects.requireNonNull(mask);
645             Short64Mask m = (Short64Mask)mask;
646             return VectorSupport.binaryOp(VECTOR_OP_XOR, Short64Mask.class, short.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, Short64Mask.class, short.class, VLENGTH, this,
657                                                       (m) -> trueCountHelper(((Short64Mask)m).getBits()));
658         }
659 
660         @Override
661         @ForceInline
662         public int firstTrue() {
663             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short64Mask.class, short.class, VLENGTH, this,
664                                                       (m) -> firstTrueHelper(((Short64Mask)m).getBits()));
665         }
666 
667         @Override
668         @ForceInline
669         public int lastTrue() {
670             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short64Mask.class, short.class, VLENGTH, this,
671                                                       (m) -> lastTrueHelper(((Short64Mask)m).getBits()));










672         }
673 
674         // Reductions
675 
676         @Override
677         @ForceInline
678         public boolean anyTrue() {
679             return VectorSupport.test(BT_ne, Short64Mask.class, short.class, VLENGTH,
680                                          this, vspecies().maskAll(true),
681                                          (m, __) -> anyTrueHelper(((Short64Mask)m).getBits()));
682         }
683 
684         @Override
685         @ForceInline
686         public boolean allTrue() {
687             return VectorSupport.test(BT_overflow, Short64Mask.class, short.class, VLENGTH,
688                                          this, vspecies().maskAll(true),
689                                          (m, __) -> allTrueHelper(((Short64Mask)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 Short64Shuffle(r);
768         }
769     }
770 
771     // ================================================
772 
773     // Specialized low-level memory operations.
774 
775     @ForceInline
776     @Override
777     final
778     ShortVector fromArray0(short[] a, int offset) {
779         return super.fromArray0Template(a, offset);  // specialize
780     }
781 








782     @ForceInline
783     @Override
784     final
785     ShortVector fromCharArray0(char[] a, int offset) {
786         return super.fromCharArray0Template(a, offset);  // specialize
787     }
788 







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







797     @ForceInline
798     @Override
799     final
800     ShortVector fromByteBuffer0(ByteBuffer bb, int offset) {
801         return super.fromByteBuffer0Template(bb, offset);  // specialize
802     }
803 







804     @ForceInline
805     @Override
806     final
807     void intoArray0(short[] a, int offset) {
808         super.intoArray0Template(a, offset);  // specialize
809     }
810 









811     @ForceInline
812     @Override
813     final
814     void intoByteArray0(byte[] a, int offset) {
815         super.intoByteArray0Template(a, offset);  // specialize
816     }
817 





















818     // End of specialized low-level memory operations.
819 
820     // ================================================
821 
822 }

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

436     @Override
437     @ForceInline
438     public Short64Vector unslice(int origin) {
439         return (Short64Vector) super.unsliceTemplate(origin);  // specialize
440     }
441 
442     @Override
443     @ForceInline
444     public Short64Vector rearrange(VectorShuffle<Short> s) {
445         return (Short64Vector)
446             super.rearrangeTemplate(Short64Shuffle.class,
447                                     (Short64Shuffle) s);  // specialize
448     }
449 
450     @Override
451     @ForceInline
452     public Short64Vector rearrange(VectorShuffle<Short> shuffle,
453                                   VectorMask<Short> m) {
454         return (Short64Vector)
455             super.rearrangeTemplate(Short64Shuffle.class,
456                                     Short64Mask.class,
457                                     (Short64Shuffle) shuffle,
458                                     (Short64Mask) m);  // specialize
459     }
460 
461     @Override
462     @ForceInline
463     public Short64Vector rearrange(VectorShuffle<Short> s,
464                                   Vector<Short> v) {
465         return (Short64Vector)
466             super.rearrangeTemplate(Short64Shuffle.class,
467                                     (Short64Shuffle) s,
468                                     (Short64Vector) v);  // specialize
469     }
470 
471     @Override
472     @ForceInline
473     public Short64Vector selectFrom(Vector<Short> v) {
474         return (Short64Vector)
475             super.selectFromTemplate((Short64Vector) 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 Short64Mask eq(VectorMask<Short> mask) {
637             Objects.requireNonNull(mask);
638             Short64Mask m = (Short64Mask)mask;
639             return xor(m.not());
640         }
641 
642         // Unary operations
643 
644         @Override
645         @ForceInline
646         public Short64Mask not() {
647             return xor(maskAll(true));
648         }
649 
650         // Binary operations
651 
652         @Override
653         @ForceInline
654         public Short64Mask and(VectorMask<Short> mask) {
655             Objects.requireNonNull(mask);
656             Short64Mask m = (Short64Mask)mask;
657             return VectorSupport.binaryOp(VECTOR_OP_AND, Short64Mask.class, null, short.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 Short64Mask or(VectorMask<Short> mask) {
665             Objects.requireNonNull(mask);
666             Short64Mask m = (Short64Mask)mask;
667             return VectorSupport.binaryOp(VECTOR_OP_OR, Short64Mask.class, null, short.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         Short64Mask xor(VectorMask<Short> mask) {
675             Objects.requireNonNull(mask);
676             Short64Mask m = (Short64Mask)mask;
677             return VectorSupport.binaryOp(VECTOR_OP_XOR, Short64Mask.class, null, short.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, Short64Mask.class, short.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, Short64Mask.class, short.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, Short64Mask.class, short.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, Short64Mask.class, short.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, Short64Mask.class, short.class, VLENGTH,
721                                          this, vspecies().maskAll(true),
722                                          (m, __) -> anyTrueHelper(((Short64Mask)m).getBits()));
723         }
724 
725         @Override
726         @ForceInline
727         public boolean allTrue() {
728             return VectorSupport.test(BT_overflow, Short64Mask.class, short.class, VLENGTH,
729                                          this, vspecies().maskAll(true),
730                                          (m, __) -> allTrueHelper(((Short64Mask)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 Short64Shuffle(r);
809         }
810     }
811 
812     // ================================================
813 
814     // Specialized low-level memory operations.
815 
816     @ForceInline
817     @Override
818     final
819     ShortVector fromArray0(short[] a, int offset) {
820         return super.fromArray0Template(a, offset);  // specialize
821     }
822 
823     @ForceInline
824     @Override
825     final
826     ShortVector fromArray0(short[] a, int offset, VectorMask<Short> m) {
827         return super.fromArray0Template(Short64Mask.class, a, offset, (Short64Mask) m);  // specialize
828     }
829 
830 
831     @ForceInline
832     @Override
833     final
834     ShortVector fromCharArray0(char[] a, int offset) {
835         return super.fromCharArray0Template(a, offset);  // specialize
836     }
837 
838     @ForceInline
839     @Override
840     final
841     ShortVector fromCharArray0(char[] a, int offset, VectorMask<Short> m) {
842         return super.fromCharArray0Template(Short64Mask.class, a, offset, (Short64Mask) m);  // specialize
843     }
844 
845 
846     @ForceInline
847     @Override
848     final
849     ShortVector fromByteArray0(byte[] a, int offset) {
850         return super.fromByteArray0Template(a, offset);  // specialize
851     }
852 
853     @ForceInline
854     @Override
855     final
856     ShortVector fromByteArray0(byte[] a, int offset, VectorMask<Short> m) {
857         return super.fromByteArray0Template(Short64Mask.class, a, offset, (Short64Mask) m);  // specialize
858     }
859 
860     @ForceInline
861     @Override
862     final
863     ShortVector fromByteBuffer0(ByteBuffer bb, int offset) {
864         return super.fromByteBuffer0Template(bb, offset);  // specialize
865     }
866 
867     @ForceInline
868     @Override
869     final
870     ShortVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m) {
871         return super.fromByteBuffer0Template(Short64Mask.class, bb, offset, (Short64Mask) m);  // specialize
872     }
873 
874     @ForceInline
875     @Override
876     final
877     void intoArray0(short[] a, int offset) {
878         super.intoArray0Template(a, offset);  // specialize
879     }
880 
881     @ForceInline
882     @Override
883     final
884     void intoArray0(short[] a, int offset, VectorMask<Short> m) {
885         super.intoArray0Template(Short64Mask.class, a, offset, (Short64Mask) m);
886     }
887 
888 
889 
890     @ForceInline
891     @Override
892     final
893     void intoByteArray0(byte[] a, int offset) {
894         super.intoByteArray0Template(a, offset);  // specialize
895     }
896 
897     @ForceInline
898     @Override
899     final
900     void intoByteArray0(byte[] a, int offset, VectorMask<Short> m) {
901         super.intoByteArray0Template(Short64Mask.class, a, offset, (Short64Mask) m);  // specialize
902     }
903 
904     @ForceInline
905     @Override
906     final
907     void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m) {
908         super.intoByteBuffer0Template(Short64Mask.class, bb, offset, (Short64Mask) m);
909     }
910 
911     @ForceInline
912     @Override
913     final
914     void intoCharArray0(char[] a, int offset, VectorMask<Short> m) {
915         super.intoCharArray0Template(Short64Mask.class, a, offset, (Short64Mask) m);
916     }
917 
918     // End of specialized low-level memory operations.
919 
920     // ================================================
921 
922 }
< prev index next >