< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.jdk9.test/src/org/graalvm/compiler/hotspot/jdk9/test/MathDoubleFMATest.java

Print this page
rev 56282 : [mq]: graal


  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 
  25 package org.graalvm.compiler.hotspot.jdk9.test;
  26 
  27 import static org.junit.Assume.assumeTrue;
  28 
  29 import java.util.ArrayList;
  30 import java.util.Collection;
  31 import java.util.List;
  32 
  33 import org.graalvm.compiler.api.test.Graal;
  34 import org.graalvm.compiler.core.test.GraalCompilerTest;
  35 import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider;
  36 import org.graalvm.compiler.runtime.RuntimeProvider;
  37 import org.graalvm.compiler.test.AddExports;
  38 import org.junit.Before;
  39 import org.junit.Test;
  40 import org.junit.runner.RunWith;
  41 import org.junit.runners.Parameterized;
  42 import org.junit.runners.Parameterized.Parameter;
  43 import org.junit.runners.Parameterized.Parameters;
  44 
  45 import jdk.vm.ci.amd64.AMD64;
  46 
  47 @AddExports({"java.base/java.lang"})
  48 @RunWith(Parameterized.class)
  49 public final class MathDoubleFMATest extends GraalCompilerTest {
  50 
  51     @Before
  52     public void checkAMD64() {
  53         assumeTrue("skipping AMD64 specific test", getTarget().arch instanceof AMD64);
  54         HotSpotGraalRuntimeProvider rt = (HotSpotGraalRuntimeProvider) Graal.getRequiredCapability(RuntimeProvider.class);
  55         assumeTrue("skipping FMA specific test", rt.getVMConfig().useFMAIntrinsics);
  56     }
  57 
  58     @Parameters(name = "{0}, {1}, {2}")
  59     public static Collection<Object[]> data() {
  60         double[] inputs = {0.0d, 1.0d, 4.0d, -0.0d, -1.0d, -4.0d, Double.MIN_VALUE, Double.MAX_VALUE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
  61                         Double.NaN, Double.longBitsToDouble(0xfff0000000000001L)};
  62 
  63         List<Object[]> tests = new ArrayList<>();
  64         for (double a : inputs) {
  65             for (double b : inputs) {
  66                 for (double c : inputs) {
  67                     tests.add(new Object[]{a, b, c});


  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 
  25 package org.graalvm.compiler.hotspot.jdk9.test;
  26 
  27 import static org.junit.Assume.assumeTrue;
  28 
  29 import java.util.ArrayList;
  30 import java.util.Collection;
  31 import java.util.List;
  32 
  33 import org.graalvm.compiler.api.test.Graal;
  34 import org.graalvm.compiler.core.test.GraalCompilerTest;
  35 import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider;
  36 import org.graalvm.compiler.runtime.RuntimeProvider;

  37 import org.junit.Before;
  38 import org.junit.Test;
  39 import org.junit.runner.RunWith;
  40 import org.junit.runners.Parameterized;
  41 import org.junit.runners.Parameterized.Parameter;
  42 import org.junit.runners.Parameterized.Parameters;
  43 
  44 import jdk.vm.ci.amd64.AMD64;
  45 

  46 @RunWith(Parameterized.class)
  47 public final class MathDoubleFMATest extends GraalCompilerTest {
  48 
  49     @Before
  50     public void checkAMD64() {
  51         assumeTrue("skipping AMD64 specific test", getTarget().arch instanceof AMD64);
  52         HotSpotGraalRuntimeProvider rt = (HotSpotGraalRuntimeProvider) Graal.getRequiredCapability(RuntimeProvider.class);
  53         assumeTrue("skipping FMA specific test", rt.getVMConfig().useFMAIntrinsics);
  54     }
  55 
  56     @Parameters(name = "{0}, {1}, {2}")
  57     public static Collection<Object[]> data() {
  58         double[] inputs = {0.0d, 1.0d, 4.0d, -0.0d, -1.0d, -4.0d, Double.MIN_VALUE, Double.MAX_VALUE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
  59                         Double.NaN, Double.longBitsToDouble(0xfff0000000000001L)};
  60 
  61         List<Object[]> tests = new ArrayList<>();
  62         for (double a : inputs) {
  63             for (double b : inputs) {
  64                 for (double c : inputs) {
  65                     tests.add(new Object[]{a, b, c});
< prev index next >