7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25 package jdk.incubator.vector;
26
27 import java.nio.ByteBuffer;
28 import java.util.Arrays;
29 import java.util.Objects;
30 import java.util.function.IntUnaryOperator;
31
32 import jdk.internal.vm.annotation.ForceInline;
33 import jdk.internal.vm.vector.VectorSupport;
34
35 import static jdk.internal.vm.vector.VectorSupport.*;
36
37 import static jdk.incubator.vector.VectorOperators.*;
38
39 // -- This file was mechanically generated: Do not edit! -- //
40
41 @SuppressWarnings("cast") // warning: redundant cast
42 final class ByteMaxVector extends ByteVector {
43 static final ByteSpecies VSPECIES =
44 (ByteSpecies) ByteVector.SPECIES_MAX;
45
46 static final VectorShape VSHAPE =
47 VSPECIES.vectorShape();
48
49 static final Class<ByteMaxVector> VCLASS = ByteMaxVector.class;
50
51 static final int VSIZE = VSPECIES.vectorBitSize();
457 @ForceInline
458 public ByteMaxVector rearrange(VectorShuffle<Byte> shuffle,
459 VectorMask<Byte> m) {
460 return (ByteMaxVector)
461 super.rearrangeTemplate(ByteMaxShuffle.class,
462 ByteMaxMask.class,
463 (ByteMaxShuffle) shuffle,
464 (ByteMaxMask) m); // specialize
465 }
466
467 @Override
468 @ForceInline
469 public ByteMaxVector rearrange(VectorShuffle<Byte> s,
470 Vector<Byte> v) {
471 return (ByteMaxVector)
472 super.rearrangeTemplate(ByteMaxShuffle.class,
473 (ByteMaxShuffle) s,
474 (ByteMaxVector) v); // specialize
475 }
476
477 @Override
478 @ForceInline
479 public ByteMaxVector selectFrom(Vector<Byte> v) {
480 return (ByteMaxVector)
481 super.selectFromTemplate((ByteMaxVector) v); // specialize
482 }
483
484 @Override
485 @ForceInline
486 public ByteMaxVector selectFrom(Vector<Byte> v,
487 VectorMask<Byte> m) {
488 return (ByteMaxVector)
489 super.selectFromTemplate((ByteMaxVector) v,
490 (ByteMaxMask) m); // specialize
491 }
492
493
494 @ForceInline
495 @Override
496 public byte lane(int i) {
630 this, species,
631 (m, s) -> s.maskFactory(m.toArray()).check(s));
632 }
633
634 @Override
635 @ForceInline
636 public ByteMaxMask eq(VectorMask<Byte> mask) {
637 Objects.requireNonNull(mask);
638 ByteMaxMask m = (ByteMaxMask)mask;
639 return xor(m.not());
640 }
641
642 // Unary operations
643
644 @Override
645 @ForceInline
646 public ByteMaxMask not() {
647 return xor(maskAll(true));
648 }
649
650 // Binary operations
651
652 @Override
653 @ForceInline
654 public ByteMaxMask and(VectorMask<Byte> mask) {
655 Objects.requireNonNull(mask);
656 ByteMaxMask m = (ByteMaxMask)mask;
657 return VectorSupport.binaryOp(VECTOR_OP_AND, ByteMaxMask.class, null, byte.class, VLENGTH,
658 this, m, null,
659 (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
660 }
661
662 @Override
663 @ForceInline
664 public ByteMaxMask or(VectorMask<Byte> mask) {
665 Objects.requireNonNull(mask);
666 ByteMaxMask m = (ByteMaxMask)mask;
667 return VectorSupport.binaryOp(VECTOR_OP_OR, ByteMaxMask.class, null, byte.class, VLENGTH,
668 this, m, null,
669 (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
829
830
831
832 @ForceInline
833 @Override
834 final
835 ByteVector fromBooleanArray0(boolean[] a, int offset) {
836 return super.fromBooleanArray0Template(a, offset); // specialize
837 }
838
839 @ForceInline
840 @Override
841 final
842 ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
843 return super.fromBooleanArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m); // specialize
844 }
845
846 @ForceInline
847 @Override
848 final
849 ByteVector fromByteArray0(byte[] a, int offset) {
850 return super.fromByteArray0Template(a, offset); // specialize
851 }
852
853 @ForceInline
854 @Override
855 final
856 ByteVector fromByteArray0(byte[] a, int offset, VectorMask<Byte> m) {
857 return super.fromByteArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m); // specialize
858 }
859
860 @ForceInline
861 @Override
862 final
863 ByteVector fromByteBuffer0(ByteBuffer bb, int offset) {
864 return super.fromByteBuffer0Template(bb, offset); // specialize
865 }
866
867 @ForceInline
868 @Override
869 final
870 ByteVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
871 return super.fromByteBuffer0Template(ByteMaxMask.class, bb, offset, (ByteMaxMask) m); // specialize
872 }
873
874 @ForceInline
875 @Override
876 final
877 void intoArray0(byte[] a, int offset) {
878 super.intoArray0Template(a, offset); // specialize
879 }
880
881 @ForceInline
882 @Override
883 final
884 void intoArray0(byte[] a, int offset, VectorMask<Byte> m) {
885 super.intoArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m);
886 }
887
888
889 @ForceInline
890 @Override
891 final
892 void intoBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
893 super.intoBooleanArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m);
894 }
895
896 @ForceInline
897 @Override
898 final
899 void intoByteArray0(byte[] a, int offset) {
900 super.intoByteArray0Template(a, offset); // specialize
901 }
902
903 @ForceInline
904 @Override
905 final
906 void intoByteArray0(byte[] a, int offset, VectorMask<Byte> m) {
907 super.intoByteArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m); // specialize
908 }
909
910 @ForceInline
911 @Override
912 final
913 void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
914 super.intoByteBuffer0Template(ByteMaxMask.class, bb, offset, (ByteMaxMask) m);
915 }
916
917
918 // End of specialized low-level memory operations.
919
920 // ================================================
921
922 }
|
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25 package jdk.incubator.vector;
26
27 import java.util.Arrays;
28 import java.util.Objects;
29 import java.util.function.IntUnaryOperator;
30
31 import jdk.incubator.foreign.MemorySegment;
32 import jdk.internal.vm.annotation.ForceInline;
33 import jdk.internal.vm.vector.VectorSupport;
34
35 import static jdk.internal.vm.vector.VectorSupport.*;
36
37 import static jdk.incubator.vector.VectorOperators.*;
38
39 // -- This file was mechanically generated: Do not edit! -- //
40
41 @SuppressWarnings("cast") // warning: redundant cast
42 final class ByteMaxVector extends ByteVector {
43 static final ByteSpecies VSPECIES =
44 (ByteSpecies) ByteVector.SPECIES_MAX;
45
46 static final VectorShape VSHAPE =
47 VSPECIES.vectorShape();
48
49 static final Class<ByteMaxVector> VCLASS = ByteMaxVector.class;
50
51 static final int VSIZE = VSPECIES.vectorBitSize();
457 @ForceInline
458 public ByteMaxVector rearrange(VectorShuffle<Byte> shuffle,
459 VectorMask<Byte> m) {
460 return (ByteMaxVector)
461 super.rearrangeTemplate(ByteMaxShuffle.class,
462 ByteMaxMask.class,
463 (ByteMaxShuffle) shuffle,
464 (ByteMaxMask) m); // specialize
465 }
466
467 @Override
468 @ForceInline
469 public ByteMaxVector rearrange(VectorShuffle<Byte> s,
470 Vector<Byte> v) {
471 return (ByteMaxVector)
472 super.rearrangeTemplate(ByteMaxShuffle.class,
473 (ByteMaxShuffle) s,
474 (ByteMaxVector) v); // specialize
475 }
476
477 @Override
478 @ForceInline
479 public ByteMaxVector compress(VectorMask<Byte> m) {
480 return (ByteMaxVector)
481 super.compressTemplate(ByteMaxMask.class,
482 (ByteMaxMask) m); // specialize
483 }
484
485 @Override
486 @ForceInline
487 public ByteMaxVector expand(VectorMask<Byte> m) {
488 return (ByteMaxVector)
489 super.expandTemplate(ByteMaxMask.class,
490 (ByteMaxMask) m); // specialize
491 }
492
493 @Override
494 @ForceInline
495 public ByteMaxVector selectFrom(Vector<Byte> v) {
496 return (ByteMaxVector)
497 super.selectFromTemplate((ByteMaxVector) v); // specialize
498 }
499
500 @Override
501 @ForceInline
502 public ByteMaxVector selectFrom(Vector<Byte> v,
503 VectorMask<Byte> m) {
504 return (ByteMaxVector)
505 super.selectFromTemplate((ByteMaxVector) v,
506 (ByteMaxMask) m); // specialize
507 }
508
509
510 @ForceInline
511 @Override
512 public byte lane(int i) {
646 this, species,
647 (m, s) -> s.maskFactory(m.toArray()).check(s));
648 }
649
650 @Override
651 @ForceInline
652 public ByteMaxMask eq(VectorMask<Byte> mask) {
653 Objects.requireNonNull(mask);
654 ByteMaxMask m = (ByteMaxMask)mask;
655 return xor(m.not());
656 }
657
658 // Unary operations
659
660 @Override
661 @ForceInline
662 public ByteMaxMask not() {
663 return xor(maskAll(true));
664 }
665
666 @Override
667 @ForceInline
668 public ByteMaxMask compress() {
669 return (ByteMaxMask)VectorSupport.comExpOp(VectorSupport.VECTOR_OP_MASK_COMPRESS,
670 ByteMaxVector.class, ByteMaxMask.class, ETYPE, VLENGTH, null, this,
671 (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount()));
672 }
673
674
675 // Binary operations
676
677 @Override
678 @ForceInline
679 public ByteMaxMask and(VectorMask<Byte> mask) {
680 Objects.requireNonNull(mask);
681 ByteMaxMask m = (ByteMaxMask)mask;
682 return VectorSupport.binaryOp(VECTOR_OP_AND, ByteMaxMask.class, null, byte.class, VLENGTH,
683 this, m, null,
684 (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
685 }
686
687 @Override
688 @ForceInline
689 public ByteMaxMask or(VectorMask<Byte> mask) {
690 Objects.requireNonNull(mask);
691 ByteMaxMask m = (ByteMaxMask)mask;
692 return VectorSupport.binaryOp(VECTOR_OP_OR, ByteMaxMask.class, null, byte.class, VLENGTH,
693 this, m, null,
694 (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
854
855
856
857 @ForceInline
858 @Override
859 final
860 ByteVector fromBooleanArray0(boolean[] a, int offset) {
861 return super.fromBooleanArray0Template(a, offset); // specialize
862 }
863
864 @ForceInline
865 @Override
866 final
867 ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
868 return super.fromBooleanArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m); // specialize
869 }
870
871 @ForceInline
872 @Override
873 final
874 ByteVector fromMemorySegment0(MemorySegment ms, long offset) {
875 return super.fromMemorySegment0Template(ms, offset); // specialize
876 }
877
878 @ForceInline
879 @Override
880 final
881 ByteVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask<Byte> m) {
882 return super.fromMemorySegment0Template(ByteMaxMask.class, ms, offset, (ByteMaxMask) m); // specialize
883 }
884
885 @ForceInline
886 @Override
887 final
888 void intoArray0(byte[] a, int offset) {
889 super.intoArray0Template(a, offset); // specialize
890 }
891
892 @ForceInline
893 @Override
894 final
895 void intoArray0(byte[] a, int offset, VectorMask<Byte> m) {
896 super.intoArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m);
897 }
898
899
900 @ForceInline
901 @Override
902 final
903 void intoBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
904 super.intoBooleanArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m);
905 }
906
907 @ForceInline
908 @Override
909 final
910 void intoMemorySegment0(MemorySegment ms, long offset, VectorMask<Byte> m) {
911 super.intoMemorySegment0Template(ByteMaxMask.class, ms, offset, (ByteMaxMask) m);
912 }
913
914
915 // End of specialized low-level memory operations.
916
917 // ================================================
918
919 }
|