Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8262096

Vector API fails to work due to VectorShape initialization exception

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b13

      Description

      * Symptom
      ```
      Exception in thread "main" java.lang.ExceptionInInitializerError
              at Test.<clinit>(Test.java:4)
      Caused by: java.lang.UnsupportedOperationException: shape unavailable for lane type: double
              at jdk.incubator.vector/jdk.incubator.vector.VectorShape.computePreferredShape(VectorShape.java:252)
              at jdk.incubator.vector/jdk.incubator.vector.VectorShape.preferredShape(VectorShape.java:240)
              at jdk.incubator.vector/jdk.incubator.vector.VectorSpecies.ofPreferred(VectorSpecies.java:368)
              at jdk.incubator.vector/jdk.incubator.vector.DoubleVector.<clinit>(DoubleVector.java:3662)
              ... 1 more
      ```

      * Reproduce
      Run:
        java -XX:MaxVectorSize=8 -ea -esa --add-modules=jdk.incubator.vector Test
      ```
         import jdk.incubator.vector.*;
        
         public class Test {
             static final VectorSpecies<Double> SPECIES = DoubleVector.SPECIES_64;
             static double[] a = new double[64];
             static double[] r = new double[64];
        
             static void test() {
             }
        
             public static void main(String[] args) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, 0);
                 av.lanewise(VectorOperators.ABS).intoArray(r, 0);
             }
         }
      ```

      It also fails to work if C2 is disabled.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jiefu Jie Fu
              Reporter:
              jiefu Jie Fu
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: