|
LLVM 24.0.0git
|
AArch64_AM - AArch64 Addressing Mode Stuff. More...
Enumerations | |
| enum | ShiftExtendType { InvalidShiftExtend = -1 , LSL = 0 , LSR , ASR , ROR , MSL , UXTB , UXTH , UXTW , UXTX , SXTB , SXTH , SXTW , SXTX } |
Functions | |
| static bool | isSignExtendShiftType (AArch64_AM::ShiftExtendType Type) |
isSignExtendShiftType - Returns true if Type is sign extending. | |
| static const char * | getShiftExtendName (AArch64_AM::ShiftExtendType ST) |
| getShiftName - Get the string encoding for the shift type. | |
| static AArch64_AM::ShiftExtendType | getShiftType (unsigned Imm) |
| getShiftType - Extract the shift type. | |
| static unsigned | getShiftValue (unsigned Imm) |
| getShiftValue - Extract the shift value. | |
| static unsigned | getShifterImm (AArch64_AM::ShiftExtendType ST, unsigned Imm) |
| getShifterImm - Encode the shift type and amount: imm: 6-bit shift amount shifter: 000 ==> lsl 001 ==> lsr 010 ==> asr 011 ==> ror 100 ==> msl {8-6} = shifter {5-0} = imm | |
| static unsigned | getArithShiftValue (unsigned Imm) |
| getArithShiftValue - get the arithmetic shift value. | |
| static AArch64_AM::ShiftExtendType | getExtendType (unsigned Imm) |
| getExtendType - Extract the extend type for operands of arithmetic ops. | |
| static AArch64_AM::ShiftExtendType | getArithExtendType (unsigned Imm) |
| unsigned | getExtendEncoding (AArch64_AM::ShiftExtendType ET) |
| Mapping from extend bits to required operation: shifter: 000 ==> uxtb 001 ==> uxth 010 ==> uxtw 011 ==> uxtx 100 ==> sxtb 101 ==> sxth 110 ==> sxtw 111 ==> sxtx. | |
| static unsigned | getArithExtendImm (AArch64_AM::ShiftExtendType ET, unsigned Imm) |
| getArithExtendImm - Encode the extend type and shift amount for an arithmetic instruction: imm: 3-bit extend amount {5-3} = shifter {2-0} = imm3 | |
| static uint64_t | ror (uint64_t elt, unsigned size) |
| static bool | processLogicalImmediate (uint64_t Imm, unsigned RegSize, uint64_t &Encoding) |
| processLogicalImmediate - Determine if an immediate value can be encoded as the immediate operand of a logical instruction for the given register size. | |
| static bool | isLogicalImmediate (uint64_t imm, unsigned regSize) |
| isLogicalImmediate - Return true if the immediate is valid for a logical immediate instruction of the given register size. | |
| static uint64_t | encodeLogicalImmediate (uint64_t imm, unsigned regSize) |
| encodeLogicalImmediate - Return the encoded immediate value for a logical immediate instruction of the given register size. | |
| static uint64_t | decodeLogicalImmediate (uint64_t val, unsigned regSize) |
| decodeLogicalImmediate - Decode a logical immediate value in the form "N:immr:imms" (where the immr and imms fields are each 6 bits) into the integer value it represents with regSize bits. | |
| static bool | isValidDecodeLogicalImmediate (uint64_t val, unsigned regSize) |
| isValidDecodeLogicalImmediate - Check to see if the logical immediate value in the form "N:immr:imms" (where the immr and imms fields are each 6 bits) is a valid encoding for an integer value with regSize bits. | |
| constexpr bool | isLegalArithImmed (const uint64_t C) |
| isLegalArithImmed - | |
| constexpr unsigned | getArithImmedShift (const uint64_t C) |
getArithImmedShift - assumes C is a legal immediate for arithmetic instructions and | |
| static bool | isLegalCmpImmed (const APInt &C) |
| isLegalCmpImmed - | |
| static float | getFPImmFloat (unsigned Imm) |
| static int | getFP16Imm (const APInt &Imm) |
| getFP16Imm - Return an 8-bit floating-point version of the 16-bit floating-point value. | |
| static int | getFP16Imm (const APFloat &FPImm) |
| static int | getFP32Imm (const APInt &Imm) |
| getFP32Imm - Return an 8-bit floating-point version of the 32-bit floating-point value. | |
| static int | getFP32Imm (const APFloat &FPImm) |
| static int | getFP64Imm (const APInt &Imm) |
| getFP64Imm - Return an 8-bit floating-point version of the 64-bit floating-point value. | |
| static int | getFP64Imm (const APFloat &FPImm) |
| static bool | isAdvSIMDModImmType1 (uint64_t Imm) |
| static uint8_t | encodeAdvSIMDModImmType1 (uint64_t Imm) |
| static uint64_t | decodeAdvSIMDModImmType1 (uint8_t Imm) |
| static bool | isAdvSIMDModImmType2 (uint64_t Imm) |
| static uint8_t | encodeAdvSIMDModImmType2 (uint64_t Imm) |
| static uint64_t | decodeAdvSIMDModImmType2 (uint8_t Imm) |
| static bool | isAdvSIMDModImmType3 (uint64_t Imm) |
| static uint8_t | encodeAdvSIMDModImmType3 (uint64_t Imm) |
| static uint64_t | decodeAdvSIMDModImmType3 (uint8_t Imm) |
| static bool | isAdvSIMDModImmType4 (uint64_t Imm) |
| static uint8_t | encodeAdvSIMDModImmType4 (uint64_t Imm) |
| static uint64_t | decodeAdvSIMDModImmType4 (uint8_t Imm) |
| static bool | isAdvSIMDModImmType5 (uint64_t Imm) |
| static uint8_t | encodeAdvSIMDModImmType5 (uint64_t Imm) |
| static uint64_t | decodeAdvSIMDModImmType5 (uint8_t Imm) |
| static bool | isAdvSIMDModImmType6 (uint64_t Imm) |
| static uint8_t | encodeAdvSIMDModImmType6 (uint64_t Imm) |
| static uint64_t | decodeAdvSIMDModImmType6 (uint8_t Imm) |
| static bool | isAdvSIMDModImmType7 (uint64_t Imm) |
| static uint8_t | encodeAdvSIMDModImmType7 (uint64_t Imm) |
| static uint64_t | decodeAdvSIMDModImmType7 (uint8_t Imm) |
| static bool | isAdvSIMDModImmType8 (uint64_t Imm) |
| static uint64_t | decodeAdvSIMDModImmType8 (uint8_t Imm) |
| static uint8_t | encodeAdvSIMDModImmType8 (uint64_t Imm) |
| static bool | isAdvSIMDModImmType9 (uint64_t Imm) |
| static uint8_t | encodeAdvSIMDModImmType9 (uint64_t Imm) |
| static uint64_t | decodeAdvSIMDModImmType9 (uint8_t Imm) |
| static bool | isAdvSIMDModImmType10 (uint64_t Imm) |
| static uint8_t | encodeAdvSIMDModImmType10 (uint64_t Imm) |
| static uint64_t | decodeAdvSIMDModImmType10 (uint8_t Imm) |
| static bool | isAdvSIMDModImmType11 (uint64_t Imm) |
| static uint8_t | encodeAdvSIMDModImmType11 (uint64_t Imm) |
| static uint64_t | decodeAdvSIMDModImmType11 (uint8_t Imm) |
| static bool | isAdvSIMDModImmType12 (uint64_t Imm) |
| static uint8_t | encodeAdvSIMDModImmType12 (uint64_t Imm) |
| static uint64_t | decodeAdvSIMDModImmType12 (uint8_t Imm) |
| template<typename T> | |
| static bool | isSVEMaskOfIdenticalElements (int64_t Imm) |
| Returns true if Imm is the concatenation of a repeating pattern of type T. | |
| template<typename T> | |
| static bool | isSVECpyImm (int64_t Imm) |
| Returns true if Imm is valid for CPY/DUP. | |
| template<typename T> | |
| static bool | isSVEAddSubImm (int64_t Imm) |
| Returns true if Imm is valid for ADD/SUB. | |
| static bool | isSVEMoveMaskPreferredLogicalImmediate (int64_t Imm) |
| Return true if Imm is valid for DUPM and has no single CPY/DUP equivalent. | |
| static bool | isAnyMOVZMovAlias (uint64_t Value, int RegWidth) |
| static bool | isMOVZMovAlias (uint64_t Value, int Shift, int RegWidth) |
| static bool | isMOVNMovAlias (uint64_t Value, int Shift, int RegWidth) |
| static bool | isAnyMOVWMovAlias (uint64_t Value, int RegWidth) |
| static bool | isSVECpyDupImm (int SizeInBits, int64_t Val, int32_t &Imm, int32_t &Shift) |
| static bool | isSVELogicalImm (unsigned SizeInBits, uint64_t ImmVal, uint64_t &Encoding) |
AArch64_AM - AArch64 Addressing Mode Stuff.
| Enumerator | |
|---|---|
| InvalidShiftExtend | |
| LSL | |
| LSR | |
| ASR | |
| ROR | |
| MSL | |
| UXTB | |
| UXTH | |
| UXTW | |
| UXTX | |
| SXTB | |
| SXTH | |
| SXTW | |
| SXTX | |
Definition at line 32 of file AArch64AddressingModes.h.
Definition at line 466 of file AArch64AddressingModes.h.
Definition at line 669 of file AArch64AddressingModes.h.
Referenced by llvm::AArch64TargetLowering::computeKnownBitsForTargetNode(), DecodeNEONSplat(), and llvm::AArch64InstPrinter::printSIMDType10Operand().
Definition at line 718 of file AArch64AddressingModes.h.
Referenced by DecodeFMOVImm().
Definition at line 767 of file AArch64AddressingModes.h.
Referenced by DecodeFMOVImm().
Definition at line 481 of file AArch64AddressingModes.h.
Definition at line 496 of file AArch64AddressingModes.h.
Definition at line 511 of file AArch64AddressingModes.h.
Definition at line 527 of file AArch64AddressingModes.h.
Definition at line 543 of file AArch64AddressingModes.h.
Definition at line 558 of file AArch64AddressingModes.h.
Definition at line 569 of file AArch64AddressingModes.h.
Definition at line 589 of file AArch64AddressingModes.h.
decodeLogicalImmediate - Decode a logical immediate value in the form "N:immr:imms" (where the immr and imms fields are each 6 bits) into the integer value it represents with regSize bits.
Definition at line 277 of file AArch64AddressingModes.h.
References assert(), llvm::countl_zero(), N, ror(), llvm::size(), and uint64_t.
Referenced by llvm::AArch64InstrInfo::analyzeCompare(), getUsefulBitsFromAndWithImmediate(), llvm::AArch64InstrInfo::optimizeCondBranch(), llvm::AArch64InstPrinter::printInst(), llvm::AArch64InstPrinter::printLogicalImm(), and llvm::AArch64InstPrinter::printSVELogicalImm().
Definition at line 462 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm32().
Definition at line 641 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm64().
Definition at line 690 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImmFP().
Definition at line 739 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImmFP().
Definition at line 477 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm32().
Definition at line 492 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm32().
Definition at line 507 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm32().
Definition at line 523 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm16().
Definition at line 539 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm16().
Definition at line 554 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm321s().
Definition at line 574 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm321s().
Definition at line 585 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm8().
encodeLogicalImmediate - Return the encoded immediate value for a logical immediate instruction of the given register size.
Definition at line 266 of file AArch64AddressingModes.h.
References assert(), processLogicalImmediate(), and uint64_t.
Referenced by llvm::AArch64InstrInfo::insertCmpForCondBr(), optimizeLogicalImm(), and splitDisjointBitmaskImm().
|
inlinestatic |
getArithExtendImm - Encode the extend type and shift amount for an arithmetic instruction: imm: 3-bit extend amount {5-3} = shifter {2-0} = imm3
Definition at line 183 of file AArch64AddressingModes.h.
References assert(), getExtendEncoding(), and Imm.
Referenced by llvm::AArch64InstrInfo::insertCmpForCondBr().
|
inlinestatic |
Definition at line 151 of file AArch64AddressingModes.h.
References getExtendType(), and Imm.
Referenced by llvm::AArch64InstrInfo::canFoldIntoAddrMode(), and llvm::AArch64InstPrinter::printArithExtend().
getArithImmedShift - assumes C is a legal immediate for arithmetic instructions and
Definition at line 332 of file AArch64AddressingModes.h.
References assert(), C(), isLegalArithImmed(), and uint64_t.
getArithShiftValue - get the arithmetic shift value.
Definition at line 131 of file AArch64AddressingModes.h.
References Imm.
Referenced by llvm::AArch64InstrInfo::canFoldIntoAddrMode(), and llvm::AArch64InstPrinter::printArithExtend().
|
inline |
Mapping from extend bits to required operation: shifter: 000 ==> uxtb 001 ==> uxth 010 ==> uxtw 011 ==> uxtx 100 ==> sxtb 101 ==> sxth 110 ==> sxtw 111 ==> sxtx.
Definition at line 164 of file AArch64AddressingModes.h.
References llvm_unreachable, SXTB, SXTH, SXTW, SXTX, UXTB, UXTH, UXTW, and UXTX.
Referenced by getArithExtendImm().
|
inlinestatic |
getExtendType - Extract the extend type for operands of arithmetic ops.
Definition at line 136 of file AArch64AddressingModes.h.
References assert(), Imm, llvm_unreachable, SXTB, SXTH, SXTW, SXTX, UXTB, UXTH, UXTW, and UXTX.
Referenced by getArithExtendType(), and llvm::AArch64InstrInfo::insertCmpForCondBr().
Definition at line 392 of file AArch64AddressingModes.h.
References llvm::APFloat::bitcastToAPInt(), and getFP16Imm().
getFP16Imm - Return an 8-bit floating-point version of the 16-bit floating-point value.
If the value cannot be represented as an 8-bit floating-point value, then return -1.
Definition at line 373 of file AArch64AddressingModes.h.
References Imm.
Referenced by getFP16Imm(), and llvm::AArch64TargetLowering::isFPImmLegalAsFMov().
Definition at line 420 of file AArch64AddressingModes.h.
References llvm::APFloat::bitcastToAPInt(), and getFP32Imm().
getFP32Imm - Return an 8-bit floating-point version of the 32-bit floating-point value.
If the value cannot be represented as an 8-bit floating-point value, then return -1.
Definition at line 399 of file AArch64AddressingModes.h.
References Imm.
Referenced by getFP32Imm(), and llvm::AArch64TargetLowering::isFPImmLegalAsFMov().
Definition at line 448 of file AArch64AddressingModes.h.
References llvm::APFloat::bitcastToAPInt(), and getFP64Imm().
getFP64Imm - Return an 8-bit floating-point version of the 64-bit floating-point value.
If the value cannot be represented as an 8-bit floating-point value, then return -1.
Definition at line 427 of file AArch64AddressingModes.h.
Referenced by getFP64Imm(), and llvm::AArch64TargetLowering::isFPImmLegalAsFMov().
|
inlinestatic |
Definition at line 349 of file AArch64AddressingModes.h.
References llvm::bit_cast(), I, and Imm.
Referenced by llvm::AArch64InstPrinter::printFPImmOperand().
|
inlinestatic |
getShifterImm - Encode the shift type and amount: imm: 6-bit shift amount shifter: 000 ==> lsl 001 ==> lsr 010 ==> asr 011 ==> ror 100 ==> msl {8-6} = shifter {5-0} = imm
Definition at line 111 of file AArch64AddressingModes.h.
References ASR, assert(), Imm, llvm_unreachable, LSL, LSR, MSL, and ROR.
Referenced by llvm::AArch64InstrInfo::copyPhysRegImpl(), emitFrameOffsetAdj(), llvm::AArch64_IMM::expandMOVImm(), expandMOVImmSimple(), isWorthFoldingIntoOrrWithShift(), llvm::AArch64RegisterInfo::materializeFrameBaseRegister(), tryOrrWithShift(), trySequenceOfOnes(), and tryToreplicateChunks().
|
inlinestatic |
getShiftName - Get the string encoding for the shift type.
Definition at line 65 of file AArch64AddressingModes.h.
References ASR, llvm_unreachable, LSL, LSR, MSL, ROR, SXTB, SXTH, SXTW, SXTX, UXTB, UXTH, UXTW, and UXTX.
Referenced by llvm::AArch64InstPrinter::printArithExtend(), and llvm::AArch64InstPrinter::printShifter().
|
inlinestatic |
getShiftType - Extract the shift type.
Definition at line 86 of file AArch64AddressingModes.h.
References ASR, Imm, InvalidShiftExtend, LSL, LSR, MSL, and ROR.
Referenced by llvm::AArch64InstrInfo::canFoldIntoAddrMode(), getUsefulBitsFromOrWithShiftedReg(), llvm::AArch64InstPrinter::printImm8OptLsl(), and llvm::AArch64InstPrinter::printShifter().
getShiftValue - Extract the shift value.
Definition at line 98 of file AArch64AddressingModes.h.
References Imm.
Referenced by llvm::AArch64InstrInfo::canFoldIntoAddrMode(), llvm::AArch64TargetLowering::computeKnownBitsForTargetNode(), getUsefulBitsFromOrWithShiftedReg(), llvm::AArch64InstPrinter::printAddSubImm(), llvm::AArch64InstPrinter::printImm8OptLsl(), and llvm::AArch64InstPrinter::printShifter().
Definition at line 457 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm32().
Definition at line 599 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm64().
Definition at line 683 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImmFP().
Definition at line 733 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImmFP().
Definition at line 472 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm32().
Definition at line 487 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm32().
Definition at line 502 of file AArch64AddressingModes.h.
Referenced by preferGPRForFPImm(), and tryAdvSIMDModImm32().
Definition at line 517 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm16().
Definition at line 533 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm16().
Definition at line 549 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm321s().
Definition at line 564 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm321s().
Definition at line 579 of file AArch64AddressingModes.h.
Referenced by tryAdvSIMDModImm8().
Definition at line 868 of file AArch64AddressingModes.h.
References isAnyMOVZMovAlias(), and uint64_t.
Referenced by llvm::AArch64InstPrinter::printInst().
Definition at line 837 of file AArch64AddressingModes.h.
References uint64_t.
Referenced by isAnyMOVWMovAlias(), and isMOVNMovAlias().
isLegalArithImmed -
C is a legal immediate operand for an arithmetic instruction. Definition at line 326 of file AArch64AddressingModes.h.
Referenced by getAArch64Cmp(), getArithImmedShift(), llvm::isAArch64FrameOffsetLegal(), llvm::AArch64TargetLowering::isLegalAddImmediate(), isLegalCmpImmed(), and performCONDCombine().
isLegalCmpImmed -
C is a legal immediate operand for a comparison instruction. Definition at line 340 of file AArch64AddressingModes.h.
References C(), and isLegalArithImmed().
Referenced by getAArch64Cmp(), hasLegalCmpImmediate(), and performSubWithBorrowCombine().
isLogicalImmediate - Return true if the immediate is valid for a logical immediate instruction of the given register size.
Return false otherwise.
Definition at line 259 of file AArch64AddressingModes.h.
References processLogicalImmediate(), and uint64_t.
Referenced by llvm::AArch64TTIImpl::getIntImmCost(), hasCheapXorImmediateThatNeedsCondCmpReg(), if(), isSVEMoveMaskPreferredLogicalImmediate(), optimizeLogicalImm(), llvm::AArch64TargetLowering::shouldConvertConstantLoadToIntImm(), splitDisjointBitmaskImm(), and tryBitfieldInsertOpFromOrAndImm().
Definition at line 856 of file AArch64AddressingModes.h.
References isAnyMOVZMovAlias(), isMOVZMovAlias(), and uint64_t.
Referenced by llvm::AArch64InstPrinter::printInst().
Definition at line 845 of file AArch64AddressingModes.h.
References uint64_t.
Referenced by isMOVNMovAlias(), and llvm::AArch64InstPrinter::printInst().
|
inlinestatic |
Returns true if Imm is valid for ADD/SUB.
Definition at line 813 of file AArch64AddressingModes.h.
References Imm.
|
inlinestatic |
Definition at line 880 of file AArch64AddressingModes.h.
References Imm.
Referenced by trySVESplat64().
Returns true if Imm is valid for CPY/DUP.
Definition at line 790 of file AArch64AddressingModes.h.
References Imm, llvm::max(), and T.
Referenced by isSVEMoveMaskPreferredLogicalImmediate().
|
inlinestatic |
Definition at line 910 of file AArch64AddressingModes.h.
References llvm_unreachable, processLogicalImmediate(), and uint64_t.
Referenced by trySVESplat64().
|
inlinestatic |
Returns true if Imm is the concatenation of a repeating pattern of type T.
Definition at line 783 of file AArch64AddressingModes.h.
References llvm::all_equal(), llvm::bit_cast(), Imm, and T.
Referenced by isSVEMoveMaskPreferredLogicalImmediate().
|
inlinestatic |
Return true if Imm is valid for DUPM and has no single CPY/DUP equivalent.
Definition at line 820 of file AArch64AddressingModes.h.
References B(), llvm::bit_cast(), H, Imm, isLogicalImmediate(), isSVECpyImm(), and isSVEMaskOfIdenticalElements().
|
inlinestatic |
isValidDecodeLogicalImmediate - Check to see if the logical immediate value in the form "N:immr:imms" (where the immr and imms fields are each 6 bits) is a valid encoding for an integer value with regSize bits.
Definition at line 305 of file AArch64AddressingModes.h.
References llvm::countl_zero(), N, llvm::size(), and uint64_t.
Referenced by DecodeLogicalImmInstruction(), and DecodeSVELogicalImmInstruction().
|
inlinestatic |
processLogicalImmediate - Determine if an immediate value can be encoded as the immediate operand of a logical instruction for the given register size.
If so, return true with "encoding" set to the encoded value in the form N:immr:imms.
Definition at line 197 of file AArch64AddressingModes.h.
References assert(), llvm::countl_one(), llvm::countr_one(), llvm::countr_zero(), I, Imm, llvm::isShiftedMask_64(), N, RegSize, Size, and uint64_t.
Referenced by canUseOrr(), encodeLogicalImmediate(), llvm::AArch64_IMM::expandMOVImm(), isLogicalImmediate(), isSVELogicalImm(), tryAndOfLogicalImmediates(), tryEorOfLogicalImmediates(), tryOrrOfLogicalImmediates(), and trySequenceOfOnes().
Definition at line 189 of file AArch64AddressingModes.h.
References llvm::size(), and uint64_t.
Referenced by decodeLogicalImmediate().