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


Java SPARCKind类代码示例

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


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

示例1: emitMathAbs

import jdk.vm.ci.sparc.SPARCKind; //导入依赖的package包/类
@Override
public Value emitMathAbs(Value inputValue) {
    Variable result = getLIRGen().newVariable(LIRKind.combine(inputValue));
    SPARCKind kind = (SPARCKind) inputValue.getPlatformKind();
    Opfs opf;
    switch (kind) {
        case SINGLE:
            opf = Opfs.Fabss;
            break;
        case DOUBLE:
            opf = Opfs.Fabsd;
            break;
        default:
            throw GraalError.shouldNotReachHere("Input kind: " + kind);
    }
    getLIRGen().append(new SPARCOPFOp(opf, g0.asValue(), getLIRGen().asAllocatable(inputValue), result));
    return result;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:SPARCArithmeticLIRGenerator.java

示例2: emitMathSqrt

import jdk.vm.ci.sparc.SPARCKind; //导入依赖的package包/类
@Override
public Value emitMathSqrt(Value inputValue) {
    Variable result = getLIRGen().newVariable(LIRKind.combine(inputValue));
    SPARCKind kind = (SPARCKind) inputValue.getPlatformKind();
    Opfs opf;
    switch (kind) {
        case SINGLE:
            opf = Opfs.Fsqrts;
            break;
        case DOUBLE:
            opf = Opfs.Fsqrtd;
            break;
        default:
            throw GraalError.shouldNotReachHere("Input kind: " + kind);
    }
    getLIRGen().append(new SPARCOPFOp(opf, g0.asValue(), getLIRGen().asAllocatable(inputValue), result));
    return result;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:SPARCArithmeticLIRGenerator.java

示例3: emitURem

import jdk.vm.ci.sparc.SPARCKind; //导入依赖的package包/类
@Override
public Value emitURem(Value a, Value b, LIRFrameState state) {
    Variable result = getLIRGen().newVariable(LIRKind.combine(a, b));
    Variable scratch1 = getLIRGen().newVariable(LIRKind.combine(a, b));
    Variable scratch2 = getLIRGen().newVariable(LIRKind.combine(a, b));
    Rem opcode;
    switch (((SPARCKind) a.getPlatformKind())) {
        case WORD:
            opcode = Rem.IUREM;
            break;
        case XWORD:
            opcode = Rem.LUREM;
            break;
        default:
            throw GraalError.shouldNotReachHere();
    }
    getLIRGen().append(new RemOp(opcode, result, getLIRGen().asAllocatable(a), getLIRGen().asAllocatable(b), scratch1, scratch2, state));
    return result;

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:SPARCArithmeticLIRGenerator.java

示例4: emitShl

import jdk.vm.ci.sparc.SPARCKind; //导入依赖的package包/类
@Override
public Variable emitShl(Value a, Value b) {
    SPARCKind aKind = (SPARCKind) a.getPlatformKind();
    LIRKind resultKind = LIRKind.combine(a, b).changeType(aKind);
    Op3s op;
    switch (aKind) {
        case WORD:
            op = Op3s.Sll;
            break;
        case XWORD:
            op = Op3s.Sllx;
            break;
        default:
            throw GraalError.shouldNotReachHere(String.format("Unsupported kind %s", aKind));
    }
    return emitBinary(resultKind, op, a, b);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:SPARCArithmeticLIRGenerator.java

示例5: emitShr

import jdk.vm.ci.sparc.SPARCKind; //导入依赖的package包/类
@Override
public Variable emitShr(Value a, Value b) {
    SPARCKind aKind = (SPARCKind) a.getPlatformKind();
    LIRKind resultKind = LIRKind.combine(a, b).changeType(aKind);
    Op3s op;
    switch (aKind) {
        case WORD:
            op = Op3s.Sra;
            break;
        case XWORD:
            op = Op3s.Srax;
            break;
        default:
            throw GraalError.shouldNotReachHere();
    }
    return emitBinary(resultKind, op, a, b);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:SPARCArithmeticLIRGenerator.java

示例6: emitUShr

import jdk.vm.ci.sparc.SPARCKind; //导入依赖的package包/类
@Override
public Variable emitUShr(Value a, Value b) {
    SPARCKind aKind = (SPARCKind) a.getPlatformKind();
    LIRKind resultKind = LIRKind.combine(a, b).changeType(aKind);
    Op3s op;
    switch (aKind) {
        case WORD:
            op = Op3s.Srl;
            break;
        case XWORD:
            op = Op3s.Srlx;
            break;
        default:
            throw GraalError.shouldNotReachHere();
    }
    return emitBinary(resultKind, op, a, b);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:SPARCArithmeticLIRGenerator.java

示例7: emitReinterpret

import jdk.vm.ci.sparc.SPARCKind; //导入依赖的package包/类
@Override
public AllocatableValue emitReinterpret(LIRKind to, Value inputVal) {
    SPARCKind fromKind = (SPARCKind) inputVal.getPlatformKind();
    SPARCKind toKind = (SPARCKind) to.getPlatformKind();
    AllocatableValue input = getLIRGen().asAllocatable(inputVal);
    Variable result = getLIRGen().newVariable(to);
    // These cases require a move between CPU and FPU registers:
    if (fromKind.isFloat() != toKind.isFloat()) {
        moveBetweenFpGp(result, input);
        return result;
    } else {
        // Otherwise, just emit an ordinary move instruction.
        // Instructions that move or generate 32-bit register values also set the upper 32
        // bits of the register to zero.
        // Consequently, there is no need for a special zero-extension move.
        return emitConvertMove(to, input);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:SPARCArithmeticLIRGenerator.java

示例8: zapValueForKind

import jdk.vm.ci.sparc.SPARCKind; //导入依赖的package包/类
@Override
protected JavaConstant zapValueForKind(PlatformKind kind) {
    long dead = 0xDEADDEADDEADDEADL;
    switch ((SPARCKind) kind) {
        case BYTE:
            return JavaConstant.forByte((byte) dead);
        case HWORD:
            return JavaConstant.forShort((short) dead);
        case WORD:
            return JavaConstant.forInt((int) dead);
        case XWORD:
            return JavaConstant.forLong(dead);
        case SINGLE:
        case V32_BYTE:
        case V32_HWORD:
            return JavaConstant.forFloat(Float.intBitsToFloat((int) dead));
        case DOUBLE:
        case V64_BYTE:
        case V64_HWORD:
        case V64_WORD:
            return JavaConstant.forDouble(Double.longBitsToDouble(dead));
        default:
            throw new IllegalArgumentException(kind.toString());
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:SPARCLIRGenerator.java

示例9: emitIntegerCompare

import jdk.vm.ci.sparc.SPARCKind; //导入依赖的package包/类
private boolean emitIntegerCompare(SPARCKind cmpKind, Value a, Value b) {
    boolean mirrored;
    assert cmpKind.isInteger();
    AllocatableValue left;
    Value right;
    if (LIRValueUtil.isVariable(b)) {
        left = load(b);
        right = loadSimm13(a);
        mirrored = true;
    } else {
        left = load(a);
        right = loadSimm13(b);
        mirrored = false;
    }
    int compareBytes = cmpKind.getSizeInBytes();
    // SPARC compares 32 or 64 bits
    if (compareBytes < left.getPlatformKind().getSizeInBytes()) {
        left = asAllocatable(arithmeticLIRGen.emitSignExtend(left, cmpKind.getSizeInBits(), XWORD.getSizeInBits()));
    }
    if (compareBytes < right.getPlatformKind().getSizeInBytes()) {
        right = arithmeticLIRGen.emitSignExtend(right, cmpKind.getSizeInBits(), XWORD.getSizeInBits());
    }
    append(SPARCOP3Op.newBinaryVoid(Subcc, left, right));
    return mirrored;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:SPARCLIRGenerator.java

示例10: emitCode

import jdk.vm.ci.sparc.SPARCKind; //导入依赖的package包/类
@Override
public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) {
    SPARCAddress addr = (SPARCAddress) crb.asAddress(tmpSlot);
    SPARCMove.emitStore(input, addr, result.getPlatformKind(), SPARCDelayedControlTransfer.DUMMY, null, crb, masm);
    if (addr.getIndex().equals(Register.None)) {
        Register tempReg = ValueUtil.asRegister(tempIndex, XWORD);
        masm.setx(addr.getDisplacement(), tempReg, false);
        addr = new SPARCAddress(addr.getBase(), tempReg);
    }
    getDelayedControlTransfer().emitControlTransfer(crb, masm);
    switch ((SPARCKind) input.getPlatformKind()) {
        case WORD:
            masm.lduwa(addr.getBase(), addr.getIndex(), asRegister(result, WORD), Asi.ASI_PRIMARY_LITTLE);
            break;
        case XWORD:
            masm.ldxa(addr.getBase(), addr.getIndex(), asRegister(result, XWORD), Asi.ASI_PRIMARY_LITTLE);
            break;
        default:
            throw GraalError.shouldNotReachHere();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:SPARCByteSwapOp.java

示例11: canUseShortBranch

import jdk.vm.ci.sparc.SPARCKind; //导入依赖的package包/类
private boolean canUseShortBranch(CompilationResultBuilder crb, SPARCAssembler asm, int position) {
    if (!asm.hasFeature(CPUFeature.CBCOND)) {
        return false;
    }
    if (!((SPARCKind) x.getPlatformKind()).isInteger()) {
        return false;
    }
    // Do not use short branch, if the y value is a constant and does not fit into simm5 but
    // fits into simm13; this means the code with CBcond would be longer as the code without
    // CBcond.
    if (isJavaConstant(y) && !isSimm5(asJavaConstant(y)) && isSimm13(asJavaConstant(y))) {
        return false;
    }
    boolean hasShortJumpTarget = false;
    if (!crb.isSuccessorEdge(trueDestination)) {
        hasShortJumpTarget |= isShortBranch(asm, position, trueDestinationHint, trueDestination.label());
    }
    if (!crb.isSuccessorEdge(falseDestination)) {
        hasShortJumpTarget |= isShortBranch(asm, position, falseDestinationHint, falseDestination.label());
    }
    return hasShortJumpTarget;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:SPARCControlFlow.java

示例12: emitDiv

import jdk.vm.ci.sparc.SPARCKind; //导入依赖的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

示例13: emitURem

import jdk.vm.ci.sparc.SPARCKind; //导入依赖的package包/类
@Override
public Value emitURem(Value a, Value b, LIRFrameState state) {
    Variable result = getLIRGen().newVariable(LIRKind.combine(a, b));
    Variable scratch1 = getLIRGen().newVariable(LIRKind.combine(a, b));
    Variable scratch2 = getLIRGen().newVariable(LIRKind.combine(a, b));
    Rem opcode;
    switch (((SPARCKind) a.getPlatformKind())) {
        case WORD:
            opcode = Rem.IUREM;
            break;
        case XWORD:
            opcode = Rem.LUREM;
            break;
        default:
            throw GraalError.shouldNotReachHere();
    }
    getLIRGen().append(new RemOp(opcode, result, getLIRGen().load(a), getLIRGen().load(b), scratch1, scratch2, state));
    return result;

}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:21,代码来源:SPARCArithmeticLIRGenerator.java

示例14: emitUDiv

import jdk.vm.ci.sparc.SPARCKind; //导入依赖的package包/类
@Override
public Value emitUDiv(Value a, Value b, LIRFrameState state) {
    Value actualA = a;
    Value actualB = b;
    switch (((SPARCKind) a.getPlatformKind())) {
        case WORD:
            actualA = emitZeroExtend(actualA, 32, 64);
            actualB = emitZeroExtend(actualB, 32, 64);
            break;
        case XWORD:
            break;
        default:
            throw GraalError.shouldNotReachHere();
    }
    return emitBinary(LIRKind.combine(actualA, actualB), Udivx, actualA, actualB, state);
}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:17,代码来源:SPARCArithmeticLIRGenerator.java

示例15: emitBitCount

import jdk.vm.ci.sparc.SPARCKind; //导入依赖的package包/类
@Override
public Variable emitBitCount(Value operand) {
    Variable result = getLIRGen().newVariable(LIRKind.combine(operand).changeType(SPARCKind.WORD));
    AllocatableValue usedOperand = getLIRGen().asAllocatable(emitZeroExtend(operand));
    getLIRGen().append(new SPARCOP3Op(Op3s.Popc, g0.asValue(), usedOperand, result));
    return result;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:SPARCArithmeticLIRGenerator.java


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