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


Java AMD64Kind类代码示例

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


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

示例1: emitCode

import jdk.vm.ci.amd64.AMD64Kind; //导入依赖的package包/类
@Override
public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
    switch (opcode) {
        case LOG:
            logIntrinsic(asRegister(result, AMD64Kind.DOUBLE), asRegister(input, AMD64Kind.DOUBLE), crb, masm);
            break;
        case LOG10:
            log10Intrinsic(asRegister(result, AMD64Kind.DOUBLE), asRegister(input, AMD64Kind.DOUBLE), crb, masm);
            break;
        case SIN:
            sinIntrinsic(asRegister(result, AMD64Kind.DOUBLE), asRegister(input, AMD64Kind.DOUBLE), crb, masm);
            break;
        case COS:
            cosIntrinsic(asRegister(result, AMD64Kind.DOUBLE), asRegister(input, AMD64Kind.DOUBLE), crb, masm);
            break;
        case TAN:
            tanIntrinsic(asRegister(result, AMD64Kind.DOUBLE), asRegister(input, AMD64Kind.DOUBLE), crb, masm);
            break;
        case EXP:
            expIntrinsic(asRegister(result, AMD64Kind.DOUBLE), asRegister(input, AMD64Kind.DOUBLE), crb, masm);
            break;
        default:
            throw GraalError.shouldNotReachHere();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:AMD64MathIntrinsicUnaryOp.java

示例2: emitCode

import jdk.vm.ci.amd64.AMD64Kind; //导入依赖的package包/类
@Override
public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
    AMD64Kind backupKind = (AMD64Kind) backupSlot.getPlatformKind();
    if (backupKind.isXMM()) {
        // graal doesn't use vector values, so it's safe to backup using DOUBLE
        backupKind = AMD64Kind.DOUBLE;
    }

    // backup scratch register
    move(backupKind, crb, masm, backupSlot, scratch.asValue(backupSlot.getValueKind()));
    for (int i = 0; i < results.length; i++) {
        Value input = inputs[i];
        AllocatableValue result = results[i];
        // move stack slot
        move((AMD64Kind) input.getPlatformKind(), crb, masm, scratch.asValue(input.getValueKind()), input);
        move((AMD64Kind) result.getPlatformKind(), crb, masm, result, scratch.asValue(result.getValueKind()));
    }
    // restore scratch register
    move(backupKind, crb, masm, scratch.asValue(backupSlot.getValueKind()), backupSlot);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:AMD64Move.java

示例3: reg2stack

import jdk.vm.ci.amd64.AMD64Kind; //导入依赖的package包/类
public static void reg2stack(AMD64Kind kind, CompilationResultBuilder crb, AMD64MacroAssembler masm, Value result, Register input) {
    AMD64Address dest = (AMD64Address) crb.asAddress(result);
    switch (kind) {
        case BYTE:
            masm.movb(dest, input);
            break;
        case WORD:
            masm.movw(dest, input);
            break;
        case DWORD:
            masm.movl(dest, input);
            break;
        case QWORD:
            masm.movq(dest, input);
            break;
        case SINGLE:
            masm.movflt(dest, input);
            break;
        case DOUBLE:
            masm.movsd(dest, input);
            break;
        default:
            throw GraalError.shouldNotReachHere();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:AMD64Move.java

示例4: stack2reg

import jdk.vm.ci.amd64.AMD64Kind; //导入依赖的package包/类
public static void stack2reg(AMD64Kind kind, CompilationResultBuilder crb, AMD64MacroAssembler masm, Register result, Value input) {
    AMD64Address src = (AMD64Address) crb.asAddress(input);
    switch (kind) {
        case BYTE:
            masm.movsbl(result, src);
            break;
        case WORD:
            masm.movswl(result, src);
            break;
        case DWORD:
            masm.movl(result, src);
            break;
        case QWORD:
            masm.movq(result, src);
            break;
        case SINGLE:
            masm.movflt(result, src);
            break;
        case DOUBLE:
            masm.movdbl(result, src);
            break;
        default:
            throw GraalError.shouldNotReachHere();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:AMD64Move.java

示例5: emitCode

import jdk.vm.ci.amd64.AMD64Kind; //导入依赖的package包/类
@Override
public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
    AMD64Move.move(AMD64Kind.QWORD, crb, masm, result, input);

    Register resReg = asRegister(result);
    if (encoding.hasBase() || GeneratePIC.getValue(crb.getOptions())) {
        Register baseReg = asRegister(baseRegister);
        if (!nonNull) {
            masm.testq(resReg, resReg);
            masm.cmovq(ConditionFlag.Equal, resReg, baseReg);
        }
        masm.subq(resReg, baseReg);
    }

    if (encoding.hasShift()) {
        masm.shrq(resReg, encoding.getShift());
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:AMD64HotSpotMove.java

示例6: emitCCall

import jdk.vm.ci.amd64.AMD64Kind; //导入依赖的package包/类
@Override
public void emitCCall(long address, CallingConvention nativeCallingConvention, Value[] args, int numberOfFloatingPointArguments) {
    Value[] argLocations = new Value[args.length];
    getResult().getFrameMapBuilder().callsMethod(nativeCallingConvention);
    // TODO(mg): in case a native function uses floating point varargs, the ABI requires that
    // RAX contains the length of the varargs
    PrimitiveConstant intConst = JavaConstant.forInt(numberOfFloatingPointArguments);
    AllocatableValue numberOfFloatingPointArgumentsRegister = AMD64.rax.asValue(LIRKind.value(AMD64Kind.DWORD));
    emitMoveConstant(numberOfFloatingPointArgumentsRegister, intConst);
    for (int i = 0; i < args.length; i++) {
        Value arg = args[i];
        AllocatableValue loc = nativeCallingConvention.getArgument(i);
        emitMove(loc, arg);
        argLocations[i] = loc;
    }
    Value ptr = emitLoadConstant(LIRKind.value(AMD64Kind.QWORD), JavaConstant.forLong(address));
    append(new AMD64CCall(nativeCallingConvention.getReturn(), ptr, numberOfFloatingPointArgumentsRegister, argLocations));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:AMD64HotSpotLIRGenerator.java

示例7: emitNullCheck

import jdk.vm.ci.amd64.AMD64Kind; //导入依赖的package包/类
@Override
public void emitNullCheck(Value address, LIRFrameState state) {
    if (address.getValueKind().getPlatformKind() == AMD64Kind.DWORD) {
        CompressEncoding encoding = config.getOopEncoding();
        Value uncompressed;
        if (encoding.getShift() <= 3) {
            LIRKind wordKind = LIRKind.unknownReference(target().arch.getWordKind());
            uncompressed = new AMD64AddressValue(wordKind, getProviders().getRegisters().getHeapBaseRegister().asValue(wordKind), asAllocatable(address), Scale.fromInt(1 << encoding.getShift()),
                            0);
        } else {
            uncompressed = emitUncompress(address, encoding, false);
        }
        append(new AMD64Move.NullCheckOp(asAddressValue(uncompressed), state));
    } else {
        super.emitNullCheck(address, state);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:AMD64HotSpotLIRGenerator.java

示例8: emitCode

import jdk.vm.ci.amd64.AMD64Kind; //导入依赖的package包/类
@Override
public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
    switch (opcode) {
        case LOG:
            masm.flog(asRegister(result, AMD64Kind.DOUBLE), asRegister(input, AMD64Kind.DOUBLE), false);
            break;
        case LOG10:
            masm.flog(asRegister(result, AMD64Kind.DOUBLE), asRegister(input, AMD64Kind.DOUBLE), true);
            break;
        case SIN:
            masm.fsin(asRegister(result, AMD64Kind.DOUBLE), asRegister(input, AMD64Kind.DOUBLE));
            break;
        case COS:
            masm.fcos(asRegister(result, AMD64Kind.DOUBLE), asRegister(input, AMD64Kind.DOUBLE));
            break;
        case TAN:
            masm.ftan(asRegister(result, AMD64Kind.DOUBLE), asRegister(input, AMD64Kind.DOUBLE));
            break;
        default:
            throw GraalError.shouldNotReachHere();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:AMD64HotSpotMathIntrinsicOp.java

示例9: narrowRead

import jdk.vm.ci.amd64.AMD64Kind; //导入依赖的package包/类
@MatchRule("(Narrow Read=access)")
@MatchRule("(Narrow FloatingRead=access)")
public ComplexMatchResult narrowRead(NarrowNode root, LIRLowerableAccess access) {
    return new ComplexMatchResult() {
        @Override
        public Value evaluate(NodeLIRBuilder builder) {
            AMD64AddressValue address = (AMD64AddressValue) operand(access.getAddress());
            LIRKind addressKind = LIRKind.combineDerived(getLIRGeneratorTool().getLIRKind(root.asNode().stamp()),
                            address.getBase(), address.getIndex());
            AMD64AddressValue newAddress = address.withKind(addressKind);
            LIRKind readKind = getLIRGeneratorTool().getLIRKind(root.stamp());
            return getArithmeticLIRGenerator().emitZeroExtendMemory((AMD64Kind) readKind.getPlatformKind(),
                            root.getResultBits(), newAddress, getState(access));
        }
    };
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:AMD64NodeMatchRules.java

示例10: zapValueForKind

import jdk.vm.ci.amd64.AMD64Kind; //导入依赖的package包/类
@Override
protected JavaConstant zapValueForKind(PlatformKind kind) {
    long dead = 0xDEADDEADDEADDEADL;
    switch ((AMD64Kind) kind) {
        case BYTE:
            return JavaConstant.forByte((byte) dead);
        case WORD:
            return JavaConstant.forShort((short) dead);
        case DWORD:
            return JavaConstant.forInt((int) dead);
        case QWORD:
            return JavaConstant.forLong(dead);
        case SINGLE:
            return JavaConstant.forFloat(Float.intBitsToFloat((int) dead));
        default:
            // we don't support vector types, so just zap with double for all of them
            return JavaConstant.forDouble(Double.longBitsToDouble(dead));
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:AMD64LIRGenerator.java

示例11: emitCompare

import jdk.vm.ci.amd64.AMD64Kind; //导入依赖的package包/类
/**
 * This method emits the compare instruction, and may reorder the operands. It returns true if
 * it did so.
 *
 * @param a the left operand of the comparison
 * @param b the right operand of the comparison
 * @return true if the left and right operands were switched, false otherwise
 */
private boolean emitCompare(PlatformKind cmpKind, Value a, Value b) {
    Variable left;
    Value right;
    boolean mirrored;
    if (LIRValueUtil.isVariable(b)) {
        left = load(b);
        right = loadNonConst(a);
        mirrored = true;
    } else {
        left = load(a);
        right = loadNonConst(b);
        mirrored = false;
    }
    ((AMD64ArithmeticLIRGeneratorTool) arithmeticLIRGen).emitCompareOp((AMD64Kind) cmpKind, left, right);
    return mirrored;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:AMD64LIRGenerator.java

示例12: emitNot

import jdk.vm.ci.amd64.AMD64Kind; //导入依赖的package包/类
@Override
public Variable emitNot(Value inputVal) {
    AllocatableValue input = getLIRGen().asAllocatable(inputVal);
    Variable result = getLIRGen().newVariable(LIRKind.combine(input));
    switch ((AMD64Kind) input.getPlatformKind()) {
        case DWORD:
            getLIRGen().append(new AMD64Unary.MOp(NOT, DWORD, result, input));
            break;
        case QWORD:
            getLIRGen().append(new AMD64Unary.MOp(NOT, QWORD, result, input));
            break;
        default:
            throw GraalError.shouldNotReachHere();
    }
    return result;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:AMD64ArithmeticLIRGenerator.java

示例13: emitAdd

import jdk.vm.ci.amd64.AMD64Kind; //导入依赖的package包/类
@Override
public Variable emitAdd(LIRKind resultKind, Value a, Value b, boolean setFlags) {
    TargetDescription target = getLIRGen().target();
    boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX);
    switch ((AMD64Kind) a.getPlatformKind()) {
        case DWORD:
            return emitBinary(resultKind, ADD, DWORD, true, a, b, setFlags);
        case QWORD:
            return emitBinary(resultKind, ADD, QWORD, true, a, b, setFlags);
        case SINGLE:
            if (isAvx) {
                return emitBinary(resultKind, AVXOp.ADD, SS, true, a, b);
            } else {
                return emitBinary(resultKind, SSEOp.ADD, SS, true, a, b);
            }
        case DOUBLE:
            if (isAvx) {
                return emitBinary(resultKind, AVXOp.ADD, SD, true, a, b);
            } else {
                return emitBinary(resultKind, SSEOp.ADD, SD, true, a, b);
            }
        default:
            throw GraalError.shouldNotReachHere();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:AMD64ArithmeticLIRGenerator.java

示例14: emitSub

import jdk.vm.ci.amd64.AMD64Kind; //导入依赖的package包/类
@Override
public Variable emitSub(LIRKind resultKind, Value a, Value b, boolean setFlags) {
    TargetDescription target = getLIRGen().target();
    boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX);
    switch ((AMD64Kind) a.getPlatformKind()) {
        case DWORD:
            return emitBinary(resultKind, SUB, DWORD, false, a, b, setFlags);
        case QWORD:
            return emitBinary(resultKind, SUB, QWORD, false, a, b, setFlags);
        case SINGLE:
            if (isAvx) {
                return emitBinary(resultKind, AVXOp.SUB, SS, false, a, b);
            } else {
                return emitBinary(resultKind, SSEOp.SUB, SS, false, a, b);
            }
        case DOUBLE:
            if (isAvx) {
                return emitBinary(resultKind, AVXOp.SUB, SD, false, a, b);
            } else {
                return emitBinary(resultKind, SSEOp.SUB, SD, false, a, b);
            }
        default:
            throw GraalError.shouldNotReachHere();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:AMD64ArithmeticLIRGenerator.java

示例15: emitMul

import jdk.vm.ci.amd64.AMD64Kind; //导入依赖的package包/类
@Override
public Variable emitMul(Value a, Value b, boolean setFlags) {
    LIRKind resultKind = LIRKind.combine(a, b);
    TargetDescription target = getLIRGen().target();
    boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX);
    switch ((AMD64Kind) a.getPlatformKind()) {
        case DWORD:
            return emitIMUL(DWORD, a, b);
        case QWORD:
            return emitIMUL(QWORD, a, b);
        case SINGLE:
            if (isAvx) {
                return emitBinary(resultKind, AVXOp.MUL, SS, true, a, b);
            } else {
                return emitBinary(resultKind, SSEOp.MUL, SS, true, a, b);
            }
        case DOUBLE:
            if (isAvx) {
                return emitBinary(resultKind, AVXOp.MUL, SD, true, a, b);
            } else {
                return emitBinary(resultKind, SSEOp.MUL, SD, true, a, b);
            }
        default:
            throw GraalError.shouldNotReachHere();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:AMD64ArithmeticLIRGenerator.java


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