35 if (Mips::BI__builtin_mips_addu_qb <= BuiltinID &&
36 BuiltinID <= Mips::BI__builtin_mips_lwx) {
38 return Diag(TheCall->
getBeginLoc(), diag::err_mips_builtin_requires_dsp);
41 if (Mips::BI__builtin_mips_absq_s_qb <= BuiltinID &&
42 BuiltinID <= Mips::BI__builtin_mips_subuh_r_qb) {
45 diag::err_mips_builtin_requires_dspr2);
48 if (Mips::BI__builtin_msa_add_a_b <= BuiltinID &&
49 BuiltinID <= Mips::BI__builtin_msa_xori_b) {
51 return Diag(TheCall->
getBeginLoc(), diag::err_mips_builtin_requires_msa);
67 unsigned i = 0, l = 0, u = 0, m = 0;
69 default:
return false;
70 case Mips::BI__builtin_mips_wrdsp: i = 1; l = 0; u = 63;
break;
71 case Mips::BI__builtin_mips_rddsp: i = 0; l = 0; u = 63;
break;
72 case Mips::BI__builtin_mips_append: i = 2; l = 0; u = 31;
break;
73 case Mips::BI__builtin_mips_balign: i = 2; l = 0; u = 3;
break;
74 case Mips::BI__builtin_mips_precr_sra_ph_w: i = 2; l = 0; u = 31;
break;
75 case Mips::BI__builtin_mips_precr_sra_r_ph_w: i = 2; l = 0; u = 31;
break;
76 case Mips::BI__builtin_mips_prepend: i = 2; l = 0; u = 31;
break;
80 case Mips::BI__builtin_msa_bclri_b:
81 case Mips::BI__builtin_msa_bnegi_b:
82 case Mips::BI__builtin_msa_bseti_b:
83 case Mips::BI__builtin_msa_sat_s_b:
84 case Mips::BI__builtin_msa_sat_u_b:
85 case Mips::BI__builtin_msa_slli_b:
86 case Mips::BI__builtin_msa_srai_b:
87 case Mips::BI__builtin_msa_srari_b:
88 case Mips::BI__builtin_msa_srli_b:
89 case Mips::BI__builtin_msa_srlri_b: i = 1; l = 0; u = 7;
break;
90 case Mips::BI__builtin_msa_binsli_b:
91 case Mips::BI__builtin_msa_binsri_b: i = 2; l = 0; u = 7;
break;
93 case Mips::BI__builtin_msa_bclri_h:
94 case Mips::BI__builtin_msa_bnegi_h:
95 case Mips::BI__builtin_msa_bseti_h:
96 case Mips::BI__builtin_msa_sat_s_h:
97 case Mips::BI__builtin_msa_sat_u_h:
98 case Mips::BI__builtin_msa_slli_h:
99 case Mips::BI__builtin_msa_srai_h:
100 case Mips::BI__builtin_msa_srari_h:
101 case Mips::BI__builtin_msa_srli_h:
102 case Mips::BI__builtin_msa_srlri_h: i = 1; l = 0; u = 15;
break;
103 case Mips::BI__builtin_msa_binsli_h:
104 case Mips::BI__builtin_msa_binsri_h: i = 2; l = 0; u = 15;
break;
108 case Mips::BI__builtin_msa_cfcmsa:
109 case Mips::BI__builtin_msa_ctcmsa: i = 0; l = 0; u = 31;
break;
110 case Mips::BI__builtin_msa_clei_u_b:
111 case Mips::BI__builtin_msa_clei_u_h:
112 case Mips::BI__builtin_msa_clei_u_w:
113 case Mips::BI__builtin_msa_clei_u_d:
114 case Mips::BI__builtin_msa_clti_u_b:
115 case Mips::BI__builtin_msa_clti_u_h:
116 case Mips::BI__builtin_msa_clti_u_w:
117 case Mips::BI__builtin_msa_clti_u_d:
118 case Mips::BI__builtin_msa_maxi_u_b:
119 case Mips::BI__builtin_msa_maxi_u_h:
120 case Mips::BI__builtin_msa_maxi_u_w:
121 case Mips::BI__builtin_msa_maxi_u_d:
122 case Mips::BI__builtin_msa_mini_u_b:
123 case Mips::BI__builtin_msa_mini_u_h:
124 case Mips::BI__builtin_msa_mini_u_w:
125 case Mips::BI__builtin_msa_mini_u_d:
126 case Mips::BI__builtin_msa_addvi_b:
127 case Mips::BI__builtin_msa_addvi_h:
128 case Mips::BI__builtin_msa_addvi_w:
129 case Mips::BI__builtin_msa_addvi_d:
130 case Mips::BI__builtin_msa_bclri_w:
131 case Mips::BI__builtin_msa_bnegi_w:
132 case Mips::BI__builtin_msa_bseti_w:
133 case Mips::BI__builtin_msa_sat_s_w:
134 case Mips::BI__builtin_msa_sat_u_w:
135 case Mips::BI__builtin_msa_slli_w:
136 case Mips::BI__builtin_msa_srai_w:
137 case Mips::BI__builtin_msa_srari_w:
138 case Mips::BI__builtin_msa_srli_w:
139 case Mips::BI__builtin_msa_srlri_w:
140 case Mips::BI__builtin_msa_subvi_b:
141 case Mips::BI__builtin_msa_subvi_h:
142 case Mips::BI__builtin_msa_subvi_w:
143 case Mips::BI__builtin_msa_subvi_d: i = 1; l = 0; u = 31;
break;
144 case Mips::BI__builtin_msa_binsli_w:
145 case Mips::BI__builtin_msa_binsri_w: i = 2; l = 0; u = 31;
break;
147 case Mips::BI__builtin_msa_bclri_d:
148 case Mips::BI__builtin_msa_bnegi_d:
149 case Mips::BI__builtin_msa_bseti_d:
150 case Mips::BI__builtin_msa_sat_s_d:
151 case Mips::BI__builtin_msa_sat_u_d:
152 case Mips::BI__builtin_msa_slli_d:
153 case Mips::BI__builtin_msa_srai_d:
154 case Mips::BI__builtin_msa_srari_d:
155 case Mips::BI__builtin_msa_srli_d:
156 case Mips::BI__builtin_msa_srlri_d: i = 1; l = 0; u = 63;
break;
157 case Mips::BI__builtin_msa_binsli_d:
158 case Mips::BI__builtin_msa_binsri_d: i = 2; l = 0; u = 63;
break;
160 case Mips::BI__builtin_msa_ceqi_b:
161 case Mips::BI__builtin_msa_ceqi_h:
162 case Mips::BI__builtin_msa_ceqi_w:
163 case Mips::BI__builtin_msa_ceqi_d:
164 case Mips::BI__builtin_msa_clti_s_b:
165 case Mips::BI__builtin_msa_clti_s_h:
166 case Mips::BI__builtin_msa_clti_s_w:
167 case Mips::BI__builtin_msa_clti_s_d:
168 case Mips::BI__builtin_msa_clei_s_b:
169 case Mips::BI__builtin_msa_clei_s_h:
170 case Mips::BI__builtin_msa_clei_s_w:
171 case Mips::BI__builtin_msa_clei_s_d:
172 case Mips::BI__builtin_msa_maxi_s_b:
173 case Mips::BI__builtin_msa_maxi_s_h:
174 case Mips::BI__builtin_msa_maxi_s_w:
175 case Mips::BI__builtin_msa_maxi_s_d:
176 case Mips::BI__builtin_msa_mini_s_b:
177 case Mips::BI__builtin_msa_mini_s_h:
178 case Mips::BI__builtin_msa_mini_s_w:
179 case Mips::BI__builtin_msa_mini_s_d: i = 1; l = -16; u = 15;
break;
181 case Mips::BI__builtin_msa_andi_b:
182 case Mips::BI__builtin_msa_nori_b:
183 case Mips::BI__builtin_msa_ori_b:
184 case Mips::BI__builtin_msa_shf_b:
185 case Mips::BI__builtin_msa_shf_h:
186 case Mips::BI__builtin_msa_shf_w:
187 case Mips::BI__builtin_msa_xori_b: i = 1; l = 0; u = 255;
break;
188 case Mips::BI__builtin_msa_bseli_b:
189 case Mips::BI__builtin_msa_bmnzi_b:
190 case Mips::BI__builtin_msa_bmzi_b: i = 2; l = 0; u = 255;
break;
193 case Mips::BI__builtin_msa_copy_s_b:
194 case Mips::BI__builtin_msa_copy_u_b:
195 case Mips::BI__builtin_msa_insve_b:
196 case Mips::BI__builtin_msa_splati_b: i = 1; l = 0; u = 15;
break;
197 case Mips::BI__builtin_msa_sldi_b: i = 2; l = 0; u = 15;
break;
199 case Mips::BI__builtin_msa_copy_s_h:
200 case Mips::BI__builtin_msa_copy_u_h:
201 case Mips::BI__builtin_msa_insve_h:
202 case Mips::BI__builtin_msa_splati_h: i = 1; l = 0; u = 7;
break;
203 case Mips::BI__builtin_msa_sldi_h: i = 2; l = 0; u = 7;
break;
205 case Mips::BI__builtin_msa_copy_s_w:
206 case Mips::BI__builtin_msa_copy_u_w:
207 case Mips::BI__builtin_msa_insve_w:
208 case Mips::BI__builtin_msa_splati_w: i = 1; l = 0; u = 3;
break;
209 case Mips::BI__builtin_msa_sldi_w: i = 2; l = 0; u = 3;
break;
211 case Mips::BI__builtin_msa_copy_s_d:
212 case Mips::BI__builtin_msa_copy_u_d:
213 case Mips::BI__builtin_msa_insve_d:
214 case Mips::BI__builtin_msa_splati_d: i = 1; l = 0; u = 1;
break;
215 case Mips::BI__builtin_msa_sldi_d: i = 2; l = 0; u = 1;
break;
218 case Mips::BI__builtin_msa_ldi_b: i = 0; l = -128; u = 255;
break;
219 case Mips::BI__builtin_msa_ldi_h:
220 case Mips::BI__builtin_msa_ldi_w:
221 case Mips::BI__builtin_msa_ldi_d: i = 0; l = -512; u = 511;
break;
222 case Mips::BI__builtin_msa_ld_b: i = 1; l = -512; u = 511; m = 1;
break;
223 case Mips::BI__builtin_msa_ld_h: i = 1; l = -1024; u = 1022; m = 2;
break;
224 case Mips::BI__builtin_msa_ld_w: i = 1; l = -2048; u = 2044; m = 4;
break;
225 case Mips::BI__builtin_msa_ld_d: i = 1; l = -4096; u = 4088; m = 8;
break;
226 case Mips::BI__builtin_msa_ldr_d: i = 1; l = -4096; u = 4088; m = 8;
break;
227 case Mips::BI__builtin_msa_ldr_w: i = 1; l = -2048; u = 2044; m = 4;
break;
228 case Mips::BI__builtin_msa_st_b: i = 2; l = -512; u = 511; m = 1;
break;
229 case Mips::BI__builtin_msa_st_h: i = 2; l = -1024; u = 1022; m = 2;
break;
230 case Mips::BI__builtin_msa_st_w: i = 2; l = -2048; u = 2044; m = 4;
break;
231 case Mips::BI__builtin_msa_st_d: i = 2; l = -4096; u = 4088; m = 8;
break;
232 case Mips::BI__builtin_msa_str_d: i = 2; l = -4096; u = 4088; m = 8;
break;
233 case Mips::BI__builtin_msa_str_w: i = 2; l = -2048; u = 2044; m = 4;
break;
246 Diag(AL.
getLoc(), diag::err_attribute_too_many_arguments) << AL << 1;
268 Diag(
D->getLocation(), diag::warn_attribute_wrong_decl_type)
274 Diag(
D->getLocation(), diag::warn_interrupt_attribute_invalid)
280 Diag(
D->getLocation(), diag::warn_interrupt_attribute_invalid)
287 if (checkAttrMutualExclusion<Mips16Attr>(*
this,
D, AL))
290 MipsInterruptAttr::InterruptType
Kind;
291 if (!MipsInterruptAttr::ConvertStrToInterruptType(Str,
Kind)) {
292 Diag(AL.
getLoc(), diag::warn_attribute_type_not_supported)
293 << AL <<
"'" + std::string(Str) +
"'";
enum clang::sema::@1655::IndirectLocalPathEntry::EntryKind Kind
This file declares semantic analysis functions specific to MIPS.
Enumerates target-specific builtins in their own namespaces within namespace clang.
bool isRegularKeywordAttribute() const
SourceLocation getLoc() const
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
SourceLocation getBeginLoc() const LLVM_READONLY
Decl - This represents one declaration (or definition), e.g.
ParsedAttr - Represents a syntactic attribute.
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this attribute.
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
Emit a diagnostic.
ASTContext & getASTContext() const
bool CheckMipsBuiltinCpu(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
bool CheckMipsBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
bool CheckMipsBuiltinArgument(unsigned BuiltinID, CallExpr *TheCall)
void handleInterruptAttr(Decl *D, const ParsedAttr &AL)
Sema - This implements semantic analysis and AST building for C.
bool BuiltinConstantArgMultiple(CallExpr *TheCall, int ArgNum, unsigned Multiple)
BuiltinConstantArgMultiple - Handle a check if argument ArgNum of CallExpr TheCall is a constant expr...
bool BuiltinConstantArgRange(CallExpr *TheCall, int ArgNum, int Low, int High, bool RangeIsError=true)
BuiltinConstantArgRange - Handle a check if argument ArgNum of CallExpr TheCall is a constant express...
bool checkStringLiteralArgumentAttr(const AttributeCommonInfo &CI, const Expr *E, StringRef &Str, SourceLocation *ArgLocation=nullptr)
Check if the argument E is a ASCII string literal.
Encodes a location in the source.
Exposes information about the current target.
virtual bool hasFeature(StringRef Feature) const
Determine whether the given target has the given feature.
Defines the clang::TargetInfo interface.
The JSON file list parser is used to communicate input to InstallAPI.
@ ExpectedFunctionOrMethod
QualType getFunctionOrMethodResultType(const Decl *D)
bool isFuncOrMethodForAttrSubject(const Decl *D)
isFuncOrMethodForAttrSubject - Return true if the given decl has function type (function or function-...
bool hasFunctionProto(const Decl *D)
hasFunctionProto - Return true if the given decl has a argument information.
unsigned getFunctionOrMethodNumParams(const Decl *D)
getFunctionOrMethodNumParams - Return number of function or method parameters.