< prev index next >

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

Print this page

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






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






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







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








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







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

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

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

 691 
 692         /**
 693          * Helper function for lane-wise mask conversions.
 694          * This function kicks in after intrinsic failure.
 695          */
 696         @ForceInline
 697         private final <E>
 698         VectorMask<E> defaultMaskCast(AbstractSpecies<E> dsp) {
 699             if (length() != dsp.laneCount())
 700                 throw new IllegalArgumentException("VectorMask length and species length differ");
 701             boolean[] maskArray = toArray();
 702             return  dsp.maskFactory(maskArray).check(dsp);
 703         }
 704 
 705         @Override
 706         @ForceInline
 707         public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
 708             AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
 709             if (length() != species.laneCount())
 710                 throw new IllegalArgumentException("VectorMask length and species length differ");
 711             if (VSIZE == species.vectorBitSize()) {
 712                 Class<?> dtype = species.elementType();
 713                 Class<?> dmtype = species.maskType();
 714                 return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
 715                     this.getClass(), ETYPE, VLENGTH,
 716                     dmtype, dtype, VLENGTH,
 717                     this, species,
 718                     Byte512Mask::defaultMaskCast);
 719             }
 720             return this.defaultMaskCast(species);
 721         }
 722 
 723         @Override
 724         @ForceInline
 725         public Byte512Mask eq(VectorMask<Byte> mask) {
 726             Objects.requireNonNull(mask);
 727             Byte512Mask m = (Byte512Mask)mask;
 728             return xor(m.not());
 729         }
 730 
 731         // Unary operations
 732 
 733         @Override
 734         @ForceInline
 735         public Byte512Mask not() {
 736             return xor(maskAll(true));
 737         }
 738 
 739         // Binary operations
 740 
 741         @Override
 742         @ForceInline
 743         public Byte512Mask and(VectorMask<Byte> mask) {
 744             Objects.requireNonNull(mask);
 745             Byte512Mask m = (Byte512Mask)mask;
 746             return VectorSupport.binaryOp(VECTOR_OP_AND, Byte512Mask.class, byte.class, VLENGTH,
 747                                              this, m,
 748                                              (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
 749         }
 750 
 751         @Override
 752         @ForceInline
 753         public Byte512Mask or(VectorMask<Byte> mask) {
 754             Objects.requireNonNull(mask);
 755             Byte512Mask m = (Byte512Mask)mask;
 756             return VectorSupport.binaryOp(VECTOR_OP_OR, Byte512Mask.class, byte.class, VLENGTH,
 757                                              this, m,
 758                                              (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
 759         }
 760 
 761         @ForceInline
 762         /* package-private */
 763         Byte512Mask xor(VectorMask<Byte> mask) {
 764             Objects.requireNonNull(mask);
 765             Byte512Mask m = (Byte512Mask)mask;
 766             return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte512Mask.class, byte.class, VLENGTH,
 767                                           this, m,
 768                                           (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
 769         }
 770 
 771         // Mask Query operations
 772 
 773         @Override
 774         @ForceInline
 775         public int trueCount() {
 776             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte512Mask.class, byte.class, VLENGTH, this,
 777                                                       (m) -> trueCountHelper(((Byte512Mask)m).getBits()));
 778         }
 779 
 780         @Override
 781         @ForceInline
 782         public int firstTrue() {
 783             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte512Mask.class, byte.class, VLENGTH, this,
 784                                                       (m) -> firstTrueHelper(((Byte512Mask)m).getBits()));
 785         }
 786 
 787         @Override
 788         @ForceInline
 789         public int lastTrue() {
 790             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte512Mask.class, byte.class, VLENGTH, this,
 791                                                       (m) -> lastTrueHelper(((Byte512Mask)m).getBits()));










 792         }
 793 
 794         // Reductions
 795 
 796         @Override
 797         @ForceInline
 798         public boolean anyTrue() {
 799             return VectorSupport.test(BT_ne, Byte512Mask.class, byte.class, VLENGTH,
 800                                          this, vspecies().maskAll(true),
 801                                          (m, __) -> anyTrueHelper(((Byte512Mask)m).getBits()));
 802         }
 803 
 804         @Override
 805         @ForceInline
 806         public boolean allTrue() {
 807             return VectorSupport.test(BT_overflow, Byte512Mask.class, byte.class, VLENGTH,
 808                                          this, vspecies().maskAll(true),
 809                                          (m, __) -> allTrueHelper(((Byte512Mask)m).getBits()));
 810         }
 811 

 882             byte[] r = new byte[reorder1.length];
 883             for (int i = 0; i < reorder1.length; i++) {
 884                 int ssi = reorder2[i];
 885                 r[i] = reorder1[ssi];  // throws on exceptional index
 886             }
 887             return new Byte512Shuffle(r);
 888         }
 889     }
 890 
 891     // ================================================
 892 
 893     // Specialized low-level memory operations.
 894 
 895     @ForceInline
 896     @Override
 897     final
 898     ByteVector fromArray0(byte[] a, int offset) {
 899         return super.fromArray0Template(a, offset);  // specialize
 900     }
 901 








 902 
 903     @ForceInline
 904     @Override
 905     final
 906     ByteVector fromBooleanArray0(boolean[] a, int offset) {
 907         return super.fromBooleanArray0Template(a, offset);  // specialize
 908     }
 909 







 910     @ForceInline
 911     @Override
 912     final
 913     ByteVector fromByteArray0(byte[] a, int offset) {
 914         return super.fromByteArray0Template(a, offset);  // specialize
 915     }
 916 







 917     @ForceInline
 918     @Override
 919     final
 920     ByteVector fromByteBuffer0(ByteBuffer bb, int offset) {
 921         return super.fromByteBuffer0Template(bb, offset);  // specialize
 922     }
 923 







 924     @ForceInline
 925     @Override
 926     final
 927     void intoArray0(byte[] a, int offset) {
 928         super.intoArray0Template(a, offset);  // specialize
 929     }
 930 















 931     @ForceInline
 932     @Override
 933     final
 934     void intoByteArray0(byte[] a, int offset) {
 935         super.intoByteArray0Template(a, offset);  // specialize
 936     }
 937 















 938     // End of specialized low-level memory operations.
 939 
 940     // ================================================
 941 
 942 }

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

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

 726 
 727         /**
 728          * Helper function for lane-wise mask conversions.
 729          * This function kicks in after intrinsic failure.
 730          */
 731         @ForceInline
 732         private final <E>
 733         VectorMask<E> defaultMaskCast(AbstractSpecies<E> dsp) {
 734             if (length() != dsp.laneCount())
 735                 throw new IllegalArgumentException("VectorMask length and species length differ");
 736             boolean[] maskArray = toArray();
 737             return  dsp.maskFactory(maskArray).check(dsp);
 738         }
 739 
 740         @Override
 741         @ForceInline
 742         public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
 743             AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
 744             if (length() != species.laneCount())
 745                 throw new IllegalArgumentException("VectorMask length and species length differ");
 746 
 747             return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
 748                 this.getClass(), ETYPE, VLENGTH,
 749                 species.maskType(), species.elementType(), VLENGTH,
 750                 this, species,
 751                 (m, s) -> s.maskFactory(m.toArray()).check(s));




 752         }
 753 
 754         @Override
 755         @ForceInline
 756         public Byte512Mask eq(VectorMask<Byte> mask) {
 757             Objects.requireNonNull(mask);
 758             Byte512Mask m = (Byte512Mask)mask;
 759             return xor(m.not());
 760         }
 761 
 762         // Unary operations
 763 
 764         @Override
 765         @ForceInline
 766         public Byte512Mask not() {
 767             return xor(maskAll(true));
 768         }
 769 
 770         // Binary operations
 771 
 772         @Override
 773         @ForceInline
 774         public Byte512Mask and(VectorMask<Byte> mask) {
 775             Objects.requireNonNull(mask);
 776             Byte512Mask m = (Byte512Mask)mask;
 777             return VectorSupport.binaryOp(VECTOR_OP_AND, Byte512Mask.class, null, byte.class, VLENGTH,
 778                                           this, m, null,
 779                                           (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
 780         }
 781 
 782         @Override
 783         @ForceInline
 784         public Byte512Mask or(VectorMask<Byte> mask) {
 785             Objects.requireNonNull(mask);
 786             Byte512Mask m = (Byte512Mask)mask;
 787             return VectorSupport.binaryOp(VECTOR_OP_OR, Byte512Mask.class, null, byte.class, VLENGTH,
 788                                           this, m, null,
 789                                           (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
 790         }
 791 
 792         @ForceInline
 793         /* package-private */
 794         Byte512Mask xor(VectorMask<Byte> mask) {
 795             Objects.requireNonNull(mask);
 796             Byte512Mask m = (Byte512Mask)mask;
 797             return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte512Mask.class, null, byte.class, VLENGTH,
 798                                           this, m, null,
 799                                           (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
 800         }
 801 
 802         // Mask Query operations
 803 
 804         @Override
 805         @ForceInline
 806         public int trueCount() {
 807             return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte512Mask.class, byte.class, VLENGTH, this,
 808                                                       (m) -> trueCountHelper(m.getBits()));
 809         }
 810 
 811         @Override
 812         @ForceInline
 813         public int firstTrue() {
 814             return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte512Mask.class, byte.class, VLENGTH, this,
 815                                                       (m) -> firstTrueHelper(m.getBits()));
 816         }
 817 
 818         @Override
 819         @ForceInline
 820         public int lastTrue() {
 821             return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte512Mask.class, byte.class, VLENGTH, this,
 822                                                       (m) -> lastTrueHelper(m.getBits()));
 823         }
 824 
 825         @Override
 826         @ForceInline
 827         public long toLong() {
 828             if (length() > Long.SIZE) {
 829                 throw new UnsupportedOperationException("too many lanes for one long");
 830             }
 831             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Byte512Mask.class, byte.class, VLENGTH, this,
 832                                                       (m) -> toLongHelper(m.getBits()));
 833         }
 834 
 835         // Reductions
 836 
 837         @Override
 838         @ForceInline
 839         public boolean anyTrue() {
 840             return VectorSupport.test(BT_ne, Byte512Mask.class, byte.class, VLENGTH,
 841                                          this, vspecies().maskAll(true),
 842                                          (m, __) -> anyTrueHelper(((Byte512Mask)m).getBits()));
 843         }
 844 
 845         @Override
 846         @ForceInline
 847         public boolean allTrue() {
 848             return VectorSupport.test(BT_overflow, Byte512Mask.class, byte.class, VLENGTH,
 849                                          this, vspecies().maskAll(true),
 850                                          (m, __) -> allTrueHelper(((Byte512Mask)m).getBits()));
 851         }
 852 

 923             byte[] r = new byte[reorder1.length];
 924             for (int i = 0; i < reorder1.length; i++) {
 925                 int ssi = reorder2[i];
 926                 r[i] = reorder1[ssi];  // throws on exceptional index
 927             }
 928             return new Byte512Shuffle(r);
 929         }
 930     }
 931 
 932     // ================================================
 933 
 934     // Specialized low-level memory operations.
 935 
 936     @ForceInline
 937     @Override
 938     final
 939     ByteVector fromArray0(byte[] a, int offset) {
 940         return super.fromArray0Template(a, offset);  // specialize
 941     }
 942 
 943     @ForceInline
 944     @Override
 945     final
 946     ByteVector fromArray0(byte[] a, int offset, VectorMask<Byte> m) {
 947         return super.fromArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m);  // specialize
 948     }
 949 
 950 
 951 
 952     @ForceInline
 953     @Override
 954     final
 955     ByteVector fromBooleanArray0(boolean[] a, int offset) {
 956         return super.fromBooleanArray0Template(a, offset);  // specialize
 957     }
 958 
 959     @ForceInline
 960     @Override
 961     final
 962     ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
 963         return super.fromBooleanArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m);  // specialize
 964     }
 965 
 966     @ForceInline
 967     @Override
 968     final
 969     ByteVector fromByteArray0(byte[] a, int offset) {
 970         return super.fromByteArray0Template(a, offset);  // specialize
 971     }
 972 
 973     @ForceInline
 974     @Override
 975     final
 976     ByteVector fromByteArray0(byte[] a, int offset, VectorMask<Byte> m) {
 977         return super.fromByteArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m);  // specialize
 978     }
 979 
 980     @ForceInline
 981     @Override
 982     final
 983     ByteVector fromByteBuffer0(ByteBuffer bb, int offset) {
 984         return super.fromByteBuffer0Template(bb, offset);  // specialize
 985     }
 986 
 987     @ForceInline
 988     @Override
 989     final
 990     ByteVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
 991         return super.fromByteBuffer0Template(Byte512Mask.class, bb, offset, (Byte512Mask) m);  // specialize
 992     }
 993 
 994     @ForceInline
 995     @Override
 996     final
 997     void intoArray0(byte[] a, int offset) {
 998         super.intoArray0Template(a, offset);  // specialize
 999     }
1000 
1001     @ForceInline
1002     @Override
1003     final
1004     void intoArray0(byte[] a, int offset, VectorMask<Byte> m) {
1005         super.intoArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m);
1006     }
1007 
1008 
1009     @ForceInline
1010     @Override
1011     final
1012     void intoBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
1013         super.intoBooleanArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m);
1014     }
1015 
1016     @ForceInline
1017     @Override
1018     final
1019     void intoByteArray0(byte[] a, int offset) {
1020         super.intoByteArray0Template(a, offset);  // specialize
1021     }
1022 
1023     @ForceInline
1024     @Override
1025     final
1026     void intoByteArray0(byte[] a, int offset, VectorMask<Byte> m) {
1027         super.intoByteArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m);  // specialize
1028     }
1029 
1030     @ForceInline
1031     @Override
1032     final
1033     void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
1034         super.intoByteBuffer0Template(Byte512Mask.class, bb, offset, (Byte512Mask) m);
1035     }
1036 
1037 
1038     // End of specialized low-level memory operations.
1039 
1040     // ================================================
1041 
1042 }
< prev index next >