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 Byte256Vector extends ByteVector {
43 static final ByteSpecies VSPECIES =
44 (ByteSpecies) ByteVector.SPECIES_256;
45
46 static final VectorShape VSHAPE =
47 VSPECIES.vectorShape();
48
49 static final Class<Byte256Vector> VCLASS = Byte256Vector.class;
50
51 static final int VSIZE = VSPECIES.vectorBitSize();
457 @ForceInline
458 public Byte256Vector rearrange(VectorShuffle<Byte> shuffle,
459 VectorMask<Byte> m) {
460 return (Byte256Vector)
461 super.rearrangeTemplate(Byte256Shuffle.class,
462 Byte256Mask.class,
463 (Byte256Shuffle) shuffle,
464 (Byte256Mask) m); // specialize
465 }
466
467 @Override
468 @ForceInline
469 public Byte256Vector rearrange(VectorShuffle<Byte> s,
470 Vector<Byte> v) {
471 return (Byte256Vector)
472 super.rearrangeTemplate(Byte256Shuffle.class,
473 (Byte256Shuffle) s,
474 (Byte256Vector) v); // specialize
475 }
476
477 @Override
478 @ForceInline
479 public Byte256Vector selectFrom(Vector<Byte> v) {
480 return (Byte256Vector)
481 super.selectFromTemplate((Byte256Vector) v); // specialize
482 }
483
484 @Override
485 @ForceInline
486 public Byte256Vector selectFrom(Vector<Byte> v,
487 VectorMask<Byte> m) {
488 return (Byte256Vector)
489 super.selectFromTemplate((Byte256Vector) v,
490 (Byte256Mask) m); // specialize
491 }
492
493
494 @ForceInline
495 @Override
496 public byte lane(int i) {
692 this, species,
693 (m, s) -> s.maskFactory(m.toArray()).check(s));
694 }
695
696 @Override
697 @ForceInline
698 public Byte256Mask eq(VectorMask<Byte> mask) {
699 Objects.requireNonNull(mask);
700 Byte256Mask m = (Byte256Mask)mask;
701 return xor(m.not());
702 }
703
704 // Unary operations
705
706 @Override
707 @ForceInline
708 public Byte256Mask not() {
709 return xor(maskAll(true));
710 }
711
712 // Binary operations
713
714 @Override
715 @ForceInline
716 public Byte256Mask and(VectorMask<Byte> mask) {
717 Objects.requireNonNull(mask);
718 Byte256Mask m = (Byte256Mask)mask;
719 return VectorSupport.binaryOp(VECTOR_OP_AND, Byte256Mask.class, null, byte.class, VLENGTH,
720 this, m, null,
721 (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
722 }
723
724 @Override
725 @ForceInline
726 public Byte256Mask or(VectorMask<Byte> mask) {
727 Objects.requireNonNull(mask);
728 Byte256Mask m = (Byte256Mask)mask;
729 return VectorSupport.binaryOp(VECTOR_OP_OR, Byte256Mask.class, null, byte.class, VLENGTH,
730 this, m, null,
731 (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
891
892
893
894 @ForceInline
895 @Override
896 final
897 ByteVector fromBooleanArray0(boolean[] a, int offset) {
898 return super.fromBooleanArray0Template(a, offset); // specialize
899 }
900
901 @ForceInline
902 @Override
903 final
904 ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
905 return super.fromBooleanArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m); // specialize
906 }
907
908 @ForceInline
909 @Override
910 final
911 ByteVector fromByteArray0(byte[] a, int offset) {
912 return super.fromByteArray0Template(a, offset); // specialize
913 }
914
915 @ForceInline
916 @Override
917 final
918 ByteVector fromByteArray0(byte[] a, int offset, VectorMask<Byte> m) {
919 return super.fromByteArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m); // specialize
920 }
921
922 @ForceInline
923 @Override
924 final
925 ByteVector fromByteBuffer0(ByteBuffer bb, int offset) {
926 return super.fromByteBuffer0Template(bb, offset); // specialize
927 }
928
929 @ForceInline
930 @Override
931 final
932 ByteVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
933 return super.fromByteBuffer0Template(Byte256Mask.class, bb, offset, (Byte256Mask) m); // specialize
934 }
935
936 @ForceInline
937 @Override
938 final
939 void intoArray0(byte[] a, int offset) {
940 super.intoArray0Template(a, offset); // specialize
941 }
942
943 @ForceInline
944 @Override
945 final
946 void intoArray0(byte[] a, int offset, VectorMask<Byte> m) {
947 super.intoArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m);
948 }
949
950
951 @ForceInline
952 @Override
953 final
954 void intoBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
955 super.intoBooleanArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m);
956 }
957
958 @ForceInline
959 @Override
960 final
961 void intoByteArray0(byte[] a, int offset) {
962 super.intoByteArray0Template(a, offset); // specialize
963 }
964
965 @ForceInline
966 @Override
967 final
968 void intoByteArray0(byte[] a, int offset, VectorMask<Byte> m) {
969 super.intoByteArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m); // specialize
970 }
971
972 @ForceInline
973 @Override
974 final
975 void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
976 super.intoByteBuffer0Template(Byte256Mask.class, bb, offset, (Byte256Mask) m);
977 }
978
979
980 // End of specialized low-level memory operations.
981
982 // ================================================
983
984 }
|
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 Byte256Vector extends ByteVector {
43 static final ByteSpecies VSPECIES =
44 (ByteSpecies) ByteVector.SPECIES_256;
45
46 static final VectorShape VSHAPE =
47 VSPECIES.vectorShape();
48
49 static final Class<Byte256Vector> VCLASS = Byte256Vector.class;
50
51 static final int VSIZE = VSPECIES.vectorBitSize();
457 @ForceInline
458 public Byte256Vector rearrange(VectorShuffle<Byte> shuffle,
459 VectorMask<Byte> m) {
460 return (Byte256Vector)
461 super.rearrangeTemplate(Byte256Shuffle.class,
462 Byte256Mask.class,
463 (Byte256Shuffle) shuffle,
464 (Byte256Mask) m); // specialize
465 }
466
467 @Override
468 @ForceInline
469 public Byte256Vector rearrange(VectorShuffle<Byte> s,
470 Vector<Byte> v) {
471 return (Byte256Vector)
472 super.rearrangeTemplate(Byte256Shuffle.class,
473 (Byte256Shuffle) s,
474 (Byte256Vector) v); // specialize
475 }
476
477 @Override
478 @ForceInline
479 public Byte256Vector compress(VectorMask<Byte> m) {
480 return (Byte256Vector)
481 super.compressTemplate(Byte256Mask.class,
482 (Byte256Mask) m); // specialize
483 }
484
485 @Override
486 @ForceInline
487 public Byte256Vector expand(VectorMask<Byte> m) {
488 return (Byte256Vector)
489 super.expandTemplate(Byte256Mask.class,
490 (Byte256Mask) m); // specialize
491 }
492
493 @Override
494 @ForceInline
495 public Byte256Vector selectFrom(Vector<Byte> v) {
496 return (Byte256Vector)
497 super.selectFromTemplate((Byte256Vector) v); // specialize
498 }
499
500 @Override
501 @ForceInline
502 public Byte256Vector selectFrom(Vector<Byte> v,
503 VectorMask<Byte> m) {
504 return (Byte256Vector)
505 super.selectFromTemplate((Byte256Vector) v,
506 (Byte256Mask) m); // specialize
507 }
508
509
510 @ForceInline
511 @Override
512 public byte lane(int i) {
708 this, species,
709 (m, s) -> s.maskFactory(m.toArray()).check(s));
710 }
711
712 @Override
713 @ForceInline
714 public Byte256Mask eq(VectorMask<Byte> mask) {
715 Objects.requireNonNull(mask);
716 Byte256Mask m = (Byte256Mask)mask;
717 return xor(m.not());
718 }
719
720 // Unary operations
721
722 @Override
723 @ForceInline
724 public Byte256Mask not() {
725 return xor(maskAll(true));
726 }
727
728 @Override
729 @ForceInline
730 public Byte256Mask compress() {
731 return (Byte256Mask)VectorSupport.comExpOp(VectorSupport.VECTOR_OP_MASK_COMPRESS,
732 Byte256Vector.class, Byte256Mask.class, ETYPE, VLENGTH, null, this,
733 (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount()));
734 }
735
736
737 // Binary operations
738
739 @Override
740 @ForceInline
741 public Byte256Mask and(VectorMask<Byte> mask) {
742 Objects.requireNonNull(mask);
743 Byte256Mask m = (Byte256Mask)mask;
744 return VectorSupport.binaryOp(VECTOR_OP_AND, Byte256Mask.class, null, byte.class, VLENGTH,
745 this, m, null,
746 (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
747 }
748
749 @Override
750 @ForceInline
751 public Byte256Mask or(VectorMask<Byte> mask) {
752 Objects.requireNonNull(mask);
753 Byte256Mask m = (Byte256Mask)mask;
754 return VectorSupport.binaryOp(VECTOR_OP_OR, Byte256Mask.class, null, byte.class, VLENGTH,
755 this, m, null,
756 (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
916
917
918
919 @ForceInline
920 @Override
921 final
922 ByteVector fromBooleanArray0(boolean[] a, int offset) {
923 return super.fromBooleanArray0Template(a, offset); // specialize
924 }
925
926 @ForceInline
927 @Override
928 final
929 ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
930 return super.fromBooleanArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m); // specialize
931 }
932
933 @ForceInline
934 @Override
935 final
936 ByteVector fromMemorySegment0(MemorySegment ms, long offset) {
937 return super.fromMemorySegment0Template(ms, offset); // specialize
938 }
939
940 @ForceInline
941 @Override
942 final
943 ByteVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask<Byte> m) {
944 return super.fromMemorySegment0Template(Byte256Mask.class, ms, offset, (Byte256Mask) m); // specialize
945 }
946
947 @ForceInline
948 @Override
949 final
950 void intoArray0(byte[] a, int offset) {
951 super.intoArray0Template(a, offset); // specialize
952 }
953
954 @ForceInline
955 @Override
956 final
957 void intoArray0(byte[] a, int offset, VectorMask<Byte> m) {
958 super.intoArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m);
959 }
960
961
962 @ForceInline
963 @Override
964 final
965 void intoBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
966 super.intoBooleanArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m);
967 }
968
969 @ForceInline
970 @Override
971 final
972 void intoMemorySegment0(MemorySegment ms, long offset, VectorMask<Byte> m) {
973 super.intoMemorySegment0Template(Byte256Mask.class, ms, offset, (Byte256Mask) m);
974 }
975
976
977 // End of specialized low-level memory operations.
978
979 // ================================================
980
981 }
|