• Home
  • Raw
  • Download

Lines Matching refs:constant

33 	bool cast(TBasicType newType, const ConstantUnion &constant)  in cast()  argument
38 switch (constant.type) in cast()
40 case EbtInt: setFConst(static_cast<float>(constant.getIConst())); break; in cast()
41 case EbtUInt: setFConst(static_cast<float>(constant.getUConst())); break; in cast()
42 case EbtBool: setFConst(static_cast<float>(constant.getBConst())); break; in cast()
43 case EbtFloat: setFConst(static_cast<float>(constant.getFConst())); break; in cast()
48 switch (constant.type) in cast()
50 case EbtInt: setIConst(static_cast<int>(constant.getIConst())); break; in cast()
51 case EbtUInt: setIConst(static_cast<int>(constant.getUConst())); break; in cast()
52 case EbtBool: setIConst(static_cast<int>(constant.getBConst())); break; in cast()
53 case EbtFloat: setIConst(static_cast<int>(constant.getFConst())); break; in cast()
58 switch (constant.type) in cast()
60 case EbtInt: setUConst(static_cast<unsigned int>(constant.getIConst())); break; in cast()
61 case EbtUInt: setUConst(static_cast<unsigned int>(constant.getUConst())); break; in cast()
62 case EbtBool: setUConst(static_cast<unsigned int>(constant.getBConst())); break; in cast()
63 case EbtFloat: setUConst(static_cast<unsigned int>(constant.getFConst())); break; in cast()
68 switch (constant.type) in cast()
70 case EbtInt: setBConst(constant.getIConst() != 0); break; in cast()
71 case EbtUInt: setBConst(constant.getUConst() != 0); break; in cast()
72 case EbtBool: setBConst(constant.getBConst()); break; in cast()
73 case EbtFloat: setBConst(constant.getFConst() != 0.0f); break; in cast()
78 switch (constant.type) in cast()
80 case EbtInt: setIConst(constant.getIConst()); break; in cast()
81 case EbtUInt: setUConst(constant.getUConst()); break; in cast()
82 case EbtBool: setBConst(constant.getBConst()); break; in cast()
83 case EbtFloat: setFConst(constant.getFConst()); break; in cast()
138 bool operator==(const ConstantUnion& constant) const
140 if (constant.type != type)
145 return constant.iConst == iConst;
147 return constant.uConst == uConst;
149 return constant.fConst == fConst;
151 return constant.bConst == bConst;
177 bool operator!=(const ConstantUnion& constant) const
179 return !operator==(constant);
182 bool operator>(const ConstantUnion& constant) const
184 assert(type == constant.type);
187 return iConst > constant.iConst;
189 return uConst > constant.uConst;
191 return fConst > constant.fConst;
197 bool operator<(const ConstantUnion& constant) const
199 assert(type == constant.type);
202 return iConst < constant.iConst;
204 return uConst < constant.uConst;
206 return fConst < constant.fConst;
212 bool operator<=(const ConstantUnion& constant) const
214 assert(type == constant.type);
217 return iConst <= constant.iConst;
219 return uConst <= constant.uConst;
221 return fConst <= constant.fConst;
227 bool operator>=(const ConstantUnion& constant) const
229 assert(type == constant.type);
232 return iConst >= constant.iConst;
234 return uConst >= constant.uConst;
236 return fConst >= constant.fConst;
242 ConstantUnion operator+(const ConstantUnion& constant) const
245 assert(type == constant.type);
247 case EbtInt: returnValue.setIConst(iConst + constant.iConst); break;
248 case EbtUInt: returnValue.setUConst(uConst + constant.uConst); break;
249 case EbtFloat: returnValue.setFConst(fConst + constant.fConst); break;
256 ConstantUnion operator-(const ConstantUnion& constant) const
259 assert(type == constant.type);
261 case EbtInt: returnValue.setIConst(iConst - constant.iConst); break;
262 case EbtUInt: returnValue.setUConst(uConst - constant.uConst); break;
263 case EbtFloat: returnValue.setFConst(fConst - constant.fConst); break;
270 ConstantUnion operator*(const ConstantUnion& constant) const
273 assert(type == constant.type);
275 case EbtInt: returnValue.setIConst(iConst * constant.iConst); break;
276 case EbtUInt: returnValue.setUConst(uConst * constant.uConst); break;
277 case EbtFloat: returnValue.setFConst(fConst * constant.fConst); break;
284 ConstantUnion operator%(const ConstantUnion& constant) const
287 assert(type == constant.type);
289 case EbtInt: returnValue.setIConst(iConst % constant.iConst); break;
290 case EbtUInt: returnValue.setUConst(uConst % constant.uConst); break;
297 ConstantUnion operator>>(const ConstantUnion& constant) const
300 assert(type == constant.type);
302 case EbtInt: returnValue.setIConst(iConst >> constant.iConst); break;
303 case EbtUInt: returnValue.setUConst(uConst >> constant.uConst); break;
310 ConstantUnion operator<<(const ConstantUnion& constant) const
316 assert(constant.type == EbtInt || constant.type == EbtUInt);
318 case EbtInt: returnValue.setIConst(iConst << constant.iConst); break;
319 case EbtUInt: returnValue.setUConst(uConst << constant.uConst); break;
326 ConstantUnion operator&(const ConstantUnion& constant) const
329 assert(constant.type == EbtInt || constant.type == EbtUInt);
331 case EbtInt: returnValue.setIConst(iConst & constant.iConst); break;
332 case EbtUInt: returnValue.setUConst(uConst & constant.uConst); break;
339 ConstantUnion operator|(const ConstantUnion& constant) const
342 assert(type == constant.type);
344 case EbtInt: returnValue.setIConst(iConst | constant.iConst); break;
345 case EbtUInt: returnValue.setUConst(uConst | constant.uConst); break;
352 ConstantUnion operator^(const ConstantUnion& constant) const
355 assert(type == constant.type);
357 case EbtInt: returnValue.setIConst(iConst ^ constant.iConst); break;
358 case EbtUInt: returnValue.setUConst(uConst ^ constant.uConst); break;
365 ConstantUnion operator&&(const ConstantUnion& constant) const
368 assert(type == constant.type);
370 case EbtBool: returnValue.setBConst(bConst && constant.bConst); break;
377 ConstantUnion operator||(const ConstantUnion& constant) const
380 assert(type == constant.type);
382 case EbtBool: returnValue.setBConst(bConst || constant.bConst); break;