当前位置: 首页>>代码示例>>Java>>正文


Java SPARC类代码示例

本文整理汇总了Java中jdk.vm.ci.sparc.SPARC的典型用法代码示例。如果您正苦于以下问题:Java SPARC类的具体用法?Java SPARC怎么用?Java SPARC使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SPARC类属于jdk.vm.ci.sparc包,在下文中一共展示了SPARC类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createNativeABICallerSaveRegisters

import jdk.vm.ci.sparc.SPARC; //导入依赖的package包/类
@SuppressWarnings("unused")
private static Value[] createNativeABICallerSaveRegisters(GraalHotSpotVMConfig config, RegisterConfig regConfig) {
    Set<Register> callerSavedRegisters = new HashSet<>();
    SPARC.fpusRegisters.addTo(callerSavedRegisters);
    SPARC.fpudRegisters.addTo(callerSavedRegisters);
    callerSavedRegisters.add(SPARC.g1);
    callerSavedRegisters.add(SPARC.g4);
    callerSavedRegisters.add(SPARC.g5);
    Value[] nativeABICallerSaveRegisters = new Value[callerSavedRegisters.size()];
    int i = 0;
    for (Register reg : callerSavedRegisters) {
        nativeABICallerSaveRegisters[i] = reg.asValue();
        i++;
    }
    return nativeABICallerSaveRegisters;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:SPARCHotSpotBackendFactory.java

示例2: emitCode

import jdk.vm.ci.sparc.SPARC; //导入依赖的package包/类
@Override
protected void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) {
    try (ScratchRegister tmpScratch = masm.getScratchRegister()) {
        Register tmp = tmpScratch.getRegister();
        Register resultRegister = asRegister(result, WORD);
        Register xRegister = asRegister(x, WORD);
        Register yRegister = asRegister(y, WORD);
        masm.sra(xRegister, 0, xRegister);
        masm.sra(yRegister, 0, yRegister);
        masm.mulx(xRegister, yRegister, resultRegister);
        Label noOverflow = new Label();
        masm.sra(resultRegister, 0, tmp);
        masm.compareBranch(tmp, resultRegister, Equal, Xcc, noOverflow, PREDICT_TAKEN, null);
        masm.wrccr(SPARC.g0, 1 << (SPARCAssembler.CCR_ICC_SHIFT + SPARCAssembler.CCR_V_SHIFT));
        masm.bind(noOverflow);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:SPARCArithmetic.java

示例3: emitDiv

import jdk.vm.ci.sparc.SPARC; //导入依赖的package包/类
@Override
public Value emitDiv(Value a, Value b, LIRFrameState state) {
    LIRKind resultKind = LIRKind.combine(a, b);
    PlatformKind aKind = a.getPlatformKind();
    PlatformKind bKind = b.getPlatformKind();
    if (isJavaConstant(b) && asJavaConstant(b).isDefaultForKind()) { // Div by zero
        Value zero = SPARC.g0.asValue(LIRKind.value(SPARCKind.WORD));
        return emitBinary(resultKind, Op3s.Sdivx, zero, zero, state);
    } else if (isNumericInteger(aKind)) {
        Value fixedA = emitSignExtend(a, aKind.getSizeInBytes() * 8, 64);
        Value fixedB = emitSignExtend(b, bKind.getSizeInBytes() * 8, 64);
        return emitBinary(resultKind, Op3s.Sdivx, fixedA, fixedB, state);
    } else {
        boolean isDouble = a.getPlatformKind().equals(DOUBLE);
        return emitBinary(resultKind, isDouble ? Opfs.Fdivd : Opfs.Fdivs, a, b, state);
    }
}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:18,代码来源:SPARCArithmeticLIRGenerator.java

示例4: createTarget

import jdk.vm.ci.sparc.SPARC; //导入依赖的package包/类
private static TargetDescription createTarget() {
    final int stackFrameAlignment = 16;
    final int implicitNullCheckLimit = 4096;
    final boolean inlineObjects = true;
    Architecture arch = new SPARC(computeFeatures());
    return new TargetDescription(arch, true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:SPARCAssemblerTest.java

示例5: emitDiv

import jdk.vm.ci.sparc.SPARC; //导入依赖的package包/类
@Override
public Value emitDiv(Value a, Value b, LIRFrameState state) {
    LIRKind resultKind = LIRKind.combine(a, b);
    if (isJavaConstant(b) && asJavaConstant(b).isDefaultForKind()) { // Div by zero
        Value zero = SPARC.g0.asValue(LIRKind.value(SPARCKind.WORD));
        return emitBinary(resultKind, Op3s.Sdivx, zero, zero, state);
    } else if (isNumericInteger(a.getPlatformKind())) {
        return emitBinary(resultKind, Op3s.Sdivx, emitSignExtend(a), emitSignExtend(b), state);
    } else {
        boolean isDouble = a.getPlatformKind() == DOUBLE;
        return emitBinary(resultKind, isDouble ? Opfs.Fdivd : Opfs.Fdivs, a, b, state);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:SPARCArithmeticLIRGenerator.java

示例6: asAddressValue

import jdk.vm.ci.sparc.SPARC; //导入依赖的package包/类
public SPARCAddressValue asAddressValue(Value address) {
    if (address instanceof SPARCAddressValue) {
        return (SPARCAddressValue) address;
    } else {
        ValueKind<?> kind = address.getValueKind();
        if (address instanceof JavaConstant) {
            long displacement = ((JavaConstant) address).asLong();
            if (SPARCAssembler.isSimm13(displacement)) {
                return new SPARCImmediateAddressValue(kind, SPARC.g0.asValue(kind), (int) displacement);
            }
        }
        return new SPARCImmediateAddressValue(kind, asAllocatable(address), 0);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:SPARCLIRGenerator.java

示例7: testBitCountInt

import jdk.vm.ci.sparc.SPARC; //导入依赖的package包/类
@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());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:BitOpNodesTest.java

示例8: testBitCountIntEmpty

import jdk.vm.ci.sparc.SPARC; //导入依赖的package包/类
@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());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:BitOpNodesTest.java

示例9: testBitCountLong

import jdk.vm.ci.sparc.SPARC; //导入依赖的package包/类
@Test
public void testBitCountLong() {
    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("bitCountLongSnippet");
    Assert.assertEquals(StampFactory.forInteger(JavaKind.Int, 8, 40), result.stamp());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:BitOpNodesTest.java

示例10: testBitCountLongEmpty

import jdk.vm.ci.sparc.SPARC; //导入依赖的package包/类
@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());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:BitOpNodesTest.java

示例11: testBailoutOnBranchOverflow

import jdk.vm.ci.sparc.SPARC; //导入依赖的package包/类
@SuppressWarnings("try")
@Test
public void testBailoutOnBranchOverflow() throws Throwable {
    Assume.assumeTrue(getBackend().getTarget().arch instanceof SPARC);
    ResolvedJavaMethod m = getResolvedJavaMethod("testBranch");
    DebugContext debug = getDebugContext();
    try {
        try (Scope s = debug.disable()) {
            StructuredGraph graph = parseEager(m, AllowAssumptions.YES, debug);
            compile(m, graph);
        }
    } catch (GraalError e) {
        Assert.assertEquals(PermanentBailoutException.class, e.getCause().getClass());
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:SPARCBranchBailoutTest.java

示例12: createTarget

import jdk.vm.ci.sparc.SPARC; //导入依赖的package包/类
protected TargetDescription createTarget(SPARCHotSpotVMConfig config) {
    final int stackFrameAlignment = 16;
    final int implicitNullCheckLimit = 4096;
    final boolean inlineObjects = false;
    Architecture arch = new SPARC(computeFeatures(config));
    return new TargetDescription(arch, true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:SPARCHotSpotJVMCIBackendFactory.java

示例13: SPARCHotSpotRegisterConfig

import jdk.vm.ci.sparc.SPARC; //导入依赖的package包/类
public SPARCHotSpotRegisterConfig(TargetDescription target, RegisterArray allocatable) {
    this.target = target;
    this.allocatable = allocatable;
    HashSet<Register> callerSaveSet = new HashSet<>(target.arch.getAvailableValueRegisters().asList());
    for (Register cs : windowSaveRegisters) {
        callerSaveSet.remove(cs);
    }
    this.callerSaveRegisters = new RegisterArray(callerSaveSet);
    attributesMap = RegisterAttributes.createMap(this, SPARC.allRegisters);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:SPARCHotSpotRegisterConfig.java

示例14: createAssembler

import jdk.vm.ci.sparc.SPARC; //导入依赖的package包/类
private TestAssembler createAssembler() {
    Architecture arch = codeCache.getTarget().arch;
    if (arch instanceof AMD64) {
        return new AMD64TestAssembler(codeCache, config);
    } else if (arch instanceof SPARC) {
        return new SPARCTestAssembler(codeCache, config);
    } else {
        Assert.fail("unsupported architecture");
        return null;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:CodeInstallationTest.java

示例15: emitLoad

import jdk.vm.ci.sparc.SPARC; //导入依赖的package包/类
@Override
public void emitLoad(AllocatableValue av, Object prim) {
    if (av instanceof RegisterValue) {
        Register reg = ((RegisterValue) av).getRegister();
        RegisterCategory cat = reg.getRegisterCategory();
        if (cat.equals(SPARC.FPUs)) {
            emitLoadFloat(reg, (Float) prim, scratchRegister);
        } else if (cat.equals(SPARC.FPUd)) {
            emitLoadDouble(reg, (Double) prim, scratchRegister);
        } else if (prim instanceof Integer) {
            loadIntToRegister((Integer) prim, reg);
        } else if (prim instanceof Long) {
            loadLongToRegister((Long) prim, reg);
        }
    } else if (av instanceof StackSlot) {
        StackSlot slot = (StackSlot) av;
        if (prim instanceof Float) {
            floatToStack(emitLoadFloat(floatScratch, (Float) prim, scratchRegister), slot);
        } else if (prim instanceof Double) {
            doubleToStack(emitLoadDouble(doubleScratch, (Double) prim, scratchRegister), slot);
        } else if (prim instanceof Integer) {
            intToStack(loadIntToRegister((Integer) prim, scratchRegister), slot);
        } else if (prim instanceof Long) {
            longToStack(emitLoadLongToRegister((Long) prim, scratchRegister), slot);
        }
    } else {
        throw new IllegalArgumentException("Unknown value " + av);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:SPARCTestAssembler.java


注:本文中的jdk.vm.ci.sparc.SPARC类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。