Search in sources :

Example 6 with Architecture

use of jdk.vm.ci.code.Architecture in project graal by oracle.

the class BitOpNodesTest method testBitCountIntEmpty.

@Test
public void testBitCountIntEmpty() {
    Architecture arch = getBackend().getTarget().arch;
    boolean isAmd64WithPopCount = arch instanceof AMD64 && ((AMD64) arch).getFeatures().contains(AMD64.CPUFeature.POPCNT);
    boolean isSparc = arch instanceof SPARC;
    Assume.assumeTrue("Only works on hardware with popcnt at the moment", isAmd64WithPopCount || isSparc);
    ValueNode result = parseAndInline("bitCountIntEmptySnippet");
    Assert.assertEquals(StampFactory.forInteger(JavaKind.Int, 0, 24), result.stamp(NodeView.DEFAULT));
}
Also used : AMD64(jdk.vm.ci.amd64.AMD64) SPARC(jdk.vm.ci.sparc.SPARC) Architecture(jdk.vm.ci.code.Architecture) ValueNode(org.graalvm.compiler.nodes.ValueNode) Test(org.junit.Test) GraalCompilerTest(org.graalvm.compiler.core.test.GraalCompilerTest)

Example 7 with Architecture

use of jdk.vm.ci.code.Architecture in project graal by oracle.

the class BitOpNodesTest method testBitCountInt.

@Test
public void testBitCountInt() {
    Architecture arch = getBackend().getTarget().arch;
    boolean isAmd64WithPopCount = arch instanceof AMD64 && ((AMD64) arch).getFeatures().contains(AMD64.CPUFeature.POPCNT);
    boolean isSparc = arch instanceof SPARC;
    Assume.assumeTrue("Only works on hardware with popcnt at the moment", isAmd64WithPopCount || isSparc);
    ValueNode result = parseAndInline("bitCountIntSnippet");
    Assert.assertEquals(StampFactory.forInteger(JavaKind.Int, 8, 24), result.stamp(NodeView.DEFAULT));
}
Also used : AMD64(jdk.vm.ci.amd64.AMD64) SPARC(jdk.vm.ci.sparc.SPARC) Architecture(jdk.vm.ci.code.Architecture) ValueNode(org.graalvm.compiler.nodes.ValueNode) Test(org.junit.Test) GraalCompilerTest(org.graalvm.compiler.core.test.GraalCompilerTest)

Example 8 with Architecture

use of jdk.vm.ci.code.Architecture in project graal by oracle.

the class BitOpNodesTest method testBitCountLongEmpty.

@Test
public void testBitCountLongEmpty() {
    Architecture arch = getBackend().getTarget().arch;
    boolean isAmd64WithPopCount = arch instanceof AMD64 && ((AMD64) arch).getFeatures().contains(AMD64.CPUFeature.POPCNT);
    boolean isSparc = arch instanceof SPARC;
    Assume.assumeTrue("Only works on hardware with popcnt at the moment", isAmd64WithPopCount || isSparc);
    ValueNode result = parseAndInline("bitCountLongEmptySnippet");
    Assert.assertEquals(StampFactory.forInteger(JavaKind.Int, 0, 40), result.stamp(NodeView.DEFAULT));
}
Also used : AMD64(jdk.vm.ci.amd64.AMD64) SPARC(jdk.vm.ci.sparc.SPARC) Architecture(jdk.vm.ci.code.Architecture) ValueNode(org.graalvm.compiler.nodes.ValueNode) Test(org.junit.Test) GraalCompilerTest(org.graalvm.compiler.core.test.GraalCompilerTest)

Aggregations

Architecture (jdk.vm.ci.code.Architecture)8 AMD64 (jdk.vm.ci.amd64.AMD64)5 SPARC (jdk.vm.ci.sparc.SPARC)5 GraalCompilerTest (org.graalvm.compiler.core.test.GraalCompilerTest)4 ValueNode (org.graalvm.compiler.nodes.ValueNode)4 Test (org.junit.Test)4 TargetDescription (jdk.vm.ci.code.TargetDescription)3 AllocationSite (com.oracle.svm.core.allocationprofile.AllocationSite)1 CEntryPointOptions (com.oracle.svm.core.c.function.CEntryPointOptions)1 SubstrateTargetDescription (com.oracle.svm.core.graal.meta.SubstrateTargetDescription)1 RuntimeSupport (com.oracle.svm.core.jdk.RuntimeSupport)1 AArch64 (jdk.vm.ci.aarch64.AArch64)1 Platform (org.graalvm.nativeimage.Platform)1 CEntryPoint (org.graalvm.nativeimage.c.function.CEntryPoint)1