12
12
13
13
using namespace llvm ;
14
14
15
- bool MipsCCState::isF128SoftLibCall (const char *CallSym) {
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" , " frexpl" , " log10l" , " log2l" ,
27
- " logl" , " nearbyintl" , " powl" , " rintl" ,
28
- " roundl" , " sincosl" , " sinl" , " sqrtl" ,
29
- " truncl" };
30
-
31
- // Check that LibCalls is sorted alphabetically.
32
- auto Comp = [](const char *S1, const char *S2) { return strcmp (S1, S2) < 0 ; };
33
- assert (llvm::is_sorted (LibCalls, Comp));
34
- return llvm::binary_search (LibCalls, CallSym, Comp);
35
- }
36
-
37
15
// / This function returns true if Ty is fp128, {f128} or i128 which was
38
16
// / originally a fp128.
39
- bool MipsCCState::originalTypeIsF128 (const Type *Ty, const char *Func ) {
17
+ bool MipsCCState::originalTypeIsF128 (const Type *Ty) {
40
18
if (Ty->isFP128Ty ())
41
19
return true ;
42
20
43
21
if (Ty->isStructTy () && Ty->getStructNumElements () == 1 &&
44
22
Ty->getStructElementType (0 )->isFP128Ty ())
45
23
return true ;
46
24
47
- // If the Ty is i128 and the function being called is a long double emulation
48
- // routine, then the original type is f128.
49
- // FIXME: This is unsound because these functions could be indirectly called
50
- return (Func && Ty->isIntegerTy (128 ) && isF128SoftLibCall (Func));
25
+ return false ;
51
26
}
52
27
53
28
// / Return true if the original type was vXfXX.
@@ -84,11 +59,9 @@ MipsCCState::getSpecialCallingConvForCallee(const SDNode *Callee,
84
59
}
85
60
86
61
void MipsCCState::PreAnalyzeCallResultForF128 (
87
- const SmallVectorImpl<ISD::InputArg> &Ins,
88
- const Type *RetTy, const char *Call) {
62
+ const SmallVectorImpl<ISD::InputArg> &Ins, const Type *RetTy) {
89
63
for (unsigned i = 0 ; i < Ins.size (); ++i) {
90
- OriginalArgWasF128.push_back (
91
- originalTypeIsF128 (RetTy, Call));
64
+ OriginalArgWasF128.push_back (originalTypeIsF128 (RetTy));
92
65
OriginalArgWasFloat.push_back (RetTy->isFloatingPointTy ());
93
66
}
94
67
}
@@ -98,8 +71,7 @@ void MipsCCState::PreAnalyzeCallResultForF128(
98
71
void MipsCCState::PreAnalyzeCallReturnForF128 (
99
72
const SmallVectorImpl<ISD::OutputArg> &Outs, const Type *RetTy) {
100
73
for (unsigned i = 0 ; i < Outs.size (); ++i) {
101
- OriginalArgWasF128.push_back (
102
- originalTypeIsF128 (RetTy, nullptr ));
74
+ OriginalArgWasF128.push_back (originalTypeIsF128 (RetTy));
103
75
OriginalArgWasFloat.push_back (
104
76
RetTy->isFloatingPointTy ());
105
77
}
@@ -129,8 +101,8 @@ void MipsCCState::PreAnalyzeReturnValue(EVT ArgVT) {
129
101
OriginalRetWasFloatVector.push_back (originalEVTTypeIsVectorFloat (ArgVT));
130
102
}
131
103
132
- void MipsCCState::PreAnalyzeCallOperand (const Type *ArgTy, const char *Func ) {
133
- OriginalArgWasF128.push_back (originalTypeIsF128 (ArgTy, Func ));
104
+ void MipsCCState::PreAnalyzeCallOperand (const Type *ArgTy) {
105
+ OriginalArgWasF128.push_back (originalTypeIsF128 (ArgTy));
134
106
OriginalArgWasFloat.push_back (ArgTy->isFloatingPointTy ());
135
107
OriginalArgWasFloatVector.push_back (ArgTy->isVectorTy ());
136
108
}
@@ -139,14 +111,13 @@ void MipsCCState::PreAnalyzeCallOperand(const Type *ArgTy, const char *Func) {
139
111
// / arguments and record this.
140
112
void MipsCCState::PreAnalyzeCallOperands (
141
113
const SmallVectorImpl<ISD::OutputArg> &Outs,
142
- std::vector<TargetLowering::ArgListEntry> &FuncArgs,
143
- const char *Func) {
114
+ std::vector<TargetLowering::ArgListEntry> &FuncArgs) {
144
115
for (unsigned i = 0 ; i < Outs.size (); ++i) {
145
116
TargetLowering::ArgListEntry FuncArg = FuncArgs[Outs[i].OrigArgIndex ];
146
117
147
- OriginalArgWasF128.push_back (originalTypeIsF128 (FuncArg.Ty , Func ));
148
- OriginalArgWasFloat.push_back (FuncArg.Ty ->isFloatingPointTy ());
149
- OriginalArgWasFloatVector.push_back (FuncArg.Ty ->isVectorTy ());
118
+ OriginalArgWasF128.push_back (originalTypeIsF128 (FuncArg.OrigTy ));
119
+ OriginalArgWasFloat.push_back (FuncArg.OrigTy ->isFloatingPointTy ());
120
+ OriginalArgWasFloatVector.push_back (FuncArg.OrigTy ->isVectorTy ());
150
121
}
151
122
}
152
123
@@ -162,7 +133,7 @@ void MipsCCState::PreAnalyzeFormalArgument(const Type *ArgTy,
162
133
return ;
163
134
}
164
135
165
- OriginalArgWasF128.push_back (originalTypeIsF128 (ArgTy, nullptr ));
136
+ OriginalArgWasF128.push_back (originalTypeIsF128 (ArgTy));
166
137
OriginalArgWasFloat.push_back (ArgTy->isFloatingPointTy ());
167
138
168
139
// The MIPS vector ABI exhibits a corner case of sorts or quirk; if the
@@ -192,8 +163,7 @@ void MipsCCState::PreAnalyzeFormalArgumentsForF128(
192
163
assert (Ins[i].getOrigArgIndex () < MF.getFunction ().arg_size ());
193
164
std::advance (FuncArg, Ins[i].getOrigArgIndex ());
194
165
195
- OriginalArgWasF128.push_back (
196
- originalTypeIsF128 (FuncArg->getType (), nullptr ));
166
+ OriginalArgWasF128.push_back (originalTypeIsF128 (FuncArg->getType ()));
197
167
OriginalArgWasFloat.push_back (FuncArg->getType ()->isFloatingPointTy ());
198
168
199
169
// The MIPS vector ABI exhibits a corner case of sorts or quirk; if the
0 commit comments