< prev index next >

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

Print this page
@@ -1,7 +1,7 @@
  /*
-  * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
+  * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this

@@ -22,14 +22,15 @@
   * or visit www.oracle.com if you need additional information or have any
   * questions.
   */
  package jdk.incubator.vector;
  
+ import jdk.incubator.foreign.MemorySegment;
  import jdk.internal.vm.annotation.ForceInline;
  import jdk.internal.vm.annotation.Stable;
- import java.nio.ByteOrder;
  import java.lang.reflect.Array;
+ import java.nio.ByteOrder;
  import java.util.Arrays;
  import java.util.function.Function;
  import java.util.function.IntUnaryOperator;
  
  abstract class AbstractSpecies<E> extends jdk.internal.vm.vector.VectorSupport.VectorSpecies<E>

@@ -201,16 +202,28 @@
      @ForceInline
      public final int loopBound(int length) {
          return VectorIntrinsics.roundDown(length, laneCount);
      }
  
+     @Override
+     @ForceInline
+     public final long loopBound(long length) {
+         return VectorIntrinsics.roundDown(length, laneCount);
+     }
+ 
      @Override
      @ForceInline
      public final VectorMask<E> indexInRange(int offset, int limit) {
          return maskAll(true).indexInRange(offset, limit);
      }
  
+     @Override
+     @ForceInline
+     public final VectorMask<E> indexInRange(long offset, long limit) {
+         return maskAll(true).indexInRange(offset, limit);
+     }
+ 
      @Override
      @ForceInline
      public final <F> VectorSpecies<F> withLanes(Class<F> newType) {
          return withLanes(LaneType.of(newType)).check(newType);
      }

@@ -347,13 +360,13 @@
              return dummyVector().iotaShuffle(start, step, wrap);
      }
  
      @ForceInline
      @Override
-     public final Vector<E> fromByteArray(byte[] a, int offset, ByteOrder bo) {
+     public final Vector<E> fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) {
          return dummyVector()
-             .fromByteArray0(a, offset)
+             .fromMemorySegment0(ms, offset)
              .maybeSwap(bo);
      }
  
      @Override
      public VectorMask<E> loadMask(boolean[] bits, int offset) {
< prev index next >