< prev index next >

test/jdk/jdk/incubator/vector/VectorHash.java

Print this page
rev 55892 : 8222933: [vector] Test failures after api change in JDK-8222752
Summary: Test failure becaues of renaming get() and getElement() functions to lane() in changeset http://hg.openjdk.java.net/panama/dev/rev/82514a6254e6
Reviewed-by: sviswanathan


  83                 a[i + 4] * 31 * 31 * 31 +
  84                 a[i + 5] * 31 * 31 +
  85                 a[i + 6] * 31 +
  86                 a[i + 7];
  87         }
  88 
  89         for (; i < a.length; i++) {
  90             h = 31 * h + a[i];
  91         }
  92         return h;
  93     }
  94 
  95     static int hashCodeUnrollConstants(byte[] a) {
  96         if (a == null)
  97             return 0;
  98 
  99         int h = 1;
 100         int i = 0;
 101         for (; i < (a.length & ~(8 - 1)); i += 8) {
 102             h = h * COEFF_31_TO_8 +
 103                 a[i + 0] * H_COEFF_8.get(0) +
 104                 a[i + 1] * H_COEFF_8.get(1) +
 105                 a[i + 2] * H_COEFF_8.get(2) +
 106                 a[i + 3] * H_COEFF_8.get(3) +
 107                 a[i + 4] * H_COEFF_8.get(4) +
 108                 a[i + 5] * H_COEFF_8.get(5) +
 109                 a[i + 6] * H_COEFF_8.get(6) +
 110                 a[i + 7] * H_COEFF_8.get(7);
 111         }
 112 
 113         for (; i < a.length; i++) {
 114             h = 31 * h + a[i];
 115         }
 116         return h;
 117     }
 118 
 119     static int hashCodeVector64(byte[] a) {
 120         int h = 1;
 121         int i = 0;
 122         for (; i < (a.length & ~(BYTE_64_SPECIES.length() - 1)); i += BYTE_64_SPECIES.length()) {
 123             ByteVector b = ByteVector.fromArray(BYTE_64_SPECIES, a, i);
 124             IntVector x = (IntVector) b.cast(INT_256_SPECIES);
 125             h = h * COEFF_31_TO_8 + x.mul(H_COEFF_8).addAll();
 126         }
 127 
 128         for (; i < a.length; i++) {
 129             h = 31 * h + a[i];
 130         }




  83                 a[i + 4] * 31 * 31 * 31 +
  84                 a[i + 5] * 31 * 31 +
  85                 a[i + 6] * 31 +
  86                 a[i + 7];
  87         }
  88 
  89         for (; i < a.length; i++) {
  90             h = 31 * h + a[i];
  91         }
  92         return h;
  93     }
  94 
  95     static int hashCodeUnrollConstants(byte[] a) {
  96         if (a == null)
  97             return 0;
  98 
  99         int h = 1;
 100         int i = 0;
 101         for (; i < (a.length & ~(8 - 1)); i += 8) {
 102             h = h * COEFF_31_TO_8 +
 103                 a[i + 0] * H_COEFF_8.lane(0) +
 104                 a[i + 1] * H_COEFF_8.lane(1) +
 105                 a[i + 2] * H_COEFF_8.lane(2) +
 106                 a[i + 3] * H_COEFF_8.lane(3) +
 107                 a[i + 4] * H_COEFF_8.lane(4) +
 108                 a[i + 5] * H_COEFF_8.lane(5) +
 109                 a[i + 6] * H_COEFF_8.lane(6) +
 110                 a[i + 7] * H_COEFF_8.lane(7);
 111         }
 112 
 113         for (; i < a.length; i++) {
 114             h = 31 * h + a[i];
 115         }
 116         return h;
 117     }
 118 
 119     static int hashCodeVector64(byte[] a) {
 120         int h = 1;
 121         int i = 0;
 122         for (; i < (a.length & ~(BYTE_64_SPECIES.length() - 1)); i += BYTE_64_SPECIES.length()) {
 123             ByteVector b = ByteVector.fromArray(BYTE_64_SPECIES, a, i);
 124             IntVector x = (IntVector) b.cast(INT_256_SPECIES);
 125             h = h * COEFF_31_TO_8 + x.mul(H_COEFF_8).addAll();
 126         }
 127 
 128         for (; i < a.length; i++) {
 129             h = 31 * h + a[i];
 130         }


< prev index next >