1 // Copyright 2016 The SwiftShader Authors. All Rights Reserved.
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 #ifndef sw_Reactor_hpp
16 #define sw_Reactor_hpp
18 #include "Nucleus.hpp"
19 #include "Routine.hpp"
57 static Type *getType();
75 LValue(int arraySize = 0);
82 Value *loadValue(unsigned int alignment = 0) const;
83 Value *storeValue(Value *value, unsigned int alignment = 0) const;
84 Value *storeValue(Constant *constant, unsigned int alignment = 0) const;
85 Value *getAddress(Value *index) const;
92 class Variable : public LValue<T>
95 Variable(int arraySize = 0);
97 RValue<Pointer<T>> operator&();
104 explicit Reference(Value *pointer, int alignment = 1);
106 RValue<T> operator=(RValue<T> rhs) const;
107 RValue<T> operator=(const Reference<T> &ref) const;
109 RValue<T> operator+=(RValue<T> rhs) const;
111 Value *loadValue() const;
112 int getAlignment() const;
135 typedef unsigned int type;
141 typedef int64_t type;
160 explicit RValue(Value *rvalue);
162 RValue(const T &lvalue);
163 RValue(typename IntLiteral<T>::type i);
164 RValue(typename FloatLiteral<T>::type f);
165 RValue(const Reference<T> &rhs);
167 RValue<T> &operator=(const RValue<T>&) = delete;
169 Value *value; // FIXME: Make private
175 explicit Argument(Value *value) : value(value) {}
180 class Bool : public Variable<Bool>
183 Bool(Argument<Bool> argument);
187 Bool(RValue<Bool> rhs);
188 Bool(const Bool &rhs);
189 Bool(const Reference<Bool> &rhs);
191 // RValue<Bool> operator=(bool rhs) const; // FIXME: Implement
192 RValue<Bool> operator=(RValue<Bool> rhs) const;
193 RValue<Bool> operator=(const Bool &rhs) const;
194 RValue<Bool> operator=(const Reference<Bool> &rhs) const;
196 static Type *getType();
199 RValue<Bool> operator!(RValue<Bool> val);
200 RValue<Bool> operator&&(RValue<Bool> lhs, RValue<Bool> rhs);
201 RValue<Bool> operator||(RValue<Bool> lhs, RValue<Bool> rhs);
203 class Byte : public Variable<Byte>
206 Byte(Argument<Byte> argument);
208 explicit Byte(RValue<Int> cast);
209 explicit Byte(RValue<UInt> cast);
210 explicit Byte(RValue<UShort> cast);
214 Byte(unsigned char x);
215 Byte(RValue<Byte> rhs);
216 Byte(const Byte &rhs);
217 Byte(const Reference<Byte> &rhs);
219 // RValue<Byte> operator=(unsigned char rhs) const; // FIXME: Implement
220 RValue<Byte> operator=(RValue<Byte> rhs) const;
221 RValue<Byte> operator=(const Byte &rhs) const;
222 RValue<Byte> operator=(const Reference<Byte> &rhs) const;
224 static Type *getType();
227 RValue<Byte> operator+(RValue<Byte> lhs, RValue<Byte> rhs);
228 RValue<Byte> operator-(RValue<Byte> lhs, RValue<Byte> rhs);
229 RValue<Byte> operator*(RValue<Byte> lhs, RValue<Byte> rhs);
230 RValue<Byte> operator/(RValue<Byte> lhs, RValue<Byte> rhs);
231 RValue<Byte> operator%(RValue<Byte> lhs, RValue<Byte> rhs);
232 RValue<Byte> operator&(RValue<Byte> lhs, RValue<Byte> rhs);
233 RValue<Byte> operator|(RValue<Byte> lhs, RValue<Byte> rhs);
234 RValue<Byte> operator^(RValue<Byte> lhs, RValue<Byte> rhs);
235 RValue<Byte> operator<<(RValue<Byte> lhs, RValue<Byte> rhs);
236 RValue<Byte> operator>>(RValue<Byte> lhs, RValue<Byte> rhs);
237 RValue<Byte> operator+=(const Byte &lhs, RValue<Byte> rhs);
238 RValue<Byte> operator-=(const Byte &lhs, RValue<Byte> rhs);
239 RValue<Byte> operator*=(const Byte &lhs, RValue<Byte> rhs);
240 RValue<Byte> operator/=(const Byte &lhs, RValue<Byte> rhs);
241 RValue<Byte> operator%=(const Byte &lhs, RValue<Byte> rhs);
242 RValue<Byte> operator&=(const Byte &lhs, RValue<Byte> rhs);
243 RValue<Byte> operator|=(const Byte &lhs, RValue<Byte> rhs);
244 RValue<Byte> operator^=(const Byte &lhs, RValue<Byte> rhs);
245 RValue<Byte> operator<<=(const Byte &lhs, RValue<Byte> rhs);
246 RValue<Byte> operator>>=(const Byte &lhs, RValue<Byte> rhs);
247 RValue<Byte> operator+(RValue<Byte> val);
248 RValue<Byte> operator-(RValue<Byte> val);
249 RValue<Byte> operator~(RValue<Byte> val);
250 RValue<Byte> operator++(const Byte &val, int); // Post-increment
251 const Byte &operator++(const Byte &val); // Pre-increment
252 RValue<Byte> operator--(const Byte &val, int); // Post-decrement
253 const Byte &operator--(const Byte &val); // Pre-decrement
254 RValue<Bool> operator<(RValue<Byte> lhs, RValue<Byte> rhs);
255 RValue<Bool> operator<=(RValue<Byte> lhs, RValue<Byte> rhs);
256 RValue<Bool> operator>(RValue<Byte> lhs, RValue<Byte> rhs);
257 RValue<Bool> operator>=(RValue<Byte> lhs, RValue<Byte> rhs);
258 RValue<Bool> operator!=(RValue<Byte> lhs, RValue<Byte> rhs);
259 RValue<Bool> operator==(RValue<Byte> lhs, RValue<Byte> rhs);
261 class SByte : public Variable<SByte>
264 SByte(Argument<SByte> argument);
266 explicit SByte(RValue<Int> cast);
267 explicit SByte(RValue<Short> cast);
270 SByte(signed char x);
271 SByte(RValue<SByte> rhs);
272 SByte(const SByte &rhs);
273 SByte(const Reference<SByte> &rhs);
275 // RValue<SByte> operator=(signed char rhs) const; // FIXME: Implement
276 RValue<SByte> operator=(RValue<SByte> rhs) const;
277 RValue<SByte> operator=(const SByte &rhs) const;
278 RValue<SByte> operator=(const Reference<SByte> &rhs) const;
280 static Type *getType();
283 RValue<SByte> operator+(RValue<SByte> lhs, RValue<SByte> rhs);
284 RValue<SByte> operator-(RValue<SByte> lhs, RValue<SByte> rhs);
285 RValue<SByte> operator*(RValue<SByte> lhs, RValue<SByte> rhs);
286 RValue<SByte> operator/(RValue<SByte> lhs, RValue<SByte> rhs);
287 RValue<SByte> operator%(RValue<SByte> lhs, RValue<SByte> rhs);
288 RValue<SByte> operator&(RValue<SByte> lhs, RValue<SByte> rhs);
289 RValue<SByte> operator|(RValue<SByte> lhs, RValue<SByte> rhs);
290 RValue<SByte> operator^(RValue<SByte> lhs, RValue<SByte> rhs);
291 RValue<SByte> operator<<(RValue<SByte> lhs, RValue<SByte> rhs);
292 RValue<SByte> operator>>(RValue<SByte> lhs, RValue<SByte> rhs);
293 RValue<SByte> operator+=(const SByte &lhs, RValue<SByte> rhs);
294 RValue<SByte> operator-=(const SByte &lhs, RValue<SByte> rhs);
295 RValue<SByte> operator*=(const SByte &lhs, RValue<SByte> rhs);
296 RValue<SByte> operator/=(const SByte &lhs, RValue<SByte> rhs);
297 RValue<SByte> operator%=(const SByte &lhs, RValue<SByte> rhs);
298 RValue<SByte> operator&=(const SByte &lhs, RValue<SByte> rhs);
299 RValue<SByte> operator|=(const SByte &lhs, RValue<SByte> rhs);
300 RValue<SByte> operator^=(const SByte &lhs, RValue<SByte> rhs);
301 RValue<SByte> operator<<=(const SByte &lhs, RValue<SByte> rhs);
302 RValue<SByte> operator>>=(const SByte &lhs, RValue<SByte> rhs);
303 RValue<SByte> operator+(RValue<SByte> val);
304 RValue<SByte> operator-(RValue<SByte> val);
305 RValue<SByte> operator~(RValue<SByte> val);
306 RValue<SByte> operator++(const SByte &val, int); // Post-increment
307 const SByte &operator++(const SByte &val); // Pre-increment
308 RValue<SByte> operator--(const SByte &val, int); // Post-decrement
309 const SByte &operator--(const SByte &val); // Pre-decrement
310 RValue<Bool> operator<(RValue<SByte> lhs, RValue<SByte> rhs);
311 RValue<Bool> operator<=(RValue<SByte> lhs, RValue<SByte> rhs);
312 RValue<Bool> operator>(RValue<SByte> lhs, RValue<SByte> rhs);
313 RValue<Bool> operator>=(RValue<SByte> lhs, RValue<SByte> rhs);
314 RValue<Bool> operator!=(RValue<SByte> lhs, RValue<SByte> rhs);
315 RValue<Bool> operator==(RValue<SByte> lhs, RValue<SByte> rhs);
317 class Short : public Variable<Short>
320 Short(Argument<Short> argument);
322 explicit Short(RValue<Int> cast);
326 Short(RValue<Short> rhs);
327 Short(const Short &rhs);
328 Short(const Reference<Short> &rhs);
330 // RValue<Short> operator=(short rhs) const; // FIXME: Implement
331 RValue<Short> operator=(RValue<Short> rhs) const;
332 RValue<Short> operator=(const Short &rhs) const;
333 RValue<Short> operator=(const Reference<Short> &rhs) const;
335 static Type *getType();
338 RValue<Short> operator+(RValue<Short> lhs, RValue<Short> rhs);
339 RValue<Short> operator-(RValue<Short> lhs, RValue<Short> rhs);
340 RValue<Short> operator*(RValue<Short> lhs, RValue<Short> rhs);
341 RValue<Short> operator/(RValue<Short> lhs, RValue<Short> rhs);
342 RValue<Short> operator%(RValue<Short> lhs, RValue<Short> rhs);
343 RValue<Short> operator&(RValue<Short> lhs, RValue<Short> rhs);
344 RValue<Short> operator|(RValue<Short> lhs, RValue<Short> rhs);
345 RValue<Short> operator^(RValue<Short> lhs, RValue<Short> rhs);
346 RValue<Short> operator<<(RValue<Short> lhs, RValue<Short> rhs);
347 RValue<Short> operator>>(RValue<Short> lhs, RValue<Short> rhs);
348 RValue<Short> operator+=(const Short &lhs, RValue<Short> rhs);
349 RValue<Short> operator-=(const Short &lhs, RValue<Short> rhs);
350 RValue<Short> operator*=(const Short &lhs, RValue<Short> rhs);
351 RValue<Short> operator/=(const Short &lhs, RValue<Short> rhs);
352 RValue<Short> operator%=(const Short &lhs, RValue<Short> rhs);
353 RValue<Short> operator&=(const Short &lhs, RValue<Short> rhs);
354 RValue<Short> operator|=(const Short &lhs, RValue<Short> rhs);
355 RValue<Short> operator^=(const Short &lhs, RValue<Short> rhs);
356 RValue<Short> operator<<=(const Short &lhs, RValue<Short> rhs);
357 RValue<Short> operator>>=(const Short &lhs, RValue<Short> rhs);
358 RValue<Short> operator+(RValue<Short> val);
359 RValue<Short> operator-(RValue<Short> val);
360 RValue<Short> operator~(RValue<Short> val);
361 RValue<Short> operator++(const Short &val, int); // Post-increment
362 const Short &operator++(const Short &val); // Pre-increment
363 RValue<Short> operator--(const Short &val, int); // Post-decrement
364 const Short &operator--(const Short &val); // Pre-decrement
365 RValue<Bool> operator<(RValue<Short> lhs, RValue<Short> rhs);
366 RValue<Bool> operator<=(RValue<Short> lhs, RValue<Short> rhs);
367 RValue<Bool> operator>(RValue<Short> lhs, RValue<Short> rhs);
368 RValue<Bool> operator>=(RValue<Short> lhs, RValue<Short> rhs);
369 RValue<Bool> operator!=(RValue<Short> lhs, RValue<Short> rhs);
370 RValue<Bool> operator==(RValue<Short> lhs, RValue<Short> rhs);
372 class UShort : public Variable<UShort>
375 UShort(Argument<UShort> argument);
377 explicit UShort(RValue<UInt> cast);
378 explicit UShort(RValue<Int> cast);
381 UShort(unsigned short x);
382 UShort(RValue<UShort> rhs);
383 UShort(const UShort &rhs);
384 UShort(const Reference<UShort> &rhs);
386 // RValue<UShort> operator=(unsigned short rhs) const; // FIXME: Implement
387 RValue<UShort> operator=(RValue<UShort> rhs) const;
388 RValue<UShort> operator=(const UShort &rhs) const;
389 RValue<UShort> operator=(const Reference<UShort> &rhs) const;
391 static Type *getType();
394 RValue<UShort> operator+(RValue<UShort> lhs, RValue<UShort> rhs);
395 RValue<UShort> operator-(RValue<UShort> lhs, RValue<UShort> rhs);
396 RValue<UShort> operator*(RValue<UShort> lhs, RValue<UShort> rhs);
397 RValue<UShort> operator/(RValue<UShort> lhs, RValue<UShort> rhs);
398 RValue<UShort> operator%(RValue<UShort> lhs, RValue<UShort> rhs);
399 RValue<UShort> operator&(RValue<UShort> lhs, RValue<UShort> rhs);
400 RValue<UShort> operator|(RValue<UShort> lhs, RValue<UShort> rhs);
401 RValue<UShort> operator^(RValue<UShort> lhs, RValue<UShort> rhs);
402 RValue<UShort> operator<<(RValue<UShort> lhs, RValue<UShort> rhs);
403 RValue<UShort> operator>>(RValue<UShort> lhs, RValue<UShort> rhs);
404 RValue<UShort> operator+=(const UShort &lhs, RValue<UShort> rhs);
405 RValue<UShort> operator-=(const UShort &lhs, RValue<UShort> rhs);
406 RValue<UShort> operator*=(const UShort &lhs, RValue<UShort> rhs);
407 RValue<UShort> operator/=(const UShort &lhs, RValue<UShort> rhs);
408 RValue<UShort> operator%=(const UShort &lhs, RValue<UShort> rhs);
409 RValue<UShort> operator&=(const UShort &lhs, RValue<UShort> rhs);
410 RValue<UShort> operator|=(const UShort &lhs, RValue<UShort> rhs);
411 RValue<UShort> operator^=(const UShort &lhs, RValue<UShort> rhs);
412 RValue<UShort> operator<<=(const UShort &lhs, RValue<UShort> rhs);
413 RValue<UShort> operator>>=(const UShort &lhs, RValue<UShort> rhs);
414 RValue<UShort> operator+(RValue<UShort> val);
415 RValue<UShort> operator-(RValue<UShort> val);
416 RValue<UShort> operator~(RValue<UShort> val);
417 RValue<UShort> operator++(const UShort &val, int); // Post-increment
418 const UShort &operator++(const UShort &val); // Pre-increment
419 RValue<UShort> operator--(const UShort &val, int); // Post-decrement
420 const UShort &operator--(const UShort &val); // Pre-decrement
421 RValue<Bool> operator<(RValue<UShort> lhs, RValue<UShort> rhs);
422 RValue<Bool> operator<=(RValue<UShort> lhs, RValue<UShort> rhs);
423 RValue<Bool> operator>(RValue<UShort> lhs, RValue<UShort> rhs);
424 RValue<Bool> operator>=(RValue<UShort> lhs, RValue<UShort> rhs);
425 RValue<Bool> operator!=(RValue<UShort> lhs, RValue<UShort> rhs);
426 RValue<Bool> operator==(RValue<UShort> lhs, RValue<UShort> rhs);
428 class Byte4 : public Variable<Byte4>
432 // Byte4(int x, int y, int z, int w);
433 // Byte4(RValue<Byte4> rhs);
434 // Byte4(const Byte4 &rhs);
435 // Byte4(const Reference<Byte4> &rhs);
437 // RValue<Byte4> operator=(RValue<Byte4> rhs) const;
438 // RValue<Byte4> operator=(const Byte4 &rhs) const;
439 // RValue<Byte4> operator=(const Reference<Byte4> &rhs) const;
441 static Type *getType();
444 // RValue<Byte4> operator+(RValue<Byte4> lhs, RValue<Byte4> rhs);
445 // RValue<Byte4> operator-(RValue<Byte4> lhs, RValue<Byte4> rhs);
446 // RValue<Byte4> operator*(RValue<Byte4> lhs, RValue<Byte4> rhs);
447 // RValue<Byte4> operator/(RValue<Byte4> lhs, RValue<Byte4> rhs);
448 // RValue<Byte4> operator%(RValue<Byte4> lhs, RValue<Byte4> rhs);
449 // RValue<Byte4> operator&(RValue<Byte4> lhs, RValue<Byte4> rhs);
450 // RValue<Byte4> operator|(RValue<Byte4> lhs, RValue<Byte4> rhs);
451 // RValue<Byte4> operator^(RValue<Byte4> lhs, RValue<Byte4> rhs);
452 // RValue<Byte4> operator<<(RValue<Byte4> lhs, RValue<Byte4> rhs);
453 // RValue<Byte4> operator>>(RValue<Byte4> lhs, RValue<Byte4> rhs);
454 // RValue<Byte4> operator+=(const Byte4 &lhs, RValue<Byte4> rhs);
455 // RValue<Byte4> operator-=(const Byte4 &lhs, RValue<Byte4> rhs);
456 // RValue<Byte4> operator*=(const Byte4 &lhs, RValue<Byte4> rhs);
457 // RValue<Byte4> operator/=(const Byte4 &lhs, RValue<Byte4> rhs);
458 // RValue<Byte4> operator%=(const Byte4 &lhs, RValue<Byte4> rhs);
459 // RValue<Byte4> operator&=(const Byte4 &lhs, RValue<Byte4> rhs);
460 // RValue<Byte4> operator|=(const Byte4 &lhs, RValue<Byte4> rhs);
461 // RValue<Byte4> operator^=(const Byte4 &lhs, RValue<Byte4> rhs);
462 // RValue<Byte4> operator<<=(const Byte4 &lhs, RValue<Byte4> rhs);
463 // RValue<Byte4> operator>>=(const Byte4 &lhs, RValue<Byte4> rhs);
464 // RValue<Byte4> operator+(RValue<Byte4> val);
465 // RValue<Byte4> operator-(RValue<Byte4> val);
466 // RValue<Byte4> operator~(RValue<Byte4> val);
467 // RValue<Byte4> operator++(const Byte4 &val, int); // Post-increment
468 // const Byte4 &operator++(const Byte4 &val); // Pre-increment
469 // RValue<Byte4> operator--(const Byte4 &val, int); // Post-decrement
470 // const Byte4 &operator--(const Byte4 &val); // Pre-decrement
472 class SByte4 : public Variable<SByte4>
476 // SByte4(int x, int y, int z, int w);
477 // SByte4(RValue<SByte4> rhs);
478 // SByte4(const SByte4 &rhs);
479 // SByte4(const Reference<SByte4> &rhs);
481 // RValue<SByte4> operator=(RValue<SByte4> rhs) const;
482 // RValue<SByte4> operator=(const SByte4 &rhs) const;
483 // RValue<SByte4> operator=(const Reference<SByte4> &rhs) const;
485 static Type *getType();
488 // RValue<SByte4> operator+(RValue<SByte4> lhs, RValue<SByte4> rhs);
489 // RValue<SByte4> operator-(RValue<SByte4> lhs, RValue<SByte4> rhs);
490 // RValue<SByte4> operator*(RValue<SByte4> lhs, RValue<SByte4> rhs);
491 // RValue<SByte4> operator/(RValue<SByte4> lhs, RValue<SByte4> rhs);
492 // RValue<SByte4> operator%(RValue<SByte4> lhs, RValue<SByte4> rhs);
493 // RValue<SByte4> operator&(RValue<SByte4> lhs, RValue<SByte4> rhs);
494 // RValue<SByte4> operator|(RValue<SByte4> lhs, RValue<SByte4> rhs);
495 // RValue<SByte4> operator^(RValue<SByte4> lhs, RValue<SByte4> rhs);
496 // RValue<SByte4> operator<<(RValue<SByte4> lhs, RValue<SByte4> rhs);
497 // RValue<SByte4> operator>>(RValue<SByte4> lhs, RValue<SByte4> rhs);
498 // RValue<SByte4> operator+=(const SByte4 &lhs, RValue<SByte4> rhs);
499 // RValue<SByte4> operator-=(const SByte4 &lhs, RValue<SByte4> rhs);
500 // RValue<SByte4> operator*=(const SByte4 &lhs, RValue<SByte4> rhs);
501 // RValue<SByte4> operator/=(const SByte4 &lhs, RValue<SByte4> rhs);
502 // RValue<SByte4> operator%=(const SByte4 &lhs, RValue<SByte4> rhs);
503 // RValue<SByte4> operator&=(const SByte4 &lhs, RValue<SByte4> rhs);
504 // RValue<SByte4> operator|=(const SByte4 &lhs, RValue<SByte4> rhs);
505 // RValue<SByte4> operator^=(const SByte4 &lhs, RValue<SByte4> rhs);
506 // RValue<SByte4> operator<<=(const SByte4 &lhs, RValue<SByte4> rhs);
507 // RValue<SByte4> operator>>=(const SByte4 &lhs, RValue<SByte4> rhs);
508 // RValue<SByte4> operator+(RValue<SByte4> val);
509 // RValue<SByte4> operator-(RValue<SByte4> val);
510 // RValue<SByte4> operator~(RValue<SByte4> val);
511 // RValue<SByte4> operator++(const SByte4 &val, int); // Post-increment
512 // const SByte4 &operator++(const SByte4 &val); // Pre-increment
513 // RValue<SByte4> operator--(const SByte4 &val, int); // Post-decrement
514 // const SByte4 &operator--(const SByte4 &val); // Pre-decrement
516 class Byte8 : public Variable<Byte8>
520 Byte8(uint8_t x0, uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, uint8_t x5, uint8_t x6, uint8_t x7);
522 Byte8(RValue<Byte8> rhs);
523 Byte8(const Byte8 &rhs);
524 Byte8(const Reference<Byte8> &rhs);
526 RValue<Byte8> operator=(RValue<Byte8> rhs) const;
527 RValue<Byte8> operator=(const Byte8 &rhs) const;
528 RValue<Byte8> operator=(const Reference<Byte8> &rhs) const;
530 static Type *getType();
533 RValue<Byte8> operator+(RValue<Byte8> lhs, RValue<Byte8> rhs);
534 RValue<Byte8> operator-(RValue<Byte8> lhs, RValue<Byte8> rhs);
535 // RValue<Byte8> operator*(RValue<Byte8> lhs, RValue<Byte8> rhs);
536 // RValue<Byte8> operator/(RValue<Byte8> lhs, RValue<Byte8> rhs);
537 // RValue<Byte8> operator%(RValue<Byte8> lhs, RValue<Byte8> rhs);
538 RValue<Byte8> operator&(RValue<Byte8> lhs, RValue<Byte8> rhs);
539 RValue<Byte8> operator|(RValue<Byte8> lhs, RValue<Byte8> rhs);
540 RValue<Byte8> operator^(RValue<Byte8> lhs, RValue<Byte8> rhs);
541 // RValue<Byte8> operator<<(RValue<Byte8> lhs, RValue<Byte8> rhs);
542 // RValue<Byte8> operator>>(RValue<Byte8> lhs, RValue<Byte8> rhs);
543 RValue<Byte8> operator+=(const Byte8 &lhs, RValue<Byte8> rhs);
544 RValue<Byte8> operator-=(const Byte8 &lhs, RValue<Byte8> rhs);
545 // RValue<Byte8> operator*=(const Byte8 &lhs, RValue<Byte8> rhs);
546 // RValue<Byte8> operator/=(const Byte8 &lhs, RValue<Byte8> rhs);
547 // RValue<Byte8> operator%=(const Byte8 &lhs, RValue<Byte8> rhs);
548 RValue<Byte8> operator&=(const Byte8 &lhs, RValue<Byte8> rhs);
549 RValue<Byte8> operator|=(const Byte8 &lhs, RValue<Byte8> rhs);
550 RValue<Byte8> operator^=(const Byte8 &lhs, RValue<Byte8> rhs);
551 // RValue<Byte8> operator<<=(const Byte8 &lhs, RValue<Byte8> rhs);
552 // RValue<Byte8> operator>>=(const Byte8 &lhs, RValue<Byte8> rhs);
553 // RValue<Byte8> operator+(RValue<Byte8> val);
554 // RValue<Byte8> operator-(RValue<Byte8> val);
555 RValue<Byte8> operator~(RValue<Byte8> val);
556 // RValue<Byte8> operator++(const Byte8 &val, int); // Post-increment
557 // const Byte8 &operator++(const Byte8 &val); // Pre-increment
558 // RValue<Byte8> operator--(const Byte8 &val, int); // Post-decrement
559 // const Byte8 &operator--(const Byte8 &val); // Pre-decrement
561 RValue<Byte8> AddSat(RValue<Byte8> x, RValue<Byte8> y);
562 RValue<Byte8> SubSat(RValue<Byte8> x, RValue<Byte8> y);
563 RValue<Short4> Unpack(RValue<Byte4> x);
564 RValue<Short4> UnpackLow(RValue<Byte8> x, RValue<Byte8> y);
565 RValue<Short4> UnpackHigh(RValue<Byte8> x, RValue<Byte8> y);
566 RValue<Int> SignMask(RValue<Byte8> x);
567 // RValue<Byte8> CmpGT(RValue<Byte8> x, RValue<Byte8> y);
568 RValue<Byte8> CmpEQ(RValue<Byte8> x, RValue<Byte8> y);
570 class SByte8 : public Variable<SByte8>
574 SByte8(uint8_t x0, uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, uint8_t x5, uint8_t x6, uint8_t x7);
576 SByte8(RValue<SByte8> rhs);
577 SByte8(const SByte8 &rhs);
578 SByte8(const Reference<SByte8> &rhs);
580 RValue<SByte8> operator=(RValue<SByte8> rhs) const;
581 RValue<SByte8> operator=(const SByte8 &rhs) const;
582 RValue<SByte8> operator=(const Reference<SByte8> &rhs) const;
584 static Type *getType();
587 RValue<SByte8> operator+(RValue<SByte8> lhs, RValue<SByte8> rhs);
588 RValue<SByte8> operator-(RValue<SByte8> lhs, RValue<SByte8> rhs);
589 // RValue<SByte8> operator*(RValue<SByte8> lhs, RValue<SByte8> rhs);
590 // RValue<SByte8> operator/(RValue<SByte8> lhs, RValue<SByte8> rhs);
591 // RValue<SByte8> operator%(RValue<SByte8> lhs, RValue<SByte8> rhs);
592 RValue<SByte8> operator&(RValue<SByte8> lhs, RValue<SByte8> rhs);
593 RValue<SByte8> operator|(RValue<SByte8> lhs, RValue<SByte8> rhs);
594 RValue<SByte8> operator^(RValue<SByte8> lhs, RValue<SByte8> rhs);
595 // RValue<SByte8> operator<<(RValue<SByte8> lhs, RValue<SByte8> rhs);
596 // RValue<SByte8> operator>>(RValue<SByte8> lhs, RValue<SByte8> rhs);
597 RValue<SByte8> operator+=(const SByte8 &lhs, RValue<SByte8> rhs);
598 RValue<SByte8> operator-=(const SByte8 &lhs, RValue<SByte8> rhs);
599 // RValue<SByte8> operator*=(const SByte8 &lhs, RValue<SByte8> rhs);
600 // RValue<SByte8> operator/=(const SByte8 &lhs, RValue<SByte8> rhs);
601 // RValue<SByte8> operator%=(const SByte8 &lhs, RValue<SByte8> rhs);
602 RValue<SByte8> operator&=(const SByte8 &lhs, RValue<SByte8> rhs);
603 RValue<SByte8> operator|=(const SByte8 &lhs, RValue<SByte8> rhs);
604 RValue<SByte8> operator^=(const SByte8 &lhs, RValue<SByte8> rhs);
605 // RValue<SByte8> operator<<=(const SByte8 &lhs, RValue<SByte8> rhs);
606 // RValue<SByte8> operator>>=(const SByte8 &lhs, RValue<SByte8> rhs);
607 // RValue<SByte8> operator+(RValue<SByte8> val);
608 // RValue<SByte8> operator-(RValue<SByte8> val);
609 RValue<SByte8> operator~(RValue<SByte8> val);
610 // RValue<SByte8> operator++(const SByte8 &val, int); // Post-increment
611 // const SByte8 &operator++(const SByte8 &val); // Pre-increment
612 // RValue<SByte8> operator--(const SByte8 &val, int); // Post-decrement
613 // const SByte8 &operator--(const SByte8 &val); // Pre-decrement
615 RValue<SByte8> AddSat(RValue<SByte8> x, RValue<SByte8> y);
616 RValue<SByte8> SubSat(RValue<SByte8> x, RValue<SByte8> y);
617 RValue<Short4> UnpackLow(RValue<SByte8> x, RValue<SByte8> y);
618 RValue<Short4> UnpackHigh(RValue<SByte8> x, RValue<SByte8> y);
619 RValue<Int> SignMask(RValue<SByte8> x);
620 RValue<Byte8> CmpGT(RValue<SByte8> x, RValue<SByte8> y);
621 RValue<Byte8> CmpEQ(RValue<SByte8> x, RValue<SByte8> y);
623 class Byte16 : public Variable<Byte16>
627 // Byte16(int x, int y, int z, int w);
628 Byte16(RValue<Byte16> rhs);
629 Byte16(const Byte16 &rhs);
630 Byte16(const Reference<Byte16> &rhs);
632 RValue<Byte16> operator=(RValue<Byte16> rhs) const;
633 RValue<Byte16> operator=(const Byte16 &rhs) const;
634 RValue<Byte16> operator=(const Reference<Byte16> &rhs) const;
636 static Type *getType();
639 // RValue<Byte16> operator+(RValue<Byte16> lhs, RValue<Byte16> rhs);
640 // RValue<Byte16> operator-(RValue<Byte16> lhs, RValue<Byte16> rhs);
641 // RValue<Byte16> operator*(RValue<Byte16> lhs, RValue<Byte16> rhs);
642 // RValue<Byte16> operator/(RValue<Byte16> lhs, RValue<Byte16> rhs);
643 // RValue<Byte16> operator%(RValue<Byte16> lhs, RValue<Byte16> rhs);
644 // RValue<Byte16> operator&(RValue<Byte16> lhs, RValue<Byte16> rhs);
645 // RValue<Byte16> operator|(RValue<Byte16> lhs, RValue<Byte16> rhs);
646 // RValue<Byte16> operator^(RValue<Byte16> lhs, RValue<Byte16> rhs);
647 // RValue<Byte16> operator<<(RValue<Byte16> lhs, RValue<Byte16> rhs);
648 // RValue<Byte16> operator>>(RValue<Byte16> lhs, RValue<Byte16> rhs);
649 // RValue<Byte16> operator+=(const Byte16 &lhs, RValue<Byte16> rhs);
650 // RValue<Byte16> operator-=(const Byte16 &lhs, RValue<Byte16> rhs);
651 // RValue<Byte16> operator*=(const Byte16 &lhs, RValue<Byte16> rhs);
652 // RValue<Byte16> operator/=(const Byte16 &lhs, RValue<Byte16> rhs);
653 // RValue<Byte16> operator%=(const Byte16 &lhs, RValue<Byte16> rhs);
654 // RValue<Byte16> operator&=(const Byte16 &lhs, RValue<Byte16> rhs);
655 // RValue<Byte16> operator|=(const Byte16 &lhs, RValue<Byte16> rhs);
656 // RValue<Byte16> operator^=(const Byte16 &lhs, RValue<Byte16> rhs);
657 // RValue<Byte16> operator<<=(const Byte16 &lhs, RValue<Byte16> rhs);
658 // RValue<Byte16> operator>>=(const Byte16 &lhs, RValue<Byte16> rhs);
659 // RValue<Byte16> operator+(RValue<Byte16> val);
660 // RValue<Byte16> operator-(RValue<Byte16> val);
661 // RValue<Byte16> operator~(RValue<Byte16> val);
662 // RValue<Byte16> operator++(const Byte16 &val, int); // Post-increment
663 // const Byte16 &operator++(const Byte16 &val); // Pre-increment
664 // RValue<Byte16> operator--(const Byte16 &val, int); // Post-decrement
665 // const Byte16 &operator--(const Byte16 &val); // Pre-decrement
667 class SByte16 : public Variable<SByte16>
671 // SByte16(int x, int y, int z, int w);
672 // SByte16(RValue<SByte16> rhs);
673 // SByte16(const SByte16 &rhs);
674 // SByte16(const Reference<SByte16> &rhs);
676 // RValue<SByte16> operator=(RValue<SByte16> rhs) const;
677 // RValue<SByte16> operator=(const SByte16 &rhs) const;
678 // RValue<SByte16> operator=(const Reference<SByte16> &rhs) const;
680 static Type *getType();
683 // RValue<SByte16> operator+(RValue<SByte16> lhs, RValue<SByte16> rhs);
684 // RValue<SByte16> operator-(RValue<SByte16> lhs, RValue<SByte16> rhs);
685 // RValue<SByte16> operator*(RValue<SByte16> lhs, RValue<SByte16> rhs);
686 // RValue<SByte16> operator/(RValue<SByte16> lhs, RValue<SByte16> rhs);
687 // RValue<SByte16> operator%(RValue<SByte16> lhs, RValue<SByte16> rhs);
688 // RValue<SByte16> operator&(RValue<SByte16> lhs, RValue<SByte16> rhs);
689 // RValue<SByte16> operator|(RValue<SByte16> lhs, RValue<SByte16> rhs);
690 // RValue<SByte16> operator^(RValue<SByte16> lhs, RValue<SByte16> rhs);
691 // RValue<SByte16> operator<<(RValue<SByte16> lhs, RValue<SByte16> rhs);
692 // RValue<SByte16> operator>>(RValue<SByte16> lhs, RValue<SByte16> rhs);
693 // RValue<SByte16> operator+=(const SByte16 &lhs, RValue<SByte16> rhs);
694 // RValue<SByte16> operator-=(const SByte16 &lhs, RValue<SByte16> rhs);
695 // RValue<SByte16> operator*=(const SByte16 &lhs, RValue<SByte16> rhs);
696 // RValue<SByte16> operator/=(const SByte16 &lhs, RValue<SByte16> rhs);
697 // RValue<SByte16> operator%=(const SByte16 &lhs, RValue<SByte16> rhs);
698 // RValue<SByte16> operator&=(const SByte16 &lhs, RValue<SByte16> rhs);
699 // RValue<SByte16> operator|=(const SByte16 &lhs, RValue<SByte16> rhs);
700 // RValue<SByte16> operator^=(const SByte16 &lhs, RValue<SByte16> rhs);
701 // RValue<SByte16> operator<<=(const SByte16 &lhs, RValue<SByte16> rhs);
702 // RValue<SByte16> operator>>=(const SByte16 &lhs, RValue<SByte16> rhs);
703 // RValue<SByte16> operator+(RValue<SByte16> val);
704 // RValue<SByte16> operator-(RValue<SByte16> val);
705 // RValue<SByte16> operator~(RValue<SByte16> val);
706 // RValue<SByte16> operator++(const SByte16 &val, int); // Post-increment
707 // const SByte16 &operator++(const SByte16 &val); // Pre-increment
708 // RValue<SByte16> operator--(const SByte16 &val, int); // Post-decrement
709 // const SByte16 &operator--(const SByte16 &val); // Pre-decrement
711 class Short4 : public Variable<Short4>
714 explicit Short4(RValue<Int> cast);
715 explicit Short4(RValue<Int4> cast);
716 // explicit Short4(RValue<Float> cast);
717 explicit Short4(RValue<Float4> cast);
721 Short4(short x, short y, short z, short w);
722 Short4(RValue<Short4> rhs);
723 Short4(const Short4 &rhs);
724 Short4(const Reference<Short4> &rhs);
725 Short4(RValue<UShort4> rhs);
726 Short4(const UShort4 &rhs);
727 Short4(const Reference<UShort4> &rhs);
729 RValue<Short4> operator=(RValue<Short4> rhs) const;
730 RValue<Short4> operator=(const Short4 &rhs) const;
731 RValue<Short4> operator=(const Reference<Short4> &rhs) const;
732 RValue<Short4> operator=(RValue<UShort4> rhs) const;
733 RValue<Short4> operator=(const UShort4 &rhs) const;
734 RValue<Short4> operator=(const Reference<UShort4> &rhs) const;
736 static Type *getType();
739 RValue<Short4> operator+(RValue<Short4> lhs, RValue<Short4> rhs);
740 RValue<Short4> operator-(RValue<Short4> lhs, RValue<Short4> rhs);
741 RValue<Short4> operator*(RValue<Short4> lhs, RValue<Short4> rhs);
742 // RValue<Short4> operator/(RValue<Short4> lhs, RValue<Short4> rhs);
743 // RValue<Short4> operator%(RValue<Short4> lhs, RValue<Short4> rhs);
744 RValue<Short4> operator&(RValue<Short4> lhs, RValue<Short4> rhs);
745 RValue<Short4> operator|(RValue<Short4> lhs, RValue<Short4> rhs);
746 RValue<Short4> operator^(RValue<Short4> lhs, RValue<Short4> rhs);
747 RValue<Short4> operator<<(RValue<Short4> lhs, unsigned char rhs);
748 RValue<Short4> operator>>(RValue<Short4> lhs, unsigned char rhs);
749 RValue<Short4> operator<<(RValue<Short4> lhs, RValue<Long1> rhs);
750 RValue<Short4> operator>>(RValue<Short4> lhs, RValue<Long1> rhs);
751 RValue<Short4> operator+=(const Short4 &lhs, RValue<Short4> rhs);
752 RValue<Short4> operator-=(const Short4 &lhs, RValue<Short4> rhs);
753 RValue<Short4> operator*=(const Short4 &lhs, RValue<Short4> rhs);
754 // RValue<Short4> operator/=(const Short4 &lhs, RValue<Short4> rhs);
755 // RValue<Short4> operator%=(const Short4 &lhs, RValue<Short4> rhs);
756 RValue<Short4> operator&=(const Short4 &lhs, RValue<Short4> rhs);
757 RValue<Short4> operator|=(const Short4 &lhs, RValue<Short4> rhs);
758 RValue<Short4> operator^=(const Short4 &lhs, RValue<Short4> rhs);
759 RValue<Short4> operator<<=(const Short4 &lhs, unsigned char rhs);
760 RValue<Short4> operator>>=(const Short4 &lhs, unsigned char rhs);
761 RValue<Short4> operator<<=(const Short4 &lhs, RValue<Long1> rhs);
762 RValue<Short4> operator>>=(const Short4 &lhs, RValue<Long1> rhs);
763 // RValue<Short4> operator+(RValue<Short4> val);
764 RValue<Short4> operator-(RValue<Short4> val);
765 RValue<Short4> operator~(RValue<Short4> val);
766 // RValue<Short4> operator++(const Short4 &val, int); // Post-increment
767 // const Short4 &operator++(const Short4 &val); // Pre-increment
768 // RValue<Short4> operator--(const Short4 &val, int); // Post-decrement
769 // const Short4 &operator--(const Short4 &val); // Pre-decrement
770 // RValue<Bool> operator<(RValue<Short4> lhs, RValue<Short4> rhs);
771 // RValue<Bool> operator<=(RValue<Short4> lhs, RValue<Short4> rhs);
772 // RValue<Bool> operator>(RValue<Short4> lhs, RValue<Short4> rhs);
773 // RValue<Bool> operator>=(RValue<Short4> lhs, RValue<Short4> rhs);
774 // RValue<Bool> operator!=(RValue<Short4> lhs, RValue<Short4> rhs);
775 // RValue<Bool> operator==(RValue<Short4> lhs, RValue<Short4> rhs);
777 RValue<Short4> RoundShort4(RValue<Float4> cast);
778 RValue<Short4> Max(RValue<Short4> x, RValue<Short4> y);
779 RValue<Short4> Min(RValue<Short4> x, RValue<Short4> y);
780 RValue<Short4> AddSat(RValue<Short4> x, RValue<Short4> y);
781 RValue<Short4> SubSat(RValue<Short4> x, RValue<Short4> y);
782 RValue<Short4> MulHigh(RValue<Short4> x, RValue<Short4> y);
783 RValue<Int2> MulAdd(RValue<Short4> x, RValue<Short4> y);
784 RValue<SByte8> Pack(RValue<Short4> x, RValue<Short4> y);
785 RValue<Int2> UnpackLow(RValue<Short4> x, RValue<Short4> y);
786 RValue<Int2> UnpackHigh(RValue<Short4> x, RValue<Short4> y);
787 RValue<Short4> Swizzle(RValue<Short4> x, unsigned char select);
788 RValue<Short4> Insert(RValue<Short4> val, RValue<Short> element, int i);
789 RValue<Short> Extract(RValue<Short4> val, int i);
790 RValue<Short4> CmpGT(RValue<Short4> x, RValue<Short4> y);
791 RValue<Short4> CmpEQ(RValue<Short4> x, RValue<Short4> y);
793 class UShort4 : public Variable<UShort4>
796 explicit UShort4(RValue<Int4> cast);
797 explicit UShort4(RValue<Float4> cast, bool saturate = false);
800 UShort4(unsigned short xyzw);
801 UShort4(unsigned short x, unsigned short y, unsigned short z, unsigned short w);
802 UShort4(RValue<UShort4> rhs);
803 UShort4(const UShort4 &rhs);
804 UShort4(const Reference<UShort4> &rhs);
805 UShort4(RValue<Short4> rhs);
806 UShort4(const Short4 &rhs);
807 UShort4(const Reference<Short4> &rhs);
809 RValue<UShort4> operator=(RValue<UShort4> rhs) const;
810 RValue<UShort4> operator=(const UShort4 &rhs) const;
811 RValue<UShort4> operator=(const Reference<UShort4> &rhs) const;
812 RValue<UShort4> operator=(RValue<Short4> rhs) const;
813 RValue<UShort4> operator=(const Short4 &rhs) const;
814 RValue<UShort4> operator=(const Reference<Short4> &rhs) const;
816 static Type *getType();
819 RValue<UShort4> operator+(RValue<UShort4> lhs, RValue<UShort4> rhs);
820 RValue<UShort4> operator-(RValue<UShort4> lhs, RValue<UShort4> rhs);
821 RValue<UShort4> operator*(RValue<UShort4> lhs, RValue<UShort4> rhs);
822 // RValue<UShort4> operator/(RValue<UShort4> lhs, RValue<UShort4> rhs);
823 // RValue<UShort4> operator%(RValue<UShort4> lhs, RValue<UShort4> rhs);
824 // RValue<UShort4> operator&(RValue<UShort4> lhs, RValue<UShort4> rhs);
825 // RValue<UShort4> operator|(RValue<UShort4> lhs, RValue<UShort4> rhs);
826 // RValue<UShort4> operator^(RValue<UShort4> lhs, RValue<UShort4> rhs);
827 RValue<UShort4> operator<<(RValue<UShort4> lhs, unsigned char rhs);
828 RValue<UShort4> operator>>(RValue<UShort4> lhs, unsigned char rhs);
829 RValue<UShort4> operator<<(RValue<UShort4> lhs, RValue<Long1> rhs);
830 RValue<UShort4> operator>>(RValue<UShort4> lhs, RValue<Long1> rhs);
831 // RValue<UShort4> operator+=(const UShort4 &lhs, RValue<UShort4> rhs);
832 // RValue<UShort4> operator-=(const UShort4 &lhs, RValue<UShort4> rhs);
833 // RValue<UShort4> operator*=(const UShort4 &lhs, RValue<UShort4> rhs);
834 // RValue<UShort4> operator/=(const UShort4 &lhs, RValue<UShort4> rhs);
835 // RValue<UShort4> operator%=(const UShort4 &lhs, RValue<UShort4> rhs);
836 // RValue<UShort4> operator&=(const UShort4 &lhs, RValue<UShort4> rhs);
837 // RValue<UShort4> operator|=(const UShort4 &lhs, RValue<UShort4> rhs);
838 // RValue<UShort4> operator^=(const UShort4 &lhs, RValue<UShort4> rhs);
839 RValue<UShort4> operator<<=(const UShort4 &lhs, unsigned char rhs);
840 RValue<UShort4> operator>>=(const UShort4 &lhs, unsigned char rhs);
841 RValue<UShort4> operator<<=(const UShort4 &lhs, RValue<Long1> rhs);
842 RValue<UShort4> operator>>=(const UShort4 &lhs, RValue<Long1> rhs);
843 // RValue<UShort4> operator+(RValue<UShort4> val);
844 // RValue<UShort4> operator-(RValue<UShort4> val);
845 RValue<UShort4> operator~(RValue<UShort4> val);
846 // RValue<UShort4> operator++(const UShort4 &val, int); // Post-increment
847 // const UShort4 &operator++(const UShort4 &val); // Pre-increment
848 // RValue<UShort4> operator--(const UShort4 &val, int); // Post-decrement
849 // const UShort4 &operator--(const UShort4 &val); // Pre-decrement
851 RValue<UShort4> Max(RValue<UShort4> x, RValue<UShort4> y);
852 RValue<UShort4> Min(RValue<UShort4> x, RValue<UShort4> y);
853 RValue<UShort4> AddSat(RValue<UShort4> x, RValue<UShort4> y);
854 RValue<UShort4> SubSat(RValue<UShort4> x, RValue<UShort4> y);
855 RValue<UShort4> MulHigh(RValue<UShort4> x, RValue<UShort4> y);
856 RValue<UShort4> Average(RValue<UShort4> x, RValue<UShort4> y);
857 RValue<Byte8> Pack(RValue<UShort4> x, RValue<UShort4> y);
859 class Short8 : public Variable<Short8>
863 Short8(short c0, short c1, short c2, short c3, short c4, short c5, short c6, short c7);
864 Short8(RValue<Short8> rhs);
865 // Short8(const Short8 &rhs);
866 Short8(const Reference<Short8> &rhs);
867 Short8(RValue<Short4> lo, RValue<Short4> hi);
869 // RValue<Short8> operator=(RValue<Short8> rhs) const;
870 // RValue<Short8> operator=(const Short8 &rhs) const;
871 // RValue<Short8> operator=(const Reference<Short8> &rhs) const;
873 static Type *getType();
876 RValue<Short8> operator+(RValue<Short8> lhs, RValue<Short8> rhs);
877 // RValue<Short8> operator-(RValue<Short8> lhs, RValue<Short8> rhs);
878 // RValue<Short8> operator*(RValue<Short8> lhs, RValue<Short8> rhs);
879 // RValue<Short8> operator/(RValue<Short8> lhs, RValue<Short8> rhs);
880 // RValue<Short8> operator%(RValue<Short8> lhs, RValue<Short8> rhs);
881 RValue<Short8> operator&(RValue<Short8> lhs, RValue<Short8> rhs);
882 // RValue<Short8> operator|(RValue<Short8> lhs, RValue<Short8> rhs);
883 // RValue<Short8> operator^(RValue<Short8> lhs, RValue<Short8> rhs);
884 RValue<Short8> operator<<(RValue<Short8> lhs, unsigned char rhs);
885 RValue<Short8> operator>>(RValue<Short8> lhs, unsigned char rhs);
886 // RValue<Short8> operator<<(RValue<Short8> lhs, RValue<Short8> rhs);
887 // RValue<Short8> operator>>(RValue<Short8> lhs, RValue<Short8> rhs);
888 // RValue<Short8> operator+=(const Short8 &lhs, RValue<Short8> rhs);
889 // RValue<Short8> operator-=(const Short8 &lhs, RValue<Short8> rhs);
890 // RValue<Short8> operator*=(const Short8 &lhs, RValue<Short8> rhs);
891 // RValue<Short8> operator/=(const Short8 &lhs, RValue<Short8> rhs);
892 // RValue<Short8> operator%=(const Short8 &lhs, RValue<Short8> rhs);
893 // RValue<Short8> operator&=(const Short8 &lhs, RValue<Short8> rhs);
894 // RValue<Short8> operator|=(const Short8 &lhs, RValue<Short8> rhs);
895 // RValue<Short8> operator^=(const Short8 &lhs, RValue<Short8> rhs);
896 // RValue<Short8> operator<<=(const Short8 &lhs, RValue<Short8> rhs);
897 // RValue<Short8> operator>>=(const Short8 &lhs, RValue<Short8> rhs);
898 // RValue<Short8> operator+(RValue<Short8> val);
899 // RValue<Short8> operator-(RValue<Short8> val);
900 // RValue<Short8> operator~(RValue<Short8> val);
901 // RValue<Short8> operator++(const Short8 &val, int); // Post-increment
902 // const Short8 &operator++(const Short8 &val); // Pre-increment
903 // RValue<Short8> operator--(const Short8 &val, int); // Post-decrement
904 // const Short8 &operator--(const Short8 &val); // Pre-decrement
905 // RValue<Bool> operator<(RValue<Short8> lhs, RValue<Short8> rhs);
906 // RValue<Bool> operator<=(RValue<Short8> lhs, RValue<Short8> rhs);
907 // RValue<Bool> operator>(RValue<Short8> lhs, RValue<Short8> rhs);
908 // RValue<Bool> operator>=(RValue<Short8> lhs, RValue<Short8> rhs);
909 // RValue<Bool> operator!=(RValue<Short8> lhs, RValue<Short8> rhs);
910 // RValue<Bool> operator==(RValue<Short8> lhs, RValue<Short8> rhs);
912 RValue<Short8> MulHigh(RValue<Short8> x, RValue<Short8> y);
913 RValue<Int4> MulAdd(RValue<Short8> x, RValue<Short8> y);
914 RValue<Int4> Abs(RValue<Int4> x);
916 class UShort8 : public Variable<UShort8>
920 UShort8(unsigned short c0, unsigned short c1, unsigned short c2, unsigned short c3, unsigned short c4, unsigned short c5, unsigned short c6, unsigned short c7);
921 UShort8(RValue<UShort8> rhs);
922 // UShort8(const UShort8 &rhs);
923 UShort8(const Reference<UShort8> &rhs);
924 UShort8(RValue<UShort4> lo, RValue<UShort4> hi);
926 RValue<UShort8> operator=(RValue<UShort8> rhs) const;
927 RValue<UShort8> operator=(const UShort8 &rhs) const;
928 RValue<UShort8> operator=(const Reference<UShort8> &rhs) const;
930 static Type *getType();
933 RValue<UShort8> operator+(RValue<UShort8> lhs, RValue<UShort8> rhs);
934 // RValue<UShort8> operator-(RValue<UShort8> lhs, RValue<UShort8> rhs);
935 RValue<UShort8> operator*(RValue<UShort8> lhs, RValue<UShort8> rhs);
936 // RValue<UShort8> operator/(RValue<UShort8> lhs, RValue<UShort8> rhs);
937 // RValue<UShort8> operator%(RValue<UShort8> lhs, RValue<UShort8> rhs);
938 RValue<UShort8> operator&(RValue<UShort8> lhs, RValue<UShort8> rhs);
939 // RValue<UShort8> operator|(RValue<UShort8> lhs, RValue<UShort8> rhs);
940 // RValue<UShort8> operator^(RValue<UShort8> lhs, RValue<UShort8> rhs);
941 RValue<UShort8> operator<<(RValue<UShort8> lhs, unsigned char rhs);
942 RValue<UShort8> operator>>(RValue<UShort8> lhs, unsigned char rhs);
943 // RValue<UShort8> operator<<(RValue<UShort8> lhs, RValue<UShort8> rhs);
944 // RValue<UShort8> operator>>(RValue<UShort8> lhs, RValue<UShort8> rhs);
945 RValue<UShort8> operator+=(const UShort8 &lhs, RValue<UShort8> rhs);
946 // RValue<UShort8> operator-=(const UShort8 &lhs, RValue<UShort8> rhs);
947 // RValue<UShort8> operator*=(const UShort8 &lhs, RValue<UShort8> rhs);
948 // RValue<UShort8> operator/=(const UShort8 &lhs, RValue<UShort8> rhs);
949 // RValue<UShort8> operator%=(const UShort8 &lhs, RValue<UShort8> rhs);
950 // RValue<UShort8> operator&=(const UShort8 &lhs, RValue<UShort8> rhs);
951 // RValue<UShort8> operator|=(const UShort8 &lhs, RValue<UShort8> rhs);
952 // RValue<UShort8> operator^=(const UShort8 &lhs, RValue<UShort8> rhs);
953 // RValue<UShort8> operator<<=(const UShort8 &lhs, RValue<UShort8> rhs);
954 // RValue<UShort8> operator>>=(const UShort8 &lhs, RValue<UShort8> rhs);
955 // RValue<UShort8> operator+(RValue<UShort8> val);
956 // RValue<UShort8> operator-(RValue<UShort8> val);
957 RValue<UShort8> operator~(RValue<UShort8> val);
958 // RValue<UShort8> operator++(const UShort8 &val, int); // Post-increment
959 // const UShort8 &operator++(const UShort8 &val); // Pre-increment
960 // RValue<UShort8> operator--(const UShort8 &val, int); // Post-decrement
961 // const UShort8 &operator--(const UShort8 &val); // Pre-decrement
962 // RValue<Bool> operator<(RValue<UShort8> lhs, RValue<UShort8> rhs);
963 // RValue<Bool> operator<=(RValue<UShort8> lhs, RValue<UShort8> rhs);
964 // RValue<Bool> operator>(RValue<UShort8> lhs, RValue<UShort8> rhs);
965 // RValue<Bool> operator>=(RValue<UShort8> lhs, RValue<UShort8> rhs);
966 // RValue<Bool> operator!=(RValue<UShort8> lhs, RValue<UShort8> rhs);
967 // RValue<Bool> operator==(RValue<UShort8> lhs, RValue<UShort8> rhs);
969 RValue<UShort8> Swizzle(RValue<UShort8> x, char select0, char select1, char select2, char select3, char select4, char select5, char select6, char select7);
970 RValue<UShort8> MulHigh(RValue<UShort8> x, RValue<UShort8> y);
972 class Int : public Variable<Int>
975 Int(Argument<Int> argument);
977 explicit Int(RValue<Byte> cast);
978 explicit Int(RValue<SByte> cast);
979 explicit Int(RValue<Short> cast);
980 explicit Int(RValue<UShort> cast);
981 explicit Int(RValue<Int2> cast);
982 explicit Int(RValue<Long> cast);
983 explicit Int(RValue<Float> cast);
987 Int(RValue<Int> rhs);
988 Int(RValue<UInt> rhs);
990 Int(const UInt &rhs);
991 Int(const Reference<Int> &rhs);
992 Int(const Reference<UInt> &rhs);
994 RValue<Int> operator=(int rhs) const;
995 RValue<Int> operator=(RValue<Int> rhs) const;
996 RValue<Int> operator=(RValue<UInt> rhs) const;
997 RValue<Int> operator=(const Int &rhs) const;
998 RValue<Int> operator=(const UInt &rhs) const;
999 RValue<Int> operator=(const Reference<Int> &rhs) const;
1000 RValue<Int> operator=(const Reference<UInt> &rhs) const;
1002 static Type *getType();
1005 RValue<Int> operator+(RValue<Int> lhs, RValue<Int> rhs);
1006 RValue<Int> operator-(RValue<Int> lhs, RValue<Int> rhs);
1007 RValue<Int> operator*(RValue<Int> lhs, RValue<Int> rhs);
1008 RValue<Int> operator/(RValue<Int> lhs, RValue<Int> rhs);
1009 RValue<Int> operator%(RValue<Int> lhs, RValue<Int> rhs);
1010 RValue<Int> operator&(RValue<Int> lhs, RValue<Int> rhs);
1011 RValue<Int> operator|(RValue<Int> lhs, RValue<Int> rhs);
1012 RValue<Int> operator^(RValue<Int> lhs, RValue<Int> rhs);
1013 RValue<Int> operator<<(RValue<Int> lhs, RValue<Int> rhs);
1014 RValue<Int> operator>>(RValue<Int> lhs, RValue<Int> rhs);
1015 RValue<Int> operator+=(const Int &lhs, RValue<Int> rhs);
1016 RValue<Int> operator-=(const Int &lhs, RValue<Int> rhs);
1017 RValue<Int> operator*=(const Int &lhs, RValue<Int> rhs);
1018 RValue<Int> operator/=(const Int &lhs, RValue<Int> rhs);
1019 RValue<Int> operator%=(const Int &lhs, RValue<Int> rhs);
1020 RValue<Int> operator&=(const Int &lhs, RValue<Int> rhs);
1021 RValue<Int> operator|=(const Int &lhs, RValue<Int> rhs);
1022 RValue<Int> operator^=(const Int &lhs, RValue<Int> rhs);
1023 RValue<Int> operator<<=(const Int &lhs, RValue<Int> rhs);
1024 RValue<Int> operator>>=(const Int &lhs, RValue<Int> rhs);
1025 RValue<Int> operator+(RValue<Int> val);
1026 RValue<Int> operator-(RValue<Int> val);
1027 RValue<Int> operator~(RValue<Int> val);
1028 RValue<Int> operator++(const Int &val, int); // Post-increment
1029 const Int &operator++(const Int &val); // Pre-increment
1030 RValue<Int> operator--(const Int &val, int); // Post-decrement
1031 const Int &operator--(const Int &val); // Pre-decrement
1032 RValue<Bool> operator<(RValue<Int> lhs, RValue<Int> rhs);
1033 RValue<Bool> operator<=(RValue<Int> lhs, RValue<Int> rhs);
1034 RValue<Bool> operator>(RValue<Int> lhs, RValue<Int> rhs);
1035 RValue<Bool> operator>=(RValue<Int> lhs, RValue<Int> rhs);
1036 RValue<Bool> operator!=(RValue<Int> lhs, RValue<Int> rhs);
1037 RValue<Bool> operator==(RValue<Int> lhs, RValue<Int> rhs);
1039 RValue<Int> Max(RValue<Int> x, RValue<Int> y);
1040 RValue<Int> Min(RValue<Int> x, RValue<Int> y);
1041 RValue<Int> Clamp(RValue<Int> x, RValue<Int> min, RValue<Int> max);
1042 RValue<Int> RoundInt(RValue<Float> cast);
1044 class Long : public Variable<Long>
1047 // Long(Argument<Long> argument);
1049 // explicit Long(RValue<Short> cast);
1050 // explicit Long(RValue<UShort> cast);
1051 explicit Long(RValue<Int> cast);
1052 explicit Long(RValue<UInt> cast);
1053 // explicit Long(RValue<Float> cast);
1057 Long(RValue<Long> rhs);
1058 // Long(RValue<ULong> rhs);
1059 // Long(const Long &rhs);
1060 // Long(const Reference<Long> &rhs);
1061 // Long(const ULong &rhs);
1062 // Long(const Reference<ULong> &rhs);
1064 RValue<Long> operator=(int64_t rhs) const;
1065 RValue<Long> operator=(RValue<Long> rhs) const;
1066 // RValue<Long> operator=(RValue<ULong> rhs) const;
1067 RValue<Long> operator=(const Long &rhs) const;
1068 RValue<Long> operator=(const Reference<Long> &rhs) const;
1069 // RValue<Long> operator=(const ULong &rhs) const;
1070 // RValue<Long> operator=(const Reference<ULong> &rhs) const;
1072 static Type *getType();
1075 RValue<Long> operator+(RValue<Long> lhs, RValue<Long> rhs);
1076 RValue<Long> operator-(RValue<Long> lhs, RValue<Long> rhs);
1077 // RValue<Long> operator*(RValue<Long> lhs, RValue<Long> rhs);
1078 // RValue<Long> operator/(RValue<Long> lhs, RValue<Long> rhs);
1079 // RValue<Long> operator%(RValue<Long> lhs, RValue<Long> rhs);
1080 // RValue<Long> operator&(RValue<Long> lhs, RValue<Long> rhs);
1081 // RValue<Long> operator|(RValue<Long> lhs, RValue<Long> rhs);
1082 // RValue<Long> operator^(RValue<Long> lhs, RValue<Long> rhs);
1083 // RValue<Long> operator<<(RValue<Long> lhs, RValue<Long> rhs);
1084 // RValue<Long> operator>>(RValue<Long> lhs, RValue<Long> rhs);
1085 RValue<Long> operator+=(const Long &lhs, RValue<Long> rhs);
1086 RValue<Long> operator-=(const Long &lhs, RValue<Long> rhs);
1087 // RValue<Long> operator*=(const Long &lhs, RValue<Long> rhs);
1088 // RValue<Long> operator/=(const Long &lhs, RValue<Long> rhs);
1089 // RValue<Long> operator%=(const Long &lhs, RValue<Long> rhs);
1090 // RValue<Long> operator&=(const Long &lhs, RValue<Long> rhs);
1091 // RValue<Long> operator|=(const Long &lhs, RValue<Long> rhs);
1092 // RValue<Long> operator^=(const Long &lhs, RValue<Long> rhs);
1093 // RValue<Long> operator<<=(const Long &lhs, RValue<Long> rhs);
1094 // RValue<Long> operator>>=(const Long &lhs, RValue<Long> rhs);
1095 // RValue<Long> operator+(RValue<Long> val);
1096 // RValue<Long> operator-(RValue<Long> val);
1097 // RValue<Long> operator~(RValue<Long> val);
1098 // RValue<Long> operator++(const Long &val, int); // Post-increment
1099 // const Long &operator++(const Long &val); // Pre-increment
1100 // RValue<Long> operator--(const Long &val, int); // Post-decrement
1101 // const Long &operator--(const Long &val); // Pre-decrement
1102 // RValue<Bool> operator<(RValue<Long> lhs, RValue<Long> rhs);
1103 // RValue<Bool> operator<=(RValue<Long> lhs, RValue<Long> rhs);
1104 // RValue<Bool> operator>(RValue<Long> lhs, RValue<Long> rhs);
1105 // RValue<Bool> operator>=(RValue<Long> lhs, RValue<Long> rhs);
1106 // RValue<Bool> operator!=(RValue<Long> lhs, RValue<Long> rhs);
1107 // RValue<Bool> operator==(RValue<Long> lhs, RValue<Long> rhs);
1109 // RValue<Long> RoundLong(RValue<Float> cast);
1110 RValue<Long> AddAtomic( RValue<Pointer<Long>> x, RValue<Long> y);
1112 class Long1 : public Variable<Long1>
1115 // Long1(Argument<Long1> argument);
1117 // explicit Long1(RValue<Short> cast);
1118 // explicit Long1(RValue<UShort> cast);
1119 // explicit Long1(RValue<Int> cast);
1120 explicit Long1(RValue<UInt> cast);
1121 // explicit Long1(RValue<Float> cast);
1125 Long1(RValue<Long1> rhs);
1126 // Long1(RValue<ULong1> rhs);
1127 // Long1(const Long1 &rhs);
1128 // Long1(const Reference<Long1> &rhs);
1129 // Long1(const ULong1 &rhs);
1130 // Long1(const Reference<ULong1> &rhs);
1132 // RValue<Long1> operator=(qword rhs) const;
1133 // RValue<Long1> operator=(RValue<Long1> rhs) const;
1134 // RValue<Long1> operator=(RValue<ULong1> rhs) const;
1135 // RValue<Long1> operator=(const Long1 &rhs) const;
1136 // RValue<Long1> operator=(const Reference<Long1> &rhs) const;
1137 // RValue<Long1> operator=(const ULong1 &rhs) const;
1138 // RValue<Long1> operator=(const Reference<ULong1> &rhs) const;
1140 static Type *getType();
1143 // RValue<Long1> operator+(RValue<Long1> lhs, RValue<Long1> rhs);
1144 // RValue<Long1> operator-(RValue<Long1> lhs, RValue<Long1> rhs);
1145 // RValue<Long1> operator*(RValue<Long1> lhs, RValue<Long1> rhs);
1146 // RValue<Long1> operator/(RValue<Long1> lhs, RValue<Long1> rhs);
1147 // RValue<Long1> operator%(RValue<Long1> lhs, RValue<Long1> rhs);
1148 // RValue<Long1> operator&(RValue<Long1> lhs, RValue<Long1> rhs);
1149 // RValue<Long1> operator|(RValue<Long1> lhs, RValue<Long1> rhs);
1150 // RValue<Long1> operator^(RValue<Long1> lhs, RValue<Long1> rhs);
1151 // RValue<Long1> operator<<(RValue<Long1> lhs, RValue<Long1> rhs);
1152 // RValue<Long1> operator>>(RValue<Long1> lhs, RValue<Long1> rhs);
1153 // RValue<Long1> operator+=(const Long1 &lhs, RValue<Long1> rhs);
1154 // RValue<Long1> operator-=(const Long1 &lhs, RValue<Long1> rhs);
1155 // RValue<Long1> operator*=(const Long1 &lhs, RValue<Long1> rhs);
1156 // RValue<Long1> operator/=(const Long1 &lhs, RValue<Long1> rhs);
1157 // RValue<Long1> operator%=(const Long1 &lhs, RValue<Long1> rhs);
1158 // RValue<Long1> operator&=(const Long1 &lhs, RValue<Long1> rhs);
1159 // RValue<Long1> operator|=(const Long1 &lhs, RValue<Long1> rhs);
1160 // RValue<Long1> operator^=(const Long1 &lhs, RValue<Long1> rhs);
1161 // RValue<Long1> operator<<=(const Long1 &lhs, RValue<Long1> rhs);
1162 // RValue<Long1> operator>>=(const Long1 &lhs, RValue<Long1> rhs);
1163 // RValue<Long1> operator+(RValue<Long1> val);
1164 // RValue<Long1> operator-(RValue<Long1> val);
1165 // RValue<Long1> operator~(RValue<Long1> val);
1166 // RValue<Long1> operator++(const Long1 &val, int); // Post-increment
1167 // const Long1 &operator++(const Long1 &val); // Pre-increment
1168 // RValue<Long1> operator--(const Long1 &val, int); // Post-decrement
1169 // const Long1 &operator--(const Long1 &val); // Pre-decrement
1170 // RValue<Bool> operator<(RValue<Long1> lhs, RValue<Long1> rhs);
1171 // RValue<Bool> operator<=(RValue<Long1> lhs, RValue<Long1> rhs);
1172 // RValue<Bool> operator>(RValue<Long1> lhs, RValue<Long1> rhs);
1173 // RValue<Bool> operator>=(RValue<Long1> lhs, RValue<Long1> rhs);
1174 // RValue<Bool> operator!=(RValue<Long1> lhs, RValue<Long1> rhs);
1175 // RValue<Bool> operator==(RValue<Long1> lhs, RValue<Long1> rhs);
1177 // RValue<Long1> RoundLong1(RValue<Float> cast);
1179 class Long2 : public Variable<Long2>
1182 // explicit Long2(RValue<Long> cast);
1183 // explicit Long2(RValue<Long1> cast);
1186 // Long2(int x, int y);
1187 // Long2(RValue<Long2> rhs);
1188 // Long2(const Long2 &rhs);
1189 // Long2(const Reference<Long2> &rhs);
1191 // RValue<Long2> operator=(RValue<Long2> rhs) const;
1192 // RValue<Long2> operator=(const Long2 &rhs) const;
1193 // RValue<Long2> operator=(const Reference<Long2 &rhs) const;
1195 static Type *getType();
1198 // RValue<Long2> operator+(RValue<Long2> lhs, RValue<Long2> rhs);
1199 // RValue<Long2> operator-(RValue<Long2> lhs, RValue<Long2> rhs);
1200 // RValue<Long2> operator*(RValue<Long2> lhs, RValue<Long2> rhs);
1201 // RValue<Long2> operator/(RValue<Long2> lhs, RValue<Long2> rhs);
1202 // RValue<Long2> operator%(RValue<Long2> lhs, RValue<Long2> rhs);
1203 // RValue<Long2> operator&(RValue<Long2> lhs, RValue<Long2> rhs);
1204 // RValue<Long2> operator|(RValue<Long2> lhs, RValue<Long2> rhs);
1205 // RValue<Long2> operator^(RValue<Long2> lhs, RValue<Long2> rhs);
1206 // RValue<Long2> operator<<(RValue<Long2> lhs, unsigned char rhs);
1207 // RValue<Long2> operator>>(RValue<Long2> lhs, unsigned char rhs);
1208 // RValue<Long2> operator<<(RValue<Long2> lhs, RValue<Long1> rhs);
1209 // RValue<Long2> operator>>(RValue<Long2> lhs, RValue<Long1> rhs);
1210 // RValue<Long2> operator+=(const Long2 &lhs, RValue<Long2> rhs);
1211 // RValue<Long2> operator-=(const Long2 &lhs, RValue<Long2> rhs);
1212 // RValue<Long2> operator*=(const Long2 &lhs, RValue<Long2> rhs);
1213 // RValue<Long2> operator/=(const Long2 &lhs, RValue<Long2> rhs);
1214 // RValue<Long2> operator%=(const Long2 &lhs, RValue<Long2> rhs);
1215 // RValue<Long2> operator&=(const Long2 &lhs, RValue<Long2> rhs);
1216 // RValue<Long2> operator|=(const Long2 &lhs, RValue<Long2> rhs);
1217 // RValue<Long2> operator^=(const Long2 &lhs, RValue<Long2> rhs);
1218 // RValue<Long2> operator<<=(const Long2 &lhs, unsigned char rhs);
1219 // RValue<Long2> operator>>=(const Long2 &lhs, unsigned char rhs);
1220 // RValue<Long2> operator<<=(const Long2 &lhs, RValue<Long1> rhs);
1221 // RValue<Long2> operator>>=(const Long2 &lhs, RValue<Long1> rhs);
1222 // RValue<Long2> operator+(RValue<Long2> val);
1223 // RValue<Long2> operator-(RValue<Long2> val);
1224 // RValue<Long2> operator~(RValue<Long2> val);
1225 // RValue<Long2> operator++(const Long2 &val, int); // Post-increment
1226 // const Long2 &operator++(const Long2 &val); // Pre-increment
1227 // RValue<Long2> operator--(const Long2 &val, int); // Post-decrement
1228 // const Long2 &operator--(const Long2 &val); // Pre-decrement
1229 // RValue<Bool> operator<(RValue<Long2> lhs, RValue<Long2> rhs);
1230 // RValue<Bool> operator<=(RValue<Long2> lhs, RValue<Long2> rhs);
1231 // RValue<Bool> operator>(RValue<Long2> lhs, RValue<Long2> rhs);
1232 // RValue<Bool> operator>=(RValue<Long2> lhs, RValue<Long2> rhs);
1233 // RValue<Bool> operator!=(RValue<Long2> lhs, RValue<Long2> rhs);
1234 // RValue<Bool> operator==(RValue<Long2> lhs, RValue<Long2> rhs);
1236 // RValue<Long2> RoundInt(RValue<Float4> cast);
1237 // RValue<Long2> UnpackLow(RValue<Long2> x, RValue<Long2> y);
1238 RValue<Long2> UnpackHigh(RValue<Long2> x, RValue<Long2> y);
1239 // RValue<Int> Extract(RValue<Long2> val, int i);
1240 // RValue<Long2> Insert(RValue<Long2> val, RValue<Int> element, int i);
1242 class UInt : public Variable<UInt>
1245 UInt(Argument<UInt> argument);
1247 explicit UInt(RValue<UShort> cast);
1248 explicit UInt(RValue<Long> cast);
1249 explicit UInt(RValue<Float> cast);
1253 UInt(unsigned int x);
1254 UInt(RValue<UInt> rhs);
1255 UInt(RValue<Int> rhs);
1256 UInt(const UInt &rhs);
1257 UInt(const Int &rhs);
1258 UInt(const Reference<UInt> &rhs);
1259 UInt(const Reference<Int> &rhs);
1261 RValue<UInt> operator=(unsigned int rhs) const;
1262 RValue<UInt> operator=(RValue<UInt> rhs) const;
1263 RValue<UInt> operator=(RValue<Int> rhs) const;
1264 RValue<UInt> operator=(const UInt &rhs) const;
1265 RValue<UInt> operator=(const Int &rhs) const;
1266 RValue<UInt> operator=(const Reference<UInt> &rhs) const;
1267 RValue<UInt> operator=(const Reference<Int> &rhs) const;
1269 static Type *getType();
1272 RValue<UInt> operator+(RValue<UInt> lhs, RValue<UInt> rhs);
1273 RValue<UInt> operator-(RValue<UInt> lhs, RValue<UInt> rhs);
1274 RValue<UInt> operator*(RValue<UInt> lhs, RValue<UInt> rhs);
1275 RValue<UInt> operator/(RValue<UInt> lhs, RValue<UInt> rhs);
1276 RValue<UInt> operator%(RValue<UInt> lhs, RValue<UInt> rhs);
1277 RValue<UInt> operator&(RValue<UInt> lhs, RValue<UInt> rhs);
1278 RValue<UInt> operator|(RValue<UInt> lhs, RValue<UInt> rhs);
1279 RValue<UInt> operator^(RValue<UInt> lhs, RValue<UInt> rhs);
1280 RValue<UInt> operator<<(RValue<UInt> lhs, RValue<UInt> rhs);
1281 RValue<UInt> operator>>(RValue<UInt> lhs, RValue<UInt> rhs);
1282 RValue<UInt> operator+=(const UInt &lhs, RValue<UInt> rhs);
1283 RValue<UInt> operator-=(const UInt &lhs, RValue<UInt> rhs);
1284 RValue<UInt> operator*=(const UInt &lhs, RValue<UInt> rhs);
1285 RValue<UInt> operator/=(const UInt &lhs, RValue<UInt> rhs);
1286 RValue<UInt> operator%=(const UInt &lhs, RValue<UInt> rhs);
1287 RValue<UInt> operator&=(const UInt &lhs, RValue<UInt> rhs);
1288 RValue<UInt> operator|=(const UInt &lhs, RValue<UInt> rhs);
1289 RValue<UInt> operator^=(const UInt &lhs, RValue<UInt> rhs);
1290 RValue<UInt> operator<<=(const UInt &lhs, RValue<UInt> rhs);
1291 RValue<UInt> operator>>=(const UInt &lhs, RValue<UInt> rhs);
1292 RValue<UInt> operator+(RValue<UInt> val);
1293 RValue<UInt> operator-(RValue<UInt> val);
1294 RValue<UInt> operator~(RValue<UInt> val);
1295 RValue<UInt> operator++(const UInt &val, int); // Post-increment
1296 const UInt &operator++(const UInt &val); // Pre-increment
1297 RValue<UInt> operator--(const UInt &val, int); // Post-decrement
1298 const UInt &operator--(const UInt &val); // Pre-decrement
1299 RValue<Bool> operator<(RValue<UInt> lhs, RValue<UInt> rhs);
1300 RValue<Bool> operator<=(RValue<UInt> lhs, RValue<UInt> rhs);
1301 RValue<Bool> operator>(RValue<UInt> lhs, RValue<UInt> rhs);
1302 RValue<Bool> operator>=(RValue<UInt> lhs, RValue<UInt> rhs);
1303 RValue<Bool> operator!=(RValue<UInt> lhs, RValue<UInt> rhs);
1304 RValue<Bool> operator==(RValue<UInt> lhs, RValue<UInt> rhs);
1306 RValue<UInt> Max(RValue<UInt> x, RValue<UInt> y);
1307 RValue<UInt> Min(RValue<UInt> x, RValue<UInt> y);
1308 RValue<UInt> Clamp(RValue<UInt> x, RValue<UInt> min, RValue<UInt> max);
1309 // RValue<UInt> RoundUInt(RValue<Float> cast);
1311 class Int2 : public Variable<Int2>
1314 // explicit Int2(RValue<Int> cast);
1315 explicit Int2(RValue<Int4> cast);
1319 Int2(RValue<Int2> rhs);
1320 Int2(const Int2 &rhs);
1321 Int2(const Reference<Int2> &rhs);
1322 Int2(RValue<Int> lo, RValue<Int> hi);
1324 RValue<Int2> operator=(RValue<Int2> rhs) const;
1325 RValue<Int2> operator=(const Int2 &rhs) const;
1326 RValue<Int2> operator=(const Reference<Int2> &rhs) const;
1328 static Type *getType();
1331 RValue<Int2> operator+(RValue<Int2> lhs, RValue<Int2> rhs);
1332 RValue<Int2> operator-(RValue<Int2> lhs, RValue<Int2> rhs);
1333 // RValue<Int2> operator*(RValue<Int2> lhs, RValue<Int2> rhs);
1334 // RValue<Int2> operator/(RValue<Int2> lhs, RValue<Int2> rhs);
1335 // RValue<Int2> operator%(RValue<Int2> lhs, RValue<Int2> rhs);
1336 RValue<Int2> operator&(RValue<Int2> lhs, RValue<Int2> rhs);
1337 RValue<Int2> operator|(RValue<Int2> lhs, RValue<Int2> rhs);
1338 RValue<Int2> operator^(RValue<Int2> lhs, RValue<Int2> rhs);
1339 RValue<Int2> operator<<(RValue<Int2> lhs, unsigned char rhs);
1340 RValue<Int2> operator>>(RValue<Int2> lhs, unsigned char rhs);
1341 RValue<Int2> operator<<(RValue<Int2> lhs, RValue<Long1> rhs);
1342 RValue<Int2> operator>>(RValue<Int2> lhs, RValue<Long1> rhs);
1343 RValue<Int2> operator+=(const Int2 &lhs, RValue<Int2> rhs);
1344 RValue<Int2> operator-=(const Int2 &lhs, RValue<Int2> rhs);
1345 // RValue<Int2> operator*=(const Int2 &lhs, RValue<Int2> rhs);
1346 // RValue<Int2> operator/=(const Int2 &lhs, RValue<Int2> rhs);
1347 // RValue<Int2> operator%=(const Int2 &lhs, RValue<Int2> rhs);
1348 RValue<Int2> operator&=(const Int2 &lhs, RValue<Int2> rhs);
1349 RValue<Int2> operator|=(const Int2 &lhs, RValue<Int2> rhs);
1350 RValue<Int2> operator^=(const Int2 &lhs, RValue<Int2> rhs);
1351 RValue<Int2> operator<<=(const Int2 &lhs, unsigned char rhs);
1352 RValue<Int2> operator>>=(const Int2 &lhs, unsigned char rhs);
1353 RValue<Int2> operator<<=(const Int2 &lhs, RValue<Long1> rhs);
1354 RValue<Int2> operator>>=(const Int2 &lhs, RValue<Long1> rhs);
1355 // RValue<Int2> operator+(RValue<Int2> val);
1356 // RValue<Int2> operator-(RValue<Int2> val);
1357 RValue<Int2> operator~(RValue<Int2> val);
1358 // RValue<Int2> operator++(const Int2 &val, int); // Post-increment
1359 // const Int2 &operator++(const Int2 &val); // Pre-increment
1360 // RValue<Int2> operator--(const Int2 &val, int); // Post-decrement
1361 // const Int2 &operator--(const Int2 &val); // Pre-decrement
1362 // RValue<Bool> operator<(RValue<Int2> lhs, RValue<Int2> rhs);
1363 // RValue<Bool> operator<=(RValue<Int2> lhs, RValue<Int2> rhs);
1364 // RValue<Bool> operator>(RValue<Int2> lhs, RValue<Int2> rhs);
1365 // RValue<Bool> operator>=(RValue<Int2> lhs, RValue<Int2> rhs);
1366 // RValue<Bool> operator!=(RValue<Int2> lhs, RValue<Int2> rhs);
1367 // RValue<Bool> operator==(RValue<Int2> lhs, RValue<Int2> rhs);
1369 // RValue<Int2> RoundInt(RValue<Float4> cast);
1370 RValue<Long1> UnpackLow(RValue<Int2> x, RValue<Int2> y);
1371 RValue<Long1> UnpackHigh(RValue<Int2> x, RValue<Int2> y);
1372 RValue<Int> Extract(RValue<Int2> val, int i);
1373 RValue<Int2> Insert(RValue<Int2> val, RValue<Int> element, int i);
1375 class UInt2 : public Variable<UInt2>
1379 UInt2(unsigned int x, unsigned int y);
1380 UInt2(RValue<UInt2> rhs);
1381 UInt2(const UInt2 &rhs);
1382 UInt2(const Reference<UInt2> &rhs);
1384 RValue<UInt2> operator=(RValue<UInt2> rhs) const;
1385 RValue<UInt2> operator=(const UInt2 &rhs) const;
1386 RValue<UInt2> operator=(const Reference<UInt2> &rhs) const;
1388 static Type *getType();
1391 RValue<UInt2> operator+(RValue<UInt2> lhs, RValue<UInt2> rhs);
1392 RValue<UInt2> operator-(RValue<UInt2> lhs, RValue<UInt2> rhs);
1393 // RValue<UInt2> operator*(RValue<UInt2> lhs, RValue<UInt2> rhs);
1394 // RValue<UInt2> operator/(RValue<UInt2> lhs, RValue<UInt2> rhs);
1395 // RValue<UInt2> operator%(RValue<UInt2> lhs, RValue<UInt2> rhs);
1396 RValue<UInt2> operator&(RValue<UInt2> lhs, RValue<UInt2> rhs);
1397 RValue<UInt2> operator|(RValue<UInt2> lhs, RValue<UInt2> rhs);
1398 RValue<UInt2> operator^(RValue<UInt2> lhs, RValue<UInt2> rhs);
1399 RValue<UInt2> operator<<(RValue<UInt2> lhs, unsigned char rhs);
1400 RValue<UInt2> operator>>(RValue<UInt2> lhs, unsigned char rhs);
1401 RValue<UInt2> operator<<(RValue<UInt2> lhs, RValue<Long1> rhs);
1402 RValue<UInt2> operator>>(RValue<UInt2> lhs, RValue<Long1> rhs);
1403 RValue<UInt2> operator+=(const UInt2 &lhs, RValue<UInt2> rhs);
1404 RValue<UInt2> operator-=(const UInt2 &lhs, RValue<UInt2> rhs);
1405 // RValue<UInt2> operator*=(const UInt2 &lhs, RValue<UInt2> rhs);
1406 // RValue<UInt2> operator/=(const UInt2 &lhs, RValue<UInt2> rhs);
1407 // RValue<UInt2> operator%=(const UInt2 &lhs, RValue<UInt2> rhs);
1408 RValue<UInt2> operator&=(const UInt2 &lhs, RValue<UInt2> rhs);
1409 RValue<UInt2> operator|=(const UInt2 &lhs, RValue<UInt2> rhs);
1410 RValue<UInt2> operator^=(const UInt2 &lhs, RValue<UInt2> rhs);
1411 RValue<UInt2> operator<<=(const UInt2 &lhs, unsigned char rhs);
1412 RValue<UInt2> operator>>=(const UInt2 &lhs, unsigned char rhs);
1413 RValue<UInt2> operator<<=(const UInt2 &lhs, RValue<Long1> rhs);
1414 RValue<UInt2> operator>>=(const UInt2 &lhs, RValue<Long1> rhs);
1415 // RValue<UInt2> operator+(RValue<UInt2> val);
1416 // RValue<UInt2> operator-(RValue<UInt2> val);
1417 RValue<UInt2> operator~(RValue<UInt2> val);
1418 // RValue<UInt2> operator++(const UInt2 &val, int); // Post-increment
1419 // const UInt2 &operator++(const UInt2 &val); // Pre-increment
1420 // RValue<UInt2> operator--(const UInt2 &val, int); // Post-decrement
1421 // const UInt2 &operator--(const UInt2 &val); // Pre-decrement
1422 // RValue<Bool> operator<(RValue<UInt2> lhs, RValue<UInt2> rhs);
1423 // RValue<Bool> operator<=(RValue<UInt2> lhs, RValue<UInt2> rhs);
1424 // RValue<Bool> operator>(RValue<UInt2> lhs, RValue<UInt2> rhs);
1425 // RValue<Bool> operator>=(RValue<UInt2> lhs, RValue<UInt2> rhs);
1426 // RValue<Bool> operator!=(RValue<UInt2> lhs, RValue<UInt2> rhs);
1427 // RValue<Bool> operator==(RValue<UInt2> lhs, RValue<UInt2> rhs);
1429 // RValue<UInt2> RoundInt(RValue<Float4> cast);
1431 class Int4 : public Variable<Int4>
1434 explicit Int4(RValue<Byte4> cast);
1435 explicit Int4(RValue<SByte4> cast);
1436 explicit Int4(RValue<Float4> cast);
1437 explicit Int4(RValue<Short4> cast);
1438 explicit Int4(RValue<UShort4> cast);
1442 Int4(int x, int yzw);
1443 Int4(int x, int y, int zw);
1444 Int4(int x, int y, int z, int w);
1445 Int4(RValue<Int4> rhs);
1446 Int4(const Int4 &rhs);
1447 Int4(const Reference<Int4> &rhs);
1448 Int4(RValue<UInt4> rhs);
1449 Int4(const UInt4 &rhs);
1450 Int4(const Reference<UInt4> &rhs);
1451 Int4(RValue<Int2> lo, RValue<Int2> hi);
1452 Int4(RValue<Int> rhs);
1453 Int4(const Int &rhs);
1454 Int4(const Reference<Int> &rhs);
1456 RValue<Int4> operator=(RValue<Int4> rhs) const;
1457 RValue<Int4> operator=(const Int4 &rhs) const;
1458 RValue<Int4> operator=(const Reference<Int4> &rhs) const;
1460 static Type *getType();
1463 void constant(int x, int y, int z, int w);
1466 RValue<Int4> operator+(RValue<Int4> lhs, RValue<Int4> rhs);
1467 RValue<Int4> operator-(RValue<Int4> lhs, RValue<Int4> rhs);
1468 RValue<Int4> operator*(RValue<Int4> lhs, RValue<Int4> rhs);
1469 RValue<Int4> operator/(RValue<Int4> lhs, RValue<Int4> rhs);
1470 RValue<Int4> operator%(RValue<Int4> lhs, RValue<Int4> rhs);
1471 RValue<Int4> operator&(RValue<Int4> lhs, RValue<Int4> rhs);
1472 RValue<Int4> operator|(RValue<Int4> lhs, RValue<Int4> rhs);
1473 RValue<Int4> operator^(RValue<Int4> lhs, RValue<Int4> rhs);
1474 RValue<Int4> operator<<(RValue<Int4> lhs, unsigned char rhs);
1475 RValue<Int4> operator>>(RValue<Int4> lhs, unsigned char rhs);
1476 RValue<Int4> operator<<(RValue<Int4> lhs, RValue<Int4> rhs);
1477 RValue<Int4> operator>>(RValue<Int4> lhs, RValue<Int4> rhs);
1478 RValue<Int4> operator+=(const Int4 &lhs, RValue<Int4> rhs);
1479 RValue<Int4> operator-=(const Int4 &lhs, RValue<Int4> rhs);
1480 RValue<Int4> operator*=(const Int4 &lhs, RValue<Int4> rhs);
1481 // RValue<Int4> operator/=(const Int4 &lhs, RValue<Int4> rhs);
1482 // RValue<Int4> operator%=(const Int4 &lhs, RValue<Int4> rhs);
1483 RValue<Int4> operator&=(const Int4 &lhs, RValue<Int4> rhs);
1484 RValue<Int4> operator|=(const Int4 &lhs, RValue<Int4> rhs);
1485 RValue<Int4> operator^=(const Int4 &lhs, RValue<Int4> rhs);
1486 RValue<Int4> operator<<=(const Int4 &lhs, unsigned char rhs);
1487 RValue<Int4> operator>>=(const Int4 &lhs, unsigned char rhs);
1488 RValue<Int4> operator+(RValue<Int4> val);
1489 RValue<Int4> operator-(RValue<Int4> val);
1490 RValue<Int4> operator~(RValue<Int4> val);
1491 // RValue<Int4> operator++(const Int4 &val, int); // Post-increment
1492 // const Int4 &operator++(const Int4 &val); // Pre-increment
1493 // RValue<Int4> operator--(const Int4 &val, int); // Post-decrement
1494 // const Int4 &operator--(const Int4 &val); // Pre-decrement
1495 // RValue<Bool> operator<(RValue<Int4> lhs, RValue<Int4> rhs);
1496 // RValue<Bool> operator<=(RValue<Int4> lhs, RValue<Int4> rhs);
1497 // RValue<Bool> operator>(RValue<Int4> lhs, RValue<Int4> rhs);
1498 // RValue<Bool> operator>=(RValue<Int4> lhs, RValue<Int4> rhs);
1499 // RValue<Bool> operator!=(RValue<Int4> lhs, RValue<Int4> rhs);
1500 // RValue<Bool> operator==(RValue<Int4> lhs, RValue<Int4> rhs);
1502 RValue<Int4> CmpEQ(RValue<Int4> x, RValue<Int4> y);
1503 RValue<Int4> CmpLT(RValue<Int4> x, RValue<Int4> y);
1504 RValue<Int4> CmpLE(RValue<Int4> x, RValue<Int4> y);
1505 RValue<Int4> CmpNEQ(RValue<Int4> x, RValue<Int4> y);
1506 RValue<Int4> CmpNLT(RValue<Int4> x, RValue<Int4> y);
1507 RValue<Int4> CmpNLE(RValue<Int4> x, RValue<Int4> y);
1508 RValue<Int4> Max(RValue<Int4> x, RValue<Int4> y);
1509 RValue<Int4> Min(RValue<Int4> x, RValue<Int4> y);
1510 RValue<Int4> RoundInt(RValue<Float4> cast);
1511 RValue<Short8> Pack(RValue<Int4> x, RValue<Int4> y);
1512 RValue<Int> Extract(RValue<Int4> x, int i);
1513 RValue<Int4> Insert(RValue<Int4> val, RValue<Int> element, int i);
1514 RValue<Int> SignMask(RValue<Int4> x);
1515 RValue<Int4> Swizzle(RValue<Int4> x, unsigned char select);
1517 class UInt4 : public Variable<UInt4>
1520 explicit UInt4(RValue<Float4> cast);
1524 UInt4(int x, int yzw);
1525 UInt4(int x, int y, int zw);
1526 UInt4(int x, int y, int z, int w);
1527 UInt4(unsigned int x, unsigned int y, unsigned int z, unsigned int w);
1528 UInt4(RValue<UInt4> rhs);
1529 UInt4(const UInt4 &rhs);
1530 UInt4(const Reference<UInt4> &rhs);
1531 UInt4(RValue<Int4> rhs);
1532 UInt4(const Int4 &rhs);
1533 UInt4(const Reference<Int4> &rhs);
1534 UInt4(RValue<UInt2> lo, RValue<UInt2> hi);
1536 RValue<UInt4> operator=(RValue<UInt4> rhs) const;
1537 RValue<UInt4> operator=(const UInt4 &rhs) const;
1538 RValue<UInt4> operator=(const Reference<UInt4> &rhs) const;
1540 static Type *getType();
1543 void constant(int x, int y, int z, int w);
1546 RValue<UInt4> operator+(RValue<UInt4> lhs, RValue<UInt4> rhs);
1547 RValue<UInt4> operator-(RValue<UInt4> lhs, RValue<UInt4> rhs);
1548 RValue<UInt4> operator*(RValue<UInt4> lhs, RValue<UInt4> rhs);
1549 RValue<UInt4> operator/(RValue<UInt4> lhs, RValue<UInt4> rhs);
1550 RValue<UInt4> operator%(RValue<UInt4> lhs, RValue<UInt4> rhs);
1551 RValue<UInt4> operator&(RValue<UInt4> lhs, RValue<UInt4> rhs);
1552 RValue<UInt4> operator|(RValue<UInt4> lhs, RValue<UInt4> rhs);
1553 RValue<UInt4> operator^(RValue<UInt4> lhs, RValue<UInt4> rhs);
1554 RValue<UInt4> operator<<(RValue<UInt4> lhs, unsigned char rhs);
1555 RValue<UInt4> operator>>(RValue<UInt4> lhs, unsigned char rhs);
1556 RValue<UInt4> operator<<(RValue<UInt4> lhs, RValue<UInt4> rhs);
1557 RValue<UInt4> operator>>(RValue<UInt4> lhs, RValue<UInt4> rhs);
1558 RValue<UInt4> operator+=(const UInt4 &lhs, RValue<UInt4> rhs);
1559 RValue<UInt4> operator-=(const UInt4 &lhs, RValue<UInt4> rhs);
1560 RValue<UInt4> operator*=(const UInt4 &lhs, RValue<UInt4> rhs);
1561 // RValue<UInt4> operator/=(const UInt4 &lhs, RValue<UInt4> rhs);
1562 // RValue<UInt4> operator%=(const UInt4 &lhs, RValue<UInt4> rhs);
1563 RValue<UInt4> operator&=(const UInt4 &lhs, RValue<UInt4> rhs);
1564 RValue<UInt4> operator|=(const UInt4 &lhs, RValue<UInt4> rhs);
1565 RValue<UInt4> operator^=(const UInt4 &lhs, RValue<UInt4> rhs);
1566 RValue<UInt4> operator<<=(const UInt4 &lhs, unsigned char rhs);
1567 RValue<UInt4> operator>>=(const UInt4 &lhs, unsigned char rhs);
1568 RValue<UInt4> operator+(RValue<UInt4> val);
1569 RValue<UInt4> operator-(RValue<UInt4> val);
1570 RValue<UInt4> operator~(RValue<UInt4> val);
1571 // RValue<UInt4> operator++(const UInt4 &val, int); // Post-increment
1572 // const UInt4 &operator++(const UInt4 &val); // Pre-increment
1573 // RValue<UInt4> operator--(const UInt4 &val, int); // Post-decrement
1574 // const UInt4 &operator--(const UInt4 &val); // Pre-decrement
1575 // RValue<Bool> operator<(RValue<UInt4> lhs, RValue<UInt4> rhs);
1576 // RValue<Bool> operator<=(RValue<UInt4> lhs, RValue<UInt4> rhs);
1577 // RValue<Bool> operator>(RValue<UInt4> lhs, RValue<UInt4> rhs);
1578 // RValue<Bool> operator>=(RValue<UInt4> lhs, RValue<UInt4> rhs);
1579 // RValue<Bool> operator!=(RValue<UInt4> lhs, RValue<UInt4> rhs);
1580 // RValue<Bool> operator==(RValue<UInt4> lhs, RValue<UInt4> rhs);
1582 RValue<UInt4> CmpEQ(RValue<UInt4> x, RValue<UInt4> y);
1583 RValue<UInt4> CmpLT(RValue<UInt4> x, RValue<UInt4> y);
1584 RValue<UInt4> CmpLE(RValue<UInt4> x, RValue<UInt4> y);
1585 RValue<UInt4> CmpNEQ(RValue<UInt4> x, RValue<UInt4> y);
1586 RValue<UInt4> CmpNLT(RValue<UInt4> x, RValue<UInt4> y);
1587 RValue<UInt4> CmpNLE(RValue<UInt4> x, RValue<UInt4> y);
1588 RValue<UInt4> Max(RValue<UInt4> x, RValue<UInt4> y);
1589 RValue<UInt4> Min(RValue<UInt4> x, RValue<UInt4> y);
1590 // RValue<UInt4> RoundInt(RValue<Float4> cast);
1591 RValue<UShort8> Pack(RValue<UInt4> x, RValue<UInt4> y);
1594 class Swizzle2Float4
1596 friend class Float4;
1599 operator RValue<Float4>() const;
1609 operator RValue<Float4>() const;
1616 class SwizzleMaskFloat4
1618 friend class Float4;
1621 operator RValue<Float4>() const;
1623 RValue<Float4> operator=(RValue<Float4> rhs) const;
1624 RValue<Float4> operator=(RValue<Float> rhs) const;
1631 class SwizzleMask1Float4
1634 operator RValue<Float>() const;
1635 operator RValue<Float4>() const;
1637 RValue<Float4> operator=(float x) const;
1638 RValue<Float4> operator=(RValue<Float4> rhs) const;
1639 RValue<Float4> operator=(RValue<Float> rhs) const;
1646 class SwizzleMask2Float4
1648 friend class Float4;
1651 operator RValue<Float4>() const;
1653 RValue<Float4> operator=(RValue<Float4> rhs) const;
1659 class Float : public Variable<Float>
1662 explicit Float(RValue<Int> cast);
1666 Float(RValue<Float> rhs);
1667 Float(const Float &rhs);
1668 Float(const Reference<Float> &rhs);
1671 Float(const SwizzleMask1Float4<T> &rhs);
1673 // RValue<Float> operator=(float rhs) const; // FIXME: Implement
1674 RValue<Float> operator=(RValue<Float> rhs) const;
1675 RValue<Float> operator=(const Float &rhs) const;
1676 RValue<Float> operator=(const Reference<Float> &rhs) const;
1679 RValue<Float> operator=(const SwizzleMask1Float4<T> &rhs) const;
1681 static Type *getType();
1684 RValue<Float> operator+(RValue<Float> lhs, RValue<Float> rhs);
1685 RValue<Float> operator-(RValue<Float> lhs, RValue<Float> rhs);
1686 RValue<Float> operator*(RValue<Float> lhs, RValue<Float> rhs);
1687 RValue<Float> operator/(RValue<Float> lhs, RValue<Float> rhs);
1688 RValue<Float> operator+=(const Float &lhs, RValue<Float> rhs);
1689 RValue<Float> operator-=(const Float &lhs, RValue<Float> rhs);
1690 RValue<Float> operator*=(const Float &lhs, RValue<Float> rhs);
1691 RValue<Float> operator/=(const Float &lhs, RValue<Float> rhs);
1692 RValue<Float> operator+(RValue<Float> val);
1693 RValue<Float> operator-(RValue<Float> val);
1694 RValue<Bool> operator<(RValue<Float> lhs, RValue<Float> rhs);
1695 RValue<Bool> operator<=(RValue<Float> lhs, RValue<Float> rhs);
1696 RValue<Bool> operator>(RValue<Float> lhs, RValue<Float> rhs);
1697 RValue<Bool> operator>=(RValue<Float> lhs, RValue<Float> rhs);
1698 RValue<Bool> operator!=(RValue<Float> lhs, RValue<Float> rhs);
1699 RValue<Bool> operator==(RValue<Float> lhs, RValue<Float> rhs);
1701 RValue<Float> Abs(RValue<Float> x);
1702 RValue<Float> Max(RValue<Float> x, RValue<Float> y);
1703 RValue<Float> Min(RValue<Float> x, RValue<Float> y);
1704 RValue<Float> Rcp_pp(RValue<Float> val, bool exactAtPow2 = false);
1705 RValue<Float> RcpSqrt_pp(RValue<Float> val);
1706 RValue<Float> Sqrt(RValue<Float> x);
1707 RValue<Float> Round(RValue<Float> val);
1708 RValue<Float> Trunc(RValue<Float> val);
1709 RValue<Float> Frac(RValue<Float> val);
1710 RValue<Float> Floor(RValue<Float> val);
1711 RValue<Float> Ceil(RValue<Float> val);
1713 class Float2 : public Variable<Float2>
1716 // explicit Float2(RValue<Byte2> cast);
1717 // explicit Float2(RValue<Short2> cast);
1718 // explicit Float2(RValue<UShort2> cast);
1719 // explicit Float2(RValue<Int2> cast);
1720 // explicit Float2(RValue<UInt2> cast);
1721 explicit Float2(RValue<Float4> cast);
1724 // Float2(float x, float y);
1725 // Float2(RValue<Float2> rhs);
1726 // Float2(const Float2 &rhs);
1727 // Float2(const Reference<Float2> &rhs);
1728 // Float2(RValue<Float> rhs);
1729 // Float2(const Float &rhs);
1730 // Float2(const Reference<Float> &rhs);
1733 // Float2(const SwizzleMask1Float4<T> &rhs);
1735 // RValue<Float2> operator=(float replicate) const;
1736 // RValue<Float2> operator=(RValue<Float2> rhs) const;
1737 // RValue<Float2> operator=(const Float2 &rhs) const;
1738 // RValue<Float2> operator=(const Reference<Float2> &rhs) const;
1739 // RValue<Float2> operator=(RValue<Float> rhs) const;
1740 // RValue<Float2> operator=(const Float &rhs) const;
1741 // RValue<Float2> operator=(const Reference<Float> &rhs) const;
1744 // RValue<Float2> operator=(const SwizzleMask1Float4<T> &rhs);
1746 static Type *getType();
1749 // RValue<Float2> operator+(RValue<Float2> lhs, RValue<Float2> rhs);
1750 // RValue<Float2> operator-(RValue<Float2> lhs, RValue<Float2> rhs);
1751 // RValue<Float2> operator*(RValue<Float2> lhs, RValue<Float2> rhs);
1752 // RValue<Float2> operator/(RValue<Float2> lhs, RValue<Float2> rhs);
1753 // RValue<Float2> operator%(RValue<Float2> lhs, RValue<Float2> rhs);
1754 // RValue<Float2> operator+=(const Float2 &lhs, RValue<Float2> rhs);
1755 // RValue<Float2> operator-=(const Float2 &lhs, RValue<Float2> rhs);
1756 // RValue<Float2> operator*=(const Float2 &lhs, RValue<Float2> rhs);
1757 // RValue<Float2> operator/=(const Float2 &lhs, RValue<Float2> rhs);
1758 // RValue<Float2> operator%=(const Float2 &lhs, RValue<Float2> rhs);
1759 // RValue<Float2> operator+(RValue<Float2> val);
1760 // RValue<Float2> operator-(RValue<Float2> val);
1762 // RValue<Float2> Abs(RValue<Float2> x);
1763 // RValue<Float2> Max(RValue<Float2> x, RValue<Float2> y);
1764 // RValue<Float2> Min(RValue<Float2> x, RValue<Float2> y);
1765 // RValue<Float2> Swizzle(RValue<Float2> x, unsigned char select);
1766 // RValue<Float2> Mask(Float2 &lhs, RValue<Float2> rhs, unsigned char select);
1768 class Float4 : public Variable<Float4>
1771 explicit Float4(RValue<Byte4> cast);
1772 explicit Float4(RValue<SByte4> cast);
1773 explicit Float4(RValue<Short4> cast);
1774 explicit Float4(RValue<UShort4> cast);
1775 explicit Float4(RValue<Int4> cast);
1776 explicit Float4(RValue<UInt4> cast);
1780 Float4(float x, float yzw);
1781 Float4(float x, float y, float zw);
1782 Float4(float x, float y, float z, float w);
1783 Float4(RValue<Float4> rhs);
1784 Float4(const Float4 &rhs);
1785 Float4(const Reference<Float4> &rhs);
1786 Float4(RValue<Float> rhs);
1787 Float4(const Float &rhs);
1788 Float4(const Reference<Float> &rhs);
1791 Float4(const SwizzleMask1Float4<T> &rhs);
1793 Float4(const SwizzleFloat4<T> &rhs);
1794 template<int X, int Y>
1795 Float4(const Swizzle2Float4<X> &x, const Swizzle2Float4<Y> &y);
1796 template<int X, int Y>
1797 Float4(const SwizzleMask2Float4<X> &x, const Swizzle2Float4<Y> &y);
1798 template<int X, int Y>
1799 Float4(const Swizzle2Float4<X> &x, const SwizzleMask2Float4<Y> &y);
1800 template<int X, int Y>
1801 Float4(const SwizzleMask2Float4<X> &x, const SwizzleMask2Float4<Y> &y);
1803 RValue<Float4> operator=(float replicate) const;
1804 RValue<Float4> operator=(RValue<Float4> rhs) const;
1805 RValue<Float4> operator=(const Float4 &rhs) const;
1806 RValue<Float4> operator=(const Reference<Float4> &rhs) const;
1807 RValue<Float4> operator=(RValue<Float> rhs) const;
1808 RValue<Float4> operator=(const Float &rhs) const;
1809 RValue<Float4> operator=(const Reference<Float> &rhs) const;
1812 RValue<Float4> operator=(const SwizzleMask1Float4<T> &rhs);
1814 RValue<Float4> operator=(const SwizzleFloat4<T> &rhs);
1816 static Type *getType();
1820 SwizzleMask1Float4<0x00> x;
1821 SwizzleMask1Float4<0x55> y;
1822 SwizzleMask1Float4<0xAA> z;
1823 SwizzleMask1Float4<0xFF> w;
1824 Swizzle2Float4<0x00> xx;
1825 Swizzle2Float4<0x01> yx;
1826 Swizzle2Float4<0x02> zx;
1827 Swizzle2Float4<0x03> wx;
1828 SwizzleMask2Float4<0x54> xy;
1829 Swizzle2Float4<0x55> yy;
1830 Swizzle2Float4<0x56> zy;
1831 Swizzle2Float4<0x57> wy;
1832 SwizzleMask2Float4<0xA8> xz;
1833 SwizzleMask2Float4<0xA9> yz;
1834 Swizzle2Float4<0xAA> zz;
1835 Swizzle2Float4<0xAB> wz;
1836 SwizzleMask2Float4<0xFC> xw;
1837 SwizzleMask2Float4<0xFD> yw;
1838 SwizzleMask2Float4<0xFE> zw;
1839 Swizzle2Float4<0xFF> ww;
1840 SwizzleFloat4<0x00> xxx;
1841 SwizzleFloat4<0x01> yxx;
1842 SwizzleFloat4<0x02> zxx;
1843 SwizzleFloat4<0x03> wxx;
1844 SwizzleFloat4<0x04> xyx;
1845 SwizzleFloat4<0x05> yyx;
1846 SwizzleFloat4<0x06> zyx;
1847 SwizzleFloat4<0x07> wyx;
1848 SwizzleFloat4<0x08> xzx;
1849 SwizzleFloat4<0x09> yzx;
1850 SwizzleFloat4<0x0A> zzx;
1851 SwizzleFloat4<0x0B> wzx;
1852 SwizzleFloat4<0x0C> xwx;
1853 SwizzleFloat4<0x0D> ywx;
1854 SwizzleFloat4<0x0E> zwx;
1855 SwizzleFloat4<0x0F> wwx;
1856 SwizzleFloat4<0x50> xxy;
1857 SwizzleFloat4<0x51> yxy;
1858 SwizzleFloat4<0x52> zxy;
1859 SwizzleFloat4<0x53> wxy;
1860 SwizzleFloat4<0x54> xyy;
1861 SwizzleFloat4<0x55> yyy;
1862 SwizzleFloat4<0x56> zyy;
1863 SwizzleFloat4<0x57> wyy;
1864 SwizzleFloat4<0x58> xzy;
1865 SwizzleFloat4<0x59> yzy;
1866 SwizzleFloat4<0x5A> zzy;
1867 SwizzleFloat4<0x5B> wzy;
1868 SwizzleFloat4<0x5C> xwy;
1869 SwizzleFloat4<0x5D> ywy;
1870 SwizzleFloat4<0x5E> zwy;
1871 SwizzleFloat4<0x5F> wwy;
1872 SwizzleFloat4<0xA0> xxz;
1873 SwizzleFloat4<0xA1> yxz;
1874 SwizzleFloat4<0xA2> zxz;
1875 SwizzleFloat4<0xA3> wxz;
1876 SwizzleMaskFloat4<0xA4> xyz;
1877 SwizzleFloat4<0xA5> yyz;
1878 SwizzleFloat4<0xA6> zyz;
1879 SwizzleFloat4<0xA7> wyz;
1880 SwizzleFloat4<0xA8> xzz;
1881 SwizzleFloat4<0xA9> yzz;
1882 SwizzleFloat4<0xAA> zzz;
1883 SwizzleFloat4<0xAB> wzz;
1884 SwizzleFloat4<0xAC> xwz;
1885 SwizzleFloat4<0xAD> ywz;
1886 SwizzleFloat4<0xAE> zwz;
1887 SwizzleFloat4<0xAF> wwz;
1888 SwizzleFloat4<0xF0> xxw;
1889 SwizzleFloat4<0xF1> yxw;
1890 SwizzleFloat4<0xF2> zxw;
1891 SwizzleFloat4<0xF3> wxw;
1892 SwizzleMaskFloat4<0xF4> xyw;
1893 SwizzleFloat4<0xF5> yyw;
1894 SwizzleFloat4<0xF6> zyw;
1895 SwizzleFloat4<0xF7> wyw;
1896 SwizzleMaskFloat4<0xF8> xzw;
1897 SwizzleMaskFloat4<0xF9> yzw;
1898 SwizzleFloat4<0xFA> zzw;
1899 SwizzleFloat4<0xFB> wzw;
1900 SwizzleFloat4<0xFC> xww;
1901 SwizzleFloat4<0xFD> yww;
1902 SwizzleFloat4<0xFE> zww;
1903 SwizzleFloat4<0xFF> www;
1904 SwizzleFloat4<0x00> xxxx;
1905 SwizzleFloat4<0x01> yxxx;
1906 SwizzleFloat4<0x02> zxxx;
1907 SwizzleFloat4<0x03> wxxx;
1908 SwizzleFloat4<0x04> xyxx;
1909 SwizzleFloat4<0x05> yyxx;
1910 SwizzleFloat4<0x06> zyxx;
1911 SwizzleFloat4<0x07> wyxx;
1912 SwizzleFloat4<0x08> xzxx;
1913 SwizzleFloat4<0x09> yzxx;
1914 SwizzleFloat4<0x0A> zzxx;
1915 SwizzleFloat4<0x0B> wzxx;
1916 SwizzleFloat4<0x0C> xwxx;
1917 SwizzleFloat4<0x0D> ywxx;
1918 SwizzleFloat4<0x0E> zwxx;
1919 SwizzleFloat4<0x0F> wwxx;
1920 SwizzleFloat4<0x10> xxyx;
1921 SwizzleFloat4<0x11> yxyx;
1922 SwizzleFloat4<0x12> zxyx;
1923 SwizzleFloat4<0x13> wxyx;
1924 SwizzleFloat4<0x14> xyyx;
1925 SwizzleFloat4<0x15> yyyx;
1926 SwizzleFloat4<0x16> zyyx;
1927 SwizzleFloat4<0x17> wyyx;
1928 SwizzleFloat4<0x18> xzyx;
1929 SwizzleFloat4<0x19> yzyx;
1930 SwizzleFloat4<0x1A> zzyx;
1931 SwizzleFloat4<0x1B> wzyx;
1932 SwizzleFloat4<0x1C> xwyx;
1933 SwizzleFloat4<0x1D> ywyx;
1934 SwizzleFloat4<0x1E> zwyx;
1935 SwizzleFloat4<0x1F> wwyx;
1936 SwizzleFloat4<0x20> xxzx;
1937 SwizzleFloat4<0x21> yxzx;
1938 SwizzleFloat4<0x22> zxzx;
1939 SwizzleFloat4<0x23> wxzx;
1940 SwizzleFloat4<0x24> xyzx;
1941 SwizzleFloat4<0x25> yyzx;
1942 SwizzleFloat4<0x26> zyzx;
1943 SwizzleFloat4<0x27> wyzx;
1944 SwizzleFloat4<0x28> xzzx;
1945 SwizzleFloat4<0x29> yzzx;
1946 SwizzleFloat4<0x2A> zzzx;
1947 SwizzleFloat4<0x2B> wzzx;
1948 SwizzleFloat4<0x2C> xwzx;
1949 SwizzleFloat4<0x2D> ywzx;
1950 SwizzleFloat4<0x2E> zwzx;
1951 SwizzleFloat4<0x2F> wwzx;
1952 SwizzleFloat4<0x30> xxwx;
1953 SwizzleFloat4<0x31> yxwx;
1954 SwizzleFloat4<0x32> zxwx;
1955 SwizzleFloat4<0x33> wxwx;
1956 SwizzleFloat4<0x34> xywx;
1957 SwizzleFloat4<0x35> yywx;
1958 SwizzleFloat4<0x36> zywx;
1959 SwizzleFloat4<0x37> wywx;
1960 SwizzleFloat4<0x38> xzwx;
1961 SwizzleFloat4<0x39> yzwx;
1962 SwizzleFloat4<0x3A> zzwx;
1963 SwizzleFloat4<0x3B> wzwx;
1964 SwizzleFloat4<0x3C> xwwx;
1965 SwizzleFloat4<0x3D> ywwx;
1966 SwizzleFloat4<0x3E> zwwx;
1967 SwizzleFloat4<0x3F> wwwx;
1968 SwizzleFloat4<0x40> xxxy;
1969 SwizzleFloat4<0x41> yxxy;
1970 SwizzleFloat4<0x42> zxxy;
1971 SwizzleFloat4<0x43> wxxy;
1972 SwizzleFloat4<0x44> xyxy;
1973 SwizzleFloat4<0x45> yyxy;
1974 SwizzleFloat4<0x46> zyxy;
1975 SwizzleFloat4<0x47> wyxy;
1976 SwizzleFloat4<0x48> xzxy;
1977 SwizzleFloat4<0x49> yzxy;
1978 SwizzleFloat4<0x4A> zzxy;
1979 SwizzleFloat4<0x4B> wzxy;
1980 SwizzleFloat4<0x4C> xwxy;
1981 SwizzleFloat4<0x4D> ywxy;
1982 SwizzleFloat4<0x4E> zwxy;
1983 SwizzleFloat4<0x4F> wwxy;
1984 SwizzleFloat4<0x50> xxyy;
1985 SwizzleFloat4<0x51> yxyy;
1986 SwizzleFloat4<0x52> zxyy;
1987 SwizzleFloat4<0x53> wxyy;
1988 SwizzleFloat4<0x54> xyyy;
1989 SwizzleFloat4<0x55> yyyy;
1990 SwizzleFloat4<0x56> zyyy;
1991 SwizzleFloat4<0x57> wyyy;
1992 SwizzleFloat4<0x58> xzyy;
1993 SwizzleFloat4<0x59> yzyy;
1994 SwizzleFloat4<0x5A> zzyy;
1995 SwizzleFloat4<0x5B> wzyy;
1996 SwizzleFloat4<0x5C> xwyy;
1997 SwizzleFloat4<0x5D> ywyy;
1998 SwizzleFloat4<0x5E> zwyy;
1999 SwizzleFloat4<0x5F> wwyy;
2000 SwizzleFloat4<0x60> xxzy;
2001 SwizzleFloat4<0x61> yxzy;
2002 SwizzleFloat4<0x62> zxzy;
2003 SwizzleFloat4<0x63> wxzy;
2004 SwizzleFloat4<0x64> xyzy;
2005 SwizzleFloat4<0x65> yyzy;
2006 SwizzleFloat4<0x66> zyzy;
2007 SwizzleFloat4<0x67> wyzy;
2008 SwizzleFloat4<0x68> xzzy;
2009 SwizzleFloat4<0x69> yzzy;
2010 SwizzleFloat4<0x6A> zzzy;
2011 SwizzleFloat4<0x6B> wzzy;
2012 SwizzleFloat4<0x6C> xwzy;
2013 SwizzleFloat4<0x6D> ywzy;
2014 SwizzleFloat4<0x6E> zwzy;
2015 SwizzleFloat4<0x6F> wwzy;
2016 SwizzleFloat4<0x70> xxwy;
2017 SwizzleFloat4<0x71> yxwy;
2018 SwizzleFloat4<0x72> zxwy;
2019 SwizzleFloat4<0x73> wxwy;
2020 SwizzleFloat4<0x74> xywy;
2021 SwizzleFloat4<0x75> yywy;
2022 SwizzleFloat4<0x76> zywy;
2023 SwizzleFloat4<0x77> wywy;
2024 SwizzleFloat4<0x78> xzwy;
2025 SwizzleFloat4<0x79> yzwy;
2026 SwizzleFloat4<0x7A> zzwy;
2027 SwizzleFloat4<0x7B> wzwy;
2028 SwizzleFloat4<0x7C> xwwy;
2029 SwizzleFloat4<0x7D> ywwy;
2030 SwizzleFloat4<0x7E> zwwy;
2031 SwizzleFloat4<0x7F> wwwy;
2032 SwizzleFloat4<0x80> xxxz;
2033 SwizzleFloat4<0x81> yxxz;
2034 SwizzleFloat4<0x82> zxxz;
2035 SwizzleFloat4<0x83> wxxz;
2036 SwizzleFloat4<0x84> xyxz;
2037 SwizzleFloat4<0x85> yyxz;
2038 SwizzleFloat4<0x86> zyxz;
2039 SwizzleFloat4<0x87> wyxz;
2040 SwizzleFloat4<0x88> xzxz;
2041 SwizzleFloat4<0x89> yzxz;
2042 SwizzleFloat4<0x8A> zzxz;
2043 SwizzleFloat4<0x8B> wzxz;
2044 SwizzleFloat4<0x8C> xwxz;
2045 SwizzleFloat4<0x8D> ywxz;
2046 SwizzleFloat4<0x8E> zwxz;
2047 SwizzleFloat4<0x8F> wwxz;
2048 SwizzleFloat4<0x90> xxyz;
2049 SwizzleFloat4<0x91> yxyz;
2050 SwizzleFloat4<0x92> zxyz;
2051 SwizzleFloat4<0x93> wxyz;
2052 SwizzleFloat4<0x94> xyyz;
2053 SwizzleFloat4<0x95> yyyz;
2054 SwizzleFloat4<0x96> zyyz;
2055 SwizzleFloat4<0x97> wyyz;
2056 SwizzleFloat4<0x98> xzyz;
2057 SwizzleFloat4<0x99> yzyz;
2058 SwizzleFloat4<0x9A> zzyz;
2059 SwizzleFloat4<0x9B> wzyz;
2060 SwizzleFloat4<0x9C> xwyz;
2061 SwizzleFloat4<0x9D> ywyz;
2062 SwizzleFloat4<0x9E> zwyz;
2063 SwizzleFloat4<0x9F> wwyz;
2064 SwizzleFloat4<0xA0> xxzz;
2065 SwizzleFloat4<0xA1> yxzz;
2066 SwizzleFloat4<0xA2> zxzz;
2067 SwizzleFloat4<0xA3> wxzz;
2068 SwizzleFloat4<0xA4> xyzz;
2069 SwizzleFloat4<0xA5> yyzz;
2070 SwizzleFloat4<0xA6> zyzz;
2071 SwizzleFloat4<0xA7> wyzz;
2072 SwizzleFloat4<0xA8> xzzz;
2073 SwizzleFloat4<0xA9> yzzz;
2074 SwizzleFloat4<0xAA> zzzz;
2075 SwizzleFloat4<0xAB> wzzz;
2076 SwizzleFloat4<0xAC> xwzz;
2077 SwizzleFloat4<0xAD> ywzz;
2078 SwizzleFloat4<0xAE> zwzz;
2079 SwizzleFloat4<0xAF> wwzz;
2080 SwizzleFloat4<0xB0> xxwz;
2081 SwizzleFloat4<0xB1> yxwz;
2082 SwizzleFloat4<0xB2> zxwz;
2083 SwizzleFloat4<0xB3> wxwz;
2084 SwizzleFloat4<0xB4> xywz;
2085 SwizzleFloat4<0xB5> yywz;
2086 SwizzleFloat4<0xB6> zywz;
2087 SwizzleFloat4<0xB7> wywz;
2088 SwizzleFloat4<0xB8> xzwz;
2089 SwizzleFloat4<0xB9> yzwz;
2090 SwizzleFloat4<0xBA> zzwz;
2091 SwizzleFloat4<0xBB> wzwz;
2092 SwizzleFloat4<0xBC> xwwz;
2093 SwizzleFloat4<0xBD> ywwz;
2094 SwizzleFloat4<0xBE> zwwz;
2095 SwizzleFloat4<0xBF> wwwz;
2096 SwizzleFloat4<0xC0> xxxw;
2097 SwizzleFloat4<0xC1> yxxw;
2098 SwizzleFloat4<0xC2> zxxw;
2099 SwizzleFloat4<0xC3> wxxw;
2100 SwizzleFloat4<0xC4> xyxw;
2101 SwizzleFloat4<0xC5> yyxw;
2102 SwizzleFloat4<0xC6> zyxw;
2103 SwizzleFloat4<0xC7> wyxw;
2104 SwizzleFloat4<0xC8> xzxw;
2105 SwizzleFloat4<0xC9> yzxw;
2106 SwizzleFloat4<0xCA> zzxw;
2107 SwizzleFloat4<0xCB> wzxw;
2108 SwizzleFloat4<0xCC> xwxw;
2109 SwizzleFloat4<0xCD> ywxw;
2110 SwizzleFloat4<0xCE> zwxw;
2111 SwizzleFloat4<0xCF> wwxw;
2112 SwizzleFloat4<0xD0> xxyw;
2113 SwizzleFloat4<0xD1> yxyw;
2114 SwizzleFloat4<0xD2> zxyw;
2115 SwizzleFloat4<0xD3> wxyw;
2116 SwizzleFloat4<0xD4> xyyw;
2117 SwizzleFloat4<0xD5> yyyw;
2118 SwizzleFloat4<0xD6> zyyw;
2119 SwizzleFloat4<0xD7> wyyw;
2120 SwizzleFloat4<0xD8> xzyw;
2121 SwizzleFloat4<0xD9> yzyw;
2122 SwizzleFloat4<0xDA> zzyw;
2123 SwizzleFloat4<0xDB> wzyw;
2124 SwizzleFloat4<0xDC> xwyw;
2125 SwizzleFloat4<0xDD> ywyw;
2126 SwizzleFloat4<0xDE> zwyw;
2127 SwizzleFloat4<0xDF> wwyw;
2128 SwizzleFloat4<0xE0> xxzw;
2129 SwizzleFloat4<0xE1> yxzw;
2130 SwizzleFloat4<0xE2> zxzw;
2131 SwizzleFloat4<0xE3> wxzw;
2132 SwizzleMaskFloat4<0xE4> xyzw;
2133 SwizzleFloat4<0xE5> yyzw;
2134 SwizzleFloat4<0xE6> zyzw;
2135 SwizzleFloat4<0xE7> wyzw;
2136 SwizzleFloat4<0xE8> xzzw;
2137 SwizzleFloat4<0xE9> yzzw;
2138 SwizzleFloat4<0xEA> zzzw;
2139 SwizzleFloat4<0xEB> wzzw;
2140 SwizzleFloat4<0xEC> xwzw;
2141 SwizzleFloat4<0xED> ywzw;
2142 SwizzleFloat4<0xEE> zwzw;
2143 SwizzleFloat4<0xEF> wwzw;
2144 SwizzleFloat4<0xF0> xxww;
2145 SwizzleFloat4<0xF1> yxww;
2146 SwizzleFloat4<0xF2> zxww;
2147 SwizzleFloat4<0xF3> wxww;
2148 SwizzleFloat4<0xF4> xyww;
2149 SwizzleFloat4<0xF5> yyww;
2150 SwizzleFloat4<0xF6> zyww;
2151 SwizzleFloat4<0xF7> wyww;
2152 SwizzleFloat4<0xF8> xzww;
2153 SwizzleFloat4<0xF9> yzww;
2154 SwizzleFloat4<0xFA> zzww;
2155 SwizzleFloat4<0xFB> wzww;
2156 SwizzleFloat4<0xFC> xwww;
2157 SwizzleFloat4<0xFD> ywww;
2158 SwizzleFloat4<0xFE> zwww;
2159 SwizzleFloat4<0xFF> wwww;
2163 void constant(float x, float y, float z, float w);
2166 RValue<Float4> operator+(RValue<Float4> lhs, RValue<Float4> rhs);
2167 RValue<Float4> operator-(RValue<Float4> lhs, RValue<Float4> rhs);
2168 RValue<Float4> operator*(RValue<Float4> lhs, RValue<Float4> rhs);
2169 RValue<Float4> operator/(RValue<Float4> lhs, RValue<Float4> rhs);
2170 RValue<Float4> operator%(RValue<Float4> lhs, RValue<Float4> rhs);
2171 RValue<Float4> operator+=(const Float4 &lhs, RValue<Float4> rhs);
2172 RValue<Float4> operator-=(const Float4 &lhs, RValue<Float4> rhs);
2173 RValue<Float4> operator*=(const Float4 &lhs, RValue<Float4> rhs);
2174 RValue<Float4> operator/=(const Float4 &lhs, RValue<Float4> rhs);
2175 RValue<Float4> operator%=(const Float4 &lhs, RValue<Float4> rhs);
2176 RValue<Float4> operator+(RValue<Float4> val);
2177 RValue<Float4> operator-(RValue<Float4> val);
2179 RValue<Float4> Abs(RValue<Float4> x);
2180 RValue<Float4> Max(RValue<Float4> x, RValue<Float4> y);
2181 RValue<Float4> Min(RValue<Float4> x, RValue<Float4> y);
2182 RValue<Float4> Rcp_pp(RValue<Float4> val, bool exactAtPow2 = false);
2183 RValue<Float4> RcpSqrt_pp(RValue<Float4> val);
2184 RValue<Float4> Sqrt(RValue<Float4> x);
2185 RValue<Float4> Insert(const Float4 &val, RValue<Float> element, int i);
2186 RValue<Float> Extract(RValue<Float4> x, int i);
2187 RValue<Float4> Swizzle(RValue<Float4> x, unsigned char select);
2188 RValue<Float4> ShuffleLowHigh(RValue<Float4> x, RValue<Float4> y, unsigned char imm);
2189 RValue<Float4> UnpackLow(RValue<Float4> x, RValue<Float4> y);
2190 RValue<Float4> UnpackHigh(RValue<Float4> x, RValue<Float4> y);
2191 RValue<Float4> Mask(Float4 &lhs, RValue<Float4> rhs, unsigned char select);
2192 RValue<Int> SignMask(RValue<Float4> x);
2193 RValue<Int4> CmpEQ(RValue<Float4> x, RValue<Float4> y);
2194 RValue<Int4> CmpLT(RValue<Float4> x, RValue<Float4> y);
2195 RValue<Int4> CmpLE(RValue<Float4> x, RValue<Float4> y);
2196 RValue<Int4> CmpNEQ(RValue<Float4> x, RValue<Float4> y);
2197 RValue<Int4> CmpNLT(RValue<Float4> x, RValue<Float4> y);
2198 RValue<Int4> CmpNLE(RValue<Float4> x, RValue<Float4> y);
2199 RValue<Float4> Round(RValue<Float4> x);
2200 RValue<Float4> Trunc(RValue<Float4> x);
2201 RValue<Float4> Frac(RValue<Float4> x);
2202 RValue<Float4> Floor(RValue<Float4> x);
2203 RValue<Float4> Ceil(RValue<Float4> x);
2206 class Pointer : public Variable<Pointer<T>>
2210 Pointer(RValue<Pointer<S>> pointerS, int alignment = 1) : alignment(alignment)
2212 Value *pointerT = Nucleus::createBitCast(pointerS.value, Nucleus::getPointerType(T::getType()));
2213 LValue<Pointer<T>>::storeValue(pointerT);
2217 Pointer(const Pointer<S> &pointer, int alignment = 1) : alignment(alignment)
2219 Value *pointerS = pointer.loadValue(alignment);
2220 Value *pointerT = Nucleus::createBitCast(pointerS, Nucleus::getPointerType(T::getType()));
2221 LValue<Pointer<T>>::storeValue(pointerT);
2224 Pointer(Argument<Pointer<T>> argument);
2225 explicit Pointer(const void *external);
2228 Pointer(RValue<Pointer<T>> rhs);
2229 Pointer(const Pointer<T> &rhs);
2230 Pointer(const Reference<Pointer<T>> &rhs);
2232 RValue<Pointer<T>> operator=(RValue<Pointer<T>> rhs) const;
2233 RValue<Pointer<T>> operator=(const Pointer<T> &rhs) const;
2234 RValue<Pointer<T>> operator=(const Reference<Pointer<T>> &rhs) const;
2236 Reference<T> operator*();
2237 Reference<T> operator[](int index);
2238 Reference<T> operator[](RValue<Int> index);
2240 static Type *getType();
2243 const int alignment;
2246 RValue<Pointer<Byte>> operator+(RValue<Pointer<Byte>> lhs, int offset);
2247 RValue<Pointer<Byte>> operator+(RValue<Pointer<Byte>> lhs, RValue<Int> offset);
2248 RValue<Pointer<Byte>> operator+(RValue<Pointer<Byte>> lhs, RValue<UInt> offset);
2249 RValue<Pointer<Byte>> operator+=(const Pointer<Byte> &lhs, int offset);
2250 RValue<Pointer<Byte>> operator+=(const Pointer<Byte> &lhs, RValue<Int> offset);
2251 RValue<Pointer<Byte>> operator+=(const Pointer<Byte> &lhs, RValue<UInt> offset);
2253 RValue<Pointer<Byte>> operator-(RValue<Pointer<Byte>> lhs, int offset);
2254 RValue<Pointer<Byte>> operator-(RValue<Pointer<Byte>> lhs, RValue<Int> offset);
2255 RValue<Pointer<Byte>> operator-(RValue<Pointer<Byte>> lhs, RValue<UInt> offset);
2256 RValue<Pointer<Byte>> operator-=(const Pointer<Byte> &lhs, int offset);
2257 RValue<Pointer<Byte>> operator-=(const Pointer<Byte> &lhs, RValue<Int> offset);
2258 RValue<Pointer<Byte>> operator-=(const Pointer<Byte> &lhs, RValue<UInt> offset);
2260 template<class T, int S = 1>
2261 class Array : public Variable<T>
2264 Array(int size = S);
2266 Reference<T> operator[](int index);
2267 Reference<T> operator[](RValue<Int> index);
2270 // RValue<Array<T>> operator++(const Array<T> &val, int); // Post-increment
2271 // const Array<T> &operator++(const Array<T> &val); // Pre-increment
2272 // RValue<Array<T>> operator--(const Array<T> &val, int); // Post-decrement
2273 // const Array<T> &operator--(const Array<T> &val); // Pre-decrement
2275 BasicBlock *beginLoop();
2276 bool branch(RValue<Bool> cmp, BasicBlock *bodyBB, BasicBlock *endBB);
2277 bool elseBlock(BasicBlock *falseBB);
2280 void Return(bool ret);
2281 void Return(const Int &ret);
2284 void Return(const Pointer<T> &ret);
2287 void Return(RValue<Pointer<T>> ret);
2289 template<unsigned int index, typename... Arguments>
2292 template<typename Arg0, typename... Arguments>
2293 struct ArgI<0, Arg0, Arguments...>
2298 template<unsigned int index, typename Arg0, typename... Arguments>
2299 struct ArgI<index, Arg0, Arguments...>
2301 typedef typename ArgI<index - 1, Arguments...>::Type Type;
2304 // Generic template, leave undefined!
2305 template<typename FunctionType>
2308 // Specialized for function types
2309 template<typename Return, typename... Arguments>
2310 class Function<Return(Arguments...)>
2315 virtual ~Function();
2318 Argument<typename ArgI<index, Arguments...>::Type> Arg() const
2320 Value *arg = Nucleus::getArgument(index);
2321 return Argument<typename ArgI<index, Arguments...>::Type>(arg);
2324 Routine *operator()(const wchar_t *name, ...);
2328 std::vector<Type*> arguments;
2331 template<typename Return>
2332 class Function<Return()> : public Function<Return(Void)>
2336 template<int index, typename Return, typename... Arguments>
2337 Argument<typename ArgI<index, Arguments...>::Type> Arg(Function<Return(Arguments...)> &function)
2339 return Argument<typename ArgI<index, Arguments...>::Type>(function.arg(index));
2342 RValue<Long> Ticks();
2348 LValue<T>::LValue(int arraySize)
2350 address = Nucleus::allocateStackVariable(T::getType(), arraySize);
2354 Value *LValue<T>::loadValue(unsigned int alignment) const
2356 return Nucleus::createLoad(address, T::getType(), false, alignment);
2360 Value *LValue<T>::storeValue(Value *value, unsigned int alignment) const
2362 return Nucleus::createStore(value, address, false, alignment);
2366 Value *LValue<T>::storeValue(Constant *constant, unsigned int alignment) const
2368 return Nucleus::createStore(constant, address, false, alignment);
2372 Value *LValue<T>::getAddress(Value *index) const
2374 return Nucleus::createGEP(address, index);
2378 Variable<T>::Variable(int arraySize) : LValue<T>(arraySize)
2383 RValue<Pointer<T>> Variable<T>::operator&()
2385 return RValue<Pointer<T>>(LValue<T>::address);
2389 Reference<T>::Reference(Value *pointer, int alignment) : alignment(alignment)
2395 RValue<T> Reference<T>::operator=(RValue<T> rhs) const
2397 Nucleus::createStore(rhs.value, address, false, alignment);
2403 RValue<T> Reference<T>::operator=(const Reference<T> &ref) const
2405 Value *tmp = Nucleus::createLoad(ref.address, T::getType(), false, ref.alignment);
2406 Nucleus::createStore(tmp, address, false, alignment);
2408 return RValue<T>(tmp);
2412 RValue<T> Reference<T>::operator+=(RValue<T> rhs) const
2414 return *this = *this + rhs;
2418 Value *Reference<T>::loadValue() const
2420 return Nucleus::createLoad(address, T::getType(), false, alignment);
2424 int Reference<T>::getAlignment() const
2430 RValue<T>::RValue(Value *rvalue)
2436 RValue<T>::RValue(const T &lvalue)
2438 value = lvalue.loadValue();
2442 RValue<T>::RValue(typename IntLiteral<T>::type i)
2444 value = (Value*)Nucleus::createConstantInt(i);
2448 RValue<T>::RValue(typename FloatLiteral<T>::type f)
2450 value = (Value*)Nucleus::createConstantFloat(f);
2454 RValue<T>::RValue(const Reference<T> &ref)
2456 value = ref.loadValue();
2460 Swizzle2Float4<T>::operator RValue<Float4>() const
2462 Value *vector = parent->loadValue();
2464 return RValue<Float4>(Nucleus::createSwizzle(vector, T));
2468 SwizzleFloat4<T>::operator RValue<Float4>() const
2470 Value *vector = parent->loadValue();
2472 return RValue<Float4>(Nucleus::createSwizzle(vector, T));
2476 SwizzleMaskFloat4<T>::operator RValue<Float4>() const
2478 Value *vector = parent->loadValue();
2480 return RValue<Float4>(Nucleus::createSwizzle(vector, T));
2484 RValue<Float4> SwizzleMaskFloat4<T>::operator=(RValue<Float4> rhs) const
2486 return Mask(*parent, rhs, T);
2490 RValue<Float4> SwizzleMaskFloat4<T>::operator=(RValue<Float> rhs) const
2492 return Mask(*parent, Float4(rhs), T);
2496 SwizzleMask1Float4<T>::operator RValue<Float>() const // FIXME: Call a non-template function
2498 return Extract(*parent, T & 0x3);
2502 SwizzleMask1Float4<T>::operator RValue<Float4>() const
2504 Value *vector = parent->loadValue();
2506 return RValue<Float4>(Nucleus::createSwizzle(vector, T));
2510 RValue<Float4> SwizzleMask1Float4<T>::operator=(float x) const
2512 return Insert(*parent, Float(x), T & 0x3);
2516 RValue<Float4> SwizzleMask1Float4<T>::operator=(RValue<Float4> rhs) const
2518 return Mask(*parent, Float4(rhs), T);
2522 RValue<Float4> SwizzleMask1Float4<T>::operator=(RValue<Float> rhs) const // FIXME: Call a non-template function
2524 return Insert(*parent, rhs, T & 0x3);
2528 SwizzleMask2Float4<T>::operator RValue<Float4>() const
2530 Value *vector = parent->loadValue();
2532 return RValue<Float4>(Nucleus::createSwizzle(vector, T));
2536 RValue<Float4> SwizzleMask2Float4<T>::operator=(RValue<Float4> rhs) const
2538 return Mask(*parent, Float4(rhs), T);
2542 Float::Float(const SwizzleMask1Float4<T> &rhs)
2544 *this = rhs.operator RValue<Float>();
2548 RValue<Float> Float::operator=(const SwizzleMask1Float4<T> &rhs) const
2550 return *this = rhs.operator RValue<Float>();
2554 Float4::Float4(const SwizzleMask1Float4<T> &rhs)
2558 *this = rhs.operator RValue<Float4>();
2562 Float4::Float4(const SwizzleFloat4<T> &rhs)
2566 *this = rhs.operator RValue<Float4>();
2569 template<int X, int Y>
2570 Float4::Float4(const Swizzle2Float4<X> &x, const Swizzle2Float4<Y> &y)
2574 *this = ShuffleLowHigh(*x.parent, *y.parent, (X & 0xF) | (Y & 0xF) << 4);
2577 template<int X, int Y>
2578 Float4::Float4(const SwizzleMask2Float4<X> &x, const Swizzle2Float4<Y> &y)
2582 *this = ShuffleLowHigh(*x.parent, *y.parent, (X & 0xF) | (Y & 0xF) << 4);
2585 template<int X, int Y>
2586 Float4::Float4(const Swizzle2Float4<X> &x, const SwizzleMask2Float4<Y> &y)
2590 *this = ShuffleLowHigh(*x.parent, *y.parent, (X & 0xF) | (Y & 0xF) << 4);
2593 template<int X, int Y>
2594 Float4::Float4(const SwizzleMask2Float4<X> &x, const SwizzleMask2Float4<Y> &y)
2598 *this = ShuffleLowHigh(*x.parent, *y.parent, (X & 0xF) | (Y & 0xF) << 4);
2602 RValue<Float4> Float4::operator=(const SwizzleMask1Float4<T> &rhs)
2604 return *this = rhs.operator RValue<Float4>();
2608 RValue<Float4> Float4::operator=(const SwizzleFloat4<T> &rhs)
2610 return *this = rhs.operator RValue<Float4>();
2614 Pointer<T>::Pointer(Argument<Pointer<T>> argument) : alignment(1)
2616 LValue<Pointer<T>>::storeValue(argument.value);
2620 Pointer<T>::Pointer(const void *external) : alignment((intptr_t)external & 0x0000000F ? 1 : 16)
2622 Constant *globalPointer = Nucleus::createConstantPointer(external, T::getType(), false, alignment);
2624 LValue<Pointer<T>>::storeValue(globalPointer);
2628 Pointer<T>::Pointer() : alignment(1)
2630 LValue<Pointer<T>>::storeValue(Nucleus::createNullPointer(T::getType()));
2634 Pointer<T>::Pointer(RValue<Pointer<T>> rhs) : alignment(1)
2636 LValue<Pointer<T>>::storeValue(rhs.value);
2640 Pointer<T>::Pointer(const Pointer<T> &rhs) : alignment(rhs.alignment)
2642 Value *value = rhs.loadValue();
2643 LValue<Pointer<T>>::storeValue(value);
2647 Pointer<T>::Pointer(const Reference<Pointer<T>> &rhs) : alignment(rhs.getAlignment())
2649 Value *value = rhs.loadValue();
2650 LValue<Pointer<T>>::storeValue(value);
2654 RValue<Pointer<T>> Pointer<T>::operator=(RValue<Pointer<T>> rhs) const
2656 LValue<Pointer<T>>::storeValue(rhs.value);
2662 RValue<Pointer<T>> Pointer<T>::operator=(const Pointer<T> &rhs) const
2664 Value *value = rhs.loadValue();
2665 LValue<Pointer<T>>::storeValue(value);
2667 return RValue<Pointer<T>>(value);
2671 RValue<Pointer<T>> Pointer<T>::operator=(const Reference<Pointer<T>> &rhs) const
2673 Value *value = rhs.loadValue();
2674 LValue<Pointer<T>>::storeValue(value);
2676 return RValue<Pointer<T>>(value);
2680 Reference<T> Pointer<T>::operator*()
2682 return Reference<T>(LValue<Pointer<T>>::loadValue(), alignment);
2686 Reference<T> Pointer<T>::operator[](int index)
2688 Value *element = Nucleus::createGEP(LValue<Pointer<T>>::loadValue(), (Value*)Nucleus::createConstantInt(index));
2690 return Reference<T>(element, alignment);
2694 Reference<T> Pointer<T>::operator[](RValue<Int> index)
2696 Value *element = Nucleus::createGEP(LValue<Pointer<T>>::loadValue(), index.value);
2698 return Reference<T>(element, alignment);
2702 Type *Pointer<T>::getType()
2704 return Nucleus::getPointerType(T::getType());
2707 template<class T, int S>
2708 Array<T, S>::Array(int size) : Variable<T>(size)
2712 template<class T, int S>
2713 Reference<T> Array<T, S>::operator[](int index)
2715 Value *element = LValue<T>::getAddress((Value*)Nucleus::createConstantInt(index));
2717 return Reference<T>(element);
2720 template<class T, int S>
2721 Reference<T> Array<T, S>::operator[](RValue<Int> index)
2723 Value *element = LValue<T>::getAddress(index.value);
2725 return Reference<T>(element);
2728 // template<class T>
2729 // RValue<Array<T>> operator++(const Array<T> &val, int)
2731 // // FIXME: Requires storing the address of the array
2734 // template<class T>
2735 // const Array<T> &operator++(const Array<T> &val)
2737 // // FIXME: Requires storing the address of the array
2740 // template<class T>
2741 // RValue<Array<T>> operator--(const Array<T> &val, int)
2743 // // FIXME: Requires storing the address of the array
2746 // template<class T>
2747 // const Array<T> &operator--(const Array<T> &val)
2749 // // FIXME: Requires storing the address of the array
2753 RValue<T> IfThenElse(RValue<Bool> condition, RValue<T> ifTrue, RValue<T> ifFalse)
2755 return RValue<T>(Nucleus::createSelect(condition.value, ifTrue.value, ifFalse.value));
2759 RValue<T> IfThenElse(RValue<Bool> condition, const T &ifTrue, RValue<T> ifFalse)
2761 Value *trueValue = ifTrue.loadValue();
2763 return RValue<T>(Nucleus::createSelect(condition.value, trueValue, ifFalse.value));
2767 RValue<T> IfThenElse(RValue<Bool> condition, RValue<T> ifTrue, const T &ifFalse)
2769 Value *falseValue = ifFalse.loadValue();
2771 return RValue<T>(Nucleus::createSelect(condition.value, ifTrue.value, falseValue));
2775 RValue<T> IfThenElse(RValue<Bool> condition, const T &ifTrue, const T &ifFalse)
2777 Value *trueValue = ifTrue.loadValue();
2778 Value *falseValue = ifFalse.loadValue();
2780 return RValue<T>(Nucleus::createSelect(condition.value, trueValue, falseValue));
2784 void Return(const Pointer<T> &ret)
2786 Nucleus::createRet(Nucleus::createLoad(ret.address, Pointer<T>::getType()));
2787 Nucleus::setInsertBlock(Nucleus::createBasicBlock());
2791 void Return(RValue<Pointer<T>> ret)
2793 Nucleus::createRet(ret.value);
2794 Nucleus::setInsertBlock(Nucleus::createBasicBlock());
2797 template<typename Return, typename... Arguments>
2798 Function<Return(Arguments...)>::Function()
2800 core = new Nucleus();
2802 Type *types[] = {Arguments::getType()...};
2803 for(Type *type : types)
2805 if(type != Void::getType())
2807 arguments.push_back(type);
2811 Nucleus::createFunction(Return::getType(), arguments);
2814 template<typename Return, typename... Arguments>
2815 Function<Return(Arguments...)>::~Function()
2820 template<typename Return, typename... Arguments>
2821 Routine *Function<Return(Arguments...)>::operator()(const wchar_t *name, ...)
2823 wchar_t fullName[1024 + 1];
2826 va_start(vararg, name);
2827 vswprintf(fullName, 1024, name, vararg);
2830 return core->acquireRoutine(fullName, true);
2833 template<class T, class S>
2834 RValue<T> ReinterpretCast(RValue<S> val)
2836 return RValue<T>(Nucleus::createBitCast(val.value, T::getType()));
2839 template<class T, class S>
2840 RValue<T> ReinterpretCast(const LValue<S> &var)
2842 Value *val = var.loadValue();
2844 return RValue<T>(Nucleus::createBitCast(val, T::getType()));
2847 template<class T, class S>
2848 RValue<T> ReinterpretCast(const Reference<S> &var)
2850 return ReinterpretCast<T>(RValue<S>(var));
2853 template<class T, class S>
2854 RValue<T> As(RValue<S> val)
2856 return ReinterpretCast<T>(val);
2859 template<class T, class S>
2860 RValue<T> As(const LValue<S> &var)
2862 return ReinterpretCast<T>(var);
2865 template<class T, class S>
2866 RValue<T> As(const Reference<S> &val)
2868 return ReinterpretCast<T>(val);
2871 #define For(init, cond, inc) \
2873 for(BasicBlock *loopBB__ = beginLoop(), \
2874 *bodyBB__ = Nucleus::createBasicBlock(), \
2875 *endBB__ = Nucleus::createBasicBlock(), \
2876 *onceBB__ = endBB__; \
2877 onceBB__ && branch(cond, bodyBB__, endBB__); \
2878 inc, onceBB__ = 0, Nucleus::createBr(loopBB__), Nucleus::setInsertBlock(endBB__))
2880 #define While(cond) For(((void*)0), cond, ((void*)0))
2884 BasicBlock *body = Nucleus::createBasicBlock(); \
2885 Nucleus::createBr(body); \
2886 Nucleus::setInsertBlock(body);
2888 #define Until(cond) \
2889 BasicBlock *end = Nucleus::createBasicBlock(); \
2890 Nucleus::createCondBr((cond).value, end, body); \
2891 Nucleus::setInsertBlock(end); \
2895 for(BasicBlock *trueBB__ = Nucleus::createBasicBlock(), \
2896 *falseBB__ = Nucleus::createBasicBlock(), \
2897 *endBB__ = Nucleus::createBasicBlock(), \
2898 *onceBB__ = endBB__; \
2899 onceBB__ && branch(cond, trueBB__, falseBB__); \
2900 onceBB__ = 0, Nucleus::createBr(endBB__), Nucleus::setInsertBlock(falseBB__), Nucleus::createBr(endBB__), Nucleus::setInsertBlock(endBB__))
2903 for(BasicBlock *endBB__ = Nucleus::getInsertBlock(), \
2904 *falseBB__ = Nucleus::getPredecessor(endBB__), \
2905 *onceBB__ = endBB__; \
2906 onceBB__ && elseBlock(falseBB__); \
2907 onceBB__ = 0, Nucleus::createBr(endBB__), Nucleus::setInsertBlock(endBB__))
2910 #endif // sw_Reactor_hpp