< prev index next >

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

Print this page

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






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






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







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








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







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

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

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

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










696         }
697 
698         // Reductions
699 
700         @Override
701         @ForceInline
702         public boolean anyTrue() {
703             return VectorSupport.test(BT_ne, Short256Mask.class, short.class, VLENGTH,
704                                          this, vspecies().maskAll(true),
705                                          (m, __) -> anyTrueHelper(((Short256Mask)m).getBits()));
706         }
707 
708         @Override
709         @ForceInline
710         public boolean allTrue() {
711             return VectorSupport.test(BT_overflow, Short256Mask.class, short.class, VLENGTH,
712                                          this, vspecies().maskAll(true),
713                                          (m, __) -> allTrueHelper(((Short256Mask)m).getBits()));
714         }
715 

786             byte[] r = new byte[reorder1.length];
787             for (int i = 0; i < reorder1.length; i++) {
788                 int ssi = reorder2[i];
789                 r[i] = reorder1[ssi];  // throws on exceptional index
790             }
791             return new Short256Shuffle(r);
792         }
793     }
794 
795     // ================================================
796 
797     // Specialized low-level memory operations.
798 
799     @ForceInline
800     @Override
801     final
802     ShortVector fromArray0(short[] a, int offset) {
803         return super.fromArray0Template(a, offset);  // specialize
804     }
805 








806     @ForceInline
807     @Override
808     final
809     ShortVector fromCharArray0(char[] a, int offset) {
810         return super.fromCharArray0Template(a, offset);  // specialize
811     }
812 







813 
814     @ForceInline
815     @Override
816     final
817     ShortVector fromByteArray0(byte[] a, int offset) {
818         return super.fromByteArray0Template(a, offset);  // specialize
819     }
820 







821     @ForceInline
822     @Override
823     final
824     ShortVector fromByteBuffer0(ByteBuffer bb, int offset) {
825         return super.fromByteBuffer0Template(bb, offset);  // specialize
826     }
827 







828     @ForceInline
829     @Override
830     final
831     void intoArray0(short[] a, int offset) {
832         super.intoArray0Template(a, offset);  // specialize
833     }
834 









835     @ForceInline
836     @Override
837     final
838     void intoByteArray0(byte[] a, int offset) {
839         super.intoByteArray0Template(a, offset);  // specialize
840     }
841 





















842     // End of specialized low-level memory operations.
843 
844     // ================================================
845 
846 }

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

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

630 
631         /**
632          * Helper function for lane-wise mask conversions.
633          * This function kicks in after intrinsic failure.
634          */
635         @ForceInline
636         private final <E>
637         VectorMask<E> defaultMaskCast(AbstractSpecies<E> dsp) {
638             if (length() != dsp.laneCount())
639                 throw new IllegalArgumentException("VectorMask length and species length differ");
640             boolean[] maskArray = toArray();
641             return  dsp.maskFactory(maskArray).check(dsp);
642         }
643 
644         @Override
645         @ForceInline
646         public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
647             AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
648             if (length() != species.laneCount())
649                 throw new IllegalArgumentException("VectorMask length and species length differ");
650 
651             return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
652                 this.getClass(), ETYPE, VLENGTH,
653                 species.maskType(), species.elementType(), VLENGTH,
654                 this, species,
655                 (m, s) -> s.maskFactory(m.toArray()).check(s));




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

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