< prev index next >

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

Print this page

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






271     @Override
272     @ForceInline
273     public Long128Vector lanewise(Binary op, Vector<Long> v) {
274         return (Long128Vector) super.lanewiseTemplate(op, v);  // specialize
275     }
276 






277     /*package-private*/
278     @Override
279     @ForceInline Long128Vector
280     lanewiseShift(VectorOperators.Binary op, int e) {
281         return (Long128Vector) super.lanewiseShiftTemplate(op, e);  // specialize
282     }
283 







284     /*package-private*/
285     @Override
286     @ForceInline
287     public final
288     Long128Vector
289     lanewise(VectorOperators.Ternary op, Vector<Long> v1, Vector<Long> v2) {
290         return (Long128Vector) super.lanewiseTemplate(op, v1, v2);  // specialize
291     }
292 








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







356     @Override
357     @ForceInline
358     public Long128Vector blend(Vector<Long> v, VectorMask<Long> m) {
359         return (Long128Vector)
360             super.blendTemplate(Long128Mask.class,
361                                 (Long128Vector) v,
362                                 (Long128Mask) m);  // specialize
363     }
364 
365     @Override
366     @ForceInline
367     public Long128Vector slice(int origin, Vector<Long> v) {
368         return (Long128Vector) super.sliceTemplate(origin, v);  // specialize
369     }
370 
371     @Override
372     @ForceInline
373     public Long128Vector slice(int origin) {
374         return (Long128Vector) super.sliceTemplate(origin);  // specialize
375     }

392     @Override
393     @ForceInline
394     public Long128Vector unslice(int origin) {
395         return (Long128Vector) super.unsliceTemplate(origin);  // specialize
396     }
397 
398     @Override
399     @ForceInline
400     public Long128Vector rearrange(VectorShuffle<Long> s) {
401         return (Long128Vector)
402             super.rearrangeTemplate(Long128Shuffle.class,
403                                     (Long128Shuffle) s);  // specialize
404     }
405 
406     @Override
407     @ForceInline
408     public Long128Vector rearrange(VectorShuffle<Long> shuffle,
409                                   VectorMask<Long> m) {
410         return (Long128Vector)
411             super.rearrangeTemplate(Long128Shuffle.class,

412                                     (Long128Shuffle) shuffle,
413                                     (Long128Mask) m);  // specialize
414     }
415 
416     @Override
417     @ForceInline
418     public Long128Vector rearrange(VectorShuffle<Long> s,
419                                   Vector<Long> v) {
420         return (Long128Vector)
421             super.rearrangeTemplate(Long128Shuffle.class,
422                                     (Long128Shuffle) s,
423                                     (Long128Vector) v);  // specialize
424     }
425 
426     @Override
427     @ForceInline
428     public Long128Vector selectFrom(Vector<Long> v) {
429         return (Long128Vector)
430             super.selectFromTemplate((Long128Vector) v);  // specialize
431     }

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










658         }
659 
660         // Reductions
661 
662         @Override
663         @ForceInline
664         public boolean anyTrue() {
665             return VectorSupport.test(BT_ne, Long128Mask.class, long.class, VLENGTH,
666                                          this, vspecies().maskAll(true),
667                                          (m, __) -> anyTrueHelper(((Long128Mask)m).getBits()));
668         }
669 
670         @Override
671         @ForceInline
672         public boolean allTrue() {
673             return VectorSupport.test(BT_overflow, Long128Mask.class, long.class, VLENGTH,
674                                          this, vspecies().maskAll(true),
675                                          (m, __) -> allTrueHelper(((Long128Mask)m).getBits()));
676         }
677 

748             byte[] r = new byte[reorder1.length];
749             for (int i = 0; i < reorder1.length; i++) {
750                 int ssi = reorder2[i];
751                 r[i] = reorder1[ssi];  // throws on exceptional index
752             }
753             return new Long128Shuffle(r);
754         }
755     }
756 
757     // ================================================
758 
759     // Specialized low-level memory operations.
760 
761     @ForceInline
762     @Override
763     final
764     LongVector fromArray0(long[] a, int offset) {
765         return super.fromArray0Template(a, offset);  // specialize
766     }
767 














768 
769 
770     @ForceInline
771     @Override
772     final
773     LongVector fromByteArray0(byte[] a, int offset) {
774         return super.fromByteArray0Template(a, offset);  // specialize
775     }
776 







777     @ForceInline
778     @Override
779     final
780     LongVector fromByteBuffer0(ByteBuffer bb, int offset) {
781         return super.fromByteBuffer0Template(bb, offset);  // specialize
782     }
783 







784     @ForceInline
785     @Override
786     final
787     void intoArray0(long[] a, int offset) {
788         super.intoArray0Template(a, offset);  // specialize
789     }
790 















791     @ForceInline
792     @Override
793     final
794     void intoByteArray0(byte[] a, int offset) {
795         super.intoByteArray0Template(a, offset);  // specialize
796     }
797 















798     // End of specialized low-level memory operations.
799 
800     // ================================================
801 
802 }

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

426     @Override
427     @ForceInline
428     public Long128Vector unslice(int origin) {
429         return (Long128Vector) super.unsliceTemplate(origin);  // specialize
430     }
431 
432     @Override
433     @ForceInline
434     public Long128Vector rearrange(VectorShuffle<Long> s) {
435         return (Long128Vector)
436             super.rearrangeTemplate(Long128Shuffle.class,
437                                     (Long128Shuffle) s);  // specialize
438     }
439 
440     @Override
441     @ForceInline
442     public Long128Vector rearrange(VectorShuffle<Long> shuffle,
443                                   VectorMask<Long> m) {
444         return (Long128Vector)
445             super.rearrangeTemplate(Long128Shuffle.class,
446                                     Long128Mask.class,
447                                     (Long128Shuffle) shuffle,
448                                     (Long128Mask) m);  // specialize
449     }
450 
451     @Override
452     @ForceInline
453     public Long128Vector rearrange(VectorShuffle<Long> s,
454                                   Vector<Long> v) {
455         return (Long128Vector)
456             super.rearrangeTemplate(Long128Shuffle.class,
457                                     (Long128Shuffle) s,
458                                     (Long128Vector) v);  // specialize
459     }
460 
461     @Override
462     @ForceInline
463     public Long128Vector selectFrom(Vector<Long> v) {
464         return (Long128Vector)
465             super.selectFromTemplate((Long128Vector) v);  // specialize
466     }

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




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

789             byte[] r = new byte[reorder1.length];
790             for (int i = 0; i < reorder1.length; i++) {
791                 int ssi = reorder2[i];
792                 r[i] = reorder1[ssi];  // throws on exceptional index
793             }
794             return new Long128Shuffle(r);
795         }
796     }
797 
798     // ================================================
799 
800     // Specialized low-level memory operations.
801 
802     @ForceInline
803     @Override
804     final
805     LongVector fromArray0(long[] a, int offset) {
806         return super.fromArray0Template(a, offset);  // specialize
807     }
808 
809     @ForceInline
810     @Override
811     final
812     LongVector fromArray0(long[] a, int offset, VectorMask<Long> m) {
813         return super.fromArray0Template(Long128Mask.class, a, offset, (Long128Mask) m);  // specialize
814     }
815 
816     @ForceInline
817     @Override
818     final
819     LongVector fromArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Long> m) {
820         return super.fromArray0Template(Long128Mask.class, a, offset, indexMap, mapOffset, (Long128Mask) m);
821     }
822 
823 
824 
825     @ForceInline
826     @Override
827     final
828     LongVector fromByteArray0(byte[] a, int offset) {
829         return super.fromByteArray0Template(a, offset);  // specialize
830     }
831 
832     @ForceInline
833     @Override
834     final
835     LongVector fromByteArray0(byte[] a, int offset, VectorMask<Long> m) {
836         return super.fromByteArray0Template(Long128Mask.class, a, offset, (Long128Mask) m);  // specialize
837     }
838 
839     @ForceInline
840     @Override
841     final
842     LongVector fromByteBuffer0(ByteBuffer bb, int offset) {
843         return super.fromByteBuffer0Template(bb, offset);  // specialize
844     }
845 
846     @ForceInline
847     @Override
848     final
849     LongVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Long> m) {
850         return super.fromByteBuffer0Template(Long128Mask.class, bb, offset, (Long128Mask) m);  // specialize
851     }
852 
853     @ForceInline
854     @Override
855     final
856     void intoArray0(long[] a, int offset) {
857         super.intoArray0Template(a, offset);  // specialize
858     }
859 
860     @ForceInline
861     @Override
862     final
863     void intoArray0(long[] a, int offset, VectorMask<Long> m) {
864         super.intoArray0Template(Long128Mask.class, a, offset, (Long128Mask) m);
865     }
866 
867     @ForceInline
868     @Override
869     final
870     void intoArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Long> m) {
871         super.intoArray0Template(Long128Mask.class, a, offset, indexMap, mapOffset, (Long128Mask) m);
872     }
873 
874 
875     @ForceInline
876     @Override
877     final
878     void intoByteArray0(byte[] a, int offset) {
879         super.intoByteArray0Template(a, offset);  // specialize
880     }
881 
882     @ForceInline
883     @Override
884     final
885     void intoByteArray0(byte[] a, int offset, VectorMask<Long> m) {
886         super.intoByteArray0Template(Long128Mask.class, a, offset, (Long128Mask) m);  // specialize
887     }
888 
889     @ForceInline
890     @Override
891     final
892     void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Long> m) {
893         super.intoByteBuffer0Template(Long128Mask.class, bb, offset, (Long128Mask) m);
894     }
895 
896 
897     // End of specialized low-level memory operations.
898 
899     // ================================================
900 
901 }
< prev index next >