< prev index next >

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

Print this page

  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 Short128Vector extends ShortVector {
 43     static final ShortSpecies VSPECIES =
 44         (ShortSpecies) ShortVector.SPECIES_128;
 45 
 46     static final VectorShape VSHAPE =
 47         VSPECIES.vectorShape();
 48 
 49     static final Class<Short128Vector> VCLASS = Short128Vector.class;
 50 
 51     static final int VSIZE = VSPECIES.vectorBitSize();

457     @ForceInline
458     public Short128Vector rearrange(VectorShuffle<Short> shuffle,
459                                   VectorMask<Short> m) {
460         return (Short128Vector)
461             super.rearrangeTemplate(Short128Shuffle.class,
462                                     Short128Mask.class,
463                                     (Short128Shuffle) shuffle,
464                                     (Short128Mask) m);  // specialize
465     }
466 
467     @Override
468     @ForceInline
469     public Short128Vector rearrange(VectorShuffle<Short> s,
470                                   Vector<Short> v) {
471         return (Short128Vector)
472             super.rearrangeTemplate(Short128Shuffle.class,
473                                     (Short128Shuffle) s,
474                                     (Short128Vector) v);  // specialize
475     }
476 
















477     @Override
478     @ForceInline
479     public Short128Vector selectFrom(Vector<Short> v) {
480         return (Short128Vector)
481             super.selectFromTemplate((Short128Vector) v);  // specialize
482     }
483 
484     @Override
485     @ForceInline
486     public Short128Vector selectFrom(Vector<Short> v,
487                                    VectorMask<Short> m) {
488         return (Short128Vector)
489             super.selectFromTemplate((Short128Vector) v,
490                                      (Short128Mask) m);  // specialize
491     }
492 
493 
494     @ForceInline
495     @Override
496     public short lane(int i) {

644                 this, species,
645                 (m, s) -> s.maskFactory(m.toArray()).check(s));
646         }
647 
648         @Override
649         @ForceInline
650         public Short128Mask eq(VectorMask<Short> mask) {
651             Objects.requireNonNull(mask);
652             Short128Mask m = (Short128Mask)mask;
653             return xor(m.not());
654         }
655 
656         // Unary operations
657 
658         @Override
659         @ForceInline
660         public Short128Mask not() {
661             return xor(maskAll(true));
662         }
663 









664         // Binary operations
665 
666         @Override
667         @ForceInline
668         public Short128Mask and(VectorMask<Short> mask) {
669             Objects.requireNonNull(mask);
670             Short128Mask m = (Short128Mask)mask;
671             return VectorSupport.binaryOp(VECTOR_OP_AND, Short128Mask.class, null, short.class, VLENGTH,
672                                           this, m, null,
673                                           (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
674         }
675 
676         @Override
677         @ForceInline
678         public Short128Mask or(VectorMask<Short> mask) {
679             Objects.requireNonNull(mask);
680             Short128Mask m = (Short128Mask)mask;
681             return VectorSupport.binaryOp(VECTOR_OP_OR, Short128Mask.class, null, short.class, VLENGTH,
682                                           this, m, null,
683                                           (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));

843 
844 
845     @ForceInline
846     @Override
847     final
848     ShortVector fromCharArray0(char[] a, int offset) {
849         return super.fromCharArray0Template(a, offset);  // specialize
850     }
851 
852     @ForceInline
853     @Override
854     final
855     ShortVector fromCharArray0(char[] a, int offset, VectorMask<Short> m) {
856         return super.fromCharArray0Template(Short128Mask.class, a, offset, (Short128Mask) m);  // specialize
857     }
858 
859 
860     @ForceInline
861     @Override
862     final
863     ShortVector fromByteArray0(byte[] a, int offset) {
864         return super.fromByteArray0Template(a, offset);  // specialize
865     }
866 
867     @ForceInline
868     @Override
869     final
870     ShortVector fromByteArray0(byte[] a, int offset, VectorMask<Short> m) {
871         return super.fromByteArray0Template(Short128Mask.class, a, offset, (Short128Mask) m);  // specialize
872     }
873 
874     @ForceInline
875     @Override
876     final
877     ShortVector fromByteBuffer0(ByteBuffer bb, int offset) {
878         return super.fromByteBuffer0Template(bb, offset);  // specialize
879     }
880 
881     @ForceInline
882     @Override
883     final
884     ShortVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m) {
885         return super.fromByteBuffer0Template(Short128Mask.class, bb, offset, (Short128Mask) m);  // specialize
886     }
887 
888     @ForceInline
889     @Override
890     final
891     void intoArray0(short[] a, int offset) {
892         super.intoArray0Template(a, offset);  // specialize
893     }
894 
895     @ForceInline
896     @Override
897     final
898     void intoArray0(short[] a, int offset, VectorMask<Short> m) {
899         super.intoArray0Template(Short128Mask.class, a, offset, (Short128Mask) m);
900     }
901 
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<Short> m) {
915         super.intoByteArray0Template(Short128Mask.class, a, offset, (Short128Mask) m);  // specialize
916     }
917 
918     @ForceInline
919     @Override
920     final
921     void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m) {
922         super.intoByteBuffer0Template(Short128Mask.class, bb, offset, (Short128Mask) m);
923     }
924 
925     @ForceInline
926     @Override
927     final
928     void intoCharArray0(char[] a, int offset, VectorMask<Short> m) {
929         super.intoCharArray0Template(Short128Mask.class, a, offset, (Short128Mask) m);
930     }
931 
932     // End of specialized low-level memory operations.
933 
934     // ================================================
935 
936 }

  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 Short128Vector extends ShortVector {
 43     static final ShortSpecies VSPECIES =
 44         (ShortSpecies) ShortVector.SPECIES_128;
 45 
 46     static final VectorShape VSHAPE =
 47         VSPECIES.vectorShape();
 48 
 49     static final Class<Short128Vector> VCLASS = Short128Vector.class;
 50 
 51     static final int VSIZE = VSPECIES.vectorBitSize();

457     @ForceInline
458     public Short128Vector rearrange(VectorShuffle<Short> shuffle,
459                                   VectorMask<Short> m) {
460         return (Short128Vector)
461             super.rearrangeTemplate(Short128Shuffle.class,
462                                     Short128Mask.class,
463                                     (Short128Shuffle) shuffle,
464                                     (Short128Mask) m);  // specialize
465     }
466 
467     @Override
468     @ForceInline
469     public Short128Vector rearrange(VectorShuffle<Short> s,
470                                   Vector<Short> v) {
471         return (Short128Vector)
472             super.rearrangeTemplate(Short128Shuffle.class,
473                                     (Short128Shuffle) s,
474                                     (Short128Vector) v);  // specialize
475     }
476 
477     @Override
478     @ForceInline
479     public Short128Vector compress(VectorMask<Short> m) {
480         return (Short128Vector)
481             super.compressTemplate(Short128Mask.class,
482                                    (Short128Mask) m);  // specialize
483     }
484 
485     @Override
486     @ForceInline
487     public Short128Vector expand(VectorMask<Short> m) {
488         return (Short128Vector)
489             super.expandTemplate(Short128Mask.class,
490                                    (Short128Mask) m);  // specialize
491     }
492 
493     @Override
494     @ForceInline
495     public Short128Vector selectFrom(Vector<Short> v) {
496         return (Short128Vector)
497             super.selectFromTemplate((Short128Vector) v);  // specialize
498     }
499 
500     @Override
501     @ForceInline
502     public Short128Vector selectFrom(Vector<Short> v,
503                                    VectorMask<Short> m) {
504         return (Short128Vector)
505             super.selectFromTemplate((Short128Vector) v,
506                                      (Short128Mask) m);  // specialize
507     }
508 
509 
510     @ForceInline
511     @Override
512     public short lane(int i) {

660                 this, species,
661                 (m, s) -> s.maskFactory(m.toArray()).check(s));
662         }
663 
664         @Override
665         @ForceInline
666         public Short128Mask eq(VectorMask<Short> mask) {
667             Objects.requireNonNull(mask);
668             Short128Mask m = (Short128Mask)mask;
669             return xor(m.not());
670         }
671 
672         // Unary operations
673 
674         @Override
675         @ForceInline
676         public Short128Mask not() {
677             return xor(maskAll(true));
678         }
679 
680         @Override
681         @ForceInline
682         public Short128Mask compress() {
683             return (Short128Mask)VectorSupport.comExpOp(VectorSupport.VECTOR_OP_MASK_COMPRESS,
684                 Short128Vector.class, Short128Mask.class, ETYPE, VLENGTH, null, this,
685                 (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount()));
686         }
687 
688 
689         // Binary operations
690 
691         @Override
692         @ForceInline
693         public Short128Mask and(VectorMask<Short> mask) {
694             Objects.requireNonNull(mask);
695             Short128Mask m = (Short128Mask)mask;
696             return VectorSupport.binaryOp(VECTOR_OP_AND, Short128Mask.class, null, short.class, VLENGTH,
697                                           this, m, null,
698                                           (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
699         }
700 
701         @Override
702         @ForceInline
703         public Short128Mask or(VectorMask<Short> mask) {
704             Objects.requireNonNull(mask);
705             Short128Mask m = (Short128Mask)mask;
706             return VectorSupport.binaryOp(VECTOR_OP_OR, Short128Mask.class, null, short.class, VLENGTH,
707                                           this, m, null,
708                                           (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));

868 
869 
870     @ForceInline
871     @Override
872     final
873     ShortVector fromCharArray0(char[] a, int offset) {
874         return super.fromCharArray0Template(a, offset);  // specialize
875     }
876 
877     @ForceInline
878     @Override
879     final
880     ShortVector fromCharArray0(char[] a, int offset, VectorMask<Short> m) {
881         return super.fromCharArray0Template(Short128Mask.class, a, offset, (Short128Mask) m);  // specialize
882     }
883 
884 
885     @ForceInline
886     @Override
887     final
888     ShortVector fromMemorySegment0(MemorySegment ms, long offset) {
889         return super.fromMemorySegment0Template(ms, offset);  // specialize
890     }
891 
892     @ForceInline
893     @Override
894     final
895     ShortVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask<Short> m) {
896         return super.fromMemorySegment0Template(Short128Mask.class, ms, offset, (Short128Mask) m);  // specialize














897     }
898 
899     @ForceInline
900     @Override
901     final
902     void intoArray0(short[] a, int offset) {
903         super.intoArray0Template(a, offset);  // specialize
904     }
905 
906     @ForceInline
907     @Override
908     final
909     void intoArray0(short[] a, int offset, VectorMask<Short> m) {
910         super.intoArray0Template(Short128Mask.class, a, offset, (Short128Mask) m);
911     }
912 
913 
914 
915     @ForceInline
916     @Override
917     final
918     void intoMemorySegment0(MemorySegment ms, long offset, VectorMask<Short> m) {
919         super.intoMemorySegment0Template(Short128Mask.class, ms, offset, (Short128Mask) m);














920     }
921 
922     @ForceInline
923     @Override
924     final
925     void intoCharArray0(char[] a, int offset, VectorMask<Short> m) {
926         super.intoCharArray0Template(Short128Mask.class, a, offset, (Short128Mask) m);
927     }
928 
929     // End of specialized low-level memory operations.
930 
931     // ================================================
932 
933 }
< prev index next >