003 File Manager
Current Path:
/usr/src/contrib/llvm-project/llvm/lib/Target/AArch64
usr
/
src
/
contrib
/
llvm-project
/
llvm
/
lib
/
Target
/
AArch64
/
📁
..
📄
AArch64.h
(4.09 KB)
📄
AArch64.td
(49.85 KB)
📄
AArch64A53Fix835769.cpp
(8.3 KB)
📄
AArch64A57FPLoadBalancing.cpp
(25.73 KB)
📄
AArch64AdvSIMDScalarPass.cpp
(16.1 KB)
📄
AArch64AsmPrinter.cpp
(49.26 KB)
📄
AArch64BranchTargets.cpp
(4.91 KB)
📄
AArch64CallingConvention.cpp
(6.63 KB)
📄
AArch64CallingConvention.h
(2.62 KB)
📄
AArch64CallingConvention.td
(23.84 KB)
📄
AArch64CleanupLocalDynamicTLSPass.cpp
(5.53 KB)
📄
AArch64CollectLOH.cpp
(20.07 KB)
📄
AArch64Combine.td
(3.27 KB)
📄
AArch64CompressJumpTables.cpp
(5.06 KB)
📄
AArch64CondBrTuning.cpp
(10.19 KB)
📄
AArch64ConditionOptimizer.cpp
(15.26 KB)
📄
AArch64ConditionalCompares.cpp
(33.26 KB)
📄
AArch64DeadRegisterDefinitionsPass.cpp
(7.76 KB)
📄
AArch64ExpandImm.cpp
(14.25 KB)
📄
AArch64ExpandImm.h
(959 B)
📄
AArch64ExpandPseudoInsts.cpp
(38.08 KB)
📄
AArch64FalkorHWPFFix.cpp
(23.3 KB)
📄
AArch64FastISel.cpp
(171.76 KB)
📄
AArch64FrameLowering.cpp
(124.13 KB)
📄
AArch64FrameLowering.h
(5.54 KB)
📄
AArch64GenRegisterBankInfo.def
(11 KB)
📄
AArch64ISelDAGToDAG.cpp
(180.26 KB)
📄
AArch64ISelLowering.cpp
(578.95 KB)
📄
AArch64ISelLowering.h
(33.88 KB)
📄
AArch64InstrAtomics.td
(20.33 KB)
📄
AArch64InstrFormats.td
(430.93 KB)
📄
AArch64InstrGISel.td
(4.29 KB)
📄
AArch64InstrInfo.cpp
(243.23 KB)
📄
AArch64InstrInfo.h
(19.92 KB)
📄
AArch64InstrInfo.td
(374.84 KB)
📄
AArch64LoadStoreOptimizer.cpp
(77.04 KB)
📄
AArch64MCInstLower.cpp
(11.72 KB)
📄
AArch64MCInstLower.h
(1.69 KB)
📄
AArch64MachineFunctionInfo.cpp
(1.02 KB)
📄
AArch64MachineFunctionInfo.h
(12.9 KB)
📄
AArch64MacroFusion.cpp
(11.47 KB)
📄
AArch64MacroFusion.h
(891 B)
📄
AArch64PBQPRegAlloc.cpp
(11.35 KB)
📄
AArch64PBQPRegAlloc.h
(1.3 KB)
📄
AArch64PerfectShuffle.h
(382.04 KB)
📄
AArch64PfmCounters.td
(713 B)
📄
AArch64PromoteConstant.cpp
(22.43 KB)
📄
AArch64RedundantCopyElimination.cpp
(17.09 KB)
📄
AArch64RegisterBanks.td
(719 B)
📄
AArch64RegisterInfo.cpp
(29.6 KB)
📄
AArch64RegisterInfo.h
(5.5 KB)
📄
AArch64RegisterInfo.td
(51 KB)
📄
AArch64SIMDInstrOpt.cpp
(26.07 KB)
📄
AArch64SLSHardening.cpp
(15.92 KB)
📄
AArch64SVEInstrInfo.td
(169.43 KB)
📄
AArch64SchedA53.td
(15.28 KB)
📄
AArch64SchedA57.td
(34.69 KB)
📄
AArch64SchedA57WriteRes.td
(19.87 KB)
📄
AArch64SchedCyclone.td
(29.82 KB)
📄
AArch64SchedExynosM3.td
(42.57 KB)
📄
AArch64SchedExynosM4.td
(49.81 KB)
📄
AArch64SchedExynosM5.td
(50.74 KB)
📄
AArch64SchedFalkor.td
(5.3 KB)
📄
AArch64SchedFalkorDetails.td
(67.66 KB)
📄
AArch64SchedKryo.td
(6.21 KB)
📄
AArch64SchedKryoDetails.td
(82.63 KB)
📄
AArch64SchedPredExynos.td
(7.5 KB)
📄
AArch64SchedPredicates.td
(27.86 KB)
📄
AArch64SchedThunderX.td
(14.99 KB)
📄
AArch64SchedThunderX2T99.td
(68.58 KB)
📄
AArch64SchedThunderX3T110.td
(68.77 KB)
📄
AArch64Schedule.td
(3.86 KB)
📄
AArch64SelectionDAGInfo.cpp
(5.54 KB)
📄
AArch64SelectionDAGInfo.h
(1.46 KB)
📄
AArch64SpeculationHardening.cpp
(29.6 KB)
📄
AArch64StackOffset.h
(5.01 KB)
📄
AArch64StackTagging.cpp
(24.31 KB)
📄
AArch64StackTaggingPreRA.cpp
(7.25 KB)
📄
AArch64StorePairSuppress.cpp
(6.26 KB)
📄
AArch64Subtarget.cpp
(12.38 KB)
📄
AArch64Subtarget.h
(18.49 KB)
📄
AArch64SystemOperands.td
(81.75 KB)
📄
AArch64TargetMachine.cpp
(26.65 KB)
📄
AArch64TargetMachine.h
(3.25 KB)
📄
AArch64TargetObjectFile.cpp
(3.35 KB)
📄
AArch64TargetObjectFile.h
(2.31 KB)
📄
AArch64TargetTransformInfo.cpp
(42.6 KB)
📄
AArch64TargetTransformInfo.h
(8.68 KB)
📁
AsmParser
📁
Disassembler
📁
GISel
📁
MCTargetDesc
📄
SVEInstrFormats.td
(304.03 KB)
📄
SVEIntrinsicOpts.cpp
(8.13 KB)
📁
TargetInfo
📁
Utils
Editing: AArch64StackOffset.h
//==--AArch64StackOffset.h ---------------------------------------*- C++ -*-==// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file contains the declaration of the StackOffset class, which is used to // describe scalable and non-scalable offsets during frame lowering. // //===----------------------------------------------------------------------===// #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64STACKOFFSET_H #define LLVM_LIB_TARGET_AARCH64_AARCH64STACKOFFSET_H #include "llvm/Support/MachineValueType.h" #include "llvm/Support/TypeSize.h" #include <cassert> namespace llvm { /// StackOffset is a wrapper around scalable and non-scalable offsets and is /// used in several functions such as 'isAArch64FrameOffsetLegal' and /// 'emitFrameOffset()'. StackOffsets are described by MVTs, e.g. // /// StackOffset(1, MVT::nxv16i8) // /// would describe an offset as being the size of a single SVE vector. /// /// The class also implements simple arithmetic (addition/subtraction) on these /// offsets, e.g. // /// StackOffset(1, MVT::nxv16i8) + StackOffset(1, MVT::i64) // /// describes an offset that spans the combined storage required for an SVE /// vector and a 64bit GPR. class StackOffset { int64_t Bytes; int64_t ScalableBytes; explicit operator int() const; public: using Part = std::pair<int64_t, MVT>; StackOffset() : Bytes(0), ScalableBytes(0) {} StackOffset(int64_t Offset, MVT::SimpleValueType T) : StackOffset() { assert(MVT(T).isByteSized() && "Offset type is not a multiple of bytes"); *this += Part(Offset, T); } StackOffset(const StackOffset &Other) : Bytes(Other.Bytes), ScalableBytes(Other.ScalableBytes) {} StackOffset &operator=(const StackOffset &) = default; StackOffset &operator+=(const StackOffset::Part &Other) { const TypeSize Size = Other.second.getSizeInBits(); if (Size.isScalable()) ScalableBytes += Other.first * ((int64_t)Size.getKnownMinSize() / 8); else Bytes += Other.first * ((int64_t)Size.getFixedSize() / 8); return *this; } StackOffset &operator+=(const StackOffset &Other) { Bytes += Other.Bytes; ScalableBytes += Other.ScalableBytes; return *this; } StackOffset operator+(const StackOffset &Other) const { StackOffset Res(*this); Res += Other; return Res; } StackOffset &operator-=(const StackOffset &Other) { Bytes -= Other.Bytes; ScalableBytes -= Other.ScalableBytes; return *this; } StackOffset operator-(const StackOffset &Other) const { StackOffset Res(*this); Res -= Other; return Res; } StackOffset operator-() const { StackOffset Res = {}; const StackOffset Other(*this); Res -= Other; return Res; } /// Returns the scalable part of the offset in bytes. int64_t getScalableBytes() const { return ScalableBytes; } /// Returns the non-scalable part of the offset in bytes. int64_t getBytes() const { return Bytes; } /// Returns the offset in parts to which this frame offset can be /// decomposed for the purpose of describing a frame offset. /// For non-scalable offsets this is simply its byte size. void getForFrameOffset(int64_t &NumBytes, int64_t &NumPredicateVectors, int64_t &NumDataVectors) const { assert(isValid() && "Invalid frame offset"); NumBytes = Bytes; NumDataVectors = 0; NumPredicateVectors = ScalableBytes / 2; // This method is used to get the offsets to adjust the frame offset. // If the function requires ADDPL to be used and needs more than two ADDPL // instructions, part of the offset is folded into NumDataVectors so that it // uses ADDVL for part of it, reducing the number of ADDPL instructions. if (NumPredicateVectors % 8 == 0 || NumPredicateVectors < -64 || NumPredicateVectors > 62) { NumDataVectors = NumPredicateVectors / 8; NumPredicateVectors -= NumDataVectors * 8; } } void getForDwarfOffset(int64_t &ByteSized, int64_t &VGSized) const { assert(isValid() && "Invalid frame offset"); // VGSized offsets are divided by '2', because the VG register is the // the number of 64bit granules as opposed to 128bit vector chunks, // which is how the 'n' in e.g. MVT::nxv1i8 is modelled. // So, for a stack offset of 16 MVT::nxv1i8's, the size is n x 16 bytes. // VG = n * 2 and the dwarf offset must be VG * 8 bytes. ByteSized = Bytes; VGSized = ScalableBytes / 2; } /// Returns whether the offset is known zero. explicit operator bool() const { return Bytes || ScalableBytes; } bool isValid() const { // The smallest scalable element supported by scaled SVE addressing // modes are predicates, which are 2 scalable bytes in size. So the scalable // byte offset must always be a multiple of 2. return ScalableBytes % 2 == 0; } }; } // end namespace llvm #endif
Upload File
Create Folder