Search in sources :

Example 11 with AArch64Address

use of org.graalvm.compiler.asm.aarch64.AArch64Address in project graal by oracle.

the class AArch64MacroAssemblerTest method testLoadAddressExtendedRegisterOffsetUnscaled.

@Test
public void testLoadAddressExtendedRegisterOffsetUnscaled() {
    Register dst = AArch64.r26;
    AArch64Address address = AArch64Address.createExtendedRegisterOffsetAddress(base, index, false, AArch64Assembler.ExtendType.SXTW);
    masm.loadAddress(dst, address, 4);
    asm.add(64, dst, base, index, AArch64Assembler.ExtendType.SXTW, 0);
    compareAssembly();
}
Also used : Register(jdk.vm.ci.code.Register) AArch64Address(org.graalvm.compiler.asm.aarch64.AArch64Address) Test(org.junit.Test) GraalTest(org.graalvm.compiler.test.GraalTest)

Example 12 with AArch64Address

use of org.graalvm.compiler.asm.aarch64.AArch64Address in project graal by oracle.

the class AArch64MacroAssemblerTest method testMakeAddressAddIndexNoOverwriteExtend.

@Test
public void testMakeAddressAddIndexNoOverwriteExtend() {
    AArch64Address address = masm.makeAddress(base, NumUtil.getNbitNumberInt(8) << 5, index, true, 8, scratch, false);
    Assert.assertTrue(address.isScaled() && address.getAddressingMode() == AArch64Address.AddressingMode.EXTENDED_REGISTER_OFFSET && address.getBase().equals(base) && address.getOffset().equals(scratch) && address.getExtendType() == AArch64Assembler.ExtendType.SXTW);
    asm.add(32, scratch, index, NumUtil.getNbitNumberInt(8) << 2);
    compareAssembly();
}
Also used : AArch64Address(org.graalvm.compiler.asm.aarch64.AArch64Address) Test(org.junit.Test) GraalTest(org.graalvm.compiler.test.GraalTest)

Example 13 with AArch64Address

use of org.graalvm.compiler.asm.aarch64.AArch64Address in project graal by oracle.

the class AArch64HotSpotJumpToExceptionHandlerInCallerOp method emitCode.

@Override
public void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) {
    leaveFrame(crb, masm, /* emitSafepoint */
    false);
    if (System.getProperty("java.specification.version").compareTo("1.8") < 0) {
        // Restore sp from fp if the exception PC is a method handle call site.
        try (ScratchRegister sc = masm.getScratchRegister()) {
            Register scratch = sc.getRegister();
            AArch64Address address = masm.makeAddress(thread, isMethodHandleReturnOffset, scratch, 4, /* allowOverwrite */
            false);
            masm.ldr(32, scratch, address);
            Label noRestore = new Label();
            masm.cbz(32, scratch, noRestore);
            masm.mov(64, sp, fp);
            masm.bind(noRestore);
        }
    }
    masm.jmp(asRegister(handlerInCallerPc));
}
Also used : ScratchRegister(org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler.ScratchRegister) ScratchRegister(org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler.ScratchRegister) Register(jdk.vm.ci.code.Register) ValueUtil.asRegister(jdk.vm.ci.code.ValueUtil.asRegister) Label(org.graalvm.compiler.asm.Label) AArch64Address(org.graalvm.compiler.asm.aarch64.AArch64Address)

Example 14 with AArch64Address

use of org.graalvm.compiler.asm.aarch64.AArch64Address in project graal by oracle.

the class AArch64HotSpotPatchReturnAddressOp method emitCode.

@Override
public void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) {
    final int frameSize = crb.frameMap.frameSize();
    // LR is saved in the {fp, lr} pair above the frame
    AArch64Address lrAddress = AArch64Address.createUnscaledImmediateAddress(sp, frameSize + crb.target.wordSize);
    masm.str(64, asRegister(address), lrAddress);
}
Also used : AArch64Address(org.graalvm.compiler.asm.aarch64.AArch64Address)

Example 15 with AArch64Address

use of org.graalvm.compiler.asm.aarch64.AArch64Address in project graal by oracle.

the class AArch64HotSpotBackend method bangStackWithOffset.

@Override
protected void bangStackWithOffset(CompilationResultBuilder crb, int bangOffset) {
    AArch64MacroAssembler masm = (AArch64MacroAssembler) crb.asm;
    try (ScratchRegister sc = masm.getScratchRegister()) {
        Register scratch = sc.getRegister();
        AArch64Address address = masm.makeAddress(sp, -bangOffset, scratch, 8, /* allowOverwrite */
        false);
        masm.str(64, zr, address);
    }
}
Also used : AArch64MacroAssembler(org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler) ScratchRegister(org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler.ScratchRegister) Register(jdk.vm.ci.code.Register) ValueUtil.asRegister(jdk.vm.ci.code.ValueUtil.asRegister) ScratchRegister(org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler.ScratchRegister) AArch64Address(org.graalvm.compiler.asm.aarch64.AArch64Address)

Aggregations

AArch64Address (org.graalvm.compiler.asm.aarch64.AArch64Address)25 Register (jdk.vm.ci.code.Register)16 GraalTest (org.graalvm.compiler.test.GraalTest)16 Test (org.junit.Test)16 ScratchRegister (org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler.ScratchRegister)8 ValueUtil.asRegister (jdk.vm.ci.code.ValueUtil.asRegister)6 ValueUtil.isRegister (jdk.vm.ci.code.ValueUtil.isRegister)3 AArch64Kind (jdk.vm.ci.aarch64.AArch64Kind)2 ValueUtil.asAllocatableValue (jdk.vm.ci.code.ValueUtil.asAllocatableValue)2 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)2 CallingConvention (jdk.vm.ci.code.CallingConvention)1 StackSlot (jdk.vm.ci.code.StackSlot)1 ValueUtil.asStackSlot (jdk.vm.ci.code.ValueUtil.asStackSlot)1 ValueUtil.isStackSlot (jdk.vm.ci.code.ValueUtil.isStackSlot)1 PlatformKind (jdk.vm.ci.meta.PlatformKind)1 Value (jdk.vm.ci.meta.Value)1 Label (org.graalvm.compiler.asm.Label)1 AArch64Assembler (org.graalvm.compiler.asm.aarch64.AArch64Assembler)1 ExtendType (org.graalvm.compiler.asm.aarch64.AArch64Assembler.ExtendType)1 AArch64MacroAssembler (org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler)1