public final class AArch64Address extends AbstractAddress
- Base register only - Base register + immediate or register with shifted offset - Pre-indexed: base + immediate offset are written back to base register, value used in instruction is base + offset - Post-indexed: base + offset (immediate or register) are written back to base register, value used in instruction is base only - Literal: PC + 19-bit signed word aligned offsetNote not all addressing modes are supported for all instructions. For debugging purposes, the address also stores the expected size of the memory access it will be associated with in
AArch64Address.bitMemoryTransferSize.| Modifier and Type | Class and Description |
|---|---|
static class |
AArch64Address.AddressingMode |
| Modifier and Type | Field and Description |
|---|---|
static int |
ANY_SIZE
This means that
AArch64Address.bitMemoryTransferSize is allowed to be any size. |
static AArch64Address |
PLACEHOLDER
Placeholder for addresses that get patched later.
|
| Modifier and Type | Method and Description |
|---|---|
static AArch64Address |
createAddress(int bitMemoryTransferSize,
AArch64Address.AddressingMode addressingMode,
Register base,
Register offset,
int immediate,
boolean registerOffsetScaled,
AArch64Assembler.ExtendType extendType)
General address generation mechanism.
|
static AArch64Address |
createBaseRegisterOnlyAddress(int bitMemoryTransferSize,
Register base) |
static AArch64Address |
createExtendedRegisterOffsetAddress(int bitMemoryTransferSize,
Register base,
Register offset,
boolean scaled,
AArch64Assembler.ExtendType extendType) |
static AArch64Address |
createImmediateAddress(int bitMemoryTransferSize,
AArch64Address.AddressingMode addressingMode,
Register base,
int immediate)
Creates an address representing the requested immediate addressing mode.
|
static AArch64Address |
createPairBaseRegisterOnlyAddress(int bitMemoryTransferSize,
Register base) |
static AArch64Address |
createPCLiteralAddress(int bitMemoryTransferSize)
AArch64Address specifying a PC-literal address of the form PC + imm21
Note that the imm21 offset is expected to be patched later.
|
static AArch64Address |
createRegisterOffsetAddress(int bitMemoryTransferSize,
Register base,
Register offset,
boolean scaled) |
static AArch64Address |
createStructureImmediatePostIndexAddress(AArch64ASIMDAssembler.ASIMDInstruction instruction,
AArch64ASIMDAssembler.ASIMDSize size,
AArch64ASIMDAssembler.ElementSize eSize,
Register base,
int immediate)
AArch64Address specifying a structure memory access of the form "[Xn|SP], imm", where imm is
a post-indexed value to add.
|
static AArch64Address |
createStructureNoOffsetAddress(Register base)
AArch64Address specifying a structure memory access of the form "[Xn|SP]".
|
static AArch64Address |
createStructureRegisterPostIndexAddress(Register base,
Register offset)
AArch64Address specifying a structure memory access of the form "[Xn|SP], Xm", where Xm is a
post-indexed value to add and cannot be either SP or ZR.
|
AArch64Address.AddressingMode |
getAddressingMode() |
Register |
getBase() |
int |
getBitMemoryTransferSize() |
AArch64Assembler.ExtendType |
getExtendType() |
int |
getImmediate() |
int |
getImmediateRaw() |
Register |
getOffset() |
static boolean |
isImmediateScaled(AArch64Address.AddressingMode mode)
Returns whether the immediate addressing mode being used scales the immediate operand.
|
static boolean |
isOffsetAligned(int bitMemoryTransferSize,
long offset)
Checks whether the offset provided is aligned for a given memory operation size.
|
boolean |
isRegisterOffsetScaled() |
static boolean |
isValidImmediateAddress(int bitMemoryTransferSize,
AArch64Address.AddressingMode addressingMode,
int immediate)
Checks whether an immediate can be encoded within the provided immediate addressing mode.
|
String |
toString() |
public static final int ANY_SIZE
AArch64Address.bitMemoryTransferSize is allowed to be any size.public static final AArch64Address PLACEHOLDER
public static AArch64Address createAddress(int bitMemoryTransferSize, AArch64Address.AddressingMode addressingMode, Register base, Register offset, int immediate, boolean registerOffsetScaled, AArch64Assembler.ExtendType extendType)
public static boolean isImmediateScaled(AArch64Address.AddressingMode mode)
public static boolean isOffsetAligned(int bitMemoryTransferSize,
long offset)
bitMemoryTransferSize - Memory operation size. This determines the alignment
requirements.offset - Value to be checked.public static AArch64Address createImmediateAddress(int bitMemoryTransferSize, AArch64Address.AddressingMode addressingMode, Register base, int immediate)
bitMemoryTransferSize - Memory operation size.addressingMode - Immediate addressing mode to use.base - Base register for memory operation. May not be null or the zero-register.immediate - *Unscaled* immediate value to encode. All scaling needed is performed within
this methodpublic static boolean isValidImmediateAddress(int bitMemoryTransferSize,
AArch64Address.AddressingMode addressingMode,
int immediate)
public static AArch64Address createBaseRegisterOnlyAddress(int bitMemoryTransferSize, Register base)
bitMemoryTransferSize - Memory operation size.base - May not be null or the zero register.public static AArch64Address createRegisterOffsetAddress(int bitMemoryTransferSize, Register base, Register offset, boolean scaled)
bitMemoryTransferSize - Memory operation size.base - may not be null or the zero-register.offset - Register specifying some offset, optionally scaled by the
byte_memory_transfer_size. May not be null or the stackpointer.scaled - Specifies whether offset should be scaled by byte_memory_transfer_size or not.public static AArch64Address createExtendedRegisterOffsetAddress(int bitMemoryTransferSize, Register base, Register offset, boolean scaled, AArch64Assembler.ExtendType extendType)
bitMemoryTransferSize - Memory operation size.base - may not be null or the zero-register.offset - Word register specifying some offset, optionally scaled by the
byte_memory_transfer_size. May not be null or the stackpointer.scaled - Specifies whether offset should be scaled by byte_memory_transfer_size or not.extendType - Describes whether register is zero- or sign-extended. May not be null.public static AArch64Address createPCLiteralAddress(int bitMemoryTransferSize)
bitMemoryTransferSize - Memory operation size.public static AArch64Address createPairBaseRegisterOnlyAddress(int bitMemoryTransferSize, Register base)
bitMemoryTransferSize - Memory operation size.base - May not be null or the zero register.public static AArch64Address createStructureNoOffsetAddress(Register base)
public static AArch64Address createStructureRegisterPostIndexAddress(Register base, Register offset)
public static AArch64Address createStructureImmediatePostIndexAddress(AArch64ASIMDAssembler.ASIMDInstruction instruction, AArch64ASIMDAssembler.ASIMDSize size, AArch64ASIMDAssembler.ElementSize eSize, Register base, int immediate)
#determineStructureImmediateValue(ASIMDInstruction, ASIMDSize, ElementSize) for what
the expected value is.public int getBitMemoryTransferSize()
public Register getBase()
public Register getOffset()
public int getImmediate()
addressingMode ==IMMEDIATE_UNSCALED the value will be returned
as the 9-bit signed representation.public int getImmediateRaw()
public boolean isRegisterOffsetScaled()
public AArch64Assembler.ExtendType getExtendType()
public AArch64Address.AddressingMode getAddressingMode()