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();
}
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();
}
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));
}
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);
}
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);
}
}
Aggregations