< prev index next >

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

Print this page

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






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






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







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








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







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

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

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

627 
628         /**
629          * Helper function for lane-wise mask conversions.
630          * This function kicks in after intrinsic failure.
631          */
632         @ForceInline
633         private final <E>
634         VectorMask<E> defaultMaskCast(AbstractSpecies<E> dsp) {
635             if (length() != dsp.laneCount())
636                 throw new IllegalArgumentException("VectorMask length and species length differ");
637             boolean[] maskArray = toArray();
638             return  dsp.maskFactory(maskArray).check(dsp);
639         }
640 
641         @Override
642         @ForceInline
643         public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
644             AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
645             if (length() != species.laneCount())
646                 throw new IllegalArgumentException("VectorMask length and species length differ");
647             if (VSIZE == species.vectorBitSize()) {
648                 Class<?> dtype = species.elementType();
649                 Class<?> dmtype = species.maskType();
650                 return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
651                     this.getClass(), ETYPE, VLENGTH,
652                     dmtype, dtype, VLENGTH,
653                     this, species,
654                     Short512Mask::defaultMaskCast);
655             }
656             return this.defaultMaskCast(species);
657         }
658 
659         @Override
660         @ForceInline
661         public Short512Mask eq(VectorMask<Short> mask) {
662             Objects.requireNonNull(mask);
663             Short512Mask m = (Short512Mask)mask;
664             return xor(m.not());
665         }
666 
667         // Unary operations
668 
669         @Override
670         @ForceInline
671         public Short512Mask not() {
672             return xor(maskAll(true));
673         }
674 
675         // Binary operations
676 
677         @Override
678         @ForceInline
679         public Short512Mask and(VectorMask<Short> mask) {
680             Objects.requireNonNull(mask);
681             Short512Mask m = (Short512Mask)mask;
682             return VectorSupport.binaryOp(VECTOR_OP_AND, Short512Mask.class, short.class, VLENGTH,
683                                              this, m,
684                                              (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
685         }
686 
687         @Override
688         @ForceInline
689         public Short512Mask or(VectorMask<Short> mask) {
690             Objects.requireNonNull(mask);
691             Short512Mask m = (Short512Mask)mask;
692             return VectorSupport.binaryOp(VECTOR_OP_OR, Short512Mask.class, short.class, VLENGTH,
693                                              this, m,
694                                              (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
695         }
696 
697         @ForceInline
698         /* package-private */
699         Short512Mask xor(VectorMask<Short> mask) {
700             Objects.requireNonNull(mask);
701             Short512Mask m = (Short512Mask)mask;
702             return VectorSupport.binaryOp(VECTOR_OP_XOR, Short512Mask.class, short.class, VLENGTH,
703                                           this, m,
704                                           (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
705         }
706 
707         // Mask Query operations
708 
709         @Override
710         @ForceInline
711         public int trueCount() {
712             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short512Mask.class, short.class, VLENGTH, this,
713                                                       (m) -> trueCountHelper(((Short512Mask)m).getBits()));
714         }
715 
716         @Override
717         @ForceInline
718         public int firstTrue() {
719             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short512Mask.class, short.class, VLENGTH, this,
720                                                       (m) -> firstTrueHelper(((Short512Mask)m).getBits()));
721         }
722 
723         @Override
724         @ForceInline
725         public int lastTrue() {
726             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short512Mask.class, short.class, VLENGTH, this,
727                                                       (m) -> lastTrueHelper(((Short512Mask)m).getBits()));










728         }
729 
730         // Reductions
731 
732         @Override
733         @ForceInline
734         public boolean anyTrue() {
735             return VectorSupport.test(BT_ne, Short512Mask.class, short.class, VLENGTH,
736                                          this, vspecies().maskAll(true),
737                                          (m, __) -> anyTrueHelper(((Short512Mask)m).getBits()));
738         }
739 
740         @Override
741         @ForceInline
742         public boolean allTrue() {
743             return VectorSupport.test(BT_overflow, Short512Mask.class, short.class, VLENGTH,
744                                          this, vspecies().maskAll(true),
745                                          (m, __) -> allTrueHelper(((Short512Mask)m).getBits()));
746         }
747 

818             byte[] r = new byte[reorder1.length];
819             for (int i = 0; i < reorder1.length; i++) {
820                 int ssi = reorder2[i];
821                 r[i] = reorder1[ssi];  // throws on exceptional index
822             }
823             return new Short512Shuffle(r);
824         }
825     }
826 
827     // ================================================
828 
829     // Specialized low-level memory operations.
830 
831     @ForceInline
832     @Override
833     final
834     ShortVector fromArray0(short[] a, int offset) {
835         return super.fromArray0Template(a, offset);  // specialize
836     }
837 








838     @ForceInline
839     @Override
840     final
841     ShortVector fromCharArray0(char[] a, int offset) {
842         return super.fromCharArray0Template(a, offset);  // 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 fromByteBuffer0(ByteBuffer bb, int offset) {
857         return super.fromByteBuffer0Template(bb, offset);  // specialize
858     }
859 







860     @ForceInline
861     @Override
862     final
863     void intoArray0(short[] a, int offset) {
864         super.intoArray0Template(a, offset);  // specialize
865     }
866 









867     @ForceInline
868     @Override
869     final
870     void intoByteArray0(byte[] a, int offset) {
871         super.intoByteArray0Template(a, offset);  // specialize
872     }
873 





















874     // End of specialized low-level memory operations.
875 
876     // ================================================
877 
878 }

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

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

662 
663         /**
664          * Helper function for lane-wise mask conversions.
665          * This function kicks in after intrinsic failure.
666          */
667         @ForceInline
668         private final <E>
669         VectorMask<E> defaultMaskCast(AbstractSpecies<E> dsp) {
670             if (length() != dsp.laneCount())
671                 throw new IllegalArgumentException("VectorMask length and species length differ");
672             boolean[] maskArray = toArray();
673             return  dsp.maskFactory(maskArray).check(dsp);
674         }
675 
676         @Override
677         @ForceInline
678         public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
679             AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
680             if (length() != species.laneCount())
681                 throw new IllegalArgumentException("VectorMask length and species length differ");
682 
683             return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
684                 this.getClass(), ETYPE, VLENGTH,
685                 species.maskType(), species.elementType(), VLENGTH,
686                 this, species,
687                 (m, s) -> s.maskFactory(m.toArray()).check(s));




688         }
689 
690         @Override
691         @ForceInline
692         public Short512Mask eq(VectorMask<Short> mask) {
693             Objects.requireNonNull(mask);
694             Short512Mask m = (Short512Mask)mask;
695             return xor(m.not());
696         }
697 
698         // Unary operations
699 
700         @Override
701         @ForceInline
702         public Short512Mask not() {
703             return xor(maskAll(true));
704         }
705 
706         // Binary operations
707 
708         @Override
709         @ForceInline
710         public Short512Mask and(VectorMask<Short> mask) {
711             Objects.requireNonNull(mask);
712             Short512Mask m = (Short512Mask)mask;
713             return VectorSupport.binaryOp(VECTOR_OP_AND, Short512Mask.class, null, short.class, VLENGTH,
714                                           this, m, null,
715                                           (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
716         }
717 
718         @Override
719         @ForceInline
720         public Short512Mask or(VectorMask<Short> mask) {
721             Objects.requireNonNull(mask);
722             Short512Mask m = (Short512Mask)mask;
723             return VectorSupport.binaryOp(VECTOR_OP_OR, Short512Mask.class, null, short.class, VLENGTH,
724                                           this, m, null,
725                                           (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
726         }
727 
728         @ForceInline
729         /* package-private */
730         Short512Mask xor(VectorMask<Short> mask) {
731             Objects.requireNonNull(mask);
732             Short512Mask m = (Short512Mask)mask;
733             return VectorSupport.binaryOp(VECTOR_OP_XOR, Short512Mask.class, null, short.class, VLENGTH,
734                                           this, m, null,
735                                           (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
736         }
737 
738         // Mask Query operations
739 
740         @Override
741         @ForceInline
742         public int trueCount() {
743             return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short512Mask.class, short.class, VLENGTH, this,
744                                                       (m) -> trueCountHelper(m.getBits()));
745         }
746 
747         @Override
748         @ForceInline
749         public int firstTrue() {
750             return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short512Mask.class, short.class, VLENGTH, this,
751                                                       (m) -> firstTrueHelper(m.getBits()));
752         }
753 
754         @Override
755         @ForceInline
756         public int lastTrue() {
757             return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short512Mask.class, short.class, VLENGTH, this,
758                                                       (m) -> lastTrueHelper(m.getBits()));
759         }
760 
761         @Override
762         @ForceInline
763         public long toLong() {
764             if (length() > Long.SIZE) {
765                 throw new UnsupportedOperationException("too many lanes for one long");
766             }
767             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Short512Mask.class, short.class, VLENGTH, this,
768                                                       (m) -> toLongHelper(m.getBits()));
769         }
770 
771         // Reductions
772 
773         @Override
774         @ForceInline
775         public boolean anyTrue() {
776             return VectorSupport.test(BT_ne, Short512Mask.class, short.class, VLENGTH,
777                                          this, vspecies().maskAll(true),
778                                          (m, __) -> anyTrueHelper(((Short512Mask)m).getBits()));
779         }
780 
781         @Override
782         @ForceInline
783         public boolean allTrue() {
784             return VectorSupport.test(BT_overflow, Short512Mask.class, short.class, VLENGTH,
785                                          this, vspecies().maskAll(true),
786                                          (m, __) -> allTrueHelper(((Short512Mask)m).getBits()));
787         }
788 

859             byte[] r = new byte[reorder1.length];
860             for (int i = 0; i < reorder1.length; i++) {
861                 int ssi = reorder2[i];
862                 r[i] = reorder1[ssi];  // throws on exceptional index
863             }
864             return new Short512Shuffle(r);
865         }
866     }
867 
868     // ================================================
869 
870     // Specialized low-level memory operations.
871 
872     @ForceInline
873     @Override
874     final
875     ShortVector fromArray0(short[] a, int offset) {
876         return super.fromArray0Template(a, offset);  // specialize
877     }
878 
879     @ForceInline
880     @Override
881     final
882     ShortVector fromArray0(short[] a, int offset, VectorMask<Short> m) {
883         return super.fromArray0Template(Short512Mask.class, a, offset, (Short512Mask) m);  // specialize
884     }
885 
886 
887     @ForceInline
888     @Override
889     final
890     ShortVector fromCharArray0(char[] a, int offset) {
891         return super.fromCharArray0Template(a, offset);  // specialize
892     }
893 
894     @ForceInline
895     @Override
896     final
897     ShortVector fromCharArray0(char[] a, int offset, VectorMask<Short> m) {
898         return super.fromCharArray0Template(Short512Mask.class, a, offset, (Short512Mask) m);  // specialize
899     }
900 
901 
902     @ForceInline
903     @Override
904     final
905     ShortVector fromByteArray0(byte[] a, int offset) {
906         return super.fromByteArray0Template(a, offset);  // specialize
907     }
908 
909     @ForceInline
910     @Override
911     final
912     ShortVector fromByteArray0(byte[] a, int offset, VectorMask<Short> m) {
913         return super.fromByteArray0Template(Short512Mask.class, a, offset, (Short512Mask) m);  // specialize
914     }
915 
916     @ForceInline
917     @Override
918     final
919     ShortVector fromByteBuffer0(ByteBuffer bb, int offset) {
920         return super.fromByteBuffer0Template(bb, offset);  // specialize
921     }
922 
923     @ForceInline
924     @Override
925     final
926     ShortVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m) {
927         return super.fromByteBuffer0Template(Short512Mask.class, bb, offset, (Short512Mask) m);  // specialize
928     }
929 
930     @ForceInline
931     @Override
932     final
933     void intoArray0(short[] a, int offset) {
934         super.intoArray0Template(a, offset);  // specialize
935     }
936 
937     @ForceInline
938     @Override
939     final
940     void intoArray0(short[] a, int offset, VectorMask<Short> m) {
941         super.intoArray0Template(Short512Mask.class, a, offset, (Short512Mask) m);
942     }
943 
944 
945 
946     @ForceInline
947     @Override
948     final
949     void intoByteArray0(byte[] a, int offset) {
950         super.intoByteArray0Template(a, offset);  // specialize
951     }
952 
953     @ForceInline
954     @Override
955     final
956     void intoByteArray0(byte[] a, int offset, VectorMask<Short> m) {
957         super.intoByteArray0Template(Short512Mask.class, a, offset, (Short512Mask) m);  // specialize
958     }
959 
960     @ForceInline
961     @Override
962     final
963     void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m) {
964         super.intoByteBuffer0Template(Short512Mask.class, bb, offset, (Short512Mask) m);
965     }
966 
967     @ForceInline
968     @Override
969     final
970     void intoCharArray0(char[] a, int offset, VectorMask<Short> m) {
971         super.intoCharArray0Template(Short512Mask.class, a, offset, (Short512Mask) m);
972     }
973 
974     // End of specialized low-level memory operations.
975 
976     // ================================================
977 
978 }
< prev index next >