< prev index next >

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

Print this page

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






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






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







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








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







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

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

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

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










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

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








790 
791     @ForceInline
792     @Override
793     final
794     ByteVector fromBooleanArray0(boolean[] a, int offset) {
795         return super.fromBooleanArray0Template(a, offset);  // specialize
796     }
797 







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







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







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















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















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

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

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

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




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

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