< prev index next >

test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java

Print this page
*** 163,55 ***
          }
      }
  
      @Test
      @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" },
-         applyIfOr = {"UseCompactObjectHeaders", "false", "AlignVector", "false"},
          applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"},
          applyIfPlatform = {"64-bit", "true"})
      // 32-bit: offsets are badly aligned (UNSAFE.ARRAY_BYTE_BASE_OFFSET is 4 byte aligned, but not 8 byte aligned).
      //         might get fixed with JDK-8325155.
      public static void testByteLong1a(byte[] dest, long[] src) {
          for (int i = 0; i < src.length; i++) {
              UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * i, handleByteOrder(src[i]));
-             // With AlignVector, we need 8-byte alignment of vector loads/stores.
-             // UseCompactObjectHeaders=false                  UseCompactObjectHeaders=true
-             // B_adr = base + 16 + 8*i  ->  always            B_adr = base + 12 + 8*i  ->  never
-             // L_adr = base + 16 + 8*i  ->  always            L_adr = base + 16 + 8*i  ->  always
-             // -> vectorize                                   -> no vectorization
          }
      }
  
      @Test
      @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" },
-         applyIfOr = {"UseCompactObjectHeaders", "false", "AlignVector", "false"},
          applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"},
          applyIfPlatform = {"64-bit", "true"})
      // 32-bit: address has ConvL2I for cast of long to address, not supported.
      public static void testByteLong1b(byte[] dest, long[] src) {
          for (int i = 0; i < src.length; i++) {
              UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8L * i, handleByteOrder(src[i]));
-             // With AlignVector, we need 8-byte alignment of vector loads/stores.
-             // UseCompactObjectHeaders=false                  UseCompactObjectHeaders=true
-             // B_adr = base + 16 + 8*i  ->  always            B_adr = base + 12 + 8*i  ->  never
-             // L_adr = base + 16 + 8*i  ->  always            L_adr = base + 16 + 8*i  ->  always
-             // -> vectorize                                   -> no vectorization
          }
      }
  
      @Test
      @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" },
          applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"})
      public static void testByteLong1c(byte[] dest, long[] src) {
          long base = 64; // make sure it is big enough and 8 byte aligned (required for 32-bit)
          for (int i = 0; i < src.length - 8; i++) {
              UNSAFE.putLongUnaligned(dest, base + 8 * i, handleByteOrder(src[i]));
-             // With AlignVector, we need 8-byte alignment of vector loads/stores.
-             // UseCompactObjectHeaders=false                  UseCompactObjectHeaders=true
-             // B_adr = base + 64 + 8*i  ->  always            B_adr = base + 64 + 8*i  ->  always
-             // L_adr = base + 16 + 8*i  ->  always            L_adr = base + 16 + 8*i  ->  always
-             // -> vectorize                                   -> vectorize
          }
      }
  
      @Test
      @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" },
--- 163,38 ---

*** 220,15 ***
      // 32-bit: address has ConvL2I for cast of long to address, not supported.
      public static void testByteLong1d(byte[] dest, long[] src) {
          long base = 64; // make sure it is big enough and 8 byte aligned (required for 32-bit)
          for (int i = 0; i < src.length - 8; i++) {
              UNSAFE.putLongUnaligned(dest, base + 8L * i, handleByteOrder(src[i]));
-             // With AlignVector, we need 8-byte alignment of vector loads/stores.
-             // UseCompactObjectHeaders=false                  UseCompactObjectHeaders=true
-             // B_adr = base + 64 + 8*i  ->  always            B_adr = base + 64 + 8*i  ->  always
-             // L_adr = base + 16 + 8*i  ->  always            L_adr = base + 16 + 8*i  ->  always
-             // -> vectorize                                   -> vectorize
          }
      }
  
      @Run(test = {"testByteLong1a", "testByteLong1b", "testByteLong1c", "testByteLong1d"})
      public static void testByteLong1_runner() {
--- 203,10 ---

*** 238,40 ***
          testByteLong1d(byteArray, longArray);
      }
  
      @Test
      @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" },
-         applyIfOr = {"UseCompactObjectHeaders", "false", "AlignVector", "false"},
          applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"},
          applyIfPlatform = {"64-bit", "true"})
      // 32-bit: offsets are badly aligned (UNSAFE.ARRAY_BYTE_BASE_OFFSET is 4 byte aligned, but not 8 byte aligned).
      //         might get fixed with JDK-8325155.
      public static void testByteLong2a(byte[] dest, long[] src) {
          for (int i = 1; i < src.length; i++) {
              UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * (i - 1), handleByteOrder(src[i]));
-             // With AlignVector, we need 8-byte alignment of vector loads/stores.
-             // UseCompactObjectHeaders=false                      UseCompactObjectHeaders=true
-             // B_adr = base + 16 + 8*(i-1)  ->  always            B_adr = base + 12 + 8*(i-1)  ->  never
-             // L_adr = base + 16 + 8*i      ->  always            L_adr = base + 16 + 8*i      ->  always
-             // -> vectorize                                       -> no vectorization
          }
      }
  
      @Test
      @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" },
-         applyIfOr = {"UseCompactObjectHeaders", "false", "AlignVector", "false"},
          applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"},
          applyIfPlatform = {"64-bit", "true"})
      // 32-bit: address has ConvL2I for cast of long to address, not supported.
      public static void testByteLong2b(byte[] dest, long[] src) {
          for (int i = 1; i < src.length; i++) {
              UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8L * (i - 1), handleByteOrder(src[i]));
-             // With AlignVector, we need 8-byte alignment of vector loads/stores.
-             // UseCompactObjectHeaders=false                      UseCompactObjectHeaders=true
-             // B_adr = base + 16 + 8*(i-1)  ->  always            B_adr = base + 12 + 8*(i-1)  ->  never
-             // L_adr = base + 16 + 8*i      ->  always            L_adr = base + 16 + 8*i      ->  always
-             // -> vectorize                                       -> no vectorization
          }
      }
  
      @Run(test = {"testByteLong2a", "testByteLong2b"})
      public static void testByteLong2_runner() {
--- 216,28 ---

*** 279,40 ***
          runAndVerify(() -> testByteLong2b(byteArray, longArray), -8);
      }
  
      @Test
      @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" },
-         applyIfOr = {"UseCompactObjectHeaders", "false", "AlignVector", "false"},
          applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"},
          applyIfPlatform = {"64-bit", "true"})
      // 32-bit: offsets are badly aligned (UNSAFE.ARRAY_BYTE_BASE_OFFSET is 4 byte aligned, but not 8 byte aligned).
      //         might get fixed with JDK-8325155.
      public static void testByteLong3a(byte[] dest, long[] src) {
          for (int i = 0; i < src.length - 1; i++) {
              UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * (i + 1), handleByteOrder(src[i]));
-             // With AlignVector, we need 8-byte alignment of vector loads/stores.
-             // UseCompactObjectHeaders=false                      UseCompactObjectHeaders=true
-             // B_adr = base + 16 + 8*(i+1)  ->  always            B_adr = base + 12 + 8*(i+1)  ->  never
-             // L_adr = base + 16 + 8*i      ->  always            L_adr = base + 16 + 8*i      ->  always
-             // -> vectorize                                       -> no vectorization
          }
      }
  
      @Test
      @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" },
-         applyIfOr = {"UseCompactObjectHeaders", "false", "AlignVector", "false"},
          applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"},
          applyIfPlatform = {"64-bit", "true"})
      // 32-bit: address has ConvL2I for cast of long to address, not supported.
      public static void testByteLong3b(byte[] dest, long[] src) {
          for (int i = 0; i < src.length - 1; i++) {
              UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8L * (i + 1), handleByteOrder(src[i]));
-             // With AlignVector, we need 8-byte alignment of vector loads/stores.
-             // UseCompactObjectHeaders=false                      UseCompactObjectHeaders=true
-             // B_adr = base + 16 + 8*(i+1)  ->  always            B_adr = base + 12 + 8*(i+1)  ->  never
-             // L_adr = base + 16 + 8*i      ->  always            L_adr = base + 16 + 8*i      ->  always
-             // -> vectorize                                       -> no vectorization
          }
      }
  
      @Run(test = {"testByteLong3a", "testByteLong3b"})
      public static void testByteLong3_runner() {
--- 245,28 ---

*** 354,40 ***
          runAndVerify(() -> testByteLong4b(byteArray, longArray, 0, size), 0);
      }
  
      @Test
      @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" },
-         applyIfOr = {"UseCompactObjectHeaders", "false", "AlignVector", "false"},
          applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"},
          applyIfPlatform = {"64-bit", "true"})
      // 32-bit: offsets are badly aligned (UNSAFE.ARRAY_BYTE_BASE_OFFSET is 4 byte aligned, but not 8 byte aligned).
      //         might get fixed with JDK-8325155.
      public static void testByteLong5a(byte[] dest, long[] src, int start, int stop) {
          for (int i = start; i < stop; i++) {
              UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * (i + baseOffset), handleByteOrder(src[i]));
-             // With AlignVector, we need 8-byte alignment of vector loads/stores.
-             // UseCompactObjectHeaders=false                      UseCompactObjectHeaders=true
-             // B_adr = base + 16 + 8*(i+x)  ->  always            B_adr = base + 12 + 8*(i+x)  ->  never
-             // L_adr = base + 16 + 8*i      ->  always            L_adr = base + 16 + 8*i      ->  always
-             // -> vectorize                                       -> no vectorization
          }
      }
  
      @Test
      @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" },
-         applyIfOr = {"UseCompactObjectHeaders", "false", "AlignVector", "false"},
          applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"},
          applyIfPlatform = {"64-bit", "true"})
      // 32-bit: address has ConvL2I for cast of long to address, not supported.
      public static void testByteLong5b(byte[] dest, long[] src, int start, int stop) {
          for (int i = start; i < stop; i++) {
              UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8L * (i + baseOffset), handleByteOrder(src[i]));
-             // With AlignVector, we need 8-byte alignment of vector loads/stores.
-             // UseCompactObjectHeaders=false                      UseCompactObjectHeaders=true
-             // B_adr = base + 16 + 8*(i+x)  ->  always            B_adr = base + 12 + 8*(i+x)  ->  never
-             // L_adr = base + 16 + 8*i      ->  always            L_adr = base + 16 + 8*i      ->  always
-             // -> vectorize                                       -> no vectorization
          }
      }
  
      @Run(test = {"testByteLong5a", "testByteLong5b"})
      public static void testByteLong5_runner() {
--- 308,28 ---

*** 396,40 ***
          runAndVerify(() -> testByteLong5b(byteArray, longArray, 0, size-1), 8);
      }
  
      @Test
      @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" },
-         applyIfOr = {"UseCompactObjectHeaders", "false", "AlignVector", "false"},
          applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"},
          applyIfPlatform = {"64-bit", "true"})
      // 32-bit: offsets are badly aligned (UNSAFE.ARRAY_BYTE_BASE_OFFSET is 4 byte aligned, but not 8 byte aligned).
      //         might get fixed with JDK-8325155.
      public static void testByteByte1a(byte[] dest, byte[] src) {
          for (int i = 0; i < src.length / 8; i++) {
              UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * i, UNSAFE.getLongUnaligned(src, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * i));
-             // With AlignVector, we need 8-byte alignment of vector loads/stores.
-             // UseCompactObjectHeaders=false                    UseCompactObjectHeaders=true
-             // src_adr = base + 16 + 8*i  ->  always            src_adr = base + 12 + 8*i  ->  never
-             // dst_adr = base + 16 + 8*i  ->  always            dst_adr = base + 12 + 8*i  ->  never
-             // -> vectorize                                     -> no vectorization
          }
      }
  
      @Test
      @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" },
-         applyIfOr = {"UseCompactObjectHeaders", "false", "AlignVector", "false"},
          applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"},
          applyIfPlatform = {"64-bit", "true"})
      // 32-bit: address has ConvL2I for cast of long to address, not supported.
      public static void testByteByte1b(byte[] dest, byte[] src) {
          for (int i = 0; i < src.length / 8; i++) {
              UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8L * i, UNSAFE.getLongUnaligned(src, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8L * i));
-             // With AlignVector, we need 8-byte alignment of vector loads/stores.
-             // UseCompactObjectHeaders=false                    UseCompactObjectHeaders=true
-             // src_adr = base + 16 + 8*i  ->  always            src_adr = base + 12 + 8*i  ->  never
-             // dst_adr = base + 16 + 8*i  ->  always            dst_adr = base + 12 + 8*i  ->  never
-             // -> vectorize                                     -> no vectorization
          }
      }
  
      @Run(test = {"testByteByte1a", "testByteByte1b"})
      public static void testByteByte1_runner() {
--- 338,28 ---

*** 437,40 ***
          runAndVerify2(() -> testByteByte1b(byteArray, byteArray), 0);
      }
  
      @Test
      @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" },
-         applyIfOr = {"UseCompactObjectHeaders", "false", "AlignVector", "false"},
          applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"},
          applyIfPlatform = {"64-bit", "true"})
      // 32-bit: offsets are badly aligned (UNSAFE.ARRAY_BYTE_BASE_OFFSET is 4 byte aligned, but not 8 byte aligned).
      //         might get fixed with JDK-8325155.
      public static void testByteByte2a(byte[] dest, byte[] src) {
          for (int i = 1; i < src.length / 8; i++) {
              UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * (i - 1), UNSAFE.getLongUnaligned(src, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * i));
-             // With AlignVector, we need 8-byte alignment of vector loads/stores.
-             // UseCompactObjectHeaders=false                        UseCompactObjectHeaders=true
-             // src_adr = base + 16 + 8*i      ->  always            src_adr = base + 12 + 8*i      ->  never
-             // dst_adr = base + 16 + 8*(i-1)  ->  always            dst_adr = base + 12 + 8*(i-1)  ->  never
-             // -> vectorize                                         -> no vectorization
          }
      }
  
      @Test
      @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" },
-         applyIfOr = {"UseCompactObjectHeaders", "false", "AlignVector", "false"},
          applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"},
          applyIfPlatform = {"64-bit", "true"})
      // 32-bit: address has ConvL2I for cast of long to address, not supported.
      public static void testByteByte2b(byte[] dest, byte[] src) {
          for (int i = 1; i < src.length / 8; i++) {
              UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8L * (i - 1), UNSAFE.getLongUnaligned(src, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8L * i));
-             // With AlignVector, we need 8-byte alignment of vector loads/stores.
-             // UseCompactObjectHeaders=false                        UseCompactObjectHeaders=true
-             // src_adr = base + 16 + 8*i      ->  always            src_adr = base + 12 + 8*i      ->  never
-             // dst_adr = base + 16 + 8*(i-1)  ->  always            dst_adr = base + 12 + 8*(i-1)  ->  never
-             // -> vectorize                                         -> no vectorization
          }
      }
  
      @Run(test = {"testByteByte2a", "testByteByte2b"})
      public static void testByteByte2_runner() {
--- 367,28 ---
< prev index next >