< prev index next >

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

Print this page

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






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






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







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








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







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

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

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

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










666         }
667 
668         // Reductions
669 
670         @Override
671         @ForceInline
672         public boolean anyTrue() {
673             return VectorSupport.test(BT_ne, IntMaxMask.class, int.class, VLENGTH,
674                                          this, vspecies().maskAll(true),
675                                          (m, __) -> anyTrueHelper(((IntMaxMask)m).getBits()));
676         }
677 
678         @Override
679         @ForceInline
680         public boolean allTrue() {
681             return VectorSupport.test(BT_overflow, IntMaxMask.class, int.class, VLENGTH,
682                                          this, vspecies().maskAll(true),
683                                          (m, __) -> allTrueHelper(((IntMaxMask)m).getBits()));
684         }
685 

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














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







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







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















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















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

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

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

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




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

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