003 File Manager
Current Path:
/usr/src/contrib/llvm-project/llvm/lib/Target/Mips
usr
/
src
/
contrib
/
llvm-project
/
llvm
/
lib
/
Target
/
Mips
/
📁
..
📁
AsmParser
📁
Disassembler
📁
MCTargetDesc
📄
MSA.txt
(3.64 KB)
📄
MicroMips32r6InstrFormats.td
(20.42 KB)
📄
MicroMips32r6InstrInfo.td
(86.7 KB)
📄
MicroMipsDSPInstrFormats.td
(6.55 KB)
📄
MicroMipsDSPInstrInfo.td
(33.92 KB)
📄
MicroMipsInstrFPU.td
(20.28 KB)
📄
MicroMipsInstrFormats.td
(19.75 KB)
📄
MicroMipsInstrInfo.td
(63.12 KB)
📄
MicroMipsSizeReduction.cpp
(26.44 KB)
📄
Mips.h
(1.85 KB)
📄
Mips.td
(13.99 KB)
📄
Mips16FrameLowering.cpp
(6.34 KB)
📄
Mips16FrameLowering.h
(1.73 KB)
📄
Mips16HardFloat.cpp
(15.87 KB)
📄
Mips16HardFloatInfo.cpp
(1.45 KB)
📄
Mips16HardFloatInfo.h
(1.33 KB)
📄
Mips16ISelDAGToDAG.cpp
(7.33 KB)
📄
Mips16ISelDAGToDAG.h
(1.8 KB)
📄
Mips16ISelLowering.cpp
(29.05 KB)
📄
Mips16ISelLowering.h
(3.29 KB)
📄
Mips16InstrFormats.td
(16.29 KB)
📄
Mips16InstrInfo.cpp
(17.93 KB)
📄
Mips16InstrInfo.h
(5.33 KB)
📄
Mips16InstrInfo.td
(51.26 KB)
📄
Mips16RegisterInfo.cpp
(4.81 KB)
📄
Mips16RegisterInfo.h
(1.56 KB)
📄
Mips32r6InstrFormats.td
(14.85 KB)
📄
Mips32r6InstrInfo.td
(47.55 KB)
📄
Mips64InstrInfo.td
(58.62 KB)
📄
Mips64r6InstrInfo.td
(15.93 KB)
📄
MipsAnalyzeImmediate.cpp
(4.62 KB)
📄
MipsAnalyzeImmediate.h
(2.24 KB)
📄
MipsAsmPrinter.cpp
(43.89 KB)
📄
MipsAsmPrinter.h
(6.04 KB)
📄
MipsBranchExpansion.cpp
(29.72 KB)
📄
MipsCCState.cpp
(6.71 KB)
📄
MipsCCState.h
(6.14 KB)
📄
MipsCallLowering.cpp
(23.62 KB)
📄
MipsCallLowering.h
(3.35 KB)
📄
MipsCallingConv.td
(17.55 KB)
📄
MipsCondMov.td
(14.56 KB)
📄
MipsConstantIslandPass.cpp
(62.17 KB)
📄
MipsDSPInstrFormats.td
(7.39 KB)
📄
MipsDSPInstrInfo.td
(68.68 KB)
📄
MipsDelaySlotFiller.cpp
(32.55 KB)
📄
MipsEVAInstrFormats.td
(2.51 KB)
📄
MipsEVAInstrInfo.td
(8.52 KB)
📄
MipsExpandPseudo.cpp
(30.1 KB)
📄
MipsFastISel.cpp
(66.8 KB)
📄
MipsFrameLowering.cpp
(5.75 KB)
📄
MipsFrameLowering.h
(1.74 KB)
📄
MipsISelDAGToDAG.cpp
(10.22 KB)
📄
MipsISelDAGToDAG.h
(6.13 KB)
📄
MipsISelLowering.cpp
(192.31 KB)
📄
MipsISelLowering.h
(27.02 KB)
📄
MipsInstrFPU.td
(44.82 KB)
📄
MipsInstrFormats.td
(19.73 KB)
📄
MipsInstrInfo.cpp
(28.1 KB)
📄
MipsInstrInfo.h
(7.87 KB)
📄
MipsInstrInfo.td
(138.02 KB)
📄
MipsInstructionSelector.cpp
(34.44 KB)
📄
MipsLegalizerInfo.cpp
(21.07 KB)
📄
MipsLegalizerInfo.h
(1.19 KB)
📄
MipsMCInstLower.cpp
(9.68 KB)
📄
MipsMCInstLower.h
(1.77 KB)
📄
MipsMSAInstrFormats.td
(9.18 KB)
📄
MipsMSAInstrInfo.td
(182.92 KB)
📄
MipsMTInstrFormats.td
(2.44 KB)
📄
MipsMTInstrInfo.td
(7.59 KB)
📄
MipsMachineFunction.cpp
(7.22 KB)
📄
MipsMachineFunction.h
(4.37 KB)
📄
MipsModuleISelDAGToDAG.cpp
(1.67 KB)
📄
MipsOptimizePICCall.cpp
(9.78 KB)
📄
MipsOptionRecord.h
(2.9 KB)
📄
MipsOs16.cpp
(4.18 KB)
📄
MipsPfmCounters.td
(706 B)
📄
MipsPreLegalizerCombiner.cpp
(3.93 KB)
📄
MipsRegisterBankInfo.cpp
(26.01 KB)
📄
MipsRegisterBankInfo.h
(9.13 KB)
📄
MipsRegisterBanks.td
(573 B)
📄
MipsRegisterInfo.cpp
(10.41 KB)
📄
MipsRegisterInfo.h
(2.82 KB)
📄
MipsRegisterInfo.td
(23.18 KB)
📄
MipsSEFrameLowering.cpp
(34.47 KB)
📄
MipsSEFrameLowering.h
(1.88 KB)
📄
MipsSEISelDAGToDAG.cpp
(49.41 KB)
📄
MipsSEISelDAGToDAG.h
(5.92 KB)
📄
MipsSEISelLowering.cpp
(140.76 KB)
📄
MipsSEISelLowering.h
(6.25 KB)
📄
MipsSEInstrInfo.cpp
(34.71 KB)
📄
MipsSEInstrInfo.h
(5.34 KB)
📄
MipsSERegisterInfo.cpp
(8.44 KB)
📄
MipsSERegisterInfo.h
(1.2 KB)
📄
MipsSchedule.td
(38.24 KB)
📄
MipsScheduleGeneric.td
(71.71 KB)
📄
MipsScheduleP5600.td
(27.85 KB)
📄
MipsSubtarget.cpp
(10.72 KB)
📄
MipsSubtarget.h
(13.43 KB)
📄
MipsTargetMachine.cpp
(12.66 KB)
📄
MipsTargetMachine.h
(3.08 KB)
📄
MipsTargetObjectFile.cpp
(7.39 KB)
📄
MipsTargetObjectFile.h
(2.02 KB)
📄
MipsTargetStreamer.h
(14.58 KB)
📄
Relocation.txt
(3.91 KB)
📁
TargetInfo
Editing: MipsCCState.cpp
//===---- MipsCCState.cpp - CCState with Mips specific extensions ---------===// // // 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 // //===----------------------------------------------------------------------===// #include "MipsCCState.h" #include "MipsSubtarget.h" #include "llvm/IR/Module.h" using namespace llvm; /// This function returns true if CallSym is a long double emulation routine. static bool isF128SoftLibCall(const char *CallSym) { const char *const LibCalls[] = { "__addtf3", "__divtf3", "__eqtf2", "__extenddftf2", "__extendsftf2", "__fixtfdi", "__fixtfsi", "__fixtfti", "__fixunstfdi", "__fixunstfsi", "__fixunstfti", "__floatditf", "__floatsitf", "__floattitf", "__floatunditf", "__floatunsitf", "__floatuntitf", "__getf2", "__gttf2", "__letf2", "__lttf2", "__multf3", "__netf2", "__powitf2", "__subtf3", "__trunctfdf2", "__trunctfsf2", "__unordtf2", "ceill", "copysignl", "cosl", "exp2l", "expl", "floorl", "fmal", "fmaxl", "fmodl", "log10l", "log2l", "logl", "nearbyintl", "powl", "rintl", "roundl", "sinl", "sqrtl", "truncl"}; // Check that LibCalls is sorted alphabetically. auto Comp = [](const char *S1, const char *S2) { return strcmp(S1, S2) < 0; }; assert(llvm::is_sorted(LibCalls, Comp)); return std::binary_search(std::begin(LibCalls), std::end(LibCalls), CallSym, Comp); } /// This function returns true if Ty is fp128, {f128} or i128 which was /// originally a fp128. static bool originalTypeIsF128(const Type *Ty, const char *Func) { if (Ty->isFP128Ty()) return true; if (Ty->isStructTy() && Ty->getStructNumElements() == 1 && Ty->getStructElementType(0)->isFP128Ty()) return true; // If the Ty is i128 and the function being called is a long double emulation // routine, then the original type is f128. return (Func && Ty->isIntegerTy(128) && isF128SoftLibCall(Func)); } /// Return true if the original type was vXfXX. static bool originalEVTTypeIsVectorFloat(EVT Ty) { if (Ty.isVector() && Ty.getVectorElementType().isFloatingPoint()) return true; return false; } /// Return true if the original type was vXfXX / vXfXX. static bool originalTypeIsVectorFloat(const Type * Ty) { if (Ty->isVectorTy() && Ty->isFPOrFPVectorTy()) return true; return false; } MipsCCState::SpecialCallingConvType MipsCCState::getSpecialCallingConvForCallee(const SDNode *Callee, const MipsSubtarget &Subtarget) { MipsCCState::SpecialCallingConvType SpecialCallingConv = NoSpecialCallingConv; if (Subtarget.inMips16HardFloat()) { if (const GlobalAddressSDNode *G = dyn_cast<const GlobalAddressSDNode>(Callee)) { llvm::StringRef Sym = G->getGlobal()->getName(); Function *F = G->getGlobal()->getParent()->getFunction(Sym); if (F && F->hasFnAttribute("__Mips16RetHelper")) { SpecialCallingConv = Mips16RetHelperConv; } } } return SpecialCallingConv; } void MipsCCState::PreAnalyzeCallResultForF128( const SmallVectorImpl<ISD::InputArg> &Ins, const Type *RetTy, const char *Call) { for (unsigned i = 0; i < Ins.size(); ++i) { OriginalArgWasF128.push_back( originalTypeIsF128(RetTy, Call)); OriginalArgWasFloat.push_back(RetTy->isFloatingPointTy()); } } /// Identify lowered values that originated from f128 or float arguments and /// record this for use by RetCC_MipsN. void MipsCCState::PreAnalyzeReturnForF128( const SmallVectorImpl<ISD::OutputArg> &Outs) { const MachineFunction &MF = getMachineFunction(); for (unsigned i = 0; i < Outs.size(); ++i) { OriginalArgWasF128.push_back( originalTypeIsF128(MF.getFunction().getReturnType(), nullptr)); OriginalArgWasFloat.push_back( MF.getFunction().getReturnType()->isFloatingPointTy()); } } /// Identify lower values that originated from vXfXX and record /// this. void MipsCCState::PreAnalyzeCallResultForVectorFloat( const SmallVectorImpl<ISD::InputArg> &Ins, const Type *RetTy) { for (unsigned i = 0; i < Ins.size(); ++i) { OriginalRetWasFloatVector.push_back(originalTypeIsVectorFloat(RetTy)); } } /// Identify lowered values that originated from vXfXX arguments and record /// this. void MipsCCState::PreAnalyzeReturnForVectorFloat( const SmallVectorImpl<ISD::OutputArg> &Outs) { for (unsigned i = 0; i < Outs.size(); ++i) { ISD::OutputArg Out = Outs[i]; OriginalRetWasFloatVector.push_back( originalEVTTypeIsVectorFloat(Out.ArgVT)); } } /// Identify lowered values that originated from f128, float and sret to vXfXX /// arguments and record this. void MipsCCState::PreAnalyzeCallOperands( const SmallVectorImpl<ISD::OutputArg> &Outs, std::vector<TargetLowering::ArgListEntry> &FuncArgs, const char *Func) { for (unsigned i = 0; i < Outs.size(); ++i) { TargetLowering::ArgListEntry FuncArg = FuncArgs[Outs[i].OrigArgIndex]; OriginalArgWasF128.push_back(originalTypeIsF128(FuncArg.Ty, Func)); OriginalArgWasFloat.push_back(FuncArg.Ty->isFloatingPointTy()); OriginalArgWasFloatVector.push_back(FuncArg.Ty->isVectorTy()); CallOperandIsFixed.push_back(Outs[i].IsFixed); } } /// Identify lowered values that originated from f128, float and vXfXX arguments /// and record this. void MipsCCState::PreAnalyzeFormalArgumentsForF128( const SmallVectorImpl<ISD::InputArg> &Ins) { const MachineFunction &MF = getMachineFunction(); for (unsigned i = 0; i < Ins.size(); ++i) { Function::const_arg_iterator FuncArg = MF.getFunction().arg_begin(); // SRet arguments cannot originate from f128 or {f128} returns so we just // push false. We have to handle this specially since SRet arguments // aren't mapped to an original argument. if (Ins[i].Flags.isSRet()) { OriginalArgWasF128.push_back(false); OriginalArgWasFloat.push_back(false); OriginalArgWasFloatVector.push_back(false); continue; } assert(Ins[i].getOrigArgIndex() < MF.getFunction().arg_size()); std::advance(FuncArg, Ins[i].getOrigArgIndex()); OriginalArgWasF128.push_back( originalTypeIsF128(FuncArg->getType(), nullptr)); OriginalArgWasFloat.push_back(FuncArg->getType()->isFloatingPointTy()); // The MIPS vector ABI exhibits a corner case of sorts or quirk; if the // first argument is actually an SRet pointer to a vector, then the next // argument slot is $a2. OriginalArgWasFloatVector.push_back(FuncArg->getType()->isVectorTy()); } }
Upload File
Create Folder