Search in sources :

Example 1 with AArch64Kind

use of jdk.vm.ci.aarch64.AArch64Kind in project graal by oracle.

the class AArch64ArithmeticLIRGenerator method emitStore.

@Override
public void emitStore(ValueKind<?> lirKind, Value address, Value inputVal, LIRFrameState state) {
    AArch64AddressValue storeAddress = getLIRGen().asAddressValue(address);
    AArch64Kind kind = (AArch64Kind) lirKind.getPlatformKind();
    if (isJavaConstant(inputVal) && kind.isInteger()) {
        JavaConstant c = asJavaConstant(inputVal);
        if (c.isDefaultForKind()) {
            // We can load 0 directly into integer registers
            getLIRGen().append(new StoreConstantOp(kind, storeAddress, c, state));
            return;
        }
    }
    AllocatableValue input = getLIRGen().asAllocatable(inputVal);
    getLIRGen().append(new StoreOp(kind, storeAddress, input, state));
}
Also used : AArch64AddressValue(org.graalvm.compiler.lir.aarch64.AArch64AddressValue) AArch64Kind(jdk.vm.ci.aarch64.AArch64Kind) LIRValueUtil.asJavaConstant(org.graalvm.compiler.lir.LIRValueUtil.asJavaConstant) LIRValueUtil.isJavaConstant(org.graalvm.compiler.lir.LIRValueUtil.isJavaConstant) JavaConstant(jdk.vm.ci.meta.JavaConstant) StoreOp(org.graalvm.compiler.lir.aarch64.AArch64Move.StoreOp) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) StoreConstantOp(org.graalvm.compiler.lir.aarch64.AArch64Move.StoreConstantOp)

Example 2 with AArch64Kind

use of jdk.vm.ci.aarch64.AArch64Kind in project graal by oracle.

the class AArch64Move method reg2reg.

private static void reg2reg(@SuppressWarnings("unused") CompilationResultBuilder crb, AArch64MacroAssembler masm, AllocatableValue result, AllocatableValue input) {
    Register dst = asRegister(result);
    Register src = asRegister(input);
    if (src.equals(dst)) {
        return;
    }
    AArch64Kind kind = (AArch64Kind) input.getPlatformKind();
    int size = kind.getSizeInBytes() * Byte.SIZE;
    if (kind.isInteger()) {
        masm.mov(size, dst, src);
    } else {
        masm.fmov(size, dst, src);
    }
}
Also used : Register(jdk.vm.ci.code.Register) ValueUtil.isRegister(jdk.vm.ci.code.ValueUtil.isRegister) ValueUtil.asRegister(jdk.vm.ci.code.ValueUtil.asRegister) ScratchRegister(org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler.ScratchRegister) AArch64Kind(jdk.vm.ci.aarch64.AArch64Kind)

Example 3 with AArch64Kind

use of jdk.vm.ci.aarch64.AArch64Kind in project graal by oracle.

the class AArch64Move method reg2stack.

private static void reg2stack(CompilationResultBuilder crb, AArch64MacroAssembler masm, AllocatableValue result, AllocatableValue input) {
    AArch64Address dest = loadStackSlotAddress(crb, masm, asStackSlot(result), Value.ILLEGAL);
    Register src = asRegister(input);
    // use the slot kind to define the operand size
    AArch64Kind kind = (AArch64Kind) result.getPlatformKind();
    final int size = kind.getSizeInBytes() * Byte.SIZE;
    if (kind.isInteger()) {
        masm.str(size, src, dest);
    } else {
        masm.fstr(size, src, dest);
    }
}
Also used : Register(jdk.vm.ci.code.Register) ValueUtil.isRegister(jdk.vm.ci.code.ValueUtil.isRegister) ValueUtil.asRegister(jdk.vm.ci.code.ValueUtil.asRegister) ScratchRegister(org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler.ScratchRegister) AArch64Kind(jdk.vm.ci.aarch64.AArch64Kind) AArch64Address(org.graalvm.compiler.asm.aarch64.AArch64Address)

Example 4 with AArch64Kind

use of jdk.vm.ci.aarch64.AArch64Kind in project graal by oracle.

the class AArch64HotSpotLIRGenerator method moveValueToThread.

private void moveValueToThread(Value value, int offset) {
    LIRKind wordKind = LIRKind.value(target().arch.getWordKind());
    RegisterValue thread = getProviders().getRegisters().getThreadRegister().asValue(wordKind);
    final int transferSize = value.getValueKind().getPlatformKind().getSizeInBytes();
    AArch64AddressValue address = new AArch64AddressValue(value.getValueKind(), thread, Value.ILLEGAL, offset, transferSize, AddressingMode.IMMEDIATE_SCALED);
    append(new StoreOp((AArch64Kind) value.getPlatformKind(), address, loadReg(value), null));
}
Also used : RegisterValue(jdk.vm.ci.code.RegisterValue) AArch64AddressValue(org.graalvm.compiler.lir.aarch64.AArch64AddressValue) StoreOp(org.graalvm.compiler.lir.aarch64.AArch64Move.StoreOp) AArch64Kind(jdk.vm.ci.aarch64.AArch64Kind) LIRKind(org.graalvm.compiler.core.common.LIRKind)

Example 5 with AArch64Kind

use of jdk.vm.ci.aarch64.AArch64Kind in project graal by oracle.

the class AArch64ArithmeticLIRGenerator method emitLoad.

@Override
public Variable emitLoad(LIRKind kind, Value address, LIRFrameState state) {
    AArch64AddressValue loadAddress = getLIRGen().asAddressValue(address);
    Variable result = getLIRGen().newVariable(getLIRGen().toRegisterKind(kind));
    getLIRGen().append(new LoadOp((AArch64Kind) kind.getPlatformKind(), result, loadAddress, state));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) AArch64AddressValue(org.graalvm.compiler.lir.aarch64.AArch64AddressValue) AArch64Kind(jdk.vm.ci.aarch64.AArch64Kind) LoadOp(org.graalvm.compiler.lir.aarch64.AArch64Move.LoadOp)

Aggregations

AArch64Kind (jdk.vm.ci.aarch64.AArch64Kind)10 AArch64AddressValue (org.graalvm.compiler.lir.aarch64.AArch64AddressValue)5 Register (jdk.vm.ci.code.Register)3 ValueUtil.asRegister (jdk.vm.ci.code.ValueUtil.asRegister)3 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)3 ScratchRegister (org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler.ScratchRegister)3 RegisterValue (jdk.vm.ci.code.RegisterValue)2 ValueUtil.isRegister (jdk.vm.ci.code.ValueUtil.isRegister)2 AArch64Address (org.graalvm.compiler.asm.aarch64.AArch64Address)2 StoreOp (org.graalvm.compiler.lir.aarch64.AArch64Move.StoreOp)2 ValueUtil.asAllocatableValue (jdk.vm.ci.code.ValueUtil.asAllocatableValue)1 JavaConstant (jdk.vm.ci.meta.JavaConstant)1 Value (jdk.vm.ci.meta.Value)1 AArch64ArithmeticLIRGenerator (org.graalvm.compiler.core.aarch64.AArch64ArithmeticLIRGenerator)1 AArch64LIRGenerator (org.graalvm.compiler.core.aarch64.AArch64LIRGenerator)1 LIRKind (org.graalvm.compiler.core.common.LIRKind)1 IntegerStamp (org.graalvm.compiler.core.common.type.IntegerStamp)1 LIRValueUtil.asJavaConstant (org.graalvm.compiler.lir.LIRValueUtil.asJavaConstant)1 LIRValueUtil.isJavaConstant (org.graalvm.compiler.lir.LIRValueUtil.isJavaConstant)1 Variable (org.graalvm.compiler.lir.Variable)1