< prev index next >

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

Print this page
rev 52233 : Add scalable shapes for Arm Scalable Vector Extension.
Summary: Add scalable vector shapes to support Arm SVE better.
Reviewed-by: duke

@@ -23,10 +23,12 @@
  * questions.
  */
 
 package jdk.incubator.vector;
 
+import jdk.internal.misc.Unsafe;
+
 final public class Shapes {
 
     // @@@ Move into Vector.Shape
 
     public static final S64Bit S_64_BIT = new S64Bit();

@@ -63,6 +65,14 @@
         public int bitSize() {
             return 512;
         }
     }
 
+    public static final SScalableBit S_Scalable_BIT = new SScalableBit();
+    public static final class SScalableBit extends Vector.Shape {
+        @Override
+        public int bitSize() {
+            Unsafe u = Unsafe.getUnsafe();
+            return u.getMaxVectorSize(byte.class) * 8;
+        }
+    }
 }
< prev index next >