Search in sources :

Example 16 with AArch64Address

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

the class AArch64MacroAssemblerTest method testLoadAddressUnscaled2.

@Test
public void testLoadAddressUnscaled2() {
    Register dst = AArch64.r26;
    AArch64Address address = AArch64Address.createUnscaledImmediateAddress(base, -NumUtil.getNbitNumberInt(8));
    masm.loadAddress(dst, address, 8);
    asm.sub(64, dst, base, NumUtil.getNbitNumberInt(8));
    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 17 with AArch64Address

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

the class AArch64MacroAssemblerTest method testMakeAddressAddIndex.

@Test
public void testMakeAddressAddIndex() {
    AArch64Address address = masm.makeAddress(base, NumUtil.getNbitNumberInt(8) << 5, index, false, 8, null, true);
    Assert.assertTrue(address.isScaled() && address.getAddressingMode() == AArch64Address.AddressingMode.REGISTER_OFFSET && address.getBase().equals(base) && address.getOffset().equals(index));
    asm.add(64, index, 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 18 with AArch64Address

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

the class AArch64MacroAssemblerTest method testMakeAddressAddBase.

@Test
public void testMakeAddressAddBase() {
    AArch64Address address = masm.makeAddress(base, NumUtil.getNbitNumberInt(12), index, false, 8, null, true);
    Assert.assertTrue(address.isScaled() && address.getAddressingMode() == AArch64Address.AddressingMode.REGISTER_OFFSET && address.getBase().equals(base) && address.getOffset().equals(index));
    asm.add(64, base, 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 19 with AArch64Address

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

the class AArch64MacroAssemblerTest method testMakeAddressNoAction.

@Test
public void testMakeAddressNoAction() {
    AArch64Address address = masm.makeAddress(base, NumUtil.getNbitNumberInt(12) << 3, AArch64.zr, false, 8, null, false);
    Assert.assertTrue(address.isScaled() && address.getAddressingMode() == AArch64Address.AddressingMode.IMMEDIATE_SCALED && address.getBase().equals(base) && address.getOffset().equals(AArch64.zr) && address.getImmediateRaw() == NumUtil.getNbitNumberInt(12));
    // No code generated.
    compareAssembly();
}
Also used : AArch64Address(org.graalvm.compiler.asm.aarch64.AArch64Address) Test(org.junit.Test) GraalTest(org.graalvm.compiler.test.GraalTest)

Example 20 with AArch64Address

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

the class AArch64MacroAssemblerTest method testMakeAddressAddIndexExtend.

@Test
public void testMakeAddressAddIndexExtend() {
    AArch64Address address = masm.makeAddress(base, NumUtil.getNbitNumberInt(8) << 5, index, true, 8, scratch, true);
    Assert.assertTrue(address.isScaled() && address.getAddressingMode() == AArch64Address.AddressingMode.EXTENDED_REGISTER_OFFSET && address.getBase().equals(base) && address.getOffset().equals(index) && address.getExtendType() == AArch64Assembler.ExtendType.SXTW);
    asm.add(32, index, 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)

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