Search in sources :

Example 6 with AArch64Address

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

the class AArch64MacroAssemblerTest method testMakeAddressAddBaseNoOverwrite.

@Test
public void testMakeAddressAddBaseNoOverwrite() {
    AArch64Address address = masm.makeAddress(base, NumUtil.getNbitNumberInt(12), index, false, 8, scratch, false);
    Assert.assertTrue(address.isScaled() && address.getAddressingMode() == AArch64Address.AddressingMode.REGISTER_OFFSET && address.getBase().equals(scratch) && address.getOffset().equals(index));
    asm.add(64, scratch, base, NumUtil.getNbitNumberInt(12));
    compareAssembly();
}
Also used : AArch64Address(org.graalvm.compiler.asm.aarch64.AArch64Address) Test(org.junit.Test) GraalTest(org.graalvm.compiler.test.GraalTest)

Example 7 with AArch64Address

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

the class AArch64MacroAssemblerTest method testLoadAddressExtendedRegisterOffsetScaled.

@Test
public void testLoadAddressExtendedRegisterOffsetScaled() {
    Register dst = AArch64.r26;
    AArch64Address address = AArch64Address.createExtendedRegisterOffsetAddress(base, index, true, AArch64Assembler.ExtendType.SXTW);
    masm.loadAddress(dst, address, 4);
    asm.add(64, dst, base, index, AArch64Assembler.ExtendType.SXTW, 2);
    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 8 with AArch64Address

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

the class AArch64MacroAssemblerTest method testLoadAddressRegisterOffsetUnscaled.

@Test
public void testLoadAddressRegisterOffsetUnscaled() {
    Register dst = AArch64.r26;
    AArch64Address address = AArch64Address.createRegisterOffsetAddress(base, index, false);
    masm.loadAddress(dst, address, 4);
    asm.add(64, dst, base, index, AArch64Assembler.ShiftType.LSL, 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 9 with AArch64Address

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

the class AArch64MacroAssemblerTest method testLoadAddressScaled.

@Test
public void testLoadAddressScaled() {
    Register dst = AArch64.r26;
    AArch64Address address = AArch64Address.createScaledImmediateAddress(base, NumUtil.getNbitNumberInt(12));
    masm.loadAddress(dst, address, 8);
    asm.add(64, dst, base, NumUtil.getNbitNumberInt(9) << 3);
    asm.add(64, dst, dst, NumUtil.getNbitNumberInt(3) << 12);
    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 10 with AArch64Address

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

the class AArch64MacroAssemblerTest method testLoadAddressScaledHigherOnly.

@Test
public void testLoadAddressScaledHigherOnly() {
    Register dst = AArch64.r26;
    AArch64Address address = AArch64Address.createScaledImmediateAddress(base, 1 << 11);
    masm.loadAddress(dst, address, 8);
    asm.add(64, dst, base, 1 << 11 << 3);
    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)

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