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"
58 static Type *getType();
76 LValue(int arraySize = 0);
83 Value *loadValue(unsigned int alignment = 0) const;
84 Value *storeValue(Value *value, 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>
431 explicit Byte4(RValue<Byte8> cast);
434 // Byte4(int x, int y, int z, int w);
435 // Byte4(RValue<Byte4> rhs);
436 // Byte4(const Byte4 &rhs);
437 Byte4(const Reference<Byte4> &rhs);
439 // RValue<Byte4> operator=(RValue<Byte4> rhs) const;
440 // RValue<Byte4> operator=(const Byte4 &rhs) const;
441 // RValue<Byte4> operator=(const Reference<Byte4> &rhs) const;
443 static Type *getType();
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<<(RValue<Byte4> lhs, RValue<Byte4> rhs);
455 // RValue<Byte4> operator>>(RValue<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<<=(const Byte4 &lhs, RValue<Byte4> rhs);
465 // RValue<Byte4> operator>>=(const Byte4 &lhs, RValue<Byte4> rhs);
466 // RValue<Byte4> operator+(RValue<Byte4> val);
467 // RValue<Byte4> operator-(RValue<Byte4> val);
468 // RValue<Byte4> operator~(RValue<Byte4> val);
469 // RValue<Byte4> operator++(const Byte4 &val, int); // Post-increment
470 // const Byte4 &operator++(const Byte4 &val); // Pre-increment
471 // RValue<Byte4> operator--(const Byte4 &val, int); // Post-decrement
472 // const Byte4 &operator--(const Byte4 &val); // Pre-decrement
474 class SByte4 : public Variable<SByte4>
478 // SByte4(int x, int y, int z, int w);
479 // SByte4(RValue<SByte4> rhs);
480 // SByte4(const SByte4 &rhs);
481 // SByte4(const Reference<SByte4> &rhs);
483 // RValue<SByte4> operator=(RValue<SByte4> rhs) const;
484 // RValue<SByte4> operator=(const SByte4 &rhs) const;
485 // RValue<SByte4> operator=(const Reference<SByte4> &rhs) const;
487 static Type *getType();
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<<(RValue<SByte4> lhs, RValue<SByte4> rhs);
499 // RValue<SByte4> operator>>(RValue<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<<=(const SByte4 &lhs, RValue<SByte4> rhs);
509 // RValue<SByte4> operator>>=(const SByte4 &lhs, RValue<SByte4> rhs);
510 // RValue<SByte4> operator+(RValue<SByte4> val);
511 // RValue<SByte4> operator-(RValue<SByte4> val);
512 // RValue<SByte4> operator~(RValue<SByte4> val);
513 // RValue<SByte4> operator++(const SByte4 &val, int); // Post-increment
514 // const SByte4 &operator++(const SByte4 &val); // Pre-increment
515 // RValue<SByte4> operator--(const SByte4 &val, int); // Post-decrement
516 // const SByte4 &operator--(const SByte4 &val); // Pre-decrement
518 class Byte8 : public Variable<Byte8>
522 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);
523 Byte8(RValue<Byte8> rhs);
524 Byte8(const Byte8 &rhs);
525 Byte8(const Reference<Byte8> &rhs);
527 RValue<Byte8> operator=(RValue<Byte8> rhs) const;
528 RValue<Byte8> operator=(const Byte8 &rhs) const;
529 RValue<Byte8> operator=(const Reference<Byte8> &rhs) const;
531 static Type *getType();
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>>(RValue<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>>=(const Byte8 &lhs, RValue<Byte8> rhs);
554 // RValue<Byte8> operator+(RValue<Byte8> val);
555 // RValue<Byte8> operator-(RValue<Byte8> val);
556 RValue<Byte8> operator~(RValue<Byte8> val);
557 // RValue<Byte8> operator++(const Byte8 &val, int); // Post-increment
558 // const Byte8 &operator++(const Byte8 &val); // Pre-increment
559 // RValue<Byte8> operator--(const Byte8 &val, int); // Post-decrement
560 // const Byte8 &operator--(const Byte8 &val); // Pre-decrement
562 RValue<Byte8> AddSat(RValue<Byte8> x, RValue<Byte8> y);
563 RValue<Byte8> SubSat(RValue<Byte8> x, RValue<Byte8> y);
564 RValue<Short4> Unpack(RValue<Byte4> x);
565 RValue<Short4> UnpackLow(RValue<Byte8> x, RValue<Byte8> y);
566 RValue<Short4> UnpackHigh(RValue<Byte8> x, RValue<Byte8> y);
567 RValue<Int> SignMask(RValue<Byte8> x);
568 // RValue<Byte8> CmpGT(RValue<Byte8> x, RValue<Byte8> y);
569 RValue<Byte8> CmpEQ(RValue<Byte8> x, RValue<Byte8> y);
571 class SByte8 : public Variable<SByte8>
575 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 Short2 : public Variable<Short2>
714 explicit Short2(RValue<Short4> cast);
716 static Type *getType();
719 class UShort2 : public Variable<UShort2>
722 explicit UShort2(RValue<UShort4> cast);
724 static Type *getType();
727 class Short4 : public Variable<Short4>
730 explicit Short4(RValue<Int> cast);
731 explicit Short4(RValue<Int4> cast);
732 // explicit Short4(RValue<Float> cast);
733 explicit Short4(RValue<Float4> cast);
737 Short4(short x, short y, short z, short w);
738 Short4(RValue<Short4> rhs);
739 Short4(const Short4 &rhs);
740 Short4(const Reference<Short4> &rhs);
741 Short4(RValue<UShort4> rhs);
742 Short4(const UShort4 &rhs);
743 Short4(const Reference<UShort4> &rhs);
745 RValue<Short4> operator=(RValue<Short4> rhs) const;
746 RValue<Short4> operator=(const Short4 &rhs) const;
747 RValue<Short4> operator=(const Reference<Short4> &rhs) const;
748 RValue<Short4> operator=(RValue<UShort4> rhs) const;
749 RValue<Short4> operator=(const UShort4 &rhs) const;
750 RValue<Short4> operator=(const Reference<UShort4> &rhs) const;
752 static Type *getType();
755 RValue<Short4> operator+(RValue<Short4> lhs, RValue<Short4> rhs);
756 RValue<Short4> operator-(RValue<Short4> lhs, RValue<Short4> rhs);
757 RValue<Short4> operator*(RValue<Short4> lhs, RValue<Short4> rhs);
758 // RValue<Short4> operator/(RValue<Short4> lhs, RValue<Short4> rhs);
759 // RValue<Short4> operator%(RValue<Short4> lhs, RValue<Short4> rhs);
760 RValue<Short4> operator&(RValue<Short4> lhs, RValue<Short4> rhs);
761 RValue<Short4> operator|(RValue<Short4> lhs, RValue<Short4> rhs);
762 RValue<Short4> operator^(RValue<Short4> lhs, RValue<Short4> rhs);
763 RValue<Short4> operator<<(RValue<Short4> lhs, unsigned char rhs);
764 RValue<Short4> operator>>(RValue<Short4> lhs, unsigned char rhs);
765 RValue<Short4> operator<<(RValue<Short4> lhs, RValue<Long1> rhs);
766 RValue<Short4> operator>>(RValue<Short4> lhs, RValue<Long1> rhs);
767 RValue<Short4> operator+=(const Short4 &lhs, RValue<Short4> rhs);
768 RValue<Short4> operator-=(const Short4 &lhs, RValue<Short4> rhs);
769 RValue<Short4> operator*=(const Short4 &lhs, RValue<Short4> rhs);
770 // RValue<Short4> operator/=(const Short4 &lhs, RValue<Short4> rhs);
771 // RValue<Short4> operator%=(const Short4 &lhs, RValue<Short4> rhs);
772 RValue<Short4> operator&=(const Short4 &lhs, RValue<Short4> rhs);
773 RValue<Short4> operator|=(const Short4 &lhs, RValue<Short4> rhs);
774 RValue<Short4> operator^=(const Short4 &lhs, RValue<Short4> rhs);
775 RValue<Short4> operator<<=(const Short4 &lhs, unsigned char rhs);
776 RValue<Short4> operator>>=(const Short4 &lhs, unsigned char rhs);
777 RValue<Short4> operator<<=(const Short4 &lhs, RValue<Long1> rhs);
778 RValue<Short4> operator>>=(const Short4 &lhs, RValue<Long1> rhs);
779 // RValue<Short4> operator+(RValue<Short4> val);
780 RValue<Short4> operator-(RValue<Short4> val);
781 RValue<Short4> operator~(RValue<Short4> val);
782 // RValue<Short4> operator++(const Short4 &val, int); // Post-increment
783 // const Short4 &operator++(const Short4 &val); // Pre-increment
784 // RValue<Short4> operator--(const Short4 &val, int); // Post-decrement
785 // const Short4 &operator--(const Short4 &val); // Pre-decrement
786 // RValue<Bool> operator<(RValue<Short4> lhs, RValue<Short4> rhs);
787 // RValue<Bool> operator<=(RValue<Short4> lhs, RValue<Short4> rhs);
788 // RValue<Bool> operator>(RValue<Short4> lhs, RValue<Short4> rhs);
789 // RValue<Bool> operator>=(RValue<Short4> lhs, RValue<Short4> rhs);
790 // RValue<Bool> operator!=(RValue<Short4> lhs, RValue<Short4> rhs);
791 // RValue<Bool> operator==(RValue<Short4> lhs, RValue<Short4> rhs);
793 RValue<Short4> RoundShort4(RValue<Float4> cast);
794 RValue<Short4> Max(RValue<Short4> x, RValue<Short4> y);
795 RValue<Short4> Min(RValue<Short4> x, RValue<Short4> y);
796 RValue<Short4> AddSat(RValue<Short4> x, RValue<Short4> y);
797 RValue<Short4> SubSat(RValue<Short4> x, RValue<Short4> y);
798 RValue<Short4> MulHigh(RValue<Short4> x, RValue<Short4> y);
799 RValue<Int2> MulAdd(RValue<Short4> x, RValue<Short4> y);
800 RValue<SByte8> Pack(RValue<Short4> x, RValue<Short4> y);
801 RValue<Int2> UnpackLow(RValue<Short4> x, RValue<Short4> y);
802 RValue<Int2> UnpackHigh(RValue<Short4> x, RValue<Short4> y);
803 RValue<Short4> Swizzle(RValue<Short4> x, unsigned char select);
804 RValue<Short4> Insert(RValue<Short4> val, RValue<Short> element, int i);
805 RValue<Short> Extract(RValue<Short4> val, int i);
806 RValue<Short4> CmpGT(RValue<Short4> x, RValue<Short4> y);
807 RValue<Short4> CmpEQ(RValue<Short4> x, RValue<Short4> y);
809 class UShort4 : public Variable<UShort4>
812 explicit UShort4(RValue<Int4> cast);
813 explicit UShort4(RValue<Float4> cast, bool saturate = false);
816 UShort4(unsigned short xyzw);
817 UShort4(unsigned short x, unsigned short y, unsigned short z, unsigned short w);
818 UShort4(RValue<UShort4> rhs);
819 UShort4(const UShort4 &rhs);
820 UShort4(const Reference<UShort4> &rhs);
821 UShort4(RValue<Short4> rhs);
822 UShort4(const Short4 &rhs);
823 UShort4(const Reference<Short4> &rhs);
825 RValue<UShort4> operator=(RValue<UShort4> rhs) const;
826 RValue<UShort4> operator=(const UShort4 &rhs) const;
827 RValue<UShort4> operator=(const Reference<UShort4> &rhs) const;
828 RValue<UShort4> operator=(RValue<Short4> rhs) const;
829 RValue<UShort4> operator=(const Short4 &rhs) const;
830 RValue<UShort4> operator=(const Reference<Short4> &rhs) const;
832 static Type *getType();
835 RValue<UShort4> operator+(RValue<UShort4> lhs, RValue<UShort4> rhs);
836 RValue<UShort4> operator-(RValue<UShort4> lhs, RValue<UShort4> rhs);
837 RValue<UShort4> operator*(RValue<UShort4> lhs, RValue<UShort4> rhs);
838 // RValue<UShort4> operator/(RValue<UShort4> lhs, RValue<UShort4> rhs);
839 // RValue<UShort4> operator%(RValue<UShort4> lhs, RValue<UShort4> rhs);
840 RValue<UShort4> operator&(RValue<UShort4> lhs, RValue<UShort4> rhs);
841 RValue<UShort4> operator|(RValue<UShort4> lhs, RValue<UShort4> rhs);
842 RValue<UShort4> operator^(RValue<UShort4> lhs, RValue<UShort4> rhs);
843 RValue<UShort4> operator<<(RValue<UShort4> lhs, unsigned char rhs);
844 RValue<UShort4> operator>>(RValue<UShort4> lhs, unsigned char rhs);
845 RValue<UShort4> operator<<(RValue<UShort4> lhs, RValue<Long1> rhs);
846 RValue<UShort4> operator>>(RValue<UShort4> lhs, RValue<Long1> rhs);
847 // RValue<UShort4> operator+=(const UShort4 &lhs, RValue<UShort4> rhs);
848 // RValue<UShort4> operator-=(const UShort4 &lhs, RValue<UShort4> rhs);
849 // RValue<UShort4> operator*=(const UShort4 &lhs, RValue<UShort4> rhs);
850 // RValue<UShort4> operator/=(const UShort4 &lhs, RValue<UShort4> rhs);
851 // RValue<UShort4> operator%=(const UShort4 &lhs, RValue<UShort4> rhs);
852 // RValue<UShort4> operator&=(const UShort4 &lhs, RValue<UShort4> rhs);
853 // RValue<UShort4> operator|=(const UShort4 &lhs, RValue<UShort4> rhs);
854 // RValue<UShort4> operator^=(const UShort4 &lhs, RValue<UShort4> rhs);
855 RValue<UShort4> operator<<=(const UShort4 &lhs, unsigned char rhs);
856 RValue<UShort4> operator>>=(const UShort4 &lhs, unsigned char rhs);
857 RValue<UShort4> operator<<=(const UShort4 &lhs, RValue<Long1> rhs);
858 RValue<UShort4> operator>>=(const UShort4 &lhs, RValue<Long1> rhs);
859 // RValue<UShort4> operator+(RValue<UShort4> val);
860 // RValue<UShort4> operator-(RValue<UShort4> val);
861 RValue<UShort4> operator~(RValue<UShort4> val);
862 // RValue<UShort4> operator++(const UShort4 &val, int); // Post-increment
863 // const UShort4 &operator++(const UShort4 &val); // Pre-increment
864 // RValue<UShort4> operator--(const UShort4 &val, int); // Post-decrement
865 // const UShort4 &operator--(const UShort4 &val); // Pre-decrement
867 RValue<UShort4> Max(RValue<UShort4> x, RValue<UShort4> y);
868 RValue<UShort4> Min(RValue<UShort4> x, RValue<UShort4> y);
869 RValue<UShort4> AddSat(RValue<UShort4> x, RValue<UShort4> y);
870 RValue<UShort4> SubSat(RValue<UShort4> x, RValue<UShort4> y);
871 RValue<UShort4> MulHigh(RValue<UShort4> x, RValue<UShort4> y);
872 RValue<UShort4> Average(RValue<UShort4> x, RValue<UShort4> y);
873 RValue<Byte8> Pack(RValue<UShort4> x, RValue<UShort4> y);
875 class Short8 : public Variable<Short8>
879 Short8(short c0, short c1, short c2, short c3, short c4, short c5, short c6, short c7);
880 Short8(RValue<Short8> rhs);
881 // Short8(const Short8 &rhs);
882 Short8(const Reference<Short8> &rhs);
883 Short8(RValue<Short4> lo, RValue<Short4> hi);
885 // RValue<Short8> operator=(RValue<Short8> rhs) const;
886 // RValue<Short8> operator=(const Short8 &rhs) const;
887 // RValue<Short8> operator=(const Reference<Short8> &rhs) const;
889 static Type *getType();
892 RValue<Short8> operator+(RValue<Short8> lhs, RValue<Short8> rhs);
893 // RValue<Short8> operator-(RValue<Short8> lhs, RValue<Short8> rhs);
894 // RValue<Short8> operator*(RValue<Short8> lhs, RValue<Short8> rhs);
895 // RValue<Short8> operator/(RValue<Short8> lhs, RValue<Short8> rhs);
896 // RValue<Short8> operator%(RValue<Short8> lhs, RValue<Short8> rhs);
897 RValue<Short8> operator&(RValue<Short8> lhs, RValue<Short8> rhs);
898 // RValue<Short8> operator|(RValue<Short8> lhs, RValue<Short8> rhs);
899 // RValue<Short8> operator^(RValue<Short8> lhs, RValue<Short8> rhs);
900 RValue<Short8> operator<<(RValue<Short8> lhs, unsigned char rhs);
901 RValue<Short8> operator>>(RValue<Short8> lhs, unsigned char rhs);
902 // RValue<Short8> operator<<(RValue<Short8> lhs, RValue<Short8> rhs);
903 // RValue<Short8> operator>>(RValue<Short8> lhs, RValue<Short8> rhs);
904 // RValue<Short8> operator+=(const Short8 &lhs, RValue<Short8> rhs);
905 // RValue<Short8> operator-=(const Short8 &lhs, RValue<Short8> rhs);
906 // RValue<Short8> operator*=(const Short8 &lhs, RValue<Short8> rhs);
907 // RValue<Short8> operator/=(const Short8 &lhs, RValue<Short8> rhs);
908 // RValue<Short8> operator%=(const Short8 &lhs, RValue<Short8> rhs);
909 // RValue<Short8> operator&=(const Short8 &lhs, RValue<Short8> rhs);
910 // RValue<Short8> operator|=(const Short8 &lhs, RValue<Short8> rhs);
911 // RValue<Short8> operator^=(const Short8 &lhs, RValue<Short8> rhs);
912 // RValue<Short8> operator<<=(const Short8 &lhs, RValue<Short8> rhs);
913 // RValue<Short8> operator>>=(const Short8 &lhs, RValue<Short8> rhs);
914 // RValue<Short8> operator+(RValue<Short8> val);
915 // RValue<Short8> operator-(RValue<Short8> val);
916 // RValue<Short8> operator~(RValue<Short8> val);
917 // RValue<Short8> operator++(const Short8 &val, int); // Post-increment
918 // const Short8 &operator++(const Short8 &val); // Pre-increment
919 // RValue<Short8> operator--(const Short8 &val, int); // Post-decrement
920 // const Short8 &operator--(const Short8 &val); // Pre-decrement
921 // RValue<Bool> operator<(RValue<Short8> lhs, RValue<Short8> rhs);
922 // RValue<Bool> operator<=(RValue<Short8> lhs, RValue<Short8> rhs);
923 // RValue<Bool> operator>(RValue<Short8> lhs, RValue<Short8> rhs);
924 // RValue<Bool> operator>=(RValue<Short8> lhs, RValue<Short8> rhs);
925 // RValue<Bool> operator!=(RValue<Short8> lhs, RValue<Short8> rhs);
926 // RValue<Bool> operator==(RValue<Short8> lhs, RValue<Short8> rhs);
928 RValue<Short8> MulHigh(RValue<Short8> x, RValue<Short8> y);
929 RValue<Int4> MulAdd(RValue<Short8> x, RValue<Short8> y);
930 RValue<Int4> Abs(RValue<Int4> x);
932 class UShort8 : public Variable<UShort8>
936 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);
937 UShort8(RValue<UShort8> rhs);
938 // UShort8(const UShort8 &rhs);
939 UShort8(const Reference<UShort8> &rhs);
940 UShort8(RValue<UShort4> lo, RValue<UShort4> hi);
942 RValue<UShort8> operator=(RValue<UShort8> rhs) const;
943 RValue<UShort8> operator=(const UShort8 &rhs) const;
944 RValue<UShort8> operator=(const Reference<UShort8> &rhs) const;
946 static Type *getType();
949 RValue<UShort8> operator+(RValue<UShort8> lhs, RValue<UShort8> rhs);
950 // RValue<UShort8> operator-(RValue<UShort8> lhs, RValue<UShort8> rhs);
951 RValue<UShort8> operator*(RValue<UShort8> lhs, RValue<UShort8> rhs);
952 // RValue<UShort8> operator/(RValue<UShort8> lhs, RValue<UShort8> rhs);
953 // RValue<UShort8> operator%(RValue<UShort8> lhs, RValue<UShort8> rhs);
954 RValue<UShort8> operator&(RValue<UShort8> lhs, RValue<UShort8> rhs);
955 // RValue<UShort8> operator|(RValue<UShort8> lhs, RValue<UShort8> rhs);
956 // RValue<UShort8> operator^(RValue<UShort8> lhs, RValue<UShort8> rhs);
957 RValue<UShort8> operator<<(RValue<UShort8> lhs, unsigned char rhs);
958 RValue<UShort8> operator>>(RValue<UShort8> lhs, unsigned char rhs);
959 // RValue<UShort8> operator<<(RValue<UShort8> lhs, RValue<UShort8> rhs);
960 // RValue<UShort8> operator>>(RValue<UShort8> lhs, RValue<UShort8> rhs);
961 RValue<UShort8> operator+=(const UShort8 &lhs, RValue<UShort8> rhs);
962 // RValue<UShort8> operator-=(const UShort8 &lhs, RValue<UShort8> rhs);
963 // RValue<UShort8> operator*=(const UShort8 &lhs, RValue<UShort8> rhs);
964 // RValue<UShort8> operator/=(const UShort8 &lhs, RValue<UShort8> rhs);
965 // RValue<UShort8> operator%=(const UShort8 &lhs, RValue<UShort8> rhs);
966 // RValue<UShort8> operator&=(const UShort8 &lhs, RValue<UShort8> rhs);
967 // RValue<UShort8> operator|=(const UShort8 &lhs, RValue<UShort8> rhs);
968 // RValue<UShort8> operator^=(const UShort8 &lhs, RValue<UShort8> rhs);
969 // RValue<UShort8> operator<<=(const UShort8 &lhs, RValue<UShort8> rhs);
970 // RValue<UShort8> operator>>=(const UShort8 &lhs, RValue<UShort8> rhs);
971 // RValue<UShort8> operator+(RValue<UShort8> val);
972 // RValue<UShort8> operator-(RValue<UShort8> val);
973 RValue<UShort8> operator~(RValue<UShort8> val);
974 // RValue<UShort8> operator++(const UShort8 &val, int); // Post-increment
975 // const UShort8 &operator++(const UShort8 &val); // Pre-increment
976 // RValue<UShort8> operator--(const UShort8 &val, int); // Post-decrement
977 // const UShort8 &operator--(const UShort8 &val); // Pre-decrement
978 // RValue<Bool> operator<(RValue<UShort8> lhs, RValue<UShort8> rhs);
979 // RValue<Bool> operator<=(RValue<UShort8> lhs, RValue<UShort8> rhs);
980 // RValue<Bool> operator>(RValue<UShort8> lhs, RValue<UShort8> rhs);
981 // RValue<Bool> operator>=(RValue<UShort8> lhs, RValue<UShort8> rhs);
982 // RValue<Bool> operator!=(RValue<UShort8> lhs, RValue<UShort8> rhs);
983 // RValue<Bool> operator==(RValue<UShort8> lhs, RValue<UShort8> rhs);
985 RValue<UShort8> Swizzle(RValue<UShort8> x, char select0, char select1, char select2, char select3, char select4, char select5, char select6, char select7);
986 RValue<UShort8> MulHigh(RValue<UShort8> x, RValue<UShort8> y);
988 class Int : public Variable<Int>
991 Int(Argument<Int> argument);
993 explicit Int(RValue<Byte> cast);
994 explicit Int(RValue<SByte> cast);
995 explicit Int(RValue<Short> cast);
996 explicit Int(RValue<UShort> cast);
997 explicit Int(RValue<Int2> cast);
998 explicit Int(RValue<Long> cast);
999 explicit Int(RValue<Float> cast);
1003 Int(RValue<Int> rhs);
1004 Int(RValue<UInt> rhs);
1005 Int(const Int &rhs);
1006 Int(const UInt &rhs);
1007 Int(const Reference<Int> &rhs);
1008 Int(const Reference<UInt> &rhs);
1010 RValue<Int> operator=(int rhs) const;
1011 RValue<Int> operator=(RValue<Int> rhs) const;
1012 RValue<Int> operator=(RValue<UInt> rhs) const;
1013 RValue<Int> operator=(const Int &rhs) const;
1014 RValue<Int> operator=(const UInt &rhs) const;
1015 RValue<Int> operator=(const Reference<Int> &rhs) const;
1016 RValue<Int> operator=(const Reference<UInt> &rhs) const;
1018 static Type *getType();
1021 RValue<Int> operator+(RValue<Int> lhs, RValue<Int> rhs);
1022 RValue<Int> operator-(RValue<Int> lhs, RValue<Int> rhs);
1023 RValue<Int> operator*(RValue<Int> lhs, RValue<Int> rhs);
1024 RValue<Int> operator/(RValue<Int> lhs, RValue<Int> rhs);
1025 RValue<Int> operator%(RValue<Int> lhs, RValue<Int> rhs);
1026 RValue<Int> operator&(RValue<Int> lhs, RValue<Int> rhs);
1027 RValue<Int> operator|(RValue<Int> lhs, RValue<Int> rhs);
1028 RValue<Int> operator^(RValue<Int> lhs, RValue<Int> rhs);
1029 RValue<Int> operator<<(RValue<Int> lhs, RValue<Int> rhs);
1030 RValue<Int> operator>>(RValue<Int> lhs, RValue<Int> rhs);
1031 RValue<Int> operator+=(const Int &lhs, RValue<Int> rhs);
1032 RValue<Int> operator-=(const Int &lhs, RValue<Int> rhs);
1033 RValue<Int> operator*=(const Int &lhs, RValue<Int> rhs);
1034 RValue<Int> operator/=(const Int &lhs, RValue<Int> rhs);
1035 RValue<Int> operator%=(const Int &lhs, RValue<Int> rhs);
1036 RValue<Int> operator&=(const Int &lhs, RValue<Int> rhs);
1037 RValue<Int> operator|=(const Int &lhs, RValue<Int> rhs);
1038 RValue<Int> operator^=(const Int &lhs, RValue<Int> rhs);
1039 RValue<Int> operator<<=(const Int &lhs, RValue<Int> rhs);
1040 RValue<Int> operator>>=(const Int &lhs, RValue<Int> rhs);
1041 RValue<Int> operator+(RValue<Int> val);
1042 RValue<Int> operator-(RValue<Int> val);
1043 RValue<Int> operator~(RValue<Int> val);
1044 RValue<Int> operator++(const Int &val, int); // Post-increment
1045 const Int &operator++(const Int &val); // Pre-increment
1046 RValue<Int> operator--(const Int &val, int); // Post-decrement
1047 const Int &operator--(const Int &val); // Pre-decrement
1048 RValue<Bool> operator<(RValue<Int> lhs, RValue<Int> rhs);
1049 RValue<Bool> operator<=(RValue<Int> lhs, RValue<Int> rhs);
1050 RValue<Bool> operator>(RValue<Int> lhs, RValue<Int> rhs);
1051 RValue<Bool> operator>=(RValue<Int> lhs, RValue<Int> rhs);
1052 RValue<Bool> operator!=(RValue<Int> lhs, RValue<Int> rhs);
1053 RValue<Bool> operator==(RValue<Int> lhs, RValue<Int> rhs);
1055 RValue<Int> Max(RValue<Int> x, RValue<Int> y);
1056 RValue<Int> Min(RValue<Int> x, RValue<Int> y);
1057 RValue<Int> Clamp(RValue<Int> x, RValue<Int> min, RValue<Int> max);
1058 RValue<Int> RoundInt(RValue<Float> cast);
1060 class Long : public Variable<Long>
1063 // Long(Argument<Long> argument);
1065 // explicit Long(RValue<Short> cast);
1066 // explicit Long(RValue<UShort> cast);
1067 explicit Long(RValue<Int> cast);
1068 explicit Long(RValue<UInt> cast);
1069 // explicit Long(RValue<Float> cast);
1073 Long(RValue<Long> rhs);
1074 // Long(RValue<ULong> rhs);
1075 // Long(const Long &rhs);
1076 // Long(const Reference<Long> &rhs);
1077 // Long(const ULong &rhs);
1078 // Long(const Reference<ULong> &rhs);
1080 RValue<Long> operator=(int64_t rhs) const;
1081 RValue<Long> operator=(RValue<Long> rhs) const;
1082 // RValue<Long> operator=(RValue<ULong> rhs) const;
1083 RValue<Long> operator=(const Long &rhs) const;
1084 RValue<Long> operator=(const Reference<Long> &rhs) const;
1085 // RValue<Long> operator=(const ULong &rhs) const;
1086 // RValue<Long> operator=(const Reference<ULong> &rhs) const;
1088 static Type *getType();
1091 RValue<Long> operator+(RValue<Long> lhs, RValue<Long> rhs);
1092 RValue<Long> operator-(RValue<Long> lhs, RValue<Long> rhs);
1093 // RValue<Long> operator*(RValue<Long> lhs, RValue<Long> rhs);
1094 // RValue<Long> operator/(RValue<Long> lhs, RValue<Long> rhs);
1095 // RValue<Long> operator%(RValue<Long> lhs, RValue<Long> rhs);
1096 // RValue<Long> operator&(RValue<Long> lhs, RValue<Long> rhs);
1097 // RValue<Long> operator|(RValue<Long> lhs, RValue<Long> rhs);
1098 // RValue<Long> operator^(RValue<Long> lhs, RValue<Long> rhs);
1099 // RValue<Long> operator<<(RValue<Long> lhs, RValue<Long> rhs);
1100 // RValue<Long> operator>>(RValue<Long> lhs, RValue<Long> rhs);
1101 RValue<Long> operator+=(const Long &lhs, RValue<Long> rhs);
1102 RValue<Long> operator-=(const Long &lhs, RValue<Long> rhs);
1103 // RValue<Long> operator*=(const Long &lhs, RValue<Long> rhs);
1104 // RValue<Long> operator/=(const Long &lhs, RValue<Long> rhs);
1105 // RValue<Long> operator%=(const Long &lhs, RValue<Long> rhs);
1106 // RValue<Long> operator&=(const Long &lhs, RValue<Long> rhs);
1107 // RValue<Long> operator|=(const Long &lhs, RValue<Long> rhs);
1108 // RValue<Long> operator^=(const Long &lhs, RValue<Long> rhs);
1109 // RValue<Long> operator<<=(const Long &lhs, RValue<Long> rhs);
1110 // RValue<Long> operator>>=(const Long &lhs, RValue<Long> rhs);
1111 // RValue<Long> operator+(RValue<Long> val);
1112 // RValue<Long> operator-(RValue<Long> val);
1113 // RValue<Long> operator~(RValue<Long> val);
1114 // RValue<Long> operator++(const Long &val, int); // Post-increment
1115 // const Long &operator++(const Long &val); // Pre-increment
1116 // RValue<Long> operator--(const Long &val, int); // Post-decrement
1117 // const Long &operator--(const Long &val); // Pre-decrement
1118 // RValue<Bool> operator<(RValue<Long> lhs, RValue<Long> rhs);
1119 // RValue<Bool> operator<=(RValue<Long> lhs, RValue<Long> rhs);
1120 // RValue<Bool> operator>(RValue<Long> lhs, RValue<Long> rhs);
1121 // RValue<Bool> operator>=(RValue<Long> lhs, RValue<Long> rhs);
1122 // RValue<Bool> operator!=(RValue<Long> lhs, RValue<Long> rhs);
1123 // RValue<Bool> operator==(RValue<Long> lhs, RValue<Long> rhs);
1125 // RValue<Long> RoundLong(RValue<Float> cast);
1126 RValue<Long> AddAtomic( RValue<Pointer<Long>> x, RValue<Long> y);
1128 class Long1 : public Variable<Long1>
1131 // Long1(Argument<Long1> argument);
1133 // explicit Long1(RValue<Short> cast);
1134 // explicit Long1(RValue<UShort> cast);
1135 // explicit Long1(RValue<Int> cast);
1136 explicit Long1(RValue<UInt> cast);
1137 // explicit Long1(RValue<Float> cast);
1141 Long1(RValue<Long1> rhs);
1142 // Long1(RValue<ULong1> rhs);
1143 // Long1(const Long1 &rhs);
1144 // Long1(const Reference<Long1> &rhs);
1145 // Long1(const ULong1 &rhs);
1146 // Long1(const Reference<ULong1> &rhs);
1148 // RValue<Long1> operator=(qword rhs) const;
1149 // RValue<Long1> operator=(RValue<Long1> rhs) const;
1150 // RValue<Long1> operator=(RValue<ULong1> rhs) const;
1151 // RValue<Long1> operator=(const Long1 &rhs) const;
1152 // RValue<Long1> operator=(const Reference<Long1> &rhs) const;
1153 // RValue<Long1> operator=(const ULong1 &rhs) const;
1154 // RValue<Long1> operator=(const Reference<ULong1> &rhs) const;
1156 static Type *getType();
1159 // RValue<Long1> operator+(RValue<Long1> lhs, RValue<Long1> rhs);
1160 // RValue<Long1> operator-(RValue<Long1> lhs, RValue<Long1> rhs);
1161 // RValue<Long1> operator*(RValue<Long1> lhs, RValue<Long1> rhs);
1162 // RValue<Long1> operator/(RValue<Long1> lhs, RValue<Long1> rhs);
1163 // RValue<Long1> operator%(RValue<Long1> lhs, RValue<Long1> rhs);
1164 // RValue<Long1> operator&(RValue<Long1> lhs, RValue<Long1> rhs);
1165 // RValue<Long1> operator|(RValue<Long1> lhs, RValue<Long1> rhs);
1166 // RValue<Long1> operator^(RValue<Long1> lhs, RValue<Long1> rhs);
1167 // RValue<Long1> operator<<(RValue<Long1> lhs, RValue<Long1> rhs);
1168 // RValue<Long1> operator>>(RValue<Long1> lhs, RValue<Long1> rhs);
1169 // RValue<Long1> operator+=(const Long1 &lhs, RValue<Long1> rhs);
1170 // RValue<Long1> operator-=(const Long1 &lhs, RValue<Long1> rhs);
1171 // RValue<Long1> operator*=(const Long1 &lhs, RValue<Long1> rhs);
1172 // RValue<Long1> operator/=(const Long1 &lhs, RValue<Long1> rhs);
1173 // RValue<Long1> operator%=(const Long1 &lhs, RValue<Long1> rhs);
1174 // RValue<Long1> operator&=(const Long1 &lhs, RValue<Long1> rhs);
1175 // RValue<Long1> operator|=(const Long1 &lhs, RValue<Long1> rhs);
1176 // RValue<Long1> operator^=(const Long1 &lhs, RValue<Long1> rhs);
1177 // RValue<Long1> operator<<=(const Long1 &lhs, RValue<Long1> rhs);
1178 // RValue<Long1> operator>>=(const Long1 &lhs, RValue<Long1> rhs);
1179 // RValue<Long1> operator+(RValue<Long1> val);
1180 // RValue<Long1> operator-(RValue<Long1> val);
1181 // RValue<Long1> operator~(RValue<Long1> val);
1182 // RValue<Long1> operator++(const Long1 &val, int); // Post-increment
1183 // const Long1 &operator++(const Long1 &val); // Pre-increment
1184 // RValue<Long1> operator--(const Long1 &val, int); // Post-decrement
1185 // const Long1 &operator--(const Long1 &val); // Pre-decrement
1186 // RValue<Bool> operator<(RValue<Long1> lhs, RValue<Long1> rhs);
1187 // RValue<Bool> operator<=(RValue<Long1> lhs, RValue<Long1> rhs);
1188 // RValue<Bool> operator>(RValue<Long1> lhs, RValue<Long1> rhs);
1189 // RValue<Bool> operator>=(RValue<Long1> lhs, RValue<Long1> rhs);
1190 // RValue<Bool> operator!=(RValue<Long1> lhs, RValue<Long1> rhs);
1191 // RValue<Bool> operator==(RValue<Long1> lhs, RValue<Long1> rhs);
1193 // RValue<Long1> RoundLong1(RValue<Float> cast);
1195 class UInt : public Variable<UInt>
1198 UInt(Argument<UInt> argument);
1200 explicit UInt(RValue<UShort> cast);
1201 explicit UInt(RValue<Long> cast);
1202 explicit UInt(RValue<Float> cast);
1206 UInt(unsigned int x);
1207 UInt(RValue<UInt> rhs);
1208 UInt(RValue<Int> rhs);
1209 UInt(const UInt &rhs);
1210 UInt(const Int &rhs);
1211 UInt(const Reference<UInt> &rhs);
1212 UInt(const Reference<Int> &rhs);
1214 RValue<UInt> operator=(unsigned int rhs) const;
1215 RValue<UInt> operator=(RValue<UInt> rhs) const;
1216 RValue<UInt> operator=(RValue<Int> rhs) const;
1217 RValue<UInt> operator=(const UInt &rhs) const;
1218 RValue<UInt> operator=(const Int &rhs) const;
1219 RValue<UInt> operator=(const Reference<UInt> &rhs) const;
1220 RValue<UInt> operator=(const Reference<Int> &rhs) const;
1222 static Type *getType();
1225 RValue<UInt> operator+(RValue<UInt> lhs, RValue<UInt> rhs);
1226 RValue<UInt> operator-(RValue<UInt> lhs, RValue<UInt> rhs);
1227 RValue<UInt> operator*(RValue<UInt> lhs, RValue<UInt> rhs);
1228 RValue<UInt> operator/(RValue<UInt> lhs, RValue<UInt> rhs);
1229 RValue<UInt> operator%(RValue<UInt> lhs, RValue<UInt> rhs);
1230 RValue<UInt> operator&(RValue<UInt> lhs, RValue<UInt> rhs);
1231 RValue<UInt> operator|(RValue<UInt> lhs, RValue<UInt> rhs);
1232 RValue<UInt> operator^(RValue<UInt> lhs, RValue<UInt> rhs);
1233 RValue<UInt> operator<<(RValue<UInt> lhs, RValue<UInt> rhs);
1234 RValue<UInt> operator>>(RValue<UInt> lhs, RValue<UInt> rhs);
1235 RValue<UInt> operator+=(const UInt &lhs, RValue<UInt> rhs);
1236 RValue<UInt> operator-=(const UInt &lhs, RValue<UInt> rhs);
1237 RValue<UInt> operator*=(const UInt &lhs, RValue<UInt> rhs);
1238 RValue<UInt> operator/=(const UInt &lhs, RValue<UInt> rhs);
1239 RValue<UInt> operator%=(const UInt &lhs, RValue<UInt> rhs);
1240 RValue<UInt> operator&=(const UInt &lhs, RValue<UInt> rhs);
1241 RValue<UInt> operator|=(const UInt &lhs, RValue<UInt> rhs);
1242 RValue<UInt> operator^=(const UInt &lhs, RValue<UInt> rhs);
1243 RValue<UInt> operator<<=(const UInt &lhs, RValue<UInt> rhs);
1244 RValue<UInt> operator>>=(const UInt &lhs, RValue<UInt> rhs);
1245 RValue<UInt> operator+(RValue<UInt> val);
1246 RValue<UInt> operator-(RValue<UInt> val);
1247 RValue<UInt> operator~(RValue<UInt> val);
1248 RValue<UInt> operator++(const UInt &val, int); // Post-increment
1249 const UInt &operator++(const UInt &val); // Pre-increment
1250 RValue<UInt> operator--(const UInt &val, int); // Post-decrement
1251 const UInt &operator--(const UInt &val); // Pre-decrement
1252 RValue<Bool> operator<(RValue<UInt> lhs, RValue<UInt> rhs);
1253 RValue<Bool> operator<=(RValue<UInt> lhs, RValue<UInt> rhs);
1254 RValue<Bool> operator>(RValue<UInt> lhs, RValue<UInt> rhs);
1255 RValue<Bool> operator>=(RValue<UInt> lhs, RValue<UInt> rhs);
1256 RValue<Bool> operator!=(RValue<UInt> lhs, RValue<UInt> rhs);
1257 RValue<Bool> operator==(RValue<UInt> lhs, RValue<UInt> rhs);
1259 RValue<UInt> Max(RValue<UInt> x, RValue<UInt> y);
1260 RValue<UInt> Min(RValue<UInt> x, RValue<UInt> y);
1261 RValue<UInt> Clamp(RValue<UInt> x, RValue<UInt> min, RValue<UInt> max);
1262 // RValue<UInt> RoundUInt(RValue<Float> cast);
1264 class Int2 : public Variable<Int2>
1267 // explicit Int2(RValue<Int> cast);
1268 explicit Int2(RValue<Int4> cast);
1272 Int2(RValue<Int2> rhs);
1273 Int2(const Int2 &rhs);
1274 Int2(const Reference<Int2> &rhs);
1275 Int2(RValue<Int> lo, RValue<Int> hi);
1277 RValue<Int2> operator=(RValue<Int2> rhs) const;
1278 RValue<Int2> operator=(const Int2 &rhs) const;
1279 RValue<Int2> operator=(const Reference<Int2> &rhs) const;
1281 static Type *getType();
1284 RValue<Int2> operator+(RValue<Int2> lhs, RValue<Int2> rhs);
1285 RValue<Int2> operator-(RValue<Int2> lhs, RValue<Int2> rhs);
1286 // RValue<Int2> operator*(RValue<Int2> lhs, RValue<Int2> rhs);
1287 // RValue<Int2> operator/(RValue<Int2> lhs, RValue<Int2> rhs);
1288 // RValue<Int2> operator%(RValue<Int2> lhs, RValue<Int2> rhs);
1289 RValue<Int2> operator&(RValue<Int2> lhs, RValue<Int2> rhs);
1290 RValue<Int2> operator|(RValue<Int2> lhs, RValue<Int2> rhs);
1291 RValue<Int2> operator^(RValue<Int2> lhs, RValue<Int2> rhs);
1292 RValue<Int2> operator<<(RValue<Int2> lhs, unsigned char rhs);
1293 RValue<Int2> operator>>(RValue<Int2> lhs, unsigned char rhs);
1294 RValue<Int2> operator<<(RValue<Int2> lhs, RValue<Long1> rhs);
1295 RValue<Int2> operator>>(RValue<Int2> lhs, RValue<Long1> rhs);
1296 RValue<Int2> operator+=(const Int2 &lhs, RValue<Int2> rhs);
1297 RValue<Int2> operator-=(const Int2 &lhs, RValue<Int2> rhs);
1298 // RValue<Int2> operator*=(const Int2 &lhs, RValue<Int2> rhs);
1299 // RValue<Int2> operator/=(const Int2 &lhs, RValue<Int2> rhs);
1300 // RValue<Int2> operator%=(const Int2 &lhs, RValue<Int2> rhs);
1301 RValue<Int2> operator&=(const Int2 &lhs, RValue<Int2> rhs);
1302 RValue<Int2> operator|=(const Int2 &lhs, RValue<Int2> rhs);
1303 RValue<Int2> operator^=(const Int2 &lhs, RValue<Int2> rhs);
1304 RValue<Int2> operator<<=(const Int2 &lhs, unsigned char rhs);
1305 RValue<Int2> operator>>=(const Int2 &lhs, unsigned char rhs);
1306 RValue<Int2> operator<<=(const Int2 &lhs, RValue<Long1> rhs);
1307 RValue<Int2> operator>>=(const Int2 &lhs, RValue<Long1> rhs);
1308 // RValue<Int2> operator+(RValue<Int2> val);
1309 // RValue<Int2> operator-(RValue<Int2> val);
1310 RValue<Int2> operator~(RValue<Int2> val);
1311 // RValue<Int2> operator++(const Int2 &val, int); // Post-increment
1312 // const Int2 &operator++(const Int2 &val); // Pre-increment
1313 // RValue<Int2> operator--(const Int2 &val, int); // Post-decrement
1314 // const Int2 &operator--(const Int2 &val); // Pre-decrement
1315 // RValue<Bool> operator<(RValue<Int2> lhs, RValue<Int2> rhs);
1316 // RValue<Bool> operator<=(RValue<Int2> lhs, RValue<Int2> rhs);
1317 // RValue<Bool> operator>(RValue<Int2> lhs, RValue<Int2> rhs);
1318 // RValue<Bool> operator>=(RValue<Int2> lhs, RValue<Int2> rhs);
1319 // RValue<Bool> operator!=(RValue<Int2> lhs, RValue<Int2> rhs);
1320 // RValue<Bool> operator==(RValue<Int2> lhs, RValue<Int2> rhs);
1322 // RValue<Int2> RoundInt(RValue<Float4> cast);
1323 RValue<Long1> UnpackLow(RValue<Int2> x, RValue<Int2> y);
1324 RValue<Long1> UnpackHigh(RValue<Int2> x, RValue<Int2> y);
1325 RValue<Int> Extract(RValue<Int2> val, int i);
1326 RValue<Int2> Insert(RValue<Int2> val, RValue<Int> element, int i);
1328 class UInt2 : public Variable<UInt2>
1332 UInt2(unsigned int x, unsigned int y);
1333 UInt2(RValue<UInt2> rhs);
1334 UInt2(const UInt2 &rhs);
1335 UInt2(const Reference<UInt2> &rhs);
1337 RValue<UInt2> operator=(RValue<UInt2> rhs) const;
1338 RValue<UInt2> operator=(const UInt2 &rhs) const;
1339 RValue<UInt2> operator=(const Reference<UInt2> &rhs) const;
1341 static Type *getType();
1344 RValue<UInt2> operator+(RValue<UInt2> lhs, RValue<UInt2> rhs);
1345 RValue<UInt2> operator-(RValue<UInt2> lhs, RValue<UInt2> rhs);
1346 // RValue<UInt2> operator*(RValue<UInt2> lhs, RValue<UInt2> rhs);
1347 // RValue<UInt2> operator/(RValue<UInt2> lhs, RValue<UInt2> rhs);
1348 // RValue<UInt2> operator%(RValue<UInt2> lhs, RValue<UInt2> rhs);
1349 RValue<UInt2> operator&(RValue<UInt2> lhs, RValue<UInt2> rhs);
1350 RValue<UInt2> operator|(RValue<UInt2> lhs, RValue<UInt2> rhs);
1351 RValue<UInt2> operator^(RValue<UInt2> lhs, RValue<UInt2> rhs);
1352 RValue<UInt2> operator<<(RValue<UInt2> lhs, unsigned char rhs);
1353 RValue<UInt2> operator>>(RValue<UInt2> lhs, unsigned char rhs);
1354 RValue<UInt2> operator<<(RValue<UInt2> lhs, RValue<Long1> rhs);
1355 RValue<UInt2> operator>>(RValue<UInt2> lhs, RValue<Long1> rhs);
1356 RValue<UInt2> operator+=(const UInt2 &lhs, RValue<UInt2> rhs);
1357 RValue<UInt2> operator-=(const UInt2 &lhs, RValue<UInt2> rhs);
1358 // RValue<UInt2> operator*=(const UInt2 &lhs, RValue<UInt2> rhs);
1359 // RValue<UInt2> operator/=(const UInt2 &lhs, RValue<UInt2> rhs);
1360 // RValue<UInt2> operator%=(const UInt2 &lhs, RValue<UInt2> rhs);
1361 RValue<UInt2> operator&=(const UInt2 &lhs, RValue<UInt2> rhs);
1362 RValue<UInt2> operator|=(const UInt2 &lhs, RValue<UInt2> rhs);
1363 RValue<UInt2> operator^=(const UInt2 &lhs, RValue<UInt2> rhs);
1364 RValue<UInt2> operator<<=(const UInt2 &lhs, unsigned char rhs);
1365 RValue<UInt2> operator>>=(const UInt2 &lhs, unsigned char rhs);
1366 RValue<UInt2> operator<<=(const UInt2 &lhs, RValue<Long1> rhs);
1367 RValue<UInt2> operator>>=(const UInt2 &lhs, RValue<Long1> rhs);
1368 // RValue<UInt2> operator+(RValue<UInt2> val);
1369 // RValue<UInt2> operator-(RValue<UInt2> val);
1370 RValue<UInt2> operator~(RValue<UInt2> val);
1371 // RValue<UInt2> operator++(const UInt2 &val, int); // Post-increment
1372 // const UInt2 &operator++(const UInt2 &val); // Pre-increment
1373 // RValue<UInt2> operator--(const UInt2 &val, int); // Post-decrement
1374 // const UInt2 &operator--(const UInt2 &val); // Pre-decrement
1375 // RValue<Bool> operator<(RValue<UInt2> lhs, RValue<UInt2> rhs);
1376 // RValue<Bool> operator<=(RValue<UInt2> lhs, RValue<UInt2> rhs);
1377 // RValue<Bool> operator>(RValue<UInt2> lhs, RValue<UInt2> rhs);
1378 // RValue<Bool> operator>=(RValue<UInt2> lhs, RValue<UInt2> rhs);
1379 // RValue<Bool> operator!=(RValue<UInt2> lhs, RValue<UInt2> rhs);
1380 // RValue<Bool> operator==(RValue<UInt2> lhs, RValue<UInt2> rhs);
1382 // RValue<UInt2> RoundInt(RValue<Float4> cast);
1384 class Int4 : public Variable<Int4>
1387 explicit Int4(RValue<Byte4> cast);
1388 explicit Int4(RValue<SByte4> cast);
1389 explicit Int4(RValue<Float4> cast);
1390 explicit Int4(RValue<Short4> cast);
1391 explicit Int4(RValue<UShort4> cast);
1395 Int4(int x, int yzw);
1396 Int4(int x, int y, int zw);
1397 Int4(int x, int y, int z, int w);
1398 Int4(RValue<Int4> rhs);
1399 Int4(const Int4 &rhs);
1400 Int4(const Reference<Int4> &rhs);
1401 Int4(RValue<UInt4> rhs);
1402 Int4(const UInt4 &rhs);
1403 Int4(const Reference<UInt4> &rhs);
1404 Int4(RValue<Int2> lo, RValue<Int2> hi);
1405 Int4(RValue<Int> rhs);
1406 Int4(const Int &rhs);
1407 Int4(const Reference<Int> &rhs);
1409 RValue<Int4> operator=(RValue<Int4> rhs) const;
1410 RValue<Int4> operator=(const Int4 &rhs) const;
1411 RValue<Int4> operator=(const Reference<Int4> &rhs) const;
1413 static Type *getType();
1416 void constant(int x, int y, int z, int w);
1419 RValue<Int4> operator+(RValue<Int4> lhs, RValue<Int4> rhs);
1420 RValue<Int4> operator-(RValue<Int4> lhs, RValue<Int4> rhs);
1421 RValue<Int4> operator*(RValue<Int4> lhs, RValue<Int4> rhs);
1422 RValue<Int4> operator/(RValue<Int4> lhs, RValue<Int4> rhs);
1423 RValue<Int4> operator%(RValue<Int4> lhs, RValue<Int4> rhs);
1424 RValue<Int4> operator&(RValue<Int4> lhs, RValue<Int4> rhs);
1425 RValue<Int4> operator|(RValue<Int4> lhs, RValue<Int4> rhs);
1426 RValue<Int4> operator^(RValue<Int4> lhs, RValue<Int4> rhs);
1427 RValue<Int4> operator<<(RValue<Int4> lhs, unsigned char rhs);
1428 RValue<Int4> operator>>(RValue<Int4> lhs, unsigned char rhs);
1429 RValue<Int4> operator<<(RValue<Int4> lhs, RValue<Int4> rhs);
1430 RValue<Int4> operator>>(RValue<Int4> lhs, RValue<Int4> rhs);
1431 RValue<Int4> operator+=(const Int4 &lhs, RValue<Int4> rhs);
1432 RValue<Int4> operator-=(const Int4 &lhs, RValue<Int4> rhs);
1433 RValue<Int4> operator*=(const Int4 &lhs, RValue<Int4> rhs);
1434 // RValue<Int4> operator/=(const Int4 &lhs, RValue<Int4> rhs);
1435 // RValue<Int4> operator%=(const Int4 &lhs, RValue<Int4> rhs);
1436 RValue<Int4> operator&=(const Int4 &lhs, RValue<Int4> rhs);
1437 RValue<Int4> operator|=(const Int4 &lhs, RValue<Int4> rhs);
1438 RValue<Int4> operator^=(const Int4 &lhs, RValue<Int4> rhs);
1439 RValue<Int4> operator<<=(const Int4 &lhs, unsigned char rhs);
1440 RValue<Int4> operator>>=(const Int4 &lhs, unsigned char rhs);
1441 RValue<Int4> operator+(RValue<Int4> val);
1442 RValue<Int4> operator-(RValue<Int4> val);
1443 RValue<Int4> operator~(RValue<Int4> val);
1444 // RValue<Int4> operator++(const Int4 &val, int); // Post-increment
1445 // const Int4 &operator++(const Int4 &val); // Pre-increment
1446 // RValue<Int4> operator--(const Int4 &val, int); // Post-decrement
1447 // const Int4 &operator--(const Int4 &val); // Pre-decrement
1448 // RValue<Bool> operator<(RValue<Int4> lhs, RValue<Int4> rhs);
1449 // RValue<Bool> operator<=(RValue<Int4> lhs, RValue<Int4> rhs);
1450 // RValue<Bool> operator>(RValue<Int4> lhs, RValue<Int4> rhs);
1451 // RValue<Bool> operator>=(RValue<Int4> lhs, RValue<Int4> rhs);
1452 // RValue<Bool> operator!=(RValue<Int4> lhs, RValue<Int4> rhs);
1453 // RValue<Bool> operator==(RValue<Int4> lhs, RValue<Int4> rhs);
1455 RValue<Int4> CmpEQ(RValue<Int4> x, RValue<Int4> y);
1456 RValue<Int4> CmpLT(RValue<Int4> x, RValue<Int4> y);
1457 RValue<Int4> CmpLE(RValue<Int4> x, RValue<Int4> y);
1458 RValue<Int4> CmpNEQ(RValue<Int4> x, RValue<Int4> y);
1459 RValue<Int4> CmpNLT(RValue<Int4> x, RValue<Int4> y);
1460 RValue<Int4> CmpNLE(RValue<Int4> x, RValue<Int4> y);
1461 RValue<Int4> Max(RValue<Int4> x, RValue<Int4> y);
1462 RValue<Int4> Min(RValue<Int4> x, RValue<Int4> y);
1463 RValue<Int4> RoundInt(RValue<Float4> cast);
1464 RValue<Short8> Pack(RValue<Int4> x, RValue<Int4> y);
1465 RValue<Int> Extract(RValue<Int4> val, int i);
1466 RValue<Int4> Insert(RValue<Int4> val, RValue<Int> element, int i);
1467 RValue<Int> SignMask(RValue<Int4> x);
1468 RValue<Int4> Swizzle(RValue<Int4> x, unsigned char select);
1470 class UInt4 : public Variable<UInt4>
1473 explicit UInt4(RValue<Float4> cast);
1477 UInt4(int x, int yzw);
1478 UInt4(int x, int y, int zw);
1479 UInt4(int x, int y, int z, int w);
1480 UInt4(unsigned int x, unsigned int y, unsigned int z, unsigned int w);
1481 UInt4(RValue<UInt4> rhs);
1482 UInt4(const UInt4 &rhs);
1483 UInt4(const Reference<UInt4> &rhs);
1484 UInt4(RValue<Int4> rhs);
1485 UInt4(const Int4 &rhs);
1486 UInt4(const Reference<Int4> &rhs);
1487 UInt4(RValue<UInt2> lo, RValue<UInt2> hi);
1489 RValue<UInt4> operator=(RValue<UInt4> rhs) const;
1490 RValue<UInt4> operator=(const UInt4 &rhs) const;
1491 RValue<UInt4> operator=(const Reference<UInt4> &rhs) const;
1493 static Type *getType();
1496 void constant(int x, int y, int z, int w);
1499 RValue<UInt4> operator+(RValue<UInt4> lhs, RValue<UInt4> rhs);
1500 RValue<UInt4> operator-(RValue<UInt4> lhs, RValue<UInt4> rhs);
1501 RValue<UInt4> operator*(RValue<UInt4> lhs, RValue<UInt4> rhs);
1502 RValue<UInt4> operator/(RValue<UInt4> lhs, RValue<UInt4> rhs);
1503 RValue<UInt4> operator%(RValue<UInt4> lhs, RValue<UInt4> rhs);
1504 RValue<UInt4> operator&(RValue<UInt4> lhs, RValue<UInt4> rhs);
1505 RValue<UInt4> operator|(RValue<UInt4> lhs, RValue<UInt4> rhs);
1506 RValue<UInt4> operator^(RValue<UInt4> lhs, RValue<UInt4> rhs);
1507 RValue<UInt4> operator<<(RValue<UInt4> lhs, unsigned char rhs);
1508 RValue<UInt4> operator>>(RValue<UInt4> lhs, unsigned char rhs);
1509 RValue<UInt4> operator<<(RValue<UInt4> lhs, RValue<UInt4> rhs);
1510 RValue<UInt4> operator>>(RValue<UInt4> lhs, RValue<UInt4> rhs);
1511 RValue<UInt4> operator+=(const UInt4 &lhs, RValue<UInt4> rhs);
1512 RValue<UInt4> operator-=(const UInt4 &lhs, RValue<UInt4> rhs);
1513 RValue<UInt4> operator*=(const UInt4 &lhs, RValue<UInt4> rhs);
1514 // RValue<UInt4> operator/=(const UInt4 &lhs, RValue<UInt4> rhs);
1515 // RValue<UInt4> operator%=(const UInt4 &lhs, RValue<UInt4> rhs);
1516 RValue<UInt4> operator&=(const UInt4 &lhs, RValue<UInt4> rhs);
1517 RValue<UInt4> operator|=(const UInt4 &lhs, RValue<UInt4> rhs);
1518 RValue<UInt4> operator^=(const UInt4 &lhs, RValue<UInt4> rhs);
1519 RValue<UInt4> operator<<=(const UInt4 &lhs, unsigned char rhs);
1520 RValue<UInt4> operator>>=(const UInt4 &lhs, unsigned char rhs);
1521 RValue<UInt4> operator+(RValue<UInt4> val);
1522 RValue<UInt4> operator-(RValue<UInt4> val);
1523 RValue<UInt4> operator~(RValue<UInt4> val);
1524 // RValue<UInt4> operator++(const UInt4 &val, int); // Post-increment
1525 // const UInt4 &operator++(const UInt4 &val); // Pre-increment
1526 // RValue<UInt4> operator--(const UInt4 &val, int); // Post-decrement
1527 // const UInt4 &operator--(const UInt4 &val); // Pre-decrement
1528 // RValue<Bool> operator<(RValue<UInt4> lhs, RValue<UInt4> rhs);
1529 // RValue<Bool> operator<=(RValue<UInt4> lhs, RValue<UInt4> rhs);
1530 // RValue<Bool> operator>(RValue<UInt4> lhs, RValue<UInt4> rhs);
1531 // RValue<Bool> operator>=(RValue<UInt4> lhs, RValue<UInt4> rhs);
1532 // RValue<Bool> operator!=(RValue<UInt4> lhs, RValue<UInt4> rhs);
1533 // RValue<Bool> operator==(RValue<UInt4> lhs, RValue<UInt4> rhs);
1535 RValue<UInt4> CmpEQ(RValue<UInt4> x, RValue<UInt4> y);
1536 RValue<UInt4> CmpLT(RValue<UInt4> x, RValue<UInt4> y);
1537 RValue<UInt4> CmpLE(RValue<UInt4> x, RValue<UInt4> y);
1538 RValue<UInt4> CmpNEQ(RValue<UInt4> x, RValue<UInt4> y);
1539 RValue<UInt4> CmpNLT(RValue<UInt4> x, RValue<UInt4> y);
1540 RValue<UInt4> CmpNLE(RValue<UInt4> x, RValue<UInt4> y);
1541 RValue<UInt4> Max(RValue<UInt4> x, RValue<UInt4> y);
1542 RValue<UInt4> Min(RValue<UInt4> x, RValue<UInt4> y);
1543 // RValue<UInt4> RoundInt(RValue<Float4> cast);
1544 RValue<UShort8> Pack(RValue<UInt4> x, RValue<UInt4> y);
1547 class Swizzle2Float4
1549 friend class Float4;
1552 operator RValue<Float4>() const;
1562 operator RValue<Float4>() const;
1569 class SwizzleMaskFloat4
1571 friend class Float4;
1574 operator RValue<Float4>() const;
1576 RValue<Float4> operator=(RValue<Float4> rhs) const;
1577 RValue<Float4> operator=(RValue<Float> rhs) const;
1584 class SwizzleMask1Float4
1587 operator RValue<Float>() const;
1588 operator RValue<Float4>() const;
1590 RValue<Float4> operator=(float x) const;
1591 RValue<Float4> operator=(RValue<Float4> rhs) const;
1592 RValue<Float4> operator=(RValue<Float> rhs) const;
1599 class SwizzleMask2Float4
1601 friend class Float4;
1604 operator RValue<Float4>() const;
1606 RValue<Float4> operator=(RValue<Float4> rhs) const;
1612 class Float : public Variable<Float>
1615 explicit Float(RValue<Int> cast);
1619 Float(RValue<Float> rhs);
1620 Float(const Float &rhs);
1621 Float(const Reference<Float> &rhs);
1624 Float(const SwizzleMask1Float4<T> &rhs);
1626 // RValue<Float> operator=(float rhs) const; // FIXME: Implement
1627 RValue<Float> operator=(RValue<Float> rhs) const;
1628 RValue<Float> operator=(const Float &rhs) const;
1629 RValue<Float> operator=(const Reference<Float> &rhs) const;
1632 RValue<Float> operator=(const SwizzleMask1Float4<T> &rhs) const;
1634 static Type *getType();
1637 RValue<Float> operator+(RValue<Float> lhs, RValue<Float> rhs);
1638 RValue<Float> operator-(RValue<Float> lhs, RValue<Float> rhs);
1639 RValue<Float> operator*(RValue<Float> lhs, RValue<Float> rhs);
1640 RValue<Float> operator/(RValue<Float> lhs, RValue<Float> rhs);
1641 RValue<Float> operator+=(const Float &lhs, RValue<Float> rhs);
1642 RValue<Float> operator-=(const Float &lhs, RValue<Float> rhs);
1643 RValue<Float> operator*=(const Float &lhs, RValue<Float> rhs);
1644 RValue<Float> operator/=(const Float &lhs, RValue<Float> rhs);
1645 RValue<Float> operator+(RValue<Float> val);
1646 RValue<Float> operator-(RValue<Float> val);
1647 RValue<Bool> operator<(RValue<Float> lhs, RValue<Float> rhs);
1648 RValue<Bool> operator<=(RValue<Float> lhs, RValue<Float> rhs);
1649 RValue<Bool> operator>(RValue<Float> lhs, RValue<Float> rhs);
1650 RValue<Bool> operator>=(RValue<Float> lhs, RValue<Float> rhs);
1651 RValue<Bool> operator!=(RValue<Float> lhs, RValue<Float> rhs);
1652 RValue<Bool> operator==(RValue<Float> lhs, RValue<Float> rhs);
1654 RValue<Float> Abs(RValue<Float> x);
1655 RValue<Float> Max(RValue<Float> x, RValue<Float> y);
1656 RValue<Float> Min(RValue<Float> x, RValue<Float> y);
1657 RValue<Float> Rcp_pp(RValue<Float> val, bool exactAtPow2 = false);
1658 RValue<Float> RcpSqrt_pp(RValue<Float> val);
1659 RValue<Float> Sqrt(RValue<Float> x);
1660 RValue<Float> Round(RValue<Float> val);
1661 RValue<Float> Trunc(RValue<Float> val);
1662 RValue<Float> Frac(RValue<Float> val);
1663 RValue<Float> Floor(RValue<Float> val);
1664 RValue<Float> Ceil(RValue<Float> val);
1666 class Float2 : public Variable<Float2>
1669 // explicit Float2(RValue<Byte2> cast);
1670 // explicit Float2(RValue<Short2> cast);
1671 // explicit Float2(RValue<UShort2> cast);
1672 // explicit Float2(RValue<Int2> cast);
1673 // explicit Float2(RValue<UInt2> cast);
1674 explicit Float2(RValue<Float4> cast);
1677 // Float2(float x, float y);
1678 // Float2(RValue<Float2> rhs);
1679 // Float2(const Float2 &rhs);
1680 // Float2(const Reference<Float2> &rhs);
1681 // Float2(RValue<Float> rhs);
1682 // Float2(const Float &rhs);
1683 // Float2(const Reference<Float> &rhs);
1686 // Float2(const SwizzleMask1Float4<T> &rhs);
1688 // RValue<Float2> operator=(float replicate) const;
1689 // RValue<Float2> operator=(RValue<Float2> rhs) const;
1690 // RValue<Float2> operator=(const Float2 &rhs) const;
1691 // RValue<Float2> operator=(const Reference<Float2> &rhs) const;
1692 // RValue<Float2> operator=(RValue<Float> rhs) const;
1693 // RValue<Float2> operator=(const Float &rhs) const;
1694 // RValue<Float2> operator=(const Reference<Float> &rhs) const;
1697 // RValue<Float2> operator=(const SwizzleMask1Float4<T> &rhs);
1699 static Type *getType();
1702 // RValue<Float2> operator+(RValue<Float2> lhs, RValue<Float2> rhs);
1703 // RValue<Float2> operator-(RValue<Float2> lhs, RValue<Float2> rhs);
1704 // RValue<Float2> operator*(RValue<Float2> lhs, RValue<Float2> rhs);
1705 // RValue<Float2> operator/(RValue<Float2> lhs, RValue<Float2> rhs);
1706 // RValue<Float2> operator%(RValue<Float2> lhs, RValue<Float2> rhs);
1707 // RValue<Float2> operator+=(const Float2 &lhs, RValue<Float2> rhs);
1708 // RValue<Float2> operator-=(const Float2 &lhs, RValue<Float2> rhs);
1709 // RValue<Float2> operator*=(const Float2 &lhs, RValue<Float2> rhs);
1710 // RValue<Float2> operator/=(const Float2 &lhs, RValue<Float2> rhs);
1711 // RValue<Float2> operator%=(const Float2 &lhs, RValue<Float2> rhs);
1712 // RValue<Float2> operator+(RValue<Float2> val);
1713 // RValue<Float2> operator-(RValue<Float2> val);
1715 // RValue<Float2> Abs(RValue<Float2> x);
1716 // RValue<Float2> Max(RValue<Float2> x, RValue<Float2> y);
1717 // RValue<Float2> Min(RValue<Float2> x, RValue<Float2> y);
1718 // RValue<Float2> Swizzle(RValue<Float2> x, unsigned char select);
1719 // RValue<Float2> Mask(Float2 &lhs, RValue<Float2> rhs, unsigned char select);
1721 class Float4 : public Variable<Float4>
1724 explicit Float4(RValue<Byte4> cast);
1725 explicit Float4(RValue<SByte4> cast);
1726 explicit Float4(RValue<Short4> cast);
1727 explicit Float4(RValue<UShort4> cast);
1728 explicit Float4(RValue<Int4> cast);
1729 explicit Float4(RValue<UInt4> cast);
1733 Float4(float x, float yzw);
1734 Float4(float x, float y, float zw);
1735 Float4(float x, float y, float z, float w);
1736 Float4(RValue<Float4> rhs);
1737 Float4(const Float4 &rhs);
1738 Float4(const Reference<Float4> &rhs);
1739 Float4(RValue<Float> rhs);
1740 Float4(const Float &rhs);
1741 Float4(const Reference<Float> &rhs);
1744 Float4(const SwizzleMask1Float4<T> &rhs);
1746 Float4(const SwizzleFloat4<T> &rhs);
1747 template<int X, int Y>
1748 Float4(const Swizzle2Float4<X> &x, const Swizzle2Float4<Y> &y);
1749 template<int X, int Y>
1750 Float4(const SwizzleMask2Float4<X> &x, const Swizzle2Float4<Y> &y);
1751 template<int X, int Y>
1752 Float4(const Swizzle2Float4<X> &x, const SwizzleMask2Float4<Y> &y);
1753 template<int X, int Y>
1754 Float4(const SwizzleMask2Float4<X> &x, const SwizzleMask2Float4<Y> &y);
1756 RValue<Float4> operator=(float replicate) const;
1757 RValue<Float4> operator=(RValue<Float4> rhs) const;
1758 RValue<Float4> operator=(const Float4 &rhs) const;
1759 RValue<Float4> operator=(const Reference<Float4> &rhs) const;
1760 RValue<Float4> operator=(RValue<Float> rhs) const;
1761 RValue<Float4> operator=(const Float &rhs) const;
1762 RValue<Float4> operator=(const Reference<Float> &rhs) const;
1765 RValue<Float4> operator=(const SwizzleMask1Float4<T> &rhs);
1767 RValue<Float4> operator=(const SwizzleFloat4<T> &rhs);
1769 static Type *getType();
1773 SwizzleMask1Float4<0x00> x;
1774 SwizzleMask1Float4<0x55> y;
1775 SwizzleMask1Float4<0xAA> z;
1776 SwizzleMask1Float4<0xFF> w;
1777 Swizzle2Float4<0x00> xx;
1778 Swizzle2Float4<0x01> yx;
1779 Swizzle2Float4<0x02> zx;
1780 Swizzle2Float4<0x03> wx;
1781 SwizzleMask2Float4<0x54> xy;
1782 Swizzle2Float4<0x55> yy;
1783 Swizzle2Float4<0x56> zy;
1784 Swizzle2Float4<0x57> wy;
1785 SwizzleMask2Float4<0xA8> xz;
1786 SwizzleMask2Float4<0xA9> yz;
1787 Swizzle2Float4<0xAA> zz;
1788 Swizzle2Float4<0xAB> wz;
1789 SwizzleMask2Float4<0xFC> xw;
1790 SwizzleMask2Float4<0xFD> yw;
1791 SwizzleMask2Float4<0xFE> zw;
1792 Swizzle2Float4<0xFF> ww;
1793 SwizzleFloat4<0x00> xxx;
1794 SwizzleFloat4<0x01> yxx;
1795 SwizzleFloat4<0x02> zxx;
1796 SwizzleFloat4<0x03> wxx;
1797 SwizzleFloat4<0x04> xyx;
1798 SwizzleFloat4<0x05> yyx;
1799 SwizzleFloat4<0x06> zyx;
1800 SwizzleFloat4<0x07> wyx;
1801 SwizzleFloat4<0x08> xzx;
1802 SwizzleFloat4<0x09> yzx;
1803 SwizzleFloat4<0x0A> zzx;
1804 SwizzleFloat4<0x0B> wzx;
1805 SwizzleFloat4<0x0C> xwx;
1806 SwizzleFloat4<0x0D> ywx;
1807 SwizzleFloat4<0x0E> zwx;
1808 SwizzleFloat4<0x0F> wwx;
1809 SwizzleFloat4<0x50> xxy;
1810 SwizzleFloat4<0x51> yxy;
1811 SwizzleFloat4<0x52> zxy;
1812 SwizzleFloat4<0x53> wxy;
1813 SwizzleFloat4<0x54> xyy;
1814 SwizzleFloat4<0x55> yyy;
1815 SwizzleFloat4<0x56> zyy;
1816 SwizzleFloat4<0x57> wyy;
1817 SwizzleFloat4<0x58> xzy;
1818 SwizzleFloat4<0x59> yzy;
1819 SwizzleFloat4<0x5A> zzy;
1820 SwizzleFloat4<0x5B> wzy;
1821 SwizzleFloat4<0x5C> xwy;
1822 SwizzleFloat4<0x5D> ywy;
1823 SwizzleFloat4<0x5E> zwy;
1824 SwizzleFloat4<0x5F> wwy;
1825 SwizzleFloat4<0xA0> xxz;
1826 SwizzleFloat4<0xA1> yxz;
1827 SwizzleFloat4<0xA2> zxz;
1828 SwizzleFloat4<0xA3> wxz;
1829 SwizzleMaskFloat4<0xA4> xyz;
1830 SwizzleFloat4<0xA5> yyz;
1831 SwizzleFloat4<0xA6> zyz;
1832 SwizzleFloat4<0xA7> wyz;
1833 SwizzleFloat4<0xA8> xzz;
1834 SwizzleFloat4<0xA9> yzz;
1835 SwizzleFloat4<0xAA> zzz;
1836 SwizzleFloat4<0xAB> wzz;
1837 SwizzleFloat4<0xAC> xwz;
1838 SwizzleFloat4<0xAD> ywz;
1839 SwizzleFloat4<0xAE> zwz;
1840 SwizzleFloat4<0xAF> wwz;
1841 SwizzleFloat4<0xF0> xxw;
1842 SwizzleFloat4<0xF1> yxw;
1843 SwizzleFloat4<0xF2> zxw;
1844 SwizzleFloat4<0xF3> wxw;
1845 SwizzleMaskFloat4<0xF4> xyw;
1846 SwizzleFloat4<0xF5> yyw;
1847 SwizzleFloat4<0xF6> zyw;
1848 SwizzleFloat4<0xF7> wyw;
1849 SwizzleMaskFloat4<0xF8> xzw;
1850 SwizzleMaskFloat4<0xF9> yzw;
1851 SwizzleFloat4<0xFA> zzw;
1852 SwizzleFloat4<0xFB> wzw;
1853 SwizzleFloat4<0xFC> xww;
1854 SwizzleFloat4<0xFD> yww;
1855 SwizzleFloat4<0xFE> zww;
1856 SwizzleFloat4<0xFF> www;
1857 SwizzleFloat4<0x00> xxxx;
1858 SwizzleFloat4<0x01> yxxx;
1859 SwizzleFloat4<0x02> zxxx;
1860 SwizzleFloat4<0x03> wxxx;
1861 SwizzleFloat4<0x04> xyxx;
1862 SwizzleFloat4<0x05> yyxx;
1863 SwizzleFloat4<0x06> zyxx;
1864 SwizzleFloat4<0x07> wyxx;
1865 SwizzleFloat4<0x08> xzxx;
1866 SwizzleFloat4<0x09> yzxx;
1867 SwizzleFloat4<0x0A> zzxx;
1868 SwizzleFloat4<0x0B> wzxx;
1869 SwizzleFloat4<0x0C> xwxx;
1870 SwizzleFloat4<0x0D> ywxx;
1871 SwizzleFloat4<0x0E> zwxx;
1872 SwizzleFloat4<0x0F> wwxx;
1873 SwizzleFloat4<0x10> xxyx;
1874 SwizzleFloat4<0x11> yxyx;
1875 SwizzleFloat4<0x12> zxyx;
1876 SwizzleFloat4<0x13> wxyx;
1877 SwizzleFloat4<0x14> xyyx;
1878 SwizzleFloat4<0x15> yyyx;
1879 SwizzleFloat4<0x16> zyyx;
1880 SwizzleFloat4<0x17> wyyx;
1881 SwizzleFloat4<0x18> xzyx;
1882 SwizzleFloat4<0x19> yzyx;
1883 SwizzleFloat4<0x1A> zzyx;
1884 SwizzleFloat4<0x1B> wzyx;
1885 SwizzleFloat4<0x1C> xwyx;
1886 SwizzleFloat4<0x1D> ywyx;
1887 SwizzleFloat4<0x1E> zwyx;
1888 SwizzleFloat4<0x1F> wwyx;
1889 SwizzleFloat4<0x20> xxzx;
1890 SwizzleFloat4<0x21> yxzx;
1891 SwizzleFloat4<0x22> zxzx;
1892 SwizzleFloat4<0x23> wxzx;
1893 SwizzleFloat4<0x24> xyzx;
1894 SwizzleFloat4<0x25> yyzx;
1895 SwizzleFloat4<0x26> zyzx;
1896 SwizzleFloat4<0x27> wyzx;
1897 SwizzleFloat4<0x28> xzzx;
1898 SwizzleFloat4<0x29> yzzx;
1899 SwizzleFloat4<0x2A> zzzx;
1900 SwizzleFloat4<0x2B> wzzx;
1901 SwizzleFloat4<0x2C> xwzx;
1902 SwizzleFloat4<0x2D> ywzx;
1903 SwizzleFloat4<0x2E> zwzx;
1904 SwizzleFloat4<0x2F> wwzx;
1905 SwizzleFloat4<0x30> xxwx;
1906 SwizzleFloat4<0x31> yxwx;
1907 SwizzleFloat4<0x32> zxwx;
1908 SwizzleFloat4<0x33> wxwx;
1909 SwizzleFloat4<0x34> xywx;
1910 SwizzleFloat4<0x35> yywx;
1911 SwizzleFloat4<0x36> zywx;
1912 SwizzleFloat4<0x37> wywx;
1913 SwizzleFloat4<0x38> xzwx;
1914 SwizzleFloat4<0x39> yzwx;
1915 SwizzleFloat4<0x3A> zzwx;
1916 SwizzleFloat4<0x3B> wzwx;
1917 SwizzleFloat4<0x3C> xwwx;
1918 SwizzleFloat4<0x3D> ywwx;
1919 SwizzleFloat4<0x3E> zwwx;
1920 SwizzleFloat4<0x3F> wwwx;
1921 SwizzleFloat4<0x40> xxxy;
1922 SwizzleFloat4<0x41> yxxy;
1923 SwizzleFloat4<0x42> zxxy;
1924 SwizzleFloat4<0x43> wxxy;
1925 SwizzleFloat4<0x44> xyxy;
1926 SwizzleFloat4<0x45> yyxy;
1927 SwizzleFloat4<0x46> zyxy;
1928 SwizzleFloat4<0x47> wyxy;
1929 SwizzleFloat4<0x48> xzxy;
1930 SwizzleFloat4<0x49> yzxy;
1931 SwizzleFloat4<0x4A> zzxy;
1932 SwizzleFloat4<0x4B> wzxy;
1933 SwizzleFloat4<0x4C> xwxy;
1934 SwizzleFloat4<0x4D> ywxy;
1935 SwizzleFloat4<0x4E> zwxy;
1936 SwizzleFloat4<0x4F> wwxy;
1937 SwizzleFloat4<0x50> xxyy;
1938 SwizzleFloat4<0x51> yxyy;
1939 SwizzleFloat4<0x52> zxyy;
1940 SwizzleFloat4<0x53> wxyy;
1941 SwizzleFloat4<0x54> xyyy;
1942 SwizzleFloat4<0x55> yyyy;
1943 SwizzleFloat4<0x56> zyyy;
1944 SwizzleFloat4<0x57> wyyy;
1945 SwizzleFloat4<0x58> xzyy;
1946 SwizzleFloat4<0x59> yzyy;
1947 SwizzleFloat4<0x5A> zzyy;
1948 SwizzleFloat4<0x5B> wzyy;
1949 SwizzleFloat4<0x5C> xwyy;
1950 SwizzleFloat4<0x5D> ywyy;
1951 SwizzleFloat4<0x5E> zwyy;
1952 SwizzleFloat4<0x5F> wwyy;
1953 SwizzleFloat4<0x60> xxzy;
1954 SwizzleFloat4<0x61> yxzy;
1955 SwizzleFloat4<0x62> zxzy;
1956 SwizzleFloat4<0x63> wxzy;
1957 SwizzleFloat4<0x64> xyzy;
1958 SwizzleFloat4<0x65> yyzy;
1959 SwizzleFloat4<0x66> zyzy;
1960 SwizzleFloat4<0x67> wyzy;
1961 SwizzleFloat4<0x68> xzzy;
1962 SwizzleFloat4<0x69> yzzy;
1963 SwizzleFloat4<0x6A> zzzy;
1964 SwizzleFloat4<0x6B> wzzy;
1965 SwizzleFloat4<0x6C> xwzy;
1966 SwizzleFloat4<0x6D> ywzy;
1967 SwizzleFloat4<0x6E> zwzy;
1968 SwizzleFloat4<0x6F> wwzy;
1969 SwizzleFloat4<0x70> xxwy;
1970 SwizzleFloat4<0x71> yxwy;
1971 SwizzleFloat4<0x72> zxwy;
1972 SwizzleFloat4<0x73> wxwy;
1973 SwizzleFloat4<0x74> xywy;
1974 SwizzleFloat4<0x75> yywy;
1975 SwizzleFloat4<0x76> zywy;
1976 SwizzleFloat4<0x77> wywy;
1977 SwizzleFloat4<0x78> xzwy;
1978 SwizzleFloat4<0x79> yzwy;
1979 SwizzleFloat4<0x7A> zzwy;
1980 SwizzleFloat4<0x7B> wzwy;
1981 SwizzleFloat4<0x7C> xwwy;
1982 SwizzleFloat4<0x7D> ywwy;
1983 SwizzleFloat4<0x7E> zwwy;
1984 SwizzleFloat4<0x7F> wwwy;
1985 SwizzleFloat4<0x80> xxxz;
1986 SwizzleFloat4<0x81> yxxz;
1987 SwizzleFloat4<0x82> zxxz;
1988 SwizzleFloat4<0x83> wxxz;
1989 SwizzleFloat4<0x84> xyxz;
1990 SwizzleFloat4<0x85> yyxz;
1991 SwizzleFloat4<0x86> zyxz;
1992 SwizzleFloat4<0x87> wyxz;
1993 SwizzleFloat4<0x88> xzxz;
1994 SwizzleFloat4<0x89> yzxz;
1995 SwizzleFloat4<0x8A> zzxz;
1996 SwizzleFloat4<0x8B> wzxz;
1997 SwizzleFloat4<0x8C> xwxz;
1998 SwizzleFloat4<0x8D> ywxz;
1999 SwizzleFloat4<0x8E> zwxz;
2000 SwizzleFloat4<0x8F> wwxz;
2001 SwizzleFloat4<0x90> xxyz;
2002 SwizzleFloat4<0x91> yxyz;
2003 SwizzleFloat4<0x92> zxyz;
2004 SwizzleFloat4<0x93> wxyz;
2005 SwizzleFloat4<0x94> xyyz;
2006 SwizzleFloat4<0x95> yyyz;
2007 SwizzleFloat4<0x96> zyyz;
2008 SwizzleFloat4<0x97> wyyz;
2009 SwizzleFloat4<0x98> xzyz;
2010 SwizzleFloat4<0x99> yzyz;
2011 SwizzleFloat4<0x9A> zzyz;
2012 SwizzleFloat4<0x9B> wzyz;
2013 SwizzleFloat4<0x9C> xwyz;
2014 SwizzleFloat4<0x9D> ywyz;
2015 SwizzleFloat4<0x9E> zwyz;
2016 SwizzleFloat4<0x9F> wwyz;
2017 SwizzleFloat4<0xA0> xxzz;
2018 SwizzleFloat4<0xA1> yxzz;
2019 SwizzleFloat4<0xA2> zxzz;
2020 SwizzleFloat4<0xA3> wxzz;
2021 SwizzleFloat4<0xA4> xyzz;
2022 SwizzleFloat4<0xA5> yyzz;
2023 SwizzleFloat4<0xA6> zyzz;
2024 SwizzleFloat4<0xA7> wyzz;
2025 SwizzleFloat4<0xA8> xzzz;
2026 SwizzleFloat4<0xA9> yzzz;
2027 SwizzleFloat4<0xAA> zzzz;
2028 SwizzleFloat4<0xAB> wzzz;
2029 SwizzleFloat4<0xAC> xwzz;
2030 SwizzleFloat4<0xAD> ywzz;
2031 SwizzleFloat4<0xAE> zwzz;
2032 SwizzleFloat4<0xAF> wwzz;
2033 SwizzleFloat4<0xB0> xxwz;
2034 SwizzleFloat4<0xB1> yxwz;
2035 SwizzleFloat4<0xB2> zxwz;
2036 SwizzleFloat4<0xB3> wxwz;
2037 SwizzleFloat4<0xB4> xywz;
2038 SwizzleFloat4<0xB5> yywz;
2039 SwizzleFloat4<0xB6> zywz;
2040 SwizzleFloat4<0xB7> wywz;
2041 SwizzleFloat4<0xB8> xzwz;
2042 SwizzleFloat4<0xB9> yzwz;
2043 SwizzleFloat4<0xBA> zzwz;
2044 SwizzleFloat4<0xBB> wzwz;
2045 SwizzleFloat4<0xBC> xwwz;
2046 SwizzleFloat4<0xBD> ywwz;
2047 SwizzleFloat4<0xBE> zwwz;
2048 SwizzleFloat4<0xBF> wwwz;
2049 SwizzleFloat4<0xC0> xxxw;
2050 SwizzleFloat4<0xC1> yxxw;
2051 SwizzleFloat4<0xC2> zxxw;
2052 SwizzleFloat4<0xC3> wxxw;
2053 SwizzleFloat4<0xC4> xyxw;
2054 SwizzleFloat4<0xC5> yyxw;
2055 SwizzleFloat4<0xC6> zyxw;
2056 SwizzleFloat4<0xC7> wyxw;
2057 SwizzleFloat4<0xC8> xzxw;
2058 SwizzleFloat4<0xC9> yzxw;
2059 SwizzleFloat4<0xCA> zzxw;
2060 SwizzleFloat4<0xCB> wzxw;
2061 SwizzleFloat4<0xCC> xwxw;
2062 SwizzleFloat4<0xCD> ywxw;
2063 SwizzleFloat4<0xCE> zwxw;
2064 SwizzleFloat4<0xCF> wwxw;
2065 SwizzleFloat4<0xD0> xxyw;
2066 SwizzleFloat4<0xD1> yxyw;
2067 SwizzleFloat4<0xD2> zxyw;
2068 SwizzleFloat4<0xD3> wxyw;
2069 SwizzleFloat4<0xD4> xyyw;
2070 SwizzleFloat4<0xD5> yyyw;
2071 SwizzleFloat4<0xD6> zyyw;
2072 SwizzleFloat4<0xD7> wyyw;
2073 SwizzleFloat4<0xD8> xzyw;
2074 SwizzleFloat4<0xD9> yzyw;
2075 SwizzleFloat4<0xDA> zzyw;
2076 SwizzleFloat4<0xDB> wzyw;
2077 SwizzleFloat4<0xDC> xwyw;
2078 SwizzleFloat4<0xDD> ywyw;
2079 SwizzleFloat4<0xDE> zwyw;
2080 SwizzleFloat4<0xDF> wwyw;
2081 SwizzleFloat4<0xE0> xxzw;
2082 SwizzleFloat4<0xE1> yxzw;
2083 SwizzleFloat4<0xE2> zxzw;
2084 SwizzleFloat4<0xE3> wxzw;
2085 SwizzleMaskFloat4<0xE4> xyzw;
2086 SwizzleFloat4<0xE5> yyzw;
2087 SwizzleFloat4<0xE6> zyzw;
2088 SwizzleFloat4<0xE7> wyzw;
2089 SwizzleFloat4<0xE8> xzzw;
2090 SwizzleFloat4<0xE9> yzzw;
2091 SwizzleFloat4<0xEA> zzzw;
2092 SwizzleFloat4<0xEB> wzzw;
2093 SwizzleFloat4<0xEC> xwzw;
2094 SwizzleFloat4<0xED> ywzw;
2095 SwizzleFloat4<0xEE> zwzw;
2096 SwizzleFloat4<0xEF> wwzw;
2097 SwizzleFloat4<0xF0> xxww;
2098 SwizzleFloat4<0xF1> yxww;
2099 SwizzleFloat4<0xF2> zxww;
2100 SwizzleFloat4<0xF3> wxww;
2101 SwizzleFloat4<0xF4> xyww;
2102 SwizzleFloat4<0xF5> yyww;
2103 SwizzleFloat4<0xF6> zyww;
2104 SwizzleFloat4<0xF7> wyww;
2105 SwizzleFloat4<0xF8> xzww;
2106 SwizzleFloat4<0xF9> yzww;
2107 SwizzleFloat4<0xFA> zzww;
2108 SwizzleFloat4<0xFB> wzww;
2109 SwizzleFloat4<0xFC> xwww;
2110 SwizzleFloat4<0xFD> ywww;
2111 SwizzleFloat4<0xFE> zwww;
2112 SwizzleFloat4<0xFF> wwww;
2116 void constant(float x, float y, float z, float w);
2119 RValue<Float4> operator+(RValue<Float4> lhs, RValue<Float4> rhs);
2120 RValue<Float4> operator-(RValue<Float4> lhs, RValue<Float4> rhs);
2121 RValue<Float4> operator*(RValue<Float4> lhs, RValue<Float4> rhs);
2122 RValue<Float4> operator/(RValue<Float4> lhs, RValue<Float4> rhs);
2123 RValue<Float4> operator%(RValue<Float4> lhs, RValue<Float4> rhs);
2124 RValue<Float4> operator+=(const Float4 &lhs, RValue<Float4> rhs);
2125 RValue<Float4> operator-=(const Float4 &lhs, RValue<Float4> rhs);
2126 RValue<Float4> operator*=(const Float4 &lhs, RValue<Float4> rhs);
2127 RValue<Float4> operator/=(const Float4 &lhs, RValue<Float4> rhs);
2128 RValue<Float4> operator%=(const Float4 &lhs, RValue<Float4> rhs);
2129 RValue<Float4> operator+(RValue<Float4> val);
2130 RValue<Float4> operator-(RValue<Float4> val);
2132 RValue<Float4> Abs(RValue<Float4> x);
2133 RValue<Float4> Max(RValue<Float4> x, RValue<Float4> y);
2134 RValue<Float4> Min(RValue<Float4> x, RValue<Float4> y);
2135 RValue<Float4> Rcp_pp(RValue<Float4> val, bool exactAtPow2 = false);
2136 RValue<Float4> RcpSqrt_pp(RValue<Float4> val);
2137 RValue<Float4> Sqrt(RValue<Float4> x);
2138 RValue<Float4> Insert(RValue<Float4> val, RValue<Float> element, int i);
2139 RValue<Float> Extract(RValue<Float4> x, int i);
2140 RValue<Float4> Swizzle(RValue<Float4> x, unsigned char select);
2141 RValue<Float4> ShuffleLowHigh(RValue<Float4> x, RValue<Float4> y, unsigned char imm);
2142 RValue<Float4> UnpackLow(RValue<Float4> x, RValue<Float4> y);
2143 RValue<Float4> UnpackHigh(RValue<Float4> x, RValue<Float4> y);
2144 RValue<Float4> Mask(Float4 &lhs, RValue<Float4> rhs, unsigned char select);
2145 RValue<Int> SignMask(RValue<Float4> x);
2146 RValue<Int4> CmpEQ(RValue<Float4> x, RValue<Float4> y);
2147 RValue<Int4> CmpLT(RValue<Float4> x, RValue<Float4> y);
2148 RValue<Int4> CmpLE(RValue<Float4> x, RValue<Float4> y);
2149 RValue<Int4> CmpNEQ(RValue<Float4> x, RValue<Float4> y);
2150 RValue<Int4> CmpNLT(RValue<Float4> x, RValue<Float4> y);
2151 RValue<Int4> CmpNLE(RValue<Float4> x, RValue<Float4> y);
2152 RValue<Float4> Round(RValue<Float4> x);
2153 RValue<Float4> Trunc(RValue<Float4> x);
2154 RValue<Float4> Frac(RValue<Float4> x);
2155 RValue<Float4> Floor(RValue<Float4> x);
2156 RValue<Float4> Ceil(RValue<Float4> x);
2159 class Pointer : public Variable<Pointer<T>>
2163 Pointer(RValue<Pointer<S>> pointerS, int alignment = 1) : alignment(alignment)
2165 Value *pointerT = Nucleus::createBitCast(pointerS.value, Nucleus::getPointerType(T::getType()));
2166 LValue<Pointer<T>>::storeValue(pointerT);
2170 Pointer(const Pointer<S> &pointer, int alignment = 1) : alignment(alignment)
2172 Value *pointerS = pointer.loadValue(alignment);
2173 Value *pointerT = Nucleus::createBitCast(pointerS, Nucleus::getPointerType(T::getType()));
2174 LValue<Pointer<T>>::storeValue(pointerT);
2177 Pointer(Argument<Pointer<T>> argument);
2178 explicit Pointer(const void *external);
2181 Pointer(RValue<Pointer<T>> rhs);
2182 Pointer(const Pointer<T> &rhs);
2183 Pointer(const Reference<Pointer<T>> &rhs);
2185 RValue<Pointer<T>> operator=(RValue<Pointer<T>> rhs) const;
2186 RValue<Pointer<T>> operator=(const Pointer<T> &rhs) const;
2187 RValue<Pointer<T>> operator=(const Reference<Pointer<T>> &rhs) const;
2189 Reference<T> operator*();
2190 Reference<T> operator[](int index);
2191 Reference<T> operator[](RValue<Int> index);
2193 static Type *getType();
2196 const int alignment;
2199 RValue<Pointer<Byte>> operator+(RValue<Pointer<Byte>> lhs, int offset);
2200 RValue<Pointer<Byte>> operator+(RValue<Pointer<Byte>> lhs, RValue<Int> offset);
2201 RValue<Pointer<Byte>> operator+(RValue<Pointer<Byte>> lhs, RValue<UInt> offset);
2202 RValue<Pointer<Byte>> operator+=(const Pointer<Byte> &lhs, int offset);
2203 RValue<Pointer<Byte>> operator+=(const Pointer<Byte> &lhs, RValue<Int> offset);
2204 RValue<Pointer<Byte>> operator+=(const Pointer<Byte> &lhs, RValue<UInt> offset);
2206 RValue<Pointer<Byte>> operator-(RValue<Pointer<Byte>> lhs, int offset);
2207 RValue<Pointer<Byte>> operator-(RValue<Pointer<Byte>> lhs, RValue<Int> offset);
2208 RValue<Pointer<Byte>> operator-(RValue<Pointer<Byte>> lhs, RValue<UInt> offset);
2209 RValue<Pointer<Byte>> operator-=(const Pointer<Byte> &lhs, int offset);
2210 RValue<Pointer<Byte>> operator-=(const Pointer<Byte> &lhs, RValue<Int> offset);
2211 RValue<Pointer<Byte>> operator-=(const Pointer<Byte> &lhs, RValue<UInt> offset);
2213 template<class T, int S = 1>
2214 class Array : public Variable<T>
2217 Array(int size = S);
2219 Reference<T> operator[](int index);
2220 Reference<T> operator[](RValue<Int> index);
2223 // RValue<Array<T>> operator++(const Array<T> &val, int); // Post-increment
2224 // const Array<T> &operator++(const Array<T> &val); // Pre-increment
2225 // RValue<Array<T>> operator--(const Array<T> &val, int); // Post-decrement
2226 // const Array<T> &operator--(const Array<T> &val); // Pre-decrement
2228 bool branch(RValue<Bool> cmp, BasicBlock *bodyBB, BasicBlock *endBB);
2229 void endIf(BasicBlock *falseBB);
2230 bool elseBlock(BasicBlock *falseBB);
2231 BasicBlock *beginElse();
2236 ForData(bool init) : loopOnce(init)
2245 bool operator=(bool value)
2247 return loopOnce = value;
2252 if(Nucleus::getInsertBlock() != endBB)
2254 testBB = Nucleus::createBasicBlock();
2256 Nucleus::createBr(testBB);
2257 Nucleus::setInsertBlock(testBB);
2265 bool test(RValue<Bool> cmp)
2267 BasicBlock *bodyBB = Nucleus::createBasicBlock();
2268 endBB = Nucleus::createBasicBlock();
2270 Nucleus::createCondBr(cmp.value, bodyBB, endBB);
2271 Nucleus::setInsertBlock(bodyBB);
2278 Nucleus::createBr(testBB);
2279 Nucleus::setInsertBlock(endBB);
2283 BasicBlock *testBB = nullptr;
2284 BasicBlock *endBB = nullptr;
2285 bool loopOnce = true;
2291 IfData(RValue<Bool> cmp) : loopOnce(true)
2293 trueBB = Nucleus::createBasicBlock();
2294 falseBB = Nucleus::createBasicBlock();
2295 endBB = Nucleus::createBasicBlock();
2297 branch(cmp, trueBB, falseBB);
2305 bool operator=(bool value)
2307 Nucleus::createBr(endBB);
2308 Nucleus::setInsertBlock(falseBB);
2309 Nucleus::createBr(endBB);
2310 Nucleus::setInsertBlock(endBB);
2313 return loopOnce = value;
2318 BasicBlock *falseBB;
2326 ElseData(bool init) : loopOnce(init)
2328 elseBB = beginElse();
2329 endBB = Nucleus::getInsertBlock();
2339 bool operator=(bool value)
2341 Nucleus::createBr(endBB);
2342 Nucleus::setInsertBlock(endBB);
2344 return loopOnce = value;
2354 void Return(bool ret);
2355 void Return(const Int &ret);
2358 void Return(const Pointer<T> &ret);
2361 void Return(RValue<Pointer<T>> ret);
2363 template<unsigned int index, typename... Arguments>
2366 template<typename Arg0, typename... Arguments>
2367 struct ArgI<0, Arg0, Arguments...>
2372 template<unsigned int index, typename Arg0, typename... Arguments>
2373 struct ArgI<index, Arg0, Arguments...>
2375 typedef typename ArgI<index - 1, Arguments...>::Type Type;
2378 // Generic template, leave undefined!
2379 template<typename FunctionType>
2382 // Specialized for function types
2383 template<typename Return, typename... Arguments>
2384 class Function<Return(Arguments...)>
2389 virtual ~Function();
2392 Argument<typename ArgI<index, Arguments...>::Type> Arg() const
2394 Value *arg = Nucleus::getArgument(index);
2395 return Argument<typename ArgI<index, Arguments...>::Type>(arg);
2398 Routine *operator()(const wchar_t *name, ...);
2402 std::vector<Type*> arguments;
2405 template<typename Return>
2406 class Function<Return()> : public Function<Return(Void)>
2410 template<int index, typename Return, typename... Arguments>
2411 Argument<typename ArgI<index, Arguments...>::Type> Arg(Function<Return(Arguments...)> &function)
2413 return Argument<typename ArgI<index, Arguments...>::Type>(function.arg(index));
2416 RValue<Long> Ticks();
2422 LValue<T>::LValue(int arraySize)
2424 address = Nucleus::allocateStackVariable(T::getType(), arraySize);
2428 Value *LValue<T>::loadValue(unsigned int alignment) const
2430 return Nucleus::createLoad(address, T::getType(), false, alignment);
2434 Value *LValue<T>::storeValue(Value *value, unsigned int alignment) const
2436 return Nucleus::createStore(value, address, T::getType(), false, alignment);
2440 Value *LValue<T>::getAddress(Value *index) const
2442 return Nucleus::createGEP(address, T::getType(), index);
2446 Variable<T>::Variable(int arraySize) : LValue<T>(arraySize)
2451 RValue<Pointer<T>> Variable<T>::operator&()
2453 return RValue<Pointer<T>>(LValue<T>::address);
2457 Reference<T>::Reference(Value *pointer, int alignment) : alignment(alignment)
2463 RValue<T> Reference<T>::operator=(RValue<T> rhs) const
2465 Nucleus::createStore(rhs.value, address, T::getType(), false, alignment);
2471 RValue<T> Reference<T>::operator=(const Reference<T> &ref) const
2473 Value *tmp = Nucleus::createLoad(ref.address, T::getType(), false, ref.alignment);
2474 Nucleus::createStore(tmp, address, T::getType(), false, alignment);
2476 return RValue<T>(tmp);
2480 RValue<T> Reference<T>::operator+=(RValue<T> rhs) const
2482 return *this = *this + rhs;
2486 Value *Reference<T>::loadValue() const
2488 return Nucleus::createLoad(address, T::getType(), false, alignment);
2492 int Reference<T>::getAlignment() const
2498 RValue<T>::RValue(Value *rvalue)
2504 RValue<T>::RValue(const T &lvalue)
2506 value = lvalue.loadValue();
2510 RValue<T>::RValue(typename IntLiteral<T>::type i)
2512 value = Nucleus::createConstantInt(i);
2516 RValue<T>::RValue(typename FloatLiteral<T>::type f)
2518 value = Nucleus::createConstantFloat(f);
2522 RValue<T>::RValue(const Reference<T> &ref)
2524 value = ref.loadValue();
2528 Swizzle2Float4<T>::operator RValue<Float4>() const
2530 Value *vector = parent->loadValue();
2532 return Swizzle(RValue<Float4>(vector), T);
2536 SwizzleFloat4<T>::operator RValue<Float4>() const
2538 Value *vector = parent->loadValue();
2540 return Swizzle(RValue<Float4>(vector), T);
2544 SwizzleMaskFloat4<T>::operator RValue<Float4>() const
2546 Value *vector = parent->loadValue();
2548 return Swizzle(RValue<Float4>(vector), T);
2552 RValue<Float4> SwizzleMaskFloat4<T>::operator=(RValue<Float4> rhs) const
2554 return Mask(*parent, rhs, T);
2558 RValue<Float4> SwizzleMaskFloat4<T>::operator=(RValue<Float> rhs) const
2560 return Mask(*parent, Float4(rhs), T);
2564 SwizzleMask1Float4<T>::operator RValue<Float>() const // FIXME: Call a non-template function
2566 return Extract(*parent, T & 0x3);
2570 SwizzleMask1Float4<T>::operator RValue<Float4>() const
2572 Value *vector = parent->loadValue();
2574 return Swizzle(RValue<Float4>(vector), T);
2578 RValue<Float4> SwizzleMask1Float4<T>::operator=(float x) const
2580 return *parent = Insert(*parent, Float(x), T & 0x3);
2584 RValue<Float4> SwizzleMask1Float4<T>::operator=(RValue<Float4> rhs) const
2586 return Mask(*parent, Float4(rhs), T);
2590 RValue<Float4> SwizzleMask1Float4<T>::operator=(RValue<Float> rhs) const // FIXME: Call a non-template function
2592 return *parent = Insert(*parent, rhs, T & 0x3);
2596 SwizzleMask2Float4<T>::operator RValue<Float4>() const
2598 Value *vector = parent->loadValue();
2600 return Swizzle(RValue<Float4>(vector), T);
2604 RValue<Float4> SwizzleMask2Float4<T>::operator=(RValue<Float4> rhs) const
2606 return Mask(*parent, Float4(rhs), T);
2610 Float::Float(const SwizzleMask1Float4<T> &rhs)
2612 *this = rhs.operator RValue<Float>();
2616 RValue<Float> Float::operator=(const SwizzleMask1Float4<T> &rhs) const
2618 return *this = rhs.operator RValue<Float>();
2622 Float4::Float4(const SwizzleMask1Float4<T> &rhs)
2626 *this = rhs.operator RValue<Float4>();
2630 Float4::Float4(const SwizzleFloat4<T> &rhs)
2634 *this = rhs.operator RValue<Float4>();
2637 template<int X, int Y>
2638 Float4::Float4(const Swizzle2Float4<X> &x, const Swizzle2Float4<Y> &y)
2642 *this = ShuffleLowHigh(*x.parent, *y.parent, (X & 0xF) | (Y & 0xF) << 4);
2645 template<int X, int Y>
2646 Float4::Float4(const SwizzleMask2Float4<X> &x, const Swizzle2Float4<Y> &y)
2650 *this = ShuffleLowHigh(*x.parent, *y.parent, (X & 0xF) | (Y & 0xF) << 4);
2653 template<int X, int Y>
2654 Float4::Float4(const Swizzle2Float4<X> &x, const SwizzleMask2Float4<Y> &y)
2658 *this = ShuffleLowHigh(*x.parent, *y.parent, (X & 0xF) | (Y & 0xF) << 4);
2661 template<int X, int Y>
2662 Float4::Float4(const SwizzleMask2Float4<X> &x, const SwizzleMask2Float4<Y> &y)
2666 *this = ShuffleLowHigh(*x.parent, *y.parent, (X & 0xF) | (Y & 0xF) << 4);
2670 RValue<Float4> Float4::operator=(const SwizzleMask1Float4<T> &rhs)
2672 return *this = rhs.operator RValue<Float4>();
2676 RValue<Float4> Float4::operator=(const SwizzleFloat4<T> &rhs)
2678 return *this = rhs.operator RValue<Float4>();
2682 Pointer<T>::Pointer(Argument<Pointer<T>> argument) : alignment(1)
2684 LValue<Pointer<T>>::storeValue(argument.value);
2688 Pointer<T>::Pointer(const void *external) : alignment((intptr_t)external & 0x0000000F ? 1 : 16)
2690 Value *globalPointer = Nucleus::createConstantPointer(external, T::getType(), alignment);
2692 LValue<Pointer<T>>::storeValue(globalPointer);
2696 Pointer<T>::Pointer() : alignment(1)
2698 LValue<Pointer<T>>::storeValue(Nucleus::createNullPointer(T::getType()));
2702 Pointer<T>::Pointer(RValue<Pointer<T>> rhs) : alignment(1)
2704 LValue<Pointer<T>>::storeValue(rhs.value);
2708 Pointer<T>::Pointer(const Pointer<T> &rhs) : alignment(rhs.alignment)
2710 Value *value = rhs.loadValue();
2711 LValue<Pointer<T>>::storeValue(value);
2715 Pointer<T>::Pointer(const Reference<Pointer<T>> &rhs) : alignment(rhs.getAlignment())
2717 Value *value = rhs.loadValue();
2718 LValue<Pointer<T>>::storeValue(value);
2722 RValue<Pointer<T>> Pointer<T>::operator=(RValue<Pointer<T>> rhs) const
2724 LValue<Pointer<T>>::storeValue(rhs.value);
2730 RValue<Pointer<T>> Pointer<T>::operator=(const Pointer<T> &rhs) const
2732 Value *value = rhs.loadValue();
2733 LValue<Pointer<T>>::storeValue(value);
2735 return RValue<Pointer<T>>(value);
2739 RValue<Pointer<T>> Pointer<T>::operator=(const Reference<Pointer<T>> &rhs) const
2741 Value *value = rhs.loadValue();
2742 LValue<Pointer<T>>::storeValue(value);
2744 return RValue<Pointer<T>>(value);
2748 Reference<T> Pointer<T>::operator*()
2750 return Reference<T>(LValue<Pointer<T>>::loadValue(), alignment);
2754 Reference<T> Pointer<T>::operator[](int index)
2756 Value *element = Nucleus::createGEP(LValue<Pointer<T>>::loadValue(), T::getType(), Nucleus::createConstantInt(index));
2758 return Reference<T>(element, alignment);
2762 Reference<T> Pointer<T>::operator[](RValue<Int> index)
2764 Value *element = Nucleus::createGEP(LValue<Pointer<T>>::loadValue(), T::getType(), index.value);
2766 return Reference<T>(element, alignment);
2770 Type *Pointer<T>::getType()
2772 return Nucleus::getPointerType(T::getType());
2775 template<class T, int S>
2776 Array<T, S>::Array(int size) : Variable<T>(size)
2780 template<class T, int S>
2781 Reference<T> Array<T, S>::operator[](int index)
2783 Value *element = LValue<T>::getAddress(Nucleus::createConstantInt(index));
2785 return Reference<T>(element);
2788 template<class T, int S>
2789 Reference<T> Array<T, S>::operator[](RValue<Int> index)
2791 Value *element = LValue<T>::getAddress(index.value);
2793 return Reference<T>(element);
2796 // template<class T>
2797 // RValue<Array<T>> operator++(const Array<T> &val, int)
2799 // // FIXME: Requires storing the address of the array
2802 // template<class T>
2803 // const Array<T> &operator++(const Array<T> &val)
2805 // // FIXME: Requires storing the address of the array
2808 // template<class T>
2809 // RValue<Array<T>> operator--(const Array<T> &val, int)
2811 // // FIXME: Requires storing the address of the array
2814 // template<class T>
2815 // const Array<T> &operator--(const Array<T> &val)
2817 // // FIXME: Requires storing the address of the array
2821 RValue<T> IfThenElse(RValue<Bool> condition, RValue<T> ifTrue, RValue<T> ifFalse)
2823 return RValue<T>(Nucleus::createSelect(condition.value, ifTrue.value, ifFalse.value));
2827 RValue<T> IfThenElse(RValue<Bool> condition, const T &ifTrue, RValue<T> ifFalse)
2829 Value *trueValue = ifTrue.loadValue();
2831 return RValue<T>(Nucleus::createSelect(condition.value, trueValue, ifFalse.value));
2835 RValue<T> IfThenElse(RValue<Bool> condition, RValue<T> ifTrue, const T &ifFalse)
2837 Value *falseValue = ifFalse.loadValue();
2839 return RValue<T>(Nucleus::createSelect(condition.value, ifTrue.value, falseValue));
2843 RValue<T> IfThenElse(RValue<Bool> condition, const T &ifTrue, const T &ifFalse)
2845 Value *trueValue = ifTrue.loadValue();
2846 Value *falseValue = ifFalse.loadValue();
2848 return RValue<T>(Nucleus::createSelect(condition.value, trueValue, falseValue));
2852 void Return(const Pointer<T> &ret)
2854 Nucleus::createRet(Nucleus::createLoad(ret.address, Pointer<T>::getType()));
2855 Nucleus::setInsertBlock(Nucleus::createBasicBlock());
2859 void Return(RValue<Pointer<T>> ret)
2861 Nucleus::createRet(ret.value);
2862 Nucleus::setInsertBlock(Nucleus::createBasicBlock());
2865 template<typename Return, typename... Arguments>
2866 Function<Return(Arguments...)>::Function()
2868 core = new Nucleus();
2870 Type *types[] = {Arguments::getType()...};
2871 for(Type *type : types)
2873 if(type != Void::getType())
2875 arguments.push_back(type);
2879 Nucleus::createFunction(Return::getType(), arguments);
2882 template<typename Return, typename... Arguments>
2883 Function<Return(Arguments...)>::~Function()
2888 template<typename Return, typename... Arguments>
2889 Routine *Function<Return(Arguments...)>::operator()(const wchar_t *name, ...)
2891 wchar_t fullName[1024 + 1];
2894 va_start(vararg, name);
2895 vswprintf(fullName, 1024, name, vararg);
2898 return core->acquireRoutine(fullName, true);
2901 template<class T, class S>
2902 RValue<T> ReinterpretCast(RValue<S> val)
2904 return RValue<T>(Nucleus::createBitCast(val.value, T::getType()));
2907 template<class T, class S>
2908 RValue<T> ReinterpretCast(const LValue<S> &var)
2910 Value *val = var.loadValue();
2912 return RValue<T>(Nucleus::createBitCast(val, T::getType()));
2915 template<class T, class S>
2916 RValue<T> ReinterpretCast(const Reference<S> &var)
2918 return ReinterpretCast<T>(RValue<S>(var));
2922 RValue<T> As(Value *val)
2924 return RValue<T>(Nucleus::createBitCast(val, T::getType()));
2927 template<class T, class S>
2928 RValue<T> As(RValue<S> val)
2930 return ReinterpretCast<T>(val);
2933 template<class T, class S>
2934 RValue<T> As(const LValue<S> &var)
2936 return ReinterpretCast<T>(var);
2939 template<class T, class S>
2940 RValue<T> As(const Reference<S> &val)
2942 return ReinterpretCast<T>(val);
2945 #define For(init, cond, inc) \
2946 for(ForData for__ = true; for__; for__ = false) \
2947 for(init; for__.setup() && for__.test(cond); inc, for__.end())
2949 #define While(cond) For((void)0, cond, (void)0)
2953 BasicBlock *body__ = Nucleus::createBasicBlock(); \
2954 Nucleus::createBr(body__); \
2955 Nucleus::setInsertBlock(body__);
2957 #define Until(cond) \
2958 BasicBlock *end__ = Nucleus::createBasicBlock(); \
2959 Nucleus::createCondBr((cond).value, end__, body__); \
2960 Nucleus::setInsertBlock(end__); \
2964 for(IfData if__ = cond; if__; if__ = false)
2967 for(ElseData else__ = true; else__; else__ = false)
2970 #endif // sw_Reactor_hpp