LLVM: lib/Target/Mips/MipsCCState.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

12

13using namespace llvm;

14

16 const char *const LibCalls[] = {

17 "__addtf3", "__divtf3", "__eqtf2", "__extenddftf2",

18 "__extendsftf2", "__fixtfdi", "__fixtfsi", "__fixtfti",

19 "__fixunstfdi", "__fixunstfsi", "__fixunstfti", "__floatditf",

20 "__floatsitf", "__floattitf", "__floatunditf", "__floatunsitf",

21 "__floatuntitf", "__getf2", "__gttf2", "__letf2",

22 "__lttf2", "__multf3", "__netf2", "__powitf2",

23 "__subtf3", "__trunctfdf2", "__trunctfsf2", "__unordtf2",

24 "ceill", "copysignl", "cosl", "exp2l",

25 "expl", "floorl", "fmal", "fmaxl",

26 "fmodl", "log10l", "log2l", "logl",

27 "nearbyintl", "powl", "rintl", "roundl",

28 "sinl", "sqrtl", "truncl"};

29

30

31 auto Comp = [](const char *S1, const char *S2) { return strcmp(S1, S2) < 0; };

33 return std::binary_search(std::begin(LibCalls), std::end(LibCalls), CallSym,

34 Comp);

35}

36

37

38

41 return true;

42

45 return true;

46

47

48

49

51}

52

53

56 return true;

57

58 return false;

59}

60

61

64 return true;

65

66 return false;

67}

68

75 dyn_cast(Callee)) {

77 Function *F = G->getGlobal()->getParent()->getFunction(Sym);

78 if (F && F->hasFnAttribute("__Mips16RetHelper")) {

80 }

81 }

82 }

83 return SpecialCallingConv;

84}

85

86void MipsCCState::PreAnalyzeCallResultForF128(

88 const Type *RetTy, const char *Call) {

89 for (unsigned i = 0; i < Ins.size(); ++i) {

92 OriginalArgWasFloat.push_back(RetTy->isFloatingPointTy());

93 }

94}

95

96

97

98void MipsCCState::PreAnalyzeCallReturnForF128(

100 for (unsigned i = 0; i < Outs.size(); ++i) {

104 RetTy->isFloatingPointTy());

105 }

106}

107

108

109

110void MipsCCState::PreAnalyzeCallResultForVectorFloat(

112 for (unsigned i = 0; i < Ins.size(); ++i) {

114 }

115}

116

117

118

119void MipsCCState::PreAnalyzeReturnForVectorFloat(

121 for (unsigned i = 0; i < Outs.size(); ++i) {

123 OriginalRetWasFloatVector.push_back(

125 }

126}

127

130}

131

133 const char *Func) {

137 CallOperandIsFixed.push_back(IsFixed);

138}

139

140

141

142void MipsCCState::PreAnalyzeCallOperands(

144 std::vectorTargetLowering::ArgListEntry &FuncArgs,

145 const char *Func) {

146 for (unsigned i = 0; i < Outs.size(); ++i) {

148

152 CallOperandIsFixed.push_back(Outs[i].IsFixed);

153 }

154}

155

158

159

160

161 if (Flags.isSRet()) {

162 OriginalArgWasF128.push_back(false);

163 OriginalArgWasFloat.push_back(false);

164 OriginalArgWasFloatVector.push_back(false);

165 return;

166 }

167

170

171

172

173

175}

176

177

178

179void MipsCCState::PreAnalyzeFormalArgumentsForF128(

182 for (unsigned i = 0; i < Ins.size(); ++i) {

184

185

186

187

188 if (Ins[i].Flags.isSRet()) {

189 OriginalArgWasF128.push_back(false);

190 OriginalArgWasFloat.push_back(false);

191 OriginalArgWasFloatVector.push_back(false);

192 continue;

193 }

194

196 std::advance(FuncArg, Ins[i].getOrigArgIndex());

197

201

202

203

204

206 }

207}

Module.h This file contains the declarations for the Module class.

assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())

This class represents an incoming formal argument to a Function.

MachineFunction & getMachineFunction() const

Function & getFunction()

Return the LLVM function that this machine code represents.

static bool originalTypeIsVectorFloat(const Type *Ty)

Return true if the original type was vXfXX / vXfXX.

static bool isF128SoftLibCall(const char *CallSym)

This function returns true if CallSym is a long double emulation routine.

void PreAnalyzeReturnValue(EVT ArgVT)

static bool originalTypeIsF128(const Type *Ty, const char *Func)

This function returns true if Ty is fp128, {f128} or i128 which was originally a fp128.

static bool originalEVTTypeIsVectorFloat(EVT Ty)

Return true if the original type was vXfXX.

void PreAnalyzeCallOperand(const Type *ArgTy, bool IsFixed, const char *Func)

void PreAnalyzeFormalArgument(const Type *ArgTy, ISD::ArgFlagsTy Flags)

static SpecialCallingConvType getSpecialCallingConvForCallee(const SDNode *Callee, const MipsSubtarget &Subtarget)

Determine the SpecialCallingConvType for the given callee.

bool inMips16HardFloat() const

Represents one node in the SelectionDAG.

This class consists of common code factored out of the SmallVector class to reduce code duplication b...

void push_back(const T &Elt)

StringRef - Represent a constant reference to a string, i.e.

The instances of the Type class are immutable: once they are created, they are never changed.

Type * getStructElementType(unsigned N) const

bool isVectorTy() const

True if this is an instance of VectorType.

unsigned getStructNumElements() const

bool isFP128Ty() const

Return true if this is 'fp128'.

bool isStructTy() const

True if this is an instance of StructType.

bool isFloatingPointTy() const

Return true if this is one of the floating-point types.

bool isIntegerTy() const

True if this is an instance of IntegerType.

bool isFPOrFPVectorTy() const

Return true if this is a FP type or a vector of FP.

Type * getType() const

All values are typed, get the type of this value.

This is an optimization pass for GlobalISel generic memory operations.

bool is_sorted(R &&Range, Compare C)

Wrapper function around std::is_sorted to check if elements in a range R are sorted with respect to a...

bool isFloatingPoint() const

Return true if this is a FP or a vector FP type.

bool isVector() const

Return true if this is a vector value type.

EVT getVectorElementType() const

Given a vector type, return the type of each element.

OutputArg - This struct carries flags and a value for a single outgoing (actual) argument or outgoing...