< prev index next >

test/jdk/jdk/incubator/vector/Double128VectorTests.java

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2018, 2024, 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.
--- 1,7 ---
  /*
!  * Copyright (c) 2018, 2025, 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.

*** 60,10 ***
--- 60,12 ---
      static final VectorSpecies<Double> SPECIES =
                  DoubleVector.SPECIES_128;
  
      static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
  
+     static DoubleVector bcast_vec = DoubleVector.broadcast(SPECIES, (double)10);
+ 
  
      // for floating point addition reduction ops that may introduce rounding errors
      private static final double RELATIVE_ROUNDING_ERROR_FACTOR_ADD = (double)10.0;
  
      // for floating point multiplication reduction ops that may introduce rounding errors

*** 2094,110 ***
          }
  
          assertBroadcastLongArraysEquals(r, a, b, mask, Double128VectorTests::ADD);
      }
  
-     static DoubleVector bv_MIN = DoubleVector.broadcast(SPECIES, (double)10);
- 
      @Test(dataProvider = "doubleUnaryOpProvider")
      static void MINDouble128VectorTestsWithMemOp(IntFunction<double[]> fa) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
  
          for (int ic = 0; ic < INVOC_COUNT; ic++) {
              for (int i = 0; i < a.length; i += SPECIES.length()) {
                  DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
!                 av.lanewise(VectorOperators.MIN, bv_MIN).intoArray(r, i);
              }
          }
  
          assertArraysEquals(r, a, (double)10, Double128VectorTests::MIN);
      }
  
-     static DoubleVector bv_min = DoubleVector.broadcast(SPECIES, (double)10);
- 
      @Test(dataProvider = "doubleUnaryOpProvider")
      static void minDouble128VectorTestsWithMemOp(IntFunction<double[]> fa) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
  
          for (int ic = 0; ic < INVOC_COUNT; ic++) {
              for (int i = 0; i < a.length; i += SPECIES.length()) {
                  DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
!                 av.min(bv_min).intoArray(r, i);
              }
          }
  
          assertArraysEquals(r, a, (double)10, Double128VectorTests::min);
      }
  
-     static DoubleVector bv_MIN_M = DoubleVector.broadcast(SPECIES, (double)10);
- 
      @Test(dataProvider = "doubleUnaryOpMaskProvider")
      static void MINDouble128VectorTestsMaskedWithMemOp(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());
          VectorMask<Double> vmask = VectorMask.fromArray(SPECIES, mask, 0);
  
          for (int ic = 0; ic < INVOC_COUNT; ic++) {
              for (int i = 0; i < a.length; i += SPECIES.length()) {
                  DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
!                 av.lanewise(VectorOperators.MIN, bv_MIN_M, vmask).intoArray(r, i);
              }
          }
  
          assertArraysEquals(r, a, (double)10, mask, Double128VectorTests::MIN);
      }
  
-     static DoubleVector bv_MAX = DoubleVector.broadcast(SPECIES, (double)10);
- 
      @Test(dataProvider = "doubleUnaryOpProvider")
      static void MAXDouble128VectorTestsWithMemOp(IntFunction<double[]> fa) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
  
          for (int ic = 0; ic < INVOC_COUNT; ic++) {
              for (int i = 0; i < a.length; i += SPECIES.length()) {
                  DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
!                 av.lanewise(VectorOperators.MAX, bv_MAX).intoArray(r, i);
              }
          }
  
          assertArraysEquals(r, a, (double)10, Double128VectorTests::MAX);
      }
  
-     static DoubleVector bv_max = DoubleVector.broadcast(SPECIES, (double)10);
- 
      @Test(dataProvider = "doubleUnaryOpProvider")
      static void maxDouble128VectorTestsWithMemOp(IntFunction<double[]> fa) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
  
          for (int ic = 0; ic < INVOC_COUNT; ic++) {
              for (int i = 0; i < a.length; i += SPECIES.length()) {
                  DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
!                 av.max(bv_max).intoArray(r, i);
              }
          }
  
          assertArraysEquals(r, a, (double)10, Double128VectorTests::max);
      }
  
-     static DoubleVector bv_MAX_M = DoubleVector.broadcast(SPECIES, (double)10);
- 
      @Test(dataProvider = "doubleUnaryOpMaskProvider")
      static void MAXDouble128VectorTestsMaskedWithMemOp(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());
          VectorMask<Double> vmask = VectorMask.fromArray(SPECIES, mask, 0);
  
          for (int ic = 0; ic < INVOC_COUNT; ic++) {
              for (int i = 0; i < a.length; i += SPECIES.length()) {
                  DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
!                 av.lanewise(VectorOperators.MAX, bv_MAX_M, vmask).intoArray(r, i);
              }
          }
  
          assertArraysEquals(r, a, (double)10, mask, Double128VectorTests::MAX);
      }
--- 2096,98 ---
          }
  
          assertBroadcastLongArraysEquals(r, a, b, mask, Double128VectorTests::ADD);
      }
  
      @Test(dataProvider = "doubleUnaryOpProvider")
      static void MINDouble128VectorTestsWithMemOp(IntFunction<double[]> fa) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
  
          for (int ic = 0; ic < INVOC_COUNT; ic++) {
              for (int i = 0; i < a.length; i += SPECIES.length()) {
                  DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
!                 av.lanewise(VectorOperators.MIN, bcast_vec).intoArray(r, i);
              }
          }
  
          assertArraysEquals(r, a, (double)10, Double128VectorTests::MIN);
      }
  
      @Test(dataProvider = "doubleUnaryOpProvider")
      static void minDouble128VectorTestsWithMemOp(IntFunction<double[]> fa) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
  
          for (int ic = 0; ic < INVOC_COUNT; ic++) {
              for (int i = 0; i < a.length; i += SPECIES.length()) {
                  DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
!                 av.min(bcast_vec).intoArray(r, i);
              }
          }
  
          assertArraysEquals(r, a, (double)10, Double128VectorTests::min);
      }
  
      @Test(dataProvider = "doubleUnaryOpMaskProvider")
      static void MINDouble128VectorTestsMaskedWithMemOp(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());
          VectorMask<Double> vmask = VectorMask.fromArray(SPECIES, mask, 0);
  
          for (int ic = 0; ic < INVOC_COUNT; ic++) {
              for (int i = 0; i < a.length; i += SPECIES.length()) {
                  DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
!                 av.lanewise(VectorOperators.MIN, bcast_vec, vmask).intoArray(r, i);
              }
          }
  
          assertArraysEquals(r, a, (double)10, mask, Double128VectorTests::MIN);
      }
  
      @Test(dataProvider = "doubleUnaryOpProvider")
      static void MAXDouble128VectorTestsWithMemOp(IntFunction<double[]> fa) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
  
          for (int ic = 0; ic < INVOC_COUNT; ic++) {
              for (int i = 0; i < a.length; i += SPECIES.length()) {
                  DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
!                 av.lanewise(VectorOperators.MAX, bcast_vec).intoArray(r, i);
              }
          }
  
          assertArraysEquals(r, a, (double)10, Double128VectorTests::MAX);
      }
  
      @Test(dataProvider = "doubleUnaryOpProvider")
      static void maxDouble128VectorTestsWithMemOp(IntFunction<double[]> fa) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
  
          for (int ic = 0; ic < INVOC_COUNT; ic++) {
              for (int i = 0; i < a.length; i += SPECIES.length()) {
                  DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
!                 av.max(bcast_vec).intoArray(r, i);
              }
          }
  
          assertArraysEquals(r, a, (double)10, Double128VectorTests::max);
      }
  
      @Test(dataProvider = "doubleUnaryOpMaskProvider")
      static void MAXDouble128VectorTestsMaskedWithMemOp(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());
          VectorMask<Double> vmask = VectorMask.fromArray(SPECIES, mask, 0);
  
          for (int ic = 0; ic < INVOC_COUNT; ic++) {
              for (int i = 0; i < a.length; i += SPECIES.length()) {
                  DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
!                 av.lanewise(VectorOperators.MAX, bcast_vec, vmask).intoArray(r, i);
              }
          }
  
          assertArraysEquals(r, a, (double)10, mask, Double128VectorTests::MAX);
      }
< prev index next >