John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1 | // SwiftShader Software Renderer
|
| 2 | //
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 3 | // Copyright(c) 2005-2012 TransGaming Inc.
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 4 | //
|
| 5 | // All rights reserved. No part of this software may be copied, distributed, transmitted,
|
| 6 | // transcribed, stored in a retrieval system, translated into any human or computer
|
| 7 | // language by any means, or disclosed to third parties without the explicit written
|
| 8 | // agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express
|
| 9 | // or implied, including but not limited to any patent rights, are granted to you.
|
| 10 | //
|
| 11 |
|
| 12 | #ifndef sw_Nucleus_hpp
|
| 13 | #define sw_Nucleus_hpp
|
| 14 |
|
| 15 | #include "Common/Types.hpp"
|
| 16 |
|
| 17 | #include <stdarg.h>
|
| 18 | #include <vector>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 19 | #include <stdio.h>
|
| 20 | #include <wchar.h>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 21 |
|
| 22 | #undef abs
|
| 23 | #undef max
|
| 24 | #undef min
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 25 | #undef Bool
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 26 |
|
| 27 | namespace llvm
|
| 28 | {
|
| 29 | class Function;
|
| 30 | class Module;
|
| 31 | class BasicBlock;
|
| 32 | class Value;
|
| 33 | class Constant;
|
| 34 | class ConstantInt;
|
| 35 | class ConstantFP;
|
| 36 | class Type;
|
| 37 | class Argument;
|
| 38 | class GlobalVariable;
|
| 39 | class GlobalValue;
|
| 40 | class ExecutionEngine;
|
| 41 | class LLVMContext;
|
| 42 | }
|
| 43 |
|
| 44 | namespace sw
|
| 45 | {
|
| 46 | enum Optimization
|
| 47 | {
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 48 | Disabled = 0,
|
| 49 | InstructionCombining = 1,
|
| 50 | CFGSimplification = 2,
|
| 51 | LICM = 3,
|
| 52 | AggressiveDCE = 4,
|
| 53 | GVN = 5,
|
| 54 | Reassociate = 6,
|
| 55 | DeadStoreElimination = 7,
|
| 56 | SCCP = 8,
|
| 57 | ScalarReplAggregates = 9,
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 58 |
|
| 59 | OptimizationCount
|
| 60 | };
|
| 61 |
|
| 62 | extern Optimization optimization[10];
|
| 63 |
|
Nicolas Capens | d946e0a | 2014-06-26 11:31:08 -0400 | [diff] [blame^] | 64 | class Routine;
|
Nicolas Capens | 2fb4110 | 2014-06-26 10:11:50 -0400 | [diff] [blame] | 65 | class RoutineManager;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 66 | class Builder;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 67 |
|
| 68 | class Nucleus
|
| 69 | {
|
| 70 | public:
|
| 71 | Nucleus();
|
| 72 |
|
| 73 | virtual ~Nucleus();
|
| 74 |
|
| 75 | Routine *acquireRoutine(const wchar_t *name, bool runOptimizations = true);
|
| 76 |
|
| 77 | static void setFunction(llvm::Function *function);
|
| 78 |
|
| 79 | static llvm::Module *getModule();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 80 | static llvm::Function *getFunction();
|
| 81 | static llvm::LLVMContext *getContext();
|
| 82 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 83 | static llvm::Value *allocateStackVariable(llvm::Type *type, int arraySize = 0);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 84 | static llvm::BasicBlock *createBasicBlock();
|
| 85 | static llvm::BasicBlock *getInsertBlock();
|
| 86 | static void setInsertBlock(llvm::BasicBlock *basicBlock);
|
| 87 | static llvm::BasicBlock *getPredecessor(llvm::BasicBlock *basicBlock);
|
| 88 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 89 | static llvm::Function *createFunction(llvm::Type *ReturnType, std::vector<llvm::Type*> &Params);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 90 | static llvm::Argument *getArgument(llvm::Function *function, unsigned int index);
|
| 91 |
|
| 92 | // Terminators
|
| 93 | static llvm::Value *createRetVoid();
|
| 94 | static llvm::Value *createRet(llvm::Value *V);
|
| 95 | static llvm::Value *createBr(llvm::BasicBlock *dest);
|
| 96 | static llvm::Value *createCondBr(llvm::Value *cond, llvm::BasicBlock *ifTrue, llvm::BasicBlock *ifFalse);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 97 |
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 98 | // Binary operators
|
| 99 | static llvm::Value *createAdd(llvm::Value *lhs, llvm::Value *rhs);
|
| 100 | static llvm::Value *createSub(llvm::Value *lhs, llvm::Value *rhs);
|
| 101 | static llvm::Value *createMul(llvm::Value *lhs, llvm::Value *rhs);
|
| 102 | static llvm::Value *createUDiv(llvm::Value *lhs, llvm::Value *rhs);
|
| 103 | static llvm::Value *createSDiv(llvm::Value *lhs, llvm::Value *rhs);
|
| 104 | static llvm::Value *createFAdd(llvm::Value *lhs, llvm::Value *rhs);
|
| 105 | static llvm::Value *createFSub(llvm::Value *lhs, llvm::Value *rhs);
|
| 106 | static llvm::Value *createFMul(llvm::Value *lhs, llvm::Value *rhs);
|
| 107 | static llvm::Value *createFDiv(llvm::Value *lhs, llvm::Value *rhs);
|
| 108 | static llvm::Value *createURem(llvm::Value *lhs, llvm::Value *rhs);
|
| 109 | static llvm::Value *createSRem(llvm::Value *lhs, llvm::Value *rhs);
|
| 110 | static llvm::Value *createFRem(llvm::Value *lhs, llvm::Value *rhs);
|
| 111 | static llvm::Value *createShl(llvm::Value *lhs, llvm::Value *rhs);
|
| 112 | static llvm::Value *createLShr(llvm::Value *lhs, llvm::Value *rhs);
|
| 113 | static llvm::Value *createAShr(llvm::Value *lhs, llvm::Value *rhs);
|
| 114 | static llvm::Value *createAnd(llvm::Value *lhs, llvm::Value *rhs);
|
| 115 | static llvm::Value *createOr(llvm::Value *lhs, llvm::Value *rhs);
|
| 116 | static llvm::Value *createXor(llvm::Value *lhs, llvm::Value *rhs);
|
| 117 | static llvm::Value *createNeg(llvm::Value *V);
|
| 118 | static llvm::Value *createFNeg(llvm::Value *V);
|
| 119 | static llvm::Value *createNot(llvm::Value *V);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 120 |
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 121 | // Memory instructions
|
| 122 | static llvm::Value *createLoad(llvm::Value *ptr, bool isVolatile = false, unsigned int align = 0);
|
| 123 | static llvm::Value *createStore(llvm::Value *value, llvm::Value *ptr, bool isVolatile = false, unsigned int align = 0);
|
| 124 | static llvm::Value *createGEP(llvm::Value *ptr, llvm::Value *index);
|
| 125 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 126 | // Atomic instructions
|
| 127 | static llvm::Value *createAtomicAdd(llvm::Value *ptr, llvm::Value *value);
|
| 128 |
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 129 | // Cast/Conversion Operators
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 130 | static llvm::Value *createTrunc(llvm::Value *V, llvm::Type *destType);
|
| 131 | static llvm::Value *createZExt(llvm::Value *V, llvm::Type *destType);
|
| 132 | static llvm::Value *createSExt(llvm::Value *V, llvm::Type *destType);
|
| 133 | static llvm::Value *createFPToUI(llvm::Value *V, llvm::Type *destType);
|
| 134 | static llvm::Value *createFPToSI(llvm::Value *V, llvm::Type *destType);
|
| 135 | static llvm::Value *createUIToFP(llvm::Value *V, llvm::Type *destType);
|
| 136 | static llvm::Value *createSIToFP(llvm::Value *V, llvm::Type *destType);
|
| 137 | static llvm::Value *createFPTrunc(llvm::Value *V, llvm::Type *destType);
|
| 138 | static llvm::Value *createFPExt(llvm::Value *V, llvm::Type *destType);
|
| 139 | static llvm::Value *createPtrToInt(llvm::Value *V, llvm::Type *destType);
|
| 140 | static llvm::Value *createIntToPtr(llvm::Value *V, llvm::Type *destType);
|
| 141 | static llvm::Value *createBitCast(llvm::Value *V, llvm::Type *destType);
|
| 142 | static llvm::Value *createIntCast(llvm::Value *V, llvm::Type *destType, bool isSigned);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 143 |
|
| 144 | // Compare instructions
|
| 145 | static llvm::Value *createICmpEQ(llvm::Value *lhs, llvm::Value *rhs);
|
| 146 | static llvm::Value *createICmpNE(llvm::Value *lhs, llvm::Value *rhs);
|
| 147 | static llvm::Value *createICmpUGT(llvm::Value *lhs, llvm::Value *rhs);
|
| 148 | static llvm::Value *createICmpUGE(llvm::Value *lhs, llvm::Value *rhs);
|
| 149 | static llvm::Value *createICmpULT(llvm::Value *lhs, llvm::Value *rhs);
|
| 150 | static llvm::Value *createICmpULE(llvm::Value *lhs, llvm::Value *rhs);
|
| 151 | static llvm::Value *createICmpSGT(llvm::Value *lhs, llvm::Value *rhs);
|
| 152 | static llvm::Value *createICmpSGE(llvm::Value *lhs, llvm::Value *rhs);
|
| 153 | static llvm::Value *createICmpSLT(llvm::Value *lhs, llvm::Value *rhs);
|
| 154 | static llvm::Value *createICmpSLE(llvm::Value *lhs, llvm::Value *rhs);
|
| 155 | static llvm::Value *createFCmpOEQ(llvm::Value *lhs, llvm::Value *rhs);
|
| 156 | static llvm::Value *createFCmpOGT(llvm::Value *lhs, llvm::Value *rhs);
|
| 157 | static llvm::Value *createFCmpOGE(llvm::Value *lhs, llvm::Value *rhs);
|
| 158 | static llvm::Value *createFCmpOLT(llvm::Value *lhs, llvm::Value *rhs);
|
| 159 | static llvm::Value *createFCmpOLE(llvm::Value *lhs, llvm::Value *rhs);
|
| 160 | static llvm::Value *createFCmpONE(llvm::Value *lhs, llvm::Value *rhs);
|
| 161 | static llvm::Value *createFCmpORD(llvm::Value *lhs, llvm::Value *rhs);
|
| 162 | static llvm::Value *createFCmpUNO(llvm::Value *lhs, llvm::Value *rhs);
|
| 163 | static llvm::Value *createFCmpUEQ(llvm::Value *lhs, llvm::Value *rhs);
|
| 164 | static llvm::Value *createFCmpUGT(llvm::Value *lhs, llvm::Value *rhs);
|
| 165 | static llvm::Value *createFCmpUGE(llvm::Value *lhs, llvm::Value *rhs);
|
| 166 | static llvm::Value *createFCmpULT(llvm::Value *lhs, llvm::Value *rhs);
|
| 167 | static llvm::Value *createFCmpULE(llvm::Value *lhs, llvm::Value *rhs);
|
| 168 | static llvm::Value *createFCmpUNE(llvm::Value *lhs, llvm::Value *rhs);
|
| 169 |
|
| 170 | // Call instructions
|
| 171 | static llvm::Value *createCall(llvm::Value *callee);
|
| 172 | static llvm::Value *createCall(llvm::Value *callee, llvm::Value *Arg);
|
| 173 | static llvm::Value *createCall(llvm::Value *callee, llvm::Value *Arg1, llvm::Value *Arg2);
|
| 174 | static llvm::Value *createCall(llvm::Value *callee, llvm::Value *Arg1, llvm::Value *Arg2, llvm::Value *Arg3);
|
| 175 | static llvm::Value *createCall(llvm::Value *callee, llvm::Value *Arg1, llvm::Value *Arg2, llvm::Value *Arg3,llvm::Value *Arg4);
|
| 176 |
|
| 177 | // Vector instructions
|
| 178 | static llvm::Value *createExtractElement(llvm::Value *vector, int index);
|
| 179 | static llvm::Value *createInsertElement(llvm::Value *vector, llvm::Value *element, int index);
|
| 180 | static llvm::Value *createShuffleVector(llvm::Value *V1, llvm::Value *V2, llvm::Value *mask);
|
| 181 |
|
| 182 | // Other instructions
|
| 183 | static llvm::Value *createSelect(llvm::Value *C, llvm::Value *ifTrue, llvm::Value *ifFalse);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 184 | static llvm::Value *createSwitch(llvm::Value *V, llvm::BasicBlock *Dest, unsigned NumCases);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 185 | static void addSwitchCase(llvm::Value *Switch, int Case, llvm::BasicBlock *Branch);
|
| 186 | static llvm::Value *createUnreachable();
|
| 187 |
|
| 188 | // Derived instructions
|
| 189 | static llvm::Value *createSwizzle(llvm::Value *val, unsigned char select);
|
| 190 | static llvm::Value *createMask(llvm::Value *lhs, llvm::Value *rhs, unsigned char select);
|
| 191 |
|
| 192 | // Global values
|
| 193 | static const llvm::GlobalValue *getGlobalValueAtAddress(void *Addr);
|
| 194 | static void addGlobalMapping(const llvm::GlobalValue *GV, void *Addr);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 195 | static llvm::GlobalValue *createGlobalValue(llvm::Type *Ty, bool isConstant, unsigned int Align);
|
| 196 | static llvm::Type *getPointerType(llvm::Type *ElementType);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 197 |
|
| 198 | // Constant values
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 199 | static llvm::Constant *createNullValue(llvm::Type *Ty);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 200 | static llvm::ConstantInt *createConstantInt(int64_t i);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 201 | static llvm::ConstantInt *createConstantInt(int i);
|
| 202 | static llvm::ConstantInt *createConstantInt(unsigned int i);
|
| 203 | static llvm::ConstantInt *createConstantBool(bool b);
|
| 204 | static llvm::ConstantInt *createConstantByte(signed char i);
|
| 205 | static llvm::ConstantInt *createConstantByte(unsigned char i);
|
| 206 | static llvm::ConstantInt *createConstantShort(short i);
|
| 207 | static llvm::ConstantInt *createConstantShort(unsigned short i);
|
| 208 | static llvm::Constant *createConstantFloat(float x);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 209 | static llvm::Value *createNullPointer(llvm::Type *Ty);
|
| 210 | static llvm::Value *createConstantVector(llvm::Constant *const *Vals, unsigned NumVals);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 211 |
|
| 212 | private:
|
| 213 | void optimize();
|
| 214 |
|
| 215 | static llvm::ExecutionEngine *executionEngine;
|
| 216 | static Builder *builder;
|
| 217 | static llvm::Function *function;
|
| 218 | static llvm::LLVMContext *context;
|
| 219 | static llvm::Module *module;
|
Nicolas Capens | 2fb4110 | 2014-06-26 10:11:50 -0400 | [diff] [blame] | 220 | static RoutineManager *routineManager;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 221 | };
|
| 222 |
|
| 223 | class Byte;
|
| 224 | class SByte;
|
| 225 | class Byte4;
|
| 226 | class SByte4;
|
| 227 | class Byte8;
|
| 228 | class SByte8;
|
| 229 | class Byte16;
|
| 230 | class SByte16;
|
| 231 | class Short;
|
| 232 | class UShort;
|
| 233 | class Short4;
|
| 234 | class UShort4;
|
| 235 | class Short8;
|
| 236 | class UShort8;
|
| 237 | class Int;
|
| 238 | class UInt;
|
| 239 | class Int2;
|
| 240 | class UInt2;
|
| 241 | class Int4;
|
| 242 | class UInt4;
|
| 243 | class Long;
|
| 244 | class Long1;
|
| 245 | class Long2;
|
| 246 | class Float;
|
| 247 | class Float2;
|
| 248 | class Float4;
|
| 249 |
|
| 250 | class Void
|
| 251 | {
|
| 252 | public:
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 253 | static llvm::Type *getType();
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 254 |
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 255 | static bool isVoid()
|
| 256 | {
|
| 257 | return true;
|
| 258 | }
|
| 259 |
|
| 260 | typedef void ctype;
|
| 261 | };
|
| 262 |
|
| 263 | template<class T>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 264 | class RValue;
|
| 265 |
|
| 266 | template<class T>
|
| 267 | class Pointer;
|
| 268 |
|
| 269 | class LValue
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 270 | {
|
| 271 | public:
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 272 | LValue(llvm::Type *type, int arraySize = 0);
|
| 273 |
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 274 | static bool isVoid()
|
| 275 | {
|
| 276 | return false;
|
| 277 | }
|
| 278 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 279 | llvm::Value *loadValue(unsigned int alignment = 0) const;
|
| 280 | llvm::Value *storeValue(llvm::Value *value, unsigned int alignment = 0) const;
|
| 281 | llvm::Value *getAddress(llvm::Value *index) const;
|
| 282 |
|
| 283 | private:
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 284 | llvm::Value *address;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 285 | };
|
| 286 |
|
| 287 | template<class T>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 288 | class Variable : public LValue
|
| 289 | {
|
| 290 | public:
|
| 291 | Variable(int arraySize = 0);
|
| 292 |
|
| 293 | RValue<Pointer<T> > operator&();
|
| 294 | };
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 295 |
|
| 296 | template<class T>
|
| 297 | class Reference
|
| 298 | {
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 299 | public:
|
| 300 | explicit Reference(llvm::Value *pointer, int alignment = 1);
|
| 301 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 302 | RValue<T> operator=(RValue<T> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 303 | RValue<T> operator=(const Reference<T> &ref) const;
|
| 304 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 305 | RValue<T> operator+=(RValue<T> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 306 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 307 | llvm::Value *loadValue() const;
|
| 308 | int getAlignment() const;
|
| 309 |
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 310 | private:
|
| 311 | llvm::Value *address;
|
| 312 |
|
| 313 | const int alignment;
|
| 314 | };
|
| 315 |
|
| 316 | template<class T>
|
| 317 | struct IntLiteral
|
| 318 | {
|
| 319 | struct type;
|
| 320 | };
|
| 321 |
|
| 322 | template<> struct
|
| 323 | IntLiteral<Int>
|
| 324 | {
|
| 325 | typedef int type;
|
| 326 | };
|
| 327 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 328 | template<> struct
|
| 329 | IntLiteral<UInt>
|
| 330 | {
|
| 331 | typedef unsigned int type;
|
| 332 | };
|
| 333 |
|
| 334 | template<> struct
|
| 335 | IntLiteral<Long>
|
| 336 | {
|
| 337 | typedef int64_t type;
|
| 338 | };
|
| 339 |
|
| 340 | template<class T>
|
| 341 | struct FloatLiteral
|
| 342 | {
|
| 343 | struct type;
|
| 344 | };
|
| 345 |
|
| 346 | template<> struct
|
| 347 | FloatLiteral<Float>
|
| 348 | {
|
| 349 | typedef float type;
|
| 350 | };
|
| 351 |
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 352 | template<class T>
|
| 353 | class RValue
|
| 354 | {
|
| 355 | public:
|
| 356 | explicit RValue(llvm::Value *rvalue);
|
| 357 |
|
| 358 | RValue(const T &lvalue);
|
| 359 | RValue(typename IntLiteral<T>::type i);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 360 | RValue(typename FloatLiteral<T>::type f);
|
| 361 | RValue(const Reference<T> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 362 |
|
| 363 | llvm::Value *value; // FIXME: Make private
|
| 364 | };
|
| 365 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 366 | class MMX : public Variable<MMX>
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 367 | {
|
| 368 | public:
|
| 369 | static llvm::Type *getType();
|
| 370 | };
|
| 371 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 372 | class Bool : public Variable<Bool>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 373 | {
|
| 374 | public:
|
| 375 | explicit Bool(llvm::Argument *argument);
|
| 376 |
|
| 377 | Bool();
|
| 378 | Bool(bool x);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 379 | Bool(RValue<Bool> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 380 | Bool(const Bool &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 381 | Bool(const Reference<Bool> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 382 |
|
| 383 | // RValue<Bool> operator=(bool rhs) const; // FIXME: Implement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 384 | RValue<Bool> operator=(RValue<Bool> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 385 | RValue<Bool> operator=(const Bool &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 386 | RValue<Bool> operator=(const Reference<Bool> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 387 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 388 | friend RValue<Bool> operator!(RValue<Bool> val);
|
| 389 | friend RValue<Bool> operator&&(RValue<Bool> lhs, RValue<Bool> rhs);
|
| 390 | friend RValue<Bool> operator||(RValue<Bool> lhs, RValue<Bool> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 391 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 392 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 393 | };
|
| 394 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 395 | class Byte : public Variable<Byte>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 396 | {
|
| 397 | public:
|
| 398 | explicit Byte(llvm::Argument *argument);
|
| 399 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 400 | explicit Byte(RValue<Int> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 401 |
|
| 402 | Byte();
|
| 403 | Byte(int x);
|
| 404 | Byte(unsigned char x);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 405 | Byte(RValue<Byte> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 406 | Byte(const Byte &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 407 | Byte(const Reference<Byte> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 408 |
|
| 409 | // RValue<Byte> operator=(unsigned char rhs) const; // FIXME: Implement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 410 | RValue<Byte> operator=(RValue<Byte> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 411 | RValue<Byte> operator=(const Byte &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 412 | RValue<Byte> operator=(const Reference<Byte> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 413 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 414 | friend RValue<Byte> operator+(RValue<Byte> lhs, RValue<Byte> rhs);
|
| 415 | friend RValue<Byte> operator-(RValue<Byte> lhs, RValue<Byte> rhs);
|
| 416 | friend RValue<Byte> operator*(RValue<Byte> lhs, RValue<Byte> rhs);
|
| 417 | friend RValue<Byte> operator/(RValue<Byte> lhs, RValue<Byte> rhs);
|
| 418 | friend RValue<Byte> operator%(RValue<Byte> lhs, RValue<Byte> rhs);
|
| 419 | friend RValue<Byte> operator&(RValue<Byte> lhs, RValue<Byte> rhs);
|
| 420 | friend RValue<Byte> operator|(RValue<Byte> lhs, RValue<Byte> rhs);
|
| 421 | friend RValue<Byte> operator^(RValue<Byte> lhs, RValue<Byte> rhs);
|
| 422 | friend RValue<Byte> operator<<(RValue<Byte> lhs, RValue<Byte> rhs);
|
| 423 | friend RValue<Byte> operator>>(RValue<Byte> lhs, RValue<Byte> rhs);
|
| 424 | friend RValue<Byte> operator+=(const Byte &lhs, RValue<Byte> rhs);
|
| 425 | friend RValue<Byte> operator-=(const Byte &lhs, RValue<Byte> rhs);
|
| 426 | friend RValue<Byte> operator*=(const Byte &lhs, RValue<Byte> rhs);
|
| 427 | friend RValue<Byte> operator/=(const Byte &lhs, RValue<Byte> rhs);
|
| 428 | friend RValue<Byte> operator%=(const Byte &lhs, RValue<Byte> rhs);
|
| 429 | friend RValue<Byte> operator&=(const Byte &lhs, RValue<Byte> rhs);
|
| 430 | friend RValue<Byte> operator|=(const Byte &lhs, RValue<Byte> rhs);
|
| 431 | friend RValue<Byte> operator^=(const Byte &lhs, RValue<Byte> rhs);
|
| 432 | friend RValue<Byte> operator<<=(const Byte &lhs, RValue<Byte> rhs);
|
| 433 | friend RValue<Byte> operator>>=(const Byte &lhs, RValue<Byte> rhs);
|
| 434 | friend RValue<Byte> operator+(RValue<Byte> val);
|
| 435 | friend RValue<Byte> operator-(RValue<Byte> val);
|
| 436 | friend RValue<Byte> operator~(RValue<Byte> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 437 | friend RValue<Byte> operator++(const Byte &val, int); // Post-increment
|
| 438 | friend const Byte &operator++(const Byte &val); // Pre-increment
|
| 439 | friend RValue<Byte> operator--(const Byte &val, int); // Post-decrement
|
| 440 | friend const Byte &operator--(const Byte &val); // Pre-decrement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 441 | friend RValue<Bool> operator<(RValue<Byte> lhs, RValue<Byte> rhs);
|
| 442 | friend RValue<Bool> operator<=(RValue<Byte> lhs, RValue<Byte> rhs);
|
| 443 | friend RValue<Bool> operator>(RValue<Byte> lhs, RValue<Byte> rhs);
|
| 444 | friend RValue<Bool> operator>=(RValue<Byte> lhs, RValue<Byte> rhs);
|
| 445 | friend RValue<Bool> operator!=(RValue<Byte> lhs, RValue<Byte> rhs);
|
| 446 | friend RValue<Bool> operator==(RValue<Byte> lhs, RValue<Byte> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 447 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 448 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 449 | };
|
| 450 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 451 | class SByte : public Variable<SByte>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 452 | {
|
| 453 | public:
|
| 454 | explicit SByte(llvm::Argument *argument);
|
| 455 |
|
| 456 | SByte();
|
| 457 | SByte(signed char x);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 458 | SByte(RValue<SByte> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 459 | SByte(const SByte &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 460 | SByte(const Reference<SByte> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 461 |
|
| 462 | // RValue<SByte> operator=(signed char rhs) const; // FIXME: Implement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 463 | RValue<SByte> operator=(RValue<SByte> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 464 | RValue<SByte> operator=(const SByte &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 465 | RValue<SByte> operator=(const Reference<SByte> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 466 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 467 | friend RValue<SByte> operator+(RValue<SByte> lhs, RValue<SByte> rhs);
|
| 468 | friend RValue<SByte> operator-(RValue<SByte> lhs, RValue<SByte> rhs);
|
| 469 | friend RValue<SByte> operator*(RValue<SByte> lhs, RValue<SByte> rhs);
|
| 470 | friend RValue<SByte> operator/(RValue<SByte> lhs, RValue<SByte> rhs);
|
| 471 | friend RValue<SByte> operator%(RValue<SByte> lhs, RValue<SByte> rhs);
|
| 472 | friend RValue<SByte> operator&(RValue<SByte> lhs, RValue<SByte> rhs);
|
| 473 | friend RValue<SByte> operator|(RValue<SByte> lhs, RValue<SByte> rhs);
|
| 474 | friend RValue<SByte> operator^(RValue<SByte> lhs, RValue<SByte> rhs);
|
| 475 | friend RValue<SByte> operator<<(RValue<SByte> lhs, RValue<SByte> rhs);
|
| 476 | friend RValue<SByte> operator>>(RValue<SByte> lhs, RValue<SByte> rhs);
|
| 477 | friend RValue<SByte> operator+=(const SByte &lhs, RValue<SByte> rhs);
|
| 478 | friend RValue<SByte> operator-=(const SByte &lhs, RValue<SByte> rhs);
|
| 479 | friend RValue<SByte> operator*=(const SByte &lhs, RValue<SByte> rhs);
|
| 480 | friend RValue<SByte> operator/=(const SByte &lhs, RValue<SByte> rhs);
|
| 481 | friend RValue<SByte> operator%=(const SByte &lhs, RValue<SByte> rhs);
|
| 482 | friend RValue<SByte> operator&=(const SByte &lhs, RValue<SByte> rhs);
|
| 483 | friend RValue<SByte> operator|=(const SByte &lhs, RValue<SByte> rhs);
|
| 484 | friend RValue<SByte> operator^=(const SByte &lhs, RValue<SByte> rhs);
|
| 485 | friend RValue<SByte> operator<<=(const SByte &lhs, RValue<SByte> rhs);
|
| 486 | friend RValue<SByte> operator>>=(const SByte &lhs, RValue<SByte> rhs);
|
| 487 | friend RValue<SByte> operator+(RValue<SByte> val);
|
| 488 | friend RValue<SByte> operator-(RValue<SByte> val);
|
| 489 | friend RValue<SByte> operator~(RValue<SByte> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 490 | friend RValue<SByte> operator++(const SByte &val, int); // Post-increment
|
| 491 | friend const SByte &operator++(const SByte &val); // Pre-increment
|
| 492 | friend RValue<SByte> operator--(const SByte &val, int); // Post-decrement
|
| 493 | friend const SByte &operator--(const SByte &val); // Pre-decrement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 494 | friend RValue<Bool> operator<(RValue<SByte> lhs, RValue<SByte> rhs);
|
| 495 | friend RValue<Bool> operator<=(RValue<SByte> lhs, RValue<SByte> rhs);
|
| 496 | friend RValue<Bool> operator>(RValue<SByte> lhs, RValue<SByte> rhs);
|
| 497 | friend RValue<Bool> operator>=(RValue<SByte> lhs, RValue<SByte> rhs);
|
| 498 | friend RValue<Bool> operator!=(RValue<SByte> lhs, RValue<SByte> rhs);
|
| 499 | friend RValue<Bool> operator==(RValue<SByte> lhs, RValue<SByte> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 500 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 501 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 502 | };
|
| 503 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 504 | class Short : public Variable<Short>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 505 | {
|
| 506 | public:
|
| 507 | explicit Short(llvm::Argument *argument);
|
| 508 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 509 | explicit Short(RValue<Int> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 510 |
|
| 511 | Short();
|
| 512 | Short(short x);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 513 | Short(RValue<Short> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 514 | Short(const Short &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 515 | Short(const Reference<Short> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 516 |
|
| 517 | // RValue<Short> operator=(short rhs) const; // FIXME: Implement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 518 | RValue<Short> operator=(RValue<Short> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 519 | RValue<Short> operator=(const Short &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 520 | RValue<Short> operator=(const Reference<Short> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 521 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 522 | friend RValue<Short> operator+(RValue<Short> lhs, RValue<Short> rhs);
|
| 523 | friend RValue<Short> operator-(RValue<Short> lhs, RValue<Short> rhs);
|
| 524 | friend RValue<Short> operator*(RValue<Short> lhs, RValue<Short> rhs);
|
| 525 | friend RValue<Short> operator/(RValue<Short> lhs, RValue<Short> rhs);
|
| 526 | friend RValue<Short> operator%(RValue<Short> lhs, RValue<Short> rhs);
|
| 527 | friend RValue<Short> operator&(RValue<Short> lhs, RValue<Short> rhs);
|
| 528 | friend RValue<Short> operator|(RValue<Short> lhs, RValue<Short> rhs);
|
| 529 | friend RValue<Short> operator^(RValue<Short> lhs, RValue<Short> rhs);
|
| 530 | friend RValue<Short> operator<<(RValue<Short> lhs, RValue<Short> rhs);
|
| 531 | friend RValue<Short> operator>>(RValue<Short> lhs, RValue<Short> rhs);
|
| 532 | friend RValue<Short> operator+=(const Short &lhs, RValue<Short> rhs);
|
| 533 | friend RValue<Short> operator-=(const Short &lhs, RValue<Short> rhs);
|
| 534 | friend RValue<Short> operator*=(const Short &lhs, RValue<Short> rhs);
|
| 535 | friend RValue<Short> operator/=(const Short &lhs, RValue<Short> rhs);
|
| 536 | friend RValue<Short> operator%=(const Short &lhs, RValue<Short> rhs);
|
| 537 | friend RValue<Short> operator&=(const Short &lhs, RValue<Short> rhs);
|
| 538 | friend RValue<Short> operator|=(const Short &lhs, RValue<Short> rhs);
|
| 539 | friend RValue<Short> operator^=(const Short &lhs, RValue<Short> rhs);
|
| 540 | friend RValue<Short> operator<<=(const Short &lhs, RValue<Short> rhs);
|
| 541 | friend RValue<Short> operator>>=(const Short &lhs, RValue<Short> rhs);
|
| 542 | friend RValue<Short> operator+(RValue<Short> val);
|
| 543 | friend RValue<Short> operator-(RValue<Short> val);
|
| 544 | friend RValue<Short> operator~(RValue<Short> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 545 | friend RValue<Short> operator++(const Short &val, int); // Post-increment
|
| 546 | friend const Short &operator++(const Short &val); // Pre-increment
|
| 547 | friend RValue<Short> operator--(const Short &val, int); // Post-decrement
|
| 548 | friend const Short &operator--(const Short &val); // Pre-decrement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 549 | friend RValue<Bool> operator<(RValue<Short> lhs, RValue<Short> rhs);
|
| 550 | friend RValue<Bool> operator<=(RValue<Short> lhs, RValue<Short> rhs);
|
| 551 | friend RValue<Bool> operator>(RValue<Short> lhs, RValue<Short> rhs);
|
| 552 | friend RValue<Bool> operator>=(RValue<Short> lhs, RValue<Short> rhs);
|
| 553 | friend RValue<Bool> operator!=(RValue<Short> lhs, RValue<Short> rhs);
|
| 554 | friend RValue<Bool> operator==(RValue<Short> lhs, RValue<Short> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 555 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 556 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 557 | };
|
| 558 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 559 | class UShort : public Variable<UShort>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 560 | {
|
| 561 | public:
|
| 562 | explicit UShort(llvm::Argument *argument);
|
| 563 |
|
| 564 | UShort();
|
| 565 | UShort(unsigned short x);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 566 | UShort(RValue<UShort> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 567 | UShort(const UShort &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 568 | UShort(const Reference<UShort> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 569 |
|
| 570 | // RValue<UShort> operator=(unsigned short rhs) const; // FIXME: Implement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 571 | RValue<UShort> operator=(RValue<UShort> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 572 | RValue<UShort> operator=(const UShort &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 573 | RValue<UShort> operator=(const Reference<UShort> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 574 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 575 | friend RValue<UShort> operator+(RValue<UShort> lhs, RValue<UShort> rhs);
|
| 576 | friend RValue<UShort> operator-(RValue<UShort> lhs, RValue<UShort> rhs);
|
| 577 | friend RValue<UShort> operator*(RValue<UShort> lhs, RValue<UShort> rhs);
|
| 578 | friend RValue<UShort> operator/(RValue<UShort> lhs, RValue<UShort> rhs);
|
| 579 | friend RValue<UShort> operator%(RValue<UShort> lhs, RValue<UShort> rhs);
|
| 580 | friend RValue<UShort> operator&(RValue<UShort> lhs, RValue<UShort> rhs);
|
| 581 | friend RValue<UShort> operator|(RValue<UShort> lhs, RValue<UShort> rhs);
|
| 582 | friend RValue<UShort> operator^(RValue<UShort> lhs, RValue<UShort> rhs);
|
| 583 | friend RValue<UShort> operator<<(RValue<UShort> lhs, RValue<UShort> rhs);
|
| 584 | friend RValue<UShort> operator>>(RValue<UShort> lhs, RValue<UShort> rhs);
|
| 585 | friend RValue<UShort> operator+=(const UShort &lhs, RValue<UShort> rhs);
|
| 586 | friend RValue<UShort> operator-=(const UShort &lhs, RValue<UShort> rhs);
|
| 587 | friend RValue<UShort> operator*=(const UShort &lhs, RValue<UShort> rhs);
|
| 588 | friend RValue<UShort> operator/=(const UShort &lhs, RValue<UShort> rhs);
|
| 589 | friend RValue<UShort> operator%=(const UShort &lhs, RValue<UShort> rhs);
|
| 590 | friend RValue<UShort> operator&=(const UShort &lhs, RValue<UShort> rhs);
|
| 591 | friend RValue<UShort> operator|=(const UShort &lhs, RValue<UShort> rhs);
|
| 592 | friend RValue<UShort> operator^=(const UShort &lhs, RValue<UShort> rhs);
|
| 593 | friend RValue<UShort> operator<<=(const UShort &lhs, RValue<UShort> rhs);
|
| 594 | friend RValue<UShort> operator>>=(const UShort &lhs, RValue<UShort> rhs);
|
| 595 | friend RValue<UShort> operator+(RValue<UShort> val);
|
| 596 | friend RValue<UShort> operator-(RValue<UShort> val);
|
| 597 | friend RValue<UShort> operator~(RValue<UShort> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 598 | friend RValue<UShort> operator++(const UShort &val, int); // Post-increment
|
| 599 | friend const UShort &operator++(const UShort &val); // Pre-increment
|
| 600 | friend RValue<UShort> operator--(const UShort &val, int); // Post-decrement
|
| 601 | friend const UShort &operator--(const UShort &val); // Pre-decrement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 602 | friend RValue<Bool> operator<(RValue<UShort> lhs, RValue<UShort> rhs);
|
| 603 | friend RValue<Bool> operator<=(RValue<UShort> lhs, RValue<UShort> rhs);
|
| 604 | friend RValue<Bool> operator>(RValue<UShort> lhs, RValue<UShort> rhs);
|
| 605 | friend RValue<Bool> operator>=(RValue<UShort> lhs, RValue<UShort> rhs);
|
| 606 | friend RValue<Bool> operator!=(RValue<UShort> lhs, RValue<UShort> rhs);
|
| 607 | friend RValue<Bool> operator==(RValue<UShort> lhs, RValue<UShort> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 608 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 609 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 610 | };
|
| 611 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 612 | class Byte4 : public Variable<Byte4>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 613 | {
|
| 614 | public:
|
| 615 | // Byte4();
|
| 616 | // Byte4(int x, int y, int z, int w);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 617 | // Byte4(RValue<Byte4> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 618 | // Byte4(const Byte4 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 619 | // Byte4(const Reference<Byte4> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 620 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 621 | // RValue<Byte4> operator=(RValue<Byte4> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 622 | // RValue<Byte4> operator=(const Byte4 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 623 | // RValue<Byte4> operator=(const Reference<Byte4> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 624 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 625 | // friend RValue<Byte4> operator+(RValue<Byte4> lhs, RValue<Byte4> rhs);
|
| 626 | // friend RValue<Byte4> operator-(RValue<Byte4> lhs, RValue<Byte4> rhs);
|
| 627 | // friend RValue<Byte4> operator*(RValue<Byte4> lhs, RValue<Byte4> rhs);
|
| 628 | // friend RValue<Byte4> operator/(RValue<Byte4> lhs, RValue<Byte4> rhs);
|
| 629 | // friend RValue<Byte4> operator%(RValue<Byte4> lhs, RValue<Byte4> rhs);
|
| 630 | // friend RValue<Byte4> operator&(RValue<Byte4> lhs, RValue<Byte4> rhs);
|
| 631 | // friend RValue<Byte4> operator|(RValue<Byte4> lhs, RValue<Byte4> rhs);
|
| 632 | // friend RValue<Byte4> operator^(RValue<Byte4> lhs, RValue<Byte4> rhs);
|
| 633 | // friend RValue<Byte4> operator<<(RValue<Byte4> lhs, RValue<Byte4> rhs);
|
| 634 | // friend RValue<Byte4> operator>>(RValue<Byte4> lhs, RValue<Byte4> rhs);
|
| 635 | // friend RValue<Byte4> operator+=(const Byte4 &lhs, RValue<Byte4> rhs);
|
| 636 | // friend RValue<Byte4> operator-=(const Byte4 &lhs, RValue<Byte4> rhs);
|
| 637 | // friend RValue<Byte4> operator*=(const Byte4 &lhs, RValue<Byte4> rhs);
|
| 638 | // friend RValue<Byte4> operator/=(const Byte4 &lhs, RValue<Byte4> rhs);
|
| 639 | // friend RValue<Byte4> operator%=(const Byte4 &lhs, RValue<Byte4> rhs);
|
| 640 | // friend RValue<Byte4> operator&=(const Byte4 &lhs, RValue<Byte4> rhs);
|
| 641 | // friend RValue<Byte4> operator|=(const Byte4 &lhs, RValue<Byte4> rhs);
|
| 642 | // friend RValue<Byte4> operator^=(const Byte4 &lhs, RValue<Byte4> rhs);
|
| 643 | // friend RValue<Byte4> operator<<=(const Byte4 &lhs, RValue<Byte4> rhs);
|
| 644 | // friend RValue<Byte4> operator>>=(const Byte4 &lhs, RValue<Byte4> rhs);
|
| 645 | // friend RValue<Byte4> operator+(RValue<Byte4> val);
|
| 646 | // friend RValue<Byte4> operator-(RValue<Byte4> val);
|
| 647 | // friend RValue<Byte4> operator~(RValue<Byte4> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 648 | // friend RValue<Byte4> operator++(const Byte4 &val, int); // Post-increment
|
| 649 | // friend const Byte4 &operator++(const Byte4 &val); // Pre-increment
|
| 650 | // friend RValue<Byte4> operator--(const Byte4 &val, int); // Post-decrement
|
| 651 | // friend const Byte4 &operator--(const Byte4 &val); // Pre-decrement
|
| 652 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 653 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 654 | };
|
| 655 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 656 | class SByte4 : public Variable<SByte4>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 657 | {
|
| 658 | public:
|
| 659 | // SByte4();
|
| 660 | // SByte4(int x, int y, int z, int w);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 661 | // SByte4(RValue<SByte4> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 662 | // SByte4(const SByte4 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 663 | // SByte4(const Reference<SByte4> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 664 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 665 | // RValue<SByte4> operator=(RValue<SByte4> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 666 | // RValue<SByte4> operator=(const SByte4 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 667 | // RValue<SByte4> operator=(const Reference<SByte4> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 668 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 669 | // friend RValue<SByte4> operator+(RValue<SByte4> lhs, RValue<SByte4> rhs);
|
| 670 | // friend RValue<SByte4> operator-(RValue<SByte4> lhs, RValue<SByte4> rhs);
|
| 671 | // friend RValue<SByte4> operator*(RValue<SByte4> lhs, RValue<SByte4> rhs);
|
| 672 | // friend RValue<SByte4> operator/(RValue<SByte4> lhs, RValue<SByte4> rhs);
|
| 673 | // friend RValue<SByte4> operator%(RValue<SByte4> lhs, RValue<SByte4> rhs);
|
| 674 | // friend RValue<SByte4> operator&(RValue<SByte4> lhs, RValue<SByte4> rhs);
|
| 675 | // friend RValue<SByte4> operator|(RValue<SByte4> lhs, RValue<SByte4> rhs);
|
| 676 | // friend RValue<SByte4> operator^(RValue<SByte4> lhs, RValue<SByte4> rhs);
|
| 677 | // friend RValue<SByte4> operator<<(RValue<SByte4> lhs, RValue<SByte4> rhs);
|
| 678 | // friend RValue<SByte4> operator>>(RValue<SByte4> lhs, RValue<SByte4> rhs);
|
| 679 | // friend RValue<SByte4> operator+=(const SByte4 &lhs, RValue<SByte4> rhs);
|
| 680 | // friend RValue<SByte4> operator-=(const SByte4 &lhs, RValue<SByte4> rhs);
|
| 681 | // friend RValue<SByte4> operator*=(const SByte4 &lhs, RValue<SByte4> rhs);
|
| 682 | // friend RValue<SByte4> operator/=(const SByte4 &lhs, RValue<SByte4> rhs);
|
| 683 | // friend RValue<SByte4> operator%=(const SByte4 &lhs, RValue<SByte4> rhs);
|
| 684 | // friend RValue<SByte4> operator&=(const SByte4 &lhs, RValue<SByte4> rhs);
|
| 685 | // friend RValue<SByte4> operator|=(const SByte4 &lhs, RValue<SByte4> rhs);
|
| 686 | // friend RValue<SByte4> operator^=(const SByte4 &lhs, RValue<SByte4> rhs);
|
| 687 | // friend RValue<SByte4> operator<<=(const SByte4 &lhs, RValue<SByte4> rhs);
|
| 688 | // friend RValue<SByte4> operator>>=(const SByte4 &lhs, RValue<SByte4> rhs);
|
| 689 | // friend RValue<SByte4> operator+(RValue<SByte4> val);
|
| 690 | // friend RValue<SByte4> operator-(RValue<SByte4> val);
|
| 691 | // friend RValue<SByte4> operator~(RValue<SByte4> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 692 | // friend RValue<SByte4> operator++(const SByte4 &val, int); // Post-increment
|
| 693 | // friend const SByte4 &operator++(const SByte4 &val); // Pre-increment
|
| 694 | // friend RValue<SByte4> operator--(const SByte4 &val, int); // Post-decrement
|
| 695 | // friend const SByte4 &operator--(const SByte4 &val); // Pre-decrement
|
| 696 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 697 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 698 | };
|
| 699 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 700 | class Byte8 : public Variable<Byte8>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 701 | {
|
| 702 | public:
|
| 703 | Byte8();
|
| 704 | Byte8(byte x0, byte x1, byte x2, byte x3, byte x4, byte x5, byte x6, byte x7);
|
| 705 | Byte8(int64_t x);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 706 | Byte8(RValue<Byte8> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 707 | Byte8(const Byte8 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 708 | Byte8(const Reference<Byte8> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 709 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 710 | RValue<Byte8> operator=(RValue<Byte8> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 711 | RValue<Byte8> operator=(const Byte8 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 712 | RValue<Byte8> operator=(const Reference<Byte8> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 713 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 714 | friend RValue<Byte8> operator+(RValue<Byte8> lhs, RValue<Byte8> rhs);
|
| 715 | friend RValue<Byte8> operator-(RValue<Byte8> lhs, RValue<Byte8> rhs);
|
| 716 | // friend RValue<Byte8> operator*(RValue<Byte8> lhs, RValue<Byte8> rhs);
|
| 717 | // friend RValue<Byte8> operator/(RValue<Byte8> lhs, RValue<Byte8> rhs);
|
| 718 | // friend RValue<Byte8> operator%(RValue<Byte8> lhs, RValue<Byte8> rhs);
|
| 719 | friend RValue<Byte8> operator&(RValue<Byte8> lhs, RValue<Byte8> rhs);
|
| 720 | friend RValue<Byte8> operator|(RValue<Byte8> lhs, RValue<Byte8> rhs);
|
| 721 | friend RValue<Byte8> operator^(RValue<Byte8> lhs, RValue<Byte8> rhs);
|
| 722 | // friend RValue<Byte8> operator<<(RValue<Byte8> lhs, RValue<Byte8> rhs);
|
| 723 | // friend RValue<Byte8> operator>>(RValue<Byte8> lhs, RValue<Byte8> rhs);
|
| 724 | friend RValue<Byte8> operator+=(const Byte8 &lhs, RValue<Byte8> rhs);
|
| 725 | friend RValue<Byte8> operator-=(const Byte8 &lhs, RValue<Byte8> rhs);
|
| 726 | // friend RValue<Byte8> operator*=(const Byte8 &lhs, RValue<Byte8> rhs);
|
| 727 | // friend RValue<Byte8> operator/=(const Byte8 &lhs, RValue<Byte8> rhs);
|
| 728 | // friend RValue<Byte8> operator%=(const Byte8 &lhs, RValue<Byte8> rhs);
|
| 729 | friend RValue<Byte8> operator&=(const Byte8 &lhs, RValue<Byte8> rhs);
|
| 730 | friend RValue<Byte8> operator|=(const Byte8 &lhs, RValue<Byte8> rhs);
|
| 731 | friend RValue<Byte8> operator^=(const Byte8 &lhs, RValue<Byte8> rhs);
|
| 732 | // friend RValue<Byte8> operator<<=(const Byte8 &lhs, RValue<Byte8> rhs);
|
| 733 | // friend RValue<Byte8> operator>>=(const Byte8 &lhs, RValue<Byte8> rhs);
|
| 734 | // friend RValue<Byte8> operator+(RValue<Byte8> val);
|
| 735 | // friend RValue<Byte8> operator-(RValue<Byte8> val);
|
| 736 | friend RValue<Byte8> operator~(RValue<Byte8> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 737 | // friend RValue<Byte8> operator++(const Byte8 &val, int); // Post-increment
|
| 738 | // friend const Byte8 &operator++(const Byte8 &val); // Pre-increment
|
| 739 | // friend RValue<Byte8> operator--(const Byte8 &val, int); // Post-decrement
|
| 740 | // friend const Byte8 &operator--(const Byte8 &val); // Pre-decrement
|
| 741 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 742 | friend RValue<Byte8> AddSat(RValue<Byte8> x, RValue<Byte8> y);
|
| 743 | friend RValue<Byte8> SubSat(RValue<Byte8> x, RValue<Byte8> y);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 744 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 745 | friend RValue<Short4> Unpack(RValue<Byte4> x);
|
| 746 | friend RValue<Short4> UnpackLow(RValue<Byte8> x, RValue<Byte8> y);
|
| 747 | friend RValue<Short4> UnpackHigh(RValue<Byte8> x, RValue<Byte8> y);
|
| 748 | friend RValue<Int> SignMask(RValue<Byte8> x);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 749 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 750 | // friend RValue<Byte8> CmpGT(RValue<Byte8> x, RValue<Byte8> y);
|
| 751 | friend RValue<Byte8> CmpEQ(RValue<Byte8> x, RValue<Byte8> y);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 752 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 753 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 754 | };
|
| 755 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 756 | class SByte8 : public Variable<SByte8>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 757 | {
|
| 758 | public:
|
| 759 | SByte8();
|
| 760 | SByte8(byte x0, byte x1, byte x2, byte x3, byte x4, byte x5, byte x6, byte x7);
|
| 761 | SByte8(int64_t x);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 762 | SByte8(RValue<SByte8> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 763 | SByte8(const SByte8 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 764 | SByte8(const Reference<SByte8> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 765 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 766 | RValue<SByte8> operator=(RValue<SByte8> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 767 | RValue<SByte8> operator=(const SByte8 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 768 | RValue<SByte8> operator=(const Reference<SByte8> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 769 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 770 | friend RValue<SByte8> operator+(RValue<SByte8> lhs, RValue<SByte8> rhs);
|
| 771 | friend RValue<SByte8> operator-(RValue<SByte8> lhs, RValue<SByte8> rhs);
|
| 772 | // friend RValue<SByte8> operator*(RValue<SByte8> lhs, RValue<SByte8> rhs);
|
| 773 | // friend RValue<SByte8> operator/(RValue<SByte8> lhs, RValue<SByte8> rhs);
|
| 774 | // friend RValue<SByte8> operator%(RValue<SByte8> lhs, RValue<SByte8> rhs);
|
| 775 | friend RValue<SByte8> operator&(RValue<SByte8> lhs, RValue<SByte8> rhs);
|
| 776 | friend RValue<SByte8> operator|(RValue<SByte8> lhs, RValue<SByte8> rhs);
|
| 777 | friend RValue<SByte8> operator^(RValue<SByte8> lhs, RValue<SByte8> rhs);
|
| 778 | // friend RValue<SByte8> operator<<(RValue<SByte8> lhs, RValue<SByte8> rhs);
|
| 779 | // friend RValue<SByte8> operator>>(RValue<SByte8> lhs, RValue<SByte8> rhs);
|
| 780 | friend RValue<SByte8> operator+=(const SByte8 &lhs, RValue<SByte8> rhs);
|
| 781 | friend RValue<SByte8> operator-=(const SByte8 &lhs, RValue<SByte8> rhs);
|
| 782 | // friend RValue<SByte8> operator*=(const SByte8 &lhs, RValue<SByte8> rhs);
|
| 783 | // friend RValue<SByte8> operator/=(const SByte8 &lhs, RValue<SByte8> rhs);
|
| 784 | // friend RValue<SByte8> operator%=(const SByte8 &lhs, RValue<SByte8> rhs);
|
| 785 | friend RValue<SByte8> operator&=(const SByte8 &lhs, RValue<SByte8> rhs);
|
| 786 | friend RValue<SByte8> operator|=(const SByte8 &lhs, RValue<SByte8> rhs);
|
| 787 | friend RValue<SByte8> operator^=(const SByte8 &lhs, RValue<SByte8> rhs);
|
| 788 | // friend RValue<SByte8> operator<<=(const SByte8 &lhs, RValue<SByte8> rhs);
|
| 789 | // friend RValue<SByte8> operator>>=(const SByte8 &lhs, RValue<SByte8> rhs);
|
| 790 | // friend RValue<SByte8> operator+(RValue<SByte8> val);
|
| 791 | // friend RValue<SByte8> operator-(RValue<SByte8> val);
|
| 792 | friend RValue<SByte8> operator~(RValue<SByte8> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 793 | // friend RValue<SByte8> operator++(const SByte8 &val, int); // Post-increment
|
| 794 | // friend const SByte8 &operator++(const SByte8 &val); // Pre-increment
|
| 795 | // friend RValue<SByte8> operator--(const SByte8 &val, int); // Post-decrement
|
| 796 | // friend const SByte8 &operator--(const SByte8 &val); // Pre-decrement
|
| 797 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 798 | friend RValue<SByte8> AddSat(RValue<SByte8> x, RValue<SByte8> y);
|
| 799 | friend RValue<SByte8> SubSat(RValue<SByte8> x, RValue<SByte8> y);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 800 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 801 | friend RValue<Short4> UnpackLow(RValue<SByte8> x, RValue<SByte8> y);
|
| 802 | friend RValue<Short4> UnpackHigh(RValue<SByte8> x, RValue<SByte8> y);
|
| 803 | friend RValue<Int> SignMask(RValue<SByte8> x);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 804 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 805 | friend RValue<Byte8> CmpGT(RValue<SByte8> x, RValue<SByte8> y);
|
| 806 | friend RValue<Byte8> CmpEQ(RValue<SByte8> x, RValue<SByte8> y);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 807 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 808 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 809 | };
|
| 810 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 811 | class Byte16 : public Variable<Byte16>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 812 | {
|
| 813 | public:
|
| 814 | // Byte16();
|
| 815 | // Byte16(int x, int y, int z, int w);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 816 | Byte16(RValue<Byte16> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 817 | Byte16(const Byte16 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 818 | Byte16(const Reference<Byte16> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 819 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 820 | RValue<Byte16> operator=(RValue<Byte16> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 821 | RValue<Byte16> operator=(const Byte16 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 822 | RValue<Byte16> operator=(const Reference<Byte16> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 823 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 824 | // friend RValue<Byte16> operator+(RValue<Byte16> lhs, RValue<Byte16> rhs);
|
| 825 | // friend RValue<Byte16> operator-(RValue<Byte16> lhs, RValue<Byte16> rhs);
|
| 826 | // friend RValue<Byte16> operator*(RValue<Byte16> lhs, RValue<Byte16> rhs);
|
| 827 | // friend RValue<Byte16> operator/(RValue<Byte16> lhs, RValue<Byte16> rhs);
|
| 828 | // friend RValue<Byte16> operator%(RValue<Byte16> lhs, RValue<Byte16> rhs);
|
| 829 | // friend RValue<Byte16> operator&(RValue<Byte16> lhs, RValue<Byte16> rhs);
|
| 830 | // friend RValue<Byte16> operator|(RValue<Byte16> lhs, RValue<Byte16> rhs);
|
| 831 | // friend RValue<Byte16> operator^(RValue<Byte16> lhs, RValue<Byte16> rhs);
|
| 832 | // friend RValue<Byte16> operator<<(RValue<Byte16> lhs, RValue<Byte16> rhs);
|
| 833 | // friend RValue<Byte16> operator>>(RValue<Byte16> lhs, RValue<Byte16> rhs);
|
| 834 | // friend RValue<Byte16> operator+=(const Byte16 &lhs, RValue<Byte16> rhs);
|
| 835 | // friend RValue<Byte16> operator-=(const Byte16 &lhs, RValue<Byte16> rhs);
|
| 836 | // friend RValue<Byte16> operator*=(const Byte16 &lhs, RValue<Byte16> rhs);
|
| 837 | // friend RValue<Byte16> operator/=(const Byte16 &lhs, RValue<Byte16> rhs);
|
| 838 | // friend RValue<Byte16> operator%=(const Byte16 &lhs, RValue<Byte16> rhs);
|
| 839 | // friend RValue<Byte16> operator&=(const Byte16 &lhs, RValue<Byte16> rhs);
|
| 840 | // friend RValue<Byte16> operator|=(const Byte16 &lhs, RValue<Byte16> rhs);
|
| 841 | // friend RValue<Byte16> operator^=(const Byte16 &lhs, RValue<Byte16> rhs);
|
| 842 | // friend RValue<Byte16> operator<<=(const Byte16 &lhs, RValue<Byte16> rhs);
|
| 843 | // friend RValue<Byte16> operator>>=(const Byte16 &lhs, RValue<Byte16> rhs);
|
| 844 | // friend RValue<Byte16> operator+(RValue<Byte16> val);
|
| 845 | // friend RValue<Byte16> operator-(RValue<Byte16> val);
|
| 846 | // friend RValue<Byte16> operator~(RValue<Byte16> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 847 | // friend RValue<Byte16> operator++(const Byte16 &val, int); // Post-increment
|
| 848 | // friend const Byte16 &operator++(const Byte16 &val); // Pre-increment
|
| 849 | // friend RValue<Byte16> operator--(const Byte16 &val, int); // Post-decrement
|
| 850 | // friend const Byte16 &operator--(const Byte16 &val); // Pre-decrement
|
| 851 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 852 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 853 | };
|
| 854 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 855 | class SByte16 : public Variable<SByte16>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 856 | {
|
| 857 | public:
|
| 858 | // SByte16();
|
| 859 | // SByte16(int x, int y, int z, int w);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 860 | // SByte16(RValue<SByte16> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 861 | // SByte16(const SByte16 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 862 | // SByte16(const Reference<SByte16> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 863 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 864 | // RValue<SByte16> operator=(RValue<SByte16> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 865 | // RValue<SByte16> operator=(const SByte16 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 866 | // RValue<SByte16> operator=(const Reference<SByte16> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 867 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 868 | // friend RValue<SByte16> operator+(RValue<SByte16> lhs, RValue<SByte16> rhs);
|
| 869 | // friend RValue<SByte16> operator-(RValue<SByte16> lhs, RValue<SByte16> rhs);
|
| 870 | // friend RValue<SByte16> operator*(RValue<SByte16> lhs, RValue<SByte16> rhs);
|
| 871 | // friend RValue<SByte16> operator/(RValue<SByte16> lhs, RValue<SByte16> rhs);
|
| 872 | // friend RValue<SByte16> operator%(RValue<SByte16> lhs, RValue<SByte16> rhs);
|
| 873 | // friend RValue<SByte16> operator&(RValue<SByte16> lhs, RValue<SByte16> rhs);
|
| 874 | // friend RValue<SByte16> operator|(RValue<SByte16> lhs, RValue<SByte16> rhs);
|
| 875 | // friend RValue<SByte16> operator^(RValue<SByte16> lhs, RValue<SByte16> rhs);
|
| 876 | // friend RValue<SByte16> operator<<(RValue<SByte16> lhs, RValue<SByte16> rhs);
|
| 877 | // friend RValue<SByte16> operator>>(RValue<SByte16> lhs, RValue<SByte16> rhs);
|
| 878 | // friend RValue<SByte16> operator+=(const SByte16 &lhs, RValue<SByte16> rhs);
|
| 879 | // friend RValue<SByte16> operator-=(const SByte16 &lhs, RValue<SByte16> rhs);
|
| 880 | // friend RValue<SByte16> operator*=(const SByte16 &lhs, RValue<SByte16> rhs);
|
| 881 | // friend RValue<SByte16> operator/=(const SByte16 &lhs, RValue<SByte16> rhs);
|
| 882 | // friend RValue<SByte16> operator%=(const SByte16 &lhs, RValue<SByte16> rhs);
|
| 883 | // friend RValue<SByte16> operator&=(const SByte16 &lhs, RValue<SByte16> rhs);
|
| 884 | // friend RValue<SByte16> operator|=(const SByte16 &lhs, RValue<SByte16> rhs);
|
| 885 | // friend RValue<SByte16> operator^=(const SByte16 &lhs, RValue<SByte16> rhs);
|
| 886 | // friend RValue<SByte16> operator<<=(const SByte16 &lhs, RValue<SByte16> rhs);
|
| 887 | // friend RValue<SByte16> operator>>=(const SByte16 &lhs, RValue<SByte16> rhs);
|
| 888 | // friend RValue<SByte16> operator+(RValue<SByte16> val);
|
| 889 | // friend RValue<SByte16> operator-(RValue<SByte16> val);
|
| 890 | // friend RValue<SByte16> operator~(RValue<SByte16> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 891 | // friend RValue<SByte16> operator++(const SByte16 &val, int); // Post-increment
|
| 892 | // friend const SByte16 &operator++(const SByte16 &val); // Pre-increment
|
| 893 | // friend RValue<SByte16> operator--(const SByte16 &val, int); // Post-decrement
|
| 894 | // friend const SByte16 &operator--(const SByte16 &val); // Pre-decrement
|
| 895 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 896 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 897 | };
|
| 898 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 899 | class Short4 : public Variable<Short4>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 900 | {
|
| 901 | public:
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 902 | explicit Short4(RValue<Int> cast);
|
| 903 | explicit Short4(RValue<Int4> cast);
|
| 904 | // explicit Short4(RValue<Float> cast);
|
| 905 | explicit Short4(RValue<Float4> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 906 |
|
| 907 | Short4();
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 908 | Short4(short xyzw);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 909 | Short4(short x, short y, short z, short w);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 910 | Short4(RValue<Short4> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 911 | Short4(const Short4 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 912 | Short4(const Reference<Short4> &rhs);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 913 | Short4(RValue<UShort4> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 914 | Short4(const UShort4 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 915 | Short4(const Reference<UShort4> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 916 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 917 | RValue<Short4> operator=(RValue<Short4> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 918 | RValue<Short4> operator=(const Short4 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 919 | RValue<Short4> operator=(const Reference<Short4> &rhs) const;
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 920 | RValue<Short4> operator=(RValue<UShort4> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 921 | RValue<Short4> operator=(const UShort4 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 922 | RValue<Short4> operator=(const Reference<UShort4> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 923 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 924 | friend RValue<Short4> operator+(RValue<Short4> lhs, RValue<Short4> rhs);
|
| 925 | friend RValue<Short4> operator-(RValue<Short4> lhs, RValue<Short4> rhs);
|
| 926 | friend RValue<Short4> operator*(RValue<Short4> lhs, RValue<Short4> rhs);
|
| 927 | // friend RValue<Short4> operator/(RValue<Short4> lhs, RValue<Short4> rhs);
|
| 928 | // friend RValue<Short4> operator%(RValue<Short4> lhs, RValue<Short4> rhs);
|
| 929 | friend RValue<Short4> operator&(RValue<Short4> lhs, RValue<Short4> rhs);
|
| 930 | friend RValue<Short4> operator|(RValue<Short4> lhs, RValue<Short4> rhs);
|
| 931 | friend RValue<Short4> operator^(RValue<Short4> lhs, RValue<Short4> rhs);
|
| 932 | friend RValue<Short4> operator<<(RValue<Short4> lhs, unsigned char rhs);
|
| 933 | friend RValue<Short4> operator>>(RValue<Short4> lhs, unsigned char rhs);
|
| 934 | friend RValue<Short4> operator<<(RValue<Short4> lhs, RValue<Long1> rhs);
|
| 935 | friend RValue<Short4> operator>>(RValue<Short4> lhs, RValue<Long1> rhs);
|
| 936 | friend RValue<Short4> operator+=(const Short4 &lhs, RValue<Short4> rhs);
|
| 937 | friend RValue<Short4> operator-=(const Short4 &lhs, RValue<Short4> rhs);
|
| 938 | friend RValue<Short4> operator*=(const Short4 &lhs, RValue<Short4> rhs);
|
| 939 | // friend RValue<Short4> operator/=(const Short4 &lhs, RValue<Short4> rhs);
|
| 940 | // friend RValue<Short4> operator%=(const Short4 &lhs, RValue<Short4> rhs);
|
| 941 | friend RValue<Short4> operator&=(const Short4 &lhs, RValue<Short4> rhs);
|
| 942 | friend RValue<Short4> operator|=(const Short4 &lhs, RValue<Short4> rhs);
|
| 943 | friend RValue<Short4> operator^=(const Short4 &lhs, RValue<Short4> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 944 | friend RValue<Short4> operator<<=(const Short4 &lhs, unsigned char rhs);
|
| 945 | friend RValue<Short4> operator>>=(const Short4 &lhs, unsigned char rhs);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 946 | friend RValue<Short4> operator<<=(const Short4 &lhs, RValue<Long1> rhs);
|
| 947 | friend RValue<Short4> operator>>=(const Short4 &lhs, RValue<Long1> rhs);
|
| 948 | // friend RValue<Short4> operator+(RValue<Short4> val);
|
| 949 | friend RValue<Short4> operator-(RValue<Short4> val);
|
| 950 | friend RValue<Short4> operator~(RValue<Short4> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 951 | // friend RValue<Short4> operator++(const Short4 &val, int); // Post-increment
|
| 952 | // friend const Short4 &operator++(const Short4 &val); // Pre-increment
|
| 953 | // friend RValue<Short4> operator--(const Short4 &val, int); // Post-decrement
|
| 954 | // friend const Short4 &operator--(const Short4 &val); // Pre-decrement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 955 | // friend RValue<Bool> operator<(RValue<Short4> lhs, RValue<Short4> rhs);
|
| 956 | // friend RValue<Bool> operator<=(RValue<Short4> lhs, RValue<Short4> rhs);
|
| 957 | // friend RValue<Bool> operator>(RValue<Short4> lhs, RValue<Short4> rhs);
|
| 958 | // friend RValue<Bool> operator>=(RValue<Short4> lhs, RValue<Short4> rhs);
|
| 959 | // friend RValue<Bool> operator!=(RValue<Short4> lhs, RValue<Short4> rhs);
|
| 960 | // friend RValue<Bool> operator==(RValue<Short4> lhs, RValue<Short4> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 961 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 962 | friend RValue<Short4> RoundShort4(RValue<Float4> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 963 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 964 | friend RValue<Short4> Max(RValue<Short4> x, RValue<Short4> y);
|
| 965 | friend RValue<Short4> Min(RValue<Short4> x, RValue<Short4> y);
|
| 966 | friend RValue<Short4> AddSat(RValue<Short4> x, RValue<Short4> y);
|
| 967 | friend RValue<Short4> SubSat(RValue<Short4> x, RValue<Short4> y);
|
| 968 | friend RValue<Short4> MulHigh(RValue<Short4> x, RValue<Short4> y);
|
| 969 | friend RValue<Int2> MulAdd(RValue<Short4> x, RValue<Short4> y);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 970 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 971 | friend RValue<SByte8> Pack(RValue<Short4> x, RValue<Short4> y);
|
| 972 | friend RValue<Int2> UnpackLow(RValue<Short4> x, RValue<Short4> y);
|
| 973 | friend RValue<Int2> UnpackHigh(RValue<Short4> x, RValue<Short4> y);
|
| 974 | friend RValue<Short4> Swizzle(RValue<Short4> x, unsigned char select);
|
| 975 | friend RValue<Short4> Insert(RValue<Short4> val, RValue<Short> element, int i);
|
| 976 | friend RValue<Short> Extract(RValue<Short4> val, int i);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 977 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 978 | friend RValue<Short4> CmpGT(RValue<Short4> x, RValue<Short4> y);
|
| 979 | friend RValue<Short4> CmpEQ(RValue<Short4> x, RValue<Short4> y);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 980 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 981 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 982 | };
|
| 983 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 984 | class UShort4 : public Variable<UShort4>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 985 | {
|
| 986 | public:
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 987 | explicit UShort4(RValue<Int4> cast);
|
| 988 | explicit UShort4(RValue<Float4> cast, bool saturate = false);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 989 |
|
| 990 | UShort4();
|
| 991 | UShort4(unsigned short x, unsigned short y, unsigned short z, unsigned short w);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 992 | UShort4(RValue<UShort4> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 993 | UShort4(const UShort4 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 994 | UShort4(const Reference<UShort4> &rhs);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 995 | UShort4(RValue<Short4> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 996 | UShort4(const Short4 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 997 | UShort4(const Reference<Short4> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 998 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 999 | RValue<UShort4> operator=(RValue<UShort4> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1000 | RValue<UShort4> operator=(const UShort4 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1001 | RValue<UShort4> operator=(const Reference<UShort4> &rhs) const;
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1002 | RValue<UShort4> operator=(RValue<Short4> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1003 | RValue<UShort4> operator=(const Short4 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1004 | RValue<UShort4> operator=(const Reference<Short4> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1005 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1006 | friend RValue<UShort4> operator+(RValue<UShort4> lhs, RValue<UShort4> rhs);
|
| 1007 | friend RValue<UShort4> operator-(RValue<UShort4> lhs, RValue<UShort4> rhs);
|
| 1008 | friend RValue<UShort4> operator*(RValue<UShort4> lhs, RValue<UShort4> rhs);
|
| 1009 | // friend RValue<UShort4> operator/(RValue<UShort4> lhs, RValue<UShort4> rhs);
|
| 1010 | // friend RValue<UShort4> operator%(RValue<UShort4> lhs, RValue<UShort4> rhs);
|
| 1011 | // friend RValue<UShort4> operator&(RValue<UShort4> lhs, RValue<UShort4> rhs);
|
| 1012 | // friend RValue<UShort4> operator|(RValue<UShort4> lhs, RValue<UShort4> rhs);
|
| 1013 | // friend RValue<UShort4> operator^(RValue<UShort4> lhs, RValue<UShort4> rhs);
|
| 1014 | friend RValue<UShort4> operator<<(RValue<UShort4> lhs, unsigned char rhs);
|
| 1015 | friend RValue<UShort4> operator>>(RValue<UShort4> lhs, unsigned char rhs);
|
| 1016 | friend RValue<UShort4> operator<<(RValue<UShort4> lhs, RValue<Long1> rhs);
|
| 1017 | friend RValue<UShort4> operator>>(RValue<UShort4> lhs, RValue<Long1> rhs);
|
| 1018 | // friend RValue<UShort4> operator+=(const UShort4 &lhs, RValue<UShort4> rhs);
|
| 1019 | // friend RValue<UShort4> operator-=(const UShort4 &lhs, RValue<UShort4> rhs);
|
| 1020 | // friend RValue<UShort4> operator*=(const UShort4 &lhs, RValue<UShort4> rhs);
|
| 1021 | // friend RValue<UShort4> operator/=(const UShort4 &lhs, RValue<UShort4> rhs);
|
| 1022 | // friend RValue<UShort4> operator%=(const UShort4 &lhs, RValue<UShort4> rhs);
|
| 1023 | // friend RValue<UShort4> operator&=(const UShort4 &lhs, RValue<UShort4> rhs);
|
| 1024 | // friend RValue<UShort4> operator|=(const UShort4 &lhs, RValue<UShort4> rhs);
|
| 1025 | // friend RValue<UShort4> operator^=(const UShort4 &lhs, RValue<UShort4> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1026 | friend RValue<UShort4> operator<<=(const UShort4 &lhs, unsigned char rhs);
|
| 1027 | friend RValue<UShort4> operator>>=(const UShort4 &lhs, unsigned char rhs);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1028 | friend RValue<UShort4> operator<<=(const UShort4 &lhs, RValue<Long1> rhs);
|
| 1029 | friend RValue<UShort4> operator>>=(const UShort4 &lhs, RValue<Long1> rhs);
|
| 1030 | // friend RValue<UShort4> operator+(RValue<UShort4> val);
|
| 1031 | // friend RValue<UShort4> operator-(RValue<UShort4> val);
|
| 1032 | friend RValue<UShort4> operator~(RValue<UShort4> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1033 | // friend RValue<UShort4> operator++(const UShort4 &val, int); // Post-increment
|
| 1034 | // friend const UShort4 &operator++(const UShort4 &val); // Pre-increment
|
| 1035 | // friend RValue<UShort4> operator--(const UShort4 &val, int); // Post-decrement
|
| 1036 | // friend const UShort4 &operator--(const UShort4 &val); // Pre-decrement
|
| 1037 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1038 | friend RValue<UShort4> Max(RValue<UShort4> x, RValue<UShort4> y);
|
| 1039 | friend RValue<UShort4> Min(RValue<UShort4> x, RValue<UShort4> y);
|
| 1040 | friend RValue<UShort4> AddSat(RValue<UShort4> x, RValue<UShort4> y);
|
| 1041 | friend RValue<UShort4> SubSat(RValue<UShort4> x, RValue<UShort4> y);
|
| 1042 | friend RValue<UShort4> MulHigh(RValue<UShort4> x, RValue<UShort4> y);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1043 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1044 | friend RValue<UShort4> Average(RValue<UShort4> x, RValue<UShort4> y);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1045 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1046 | friend RValue<Byte8> Pack(RValue<UShort4> x, RValue<UShort4> y);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1047 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1048 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1049 | };
|
| 1050 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1051 | class Short8 : public Variable<Short8>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1052 | {
|
| 1053 | public:
|
| 1054 | // Short8();
|
| 1055 | Short8(short c0, short c1, short c2, short c3, short c4, short c5, short c6, short c7);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1056 | Short8(RValue<Short8> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1057 | // Short8(const Short8 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1058 | // Short8(const Reference<Short8> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1059 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1060 | // RValue<Short8> operator=(RValue<Short8> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1061 | // RValue<Short8> operator=(const Short8 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1062 | // RValue<Short8> operator=(const Reference<Short8> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1063 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1064 | friend RValue<Short8> operator+(RValue<Short8> lhs, RValue<Short8> rhs);
|
| 1065 | // friend RValue<Short8> operator-(RValue<Short8> lhs, RValue<Short8> rhs);
|
| 1066 | // friend RValue<Short8> operator*(RValue<Short8> lhs, RValue<Short8> rhs);
|
| 1067 | // friend RValue<Short8> operator/(RValue<Short8> lhs, RValue<Short8> rhs);
|
| 1068 | // friend RValue<Short8> operator%(RValue<Short8> lhs, RValue<Short8> rhs);
|
| 1069 | friend RValue<Short8> operator&(RValue<Short8> lhs, RValue<Short8> rhs);
|
| 1070 | // friend RValue<Short8> operator|(RValue<Short8> lhs, RValue<Short8> rhs);
|
| 1071 | // friend RValue<Short8> operator^(RValue<Short8> lhs, RValue<Short8> rhs);
|
| 1072 | friend RValue<Short8> operator<<(RValue<Short8> lhs, unsigned char rhs);
|
| 1073 | friend RValue<Short8> operator>>(RValue<Short8> lhs, unsigned char rhs);
|
| 1074 | // friend RValue<Short8> operator<<(RValue<Short8> lhs, RValue<Short8> rhs);
|
| 1075 | // friend RValue<Short8> operator>>(RValue<Short8> lhs, RValue<Short8> rhs);
|
| 1076 | // friend RValue<Short8> operator+=(const Short8 &lhs, RValue<Short8> rhs);
|
| 1077 | // friend RValue<Short8> operator-=(const Short8 &lhs, RValue<Short8> rhs);
|
| 1078 | // friend RValue<Short8> operator*=(const Short8 &lhs, RValue<Short8> rhs);
|
| 1079 | // friend RValue<Short8> operator/=(const Short8 &lhs, RValue<Short8> rhs);
|
| 1080 | // friend RValue<Short8> operator%=(const Short8 &lhs, RValue<Short8> rhs);
|
| 1081 | // friend RValue<Short8> operator&=(const Short8 &lhs, RValue<Short8> rhs);
|
| 1082 | // friend RValue<Short8> operator|=(const Short8 &lhs, RValue<Short8> rhs);
|
| 1083 | // friend RValue<Short8> operator^=(const Short8 &lhs, RValue<Short8> rhs);
|
| 1084 | // friend RValue<Short8> operator<<=(const Short8 &lhs, RValue<Short8> rhs);
|
| 1085 | // friend RValue<Short8> operator>>=(const Short8 &lhs, RValue<Short8> rhs);
|
| 1086 | // friend RValue<Short8> operator+(RValue<Short8> val);
|
| 1087 | // friend RValue<Short8> operator-(RValue<Short8> val);
|
| 1088 | // friend RValue<Short8> operator~(RValue<Short8> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1089 | // friend RValue<Short8> operator++(const Short8 &val, int); // Post-increment
|
| 1090 | // friend const Short8 &operator++(const Short8 &val); // Pre-increment
|
| 1091 | // friend RValue<Short8> operator--(const Short8 &val, int); // Post-decrement
|
| 1092 | // friend const Short8 &operator--(const Short8 &val); // Pre-decrement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1093 | // friend RValue<Bool> operator<(RValue<Short8> lhs, RValue<Short8> rhs);
|
| 1094 | // friend RValue<Bool> operator<=(RValue<Short8> lhs, RValue<Short8> rhs);
|
| 1095 | // friend RValue<Bool> operator>(RValue<Short8> lhs, RValue<Short8> rhs);
|
| 1096 | // friend RValue<Bool> operator>=(RValue<Short8> lhs, RValue<Short8> rhs);
|
| 1097 | // friend RValue<Bool> operator!=(RValue<Short8> lhs, RValue<Short8> rhs);
|
| 1098 | // friend RValue<Bool> operator==(RValue<Short8> lhs, RValue<Short8> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1099 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1100 | friend RValue<Short8> Concatenate(RValue<Short4> lo, RValue<Short4> hi);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1101 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1102 | friend RValue<Short8> MulHigh(RValue<Short8> x, RValue<Short8> y);
|
| 1103 | friend RValue<Int4> MulAdd(RValue<Short8> x, RValue<Short8> y);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1104 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1105 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1106 | };
|
| 1107 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1108 | class UShort8 : public Variable<UShort8>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1109 | {
|
| 1110 | public:
|
| 1111 | // UShort8();
|
| 1112 | 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);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1113 | UShort8(RValue<UShort8> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1114 | // UShort8(const UShort8 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1115 | // UShort8(const Reference<UShort8> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1116 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1117 | RValue<UShort8> operator=(RValue<UShort8> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1118 | RValue<UShort8> operator=(const UShort8 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1119 | RValue<UShort8> operator=(const Reference<UShort8> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1120 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1121 | friend RValue<UShort8> operator+(RValue<UShort8> lhs, RValue<UShort8> rhs);
|
| 1122 | // friend RValue<UShort8> operator-(RValue<UShort8> lhs, RValue<UShort8> rhs);
|
| 1123 | friend RValue<UShort8> operator*(RValue<UShort8> lhs, RValue<UShort8> rhs);
|
| 1124 | // friend RValue<UShort8> operator/(RValue<UShort8> lhs, RValue<UShort8> rhs);
|
| 1125 | // friend RValue<UShort8> operator%(RValue<UShort8> lhs, RValue<UShort8> rhs);
|
| 1126 | friend RValue<UShort8> operator&(RValue<UShort8> lhs, RValue<UShort8> rhs);
|
| 1127 | // friend RValue<UShort8> operator|(RValue<UShort8> lhs, RValue<UShort8> rhs);
|
| 1128 | // friend RValue<UShort8> operator^(RValue<UShort8> lhs, RValue<UShort8> rhs);
|
| 1129 | friend RValue<UShort8> operator<<(RValue<UShort8> lhs, unsigned char rhs);
|
| 1130 | friend RValue<UShort8> operator>>(RValue<UShort8> lhs, unsigned char rhs);
|
| 1131 | // friend RValue<UShort8> operator<<(RValue<UShort8> lhs, RValue<UShort8> rhs);
|
| 1132 | // friend RValue<UShort8> operator>>(RValue<UShort8> lhs, RValue<UShort8> rhs);
|
| 1133 | friend RValue<UShort8> operator+=(const UShort8 &lhs, RValue<UShort8> rhs);
|
| 1134 | // friend RValue<UShort8> operator-=(const UShort8 &lhs, RValue<UShort8> rhs);
|
| 1135 | // friend RValue<UShort8> operator*=(const UShort8 &lhs, RValue<UShort8> rhs);
|
| 1136 | // friend RValue<UShort8> operator/=(const UShort8 &lhs, RValue<UShort8> rhs);
|
| 1137 | // friend RValue<UShort8> operator%=(const UShort8 &lhs, RValue<UShort8> rhs);
|
| 1138 | // friend RValue<UShort8> operator&=(const UShort8 &lhs, RValue<UShort8> rhs);
|
| 1139 | // friend RValue<UShort8> operator|=(const UShort8 &lhs, RValue<UShort8> rhs);
|
| 1140 | // friend RValue<UShort8> operator^=(const UShort8 &lhs, RValue<UShort8> rhs);
|
| 1141 | // friend RValue<UShort8> operator<<=(const UShort8 &lhs, RValue<UShort8> rhs);
|
| 1142 | // friend RValue<UShort8> operator>>=(const UShort8 &lhs, RValue<UShort8> rhs);
|
| 1143 | // friend RValue<UShort8> operator+(RValue<UShort8> val);
|
| 1144 | // friend RValue<UShort8> operator-(RValue<UShort8> val);
|
| 1145 | friend RValue<UShort8> operator~(RValue<UShort8> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1146 | // friend RValue<UShort8> operator++(const UShort8 &val, int); // Post-increment
|
| 1147 | // friend const UShort8 &operator++(const UShort8 &val); // Pre-increment
|
| 1148 | // friend RValue<UShort8> operator--(const UShort8 &val, int); // Post-decrement
|
| 1149 | // friend const UShort8 &operator--(const UShort8 &val); // Pre-decrement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1150 | // friend RValue<Bool> operator<(RValue<UShort8> lhs, RValue<UShort8> rhs);
|
| 1151 | // friend RValue<Bool> operator<=(RValue<UShort8> lhs, RValue<UShort8> rhs);
|
| 1152 | // friend RValue<Bool> operator>(RValue<UShort8> lhs, RValue<UShort8> rhs);
|
| 1153 | // friend RValue<Bool> operator>=(RValue<UShort8> lhs, RValue<UShort8> rhs);
|
| 1154 | // friend RValue<Bool> operator!=(RValue<UShort8> lhs, RValue<UShort8> rhs);
|
| 1155 | // friend RValue<Bool> operator==(RValue<UShort8> lhs, RValue<UShort8> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1156 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1157 | friend RValue<UShort8> Swizzle(RValue<UShort8> x, char select0, char select1, char select2, char select3, char select4, char select5, char select6, char select7);
|
| 1158 | friend RValue<UShort8> Concatenate(RValue<UShort4> lo, RValue<UShort4> hi);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1159 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1160 | friend RValue<UShort8> MulHigh(RValue<UShort8> x, RValue<UShort8> y);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1161 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1162 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1163 | };
|
| 1164 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1165 | class Int : public Variable<Int>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1166 | {
|
| 1167 | public:
|
| 1168 | explicit Int(llvm::Argument *argument);
|
| 1169 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1170 | explicit Int(RValue<Byte> cast);
|
| 1171 | explicit Int(RValue<SByte> cast);
|
| 1172 | explicit Int(RValue<Short> cast);
|
| 1173 | explicit Int(RValue<UShort> cast);
|
| 1174 | explicit Int(RValue<Int2> cast);
|
| 1175 | explicit Int(RValue<Long> cast);
|
| 1176 | explicit Int(RValue<Float> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1177 |
|
| 1178 | Int();
|
| 1179 | Int(int x);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1180 | Int(RValue<Int> rhs);
|
| 1181 | Int(RValue<UInt> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1182 | Int(const Int &rhs);
|
| 1183 | Int(const UInt &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1184 | Int(const Reference<Int> &rhs);
|
| 1185 | Int(const Reference<UInt> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1186 |
|
| 1187 | RValue<Int> operator=(int rhs) const;
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1188 | RValue<Int> operator=(RValue<Int> rhs) const;
|
| 1189 | RValue<Int> operator=(RValue<UInt> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1190 | RValue<Int> operator=(const Int &rhs) const;
|
| 1191 | RValue<Int> operator=(const UInt &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1192 | RValue<Int> operator=(const Reference<Int> &rhs) const;
|
| 1193 | RValue<Int> operator=(const Reference<UInt> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1194 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1195 | friend RValue<Int> operator+(RValue<Int> lhs, RValue<Int> rhs);
|
| 1196 | friend RValue<Int> operator-(RValue<Int> lhs, RValue<Int> rhs);
|
| 1197 | friend RValue<Int> operator*(RValue<Int> lhs, RValue<Int> rhs);
|
| 1198 | friend RValue<Int> operator/(RValue<Int> lhs, RValue<Int> rhs);
|
| 1199 | friend RValue<Int> operator%(RValue<Int> lhs, RValue<Int> rhs);
|
| 1200 | friend RValue<Int> operator&(RValue<Int> lhs, RValue<Int> rhs);
|
| 1201 | friend RValue<Int> operator|(RValue<Int> lhs, RValue<Int> rhs);
|
| 1202 | friend RValue<Int> operator^(RValue<Int> lhs, RValue<Int> rhs);
|
| 1203 | friend RValue<Int> operator<<(RValue<Int> lhs, RValue<Int> rhs);
|
| 1204 | friend RValue<Int> operator>>(RValue<Int> lhs, RValue<Int> rhs);
|
| 1205 | friend RValue<Int> operator+=(const Int &lhs, RValue<Int> rhs);
|
| 1206 | friend RValue<Int> operator-=(const Int &lhs, RValue<Int> rhs);
|
| 1207 | friend RValue<Int> operator*=(const Int &lhs, RValue<Int> rhs);
|
| 1208 | friend RValue<Int> operator/=(const Int &lhs, RValue<Int> rhs);
|
| 1209 | friend RValue<Int> operator%=(const Int &lhs, RValue<Int> rhs);
|
| 1210 | friend RValue<Int> operator&=(const Int &lhs, RValue<Int> rhs);
|
| 1211 | friend RValue<Int> operator|=(const Int &lhs, RValue<Int> rhs);
|
| 1212 | friend RValue<Int> operator^=(const Int &lhs, RValue<Int> rhs);
|
| 1213 | friend RValue<Int> operator<<=(const Int &lhs, RValue<Int> rhs);
|
| 1214 | friend RValue<Int> operator>>=(const Int &lhs, RValue<Int> rhs);
|
| 1215 | friend RValue<Int> operator+(RValue<Int> val);
|
| 1216 | friend RValue<Int> operator-(RValue<Int> val);
|
| 1217 | friend RValue<Int> operator~(RValue<Int> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1218 | friend RValue<Int> operator++(const Int &val, int); // Post-increment
|
| 1219 | friend const Int &operator++(const Int &val); // Pre-increment
|
| 1220 | friend RValue<Int> operator--(const Int &val, int); // Post-decrement
|
| 1221 | friend const Int &operator--(const Int &val); // Pre-decrement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1222 | friend RValue<Bool> operator<(RValue<Int> lhs, RValue<Int> rhs);
|
| 1223 | friend RValue<Bool> operator<=(RValue<Int> lhs, RValue<Int> rhs);
|
| 1224 | friend RValue<Bool> operator>(RValue<Int> lhs, RValue<Int> rhs);
|
| 1225 | friend RValue<Bool> operator>=(RValue<Int> lhs, RValue<Int> rhs);
|
| 1226 | friend RValue<Bool> operator!=(RValue<Int> lhs, RValue<Int> rhs);
|
| 1227 | friend RValue<Bool> operator==(RValue<Int> lhs, RValue<Int> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1228 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1229 | friend RValue<Int> Max(RValue<Int> x, RValue<Int> y);
|
| 1230 | friend RValue<Int> Min(RValue<Int> x, RValue<Int> y);
|
| 1231 | friend RValue<Int> Clamp(RValue<Int> x, RValue<Int> min, RValue<Int> max);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1232 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1233 | friend RValue<Int> RoundInt(RValue<Float> cast);
|
| 1234 |
|
| 1235 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1236 | };
|
| 1237 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1238 | class Long : public Variable<Long>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1239 | {
|
| 1240 | public:
|
| 1241 | // explicit Long(llvm::Argument *argument);
|
| 1242 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1243 | // explicit Long(RValue<Short> cast);
|
| 1244 | // explicit Long(RValue<UShort> cast);
|
| 1245 | explicit Long(RValue<Int> cast);
|
| 1246 | explicit Long(RValue<UInt> cast);
|
| 1247 | // explicit Long(RValue<Float> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1248 |
|
| 1249 | Long();
|
| 1250 | // Long(qword x);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1251 | Long(RValue<Long> rhs);
|
| 1252 | // Long(RValue<ULong> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1253 | // Long(const Long &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1254 | // Long(const Reference<Long> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1255 | // Long(const ULong &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1256 | // Long(const Reference<ULong> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1257 |
|
| 1258 | RValue<Long> operator=(int64_t rhs) const;
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1259 | RValue<Long> operator=(RValue<Long> rhs) const;
|
| 1260 | // RValue<Long> operator=(RValue<ULong> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1261 | RValue<Long> operator=(const Long &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1262 | RValue<Long> operator=(const Reference<Long> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1263 | // RValue<Long> operator=(const ULong &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1264 | // RValue<Long> operator=(const Reference<ULong> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1265 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1266 | friend RValue<Long> operator+(RValue<Long> lhs, RValue<Long> rhs);
|
| 1267 | friend RValue<Long> operator-(RValue<Long> lhs, RValue<Long> rhs);
|
| 1268 | // friend RValue<Long> operator*(RValue<Long> lhs, RValue<Long> rhs);
|
| 1269 | // friend RValue<Long> operator/(RValue<Long> lhs, RValue<Long> rhs);
|
| 1270 | // friend RValue<Long> operator%(RValue<Long> lhs, RValue<Long> rhs);
|
| 1271 | // friend RValue<Long> operator&(RValue<Long> lhs, RValue<Long> rhs);
|
| 1272 | // friend RValue<Long> operator|(RValue<Long> lhs, RValue<Long> rhs);
|
| 1273 | // friend RValue<Long> operator^(RValue<Long> lhs, RValue<Long> rhs);
|
| 1274 | // friend RValue<Long> operator<<(RValue<Long> lhs, RValue<Long> rhs);
|
| 1275 | // friend RValue<Long> operator>>(RValue<Long> lhs, RValue<Long> rhs);
|
| 1276 | friend RValue<Long> operator+=(const Long &lhs, RValue<Long> rhs);
|
| 1277 | friend RValue<Long> operator-=(const Long &lhs, RValue<Long> rhs);
|
| 1278 | // friend RValue<Long> operator*=(const Long &lhs, RValue<Long> rhs);
|
| 1279 | // friend RValue<Long> operator/=(const Long &lhs, RValue<Long> rhs);
|
| 1280 | // friend RValue<Long> operator%=(const Long &lhs, RValue<Long> rhs);
|
| 1281 | // friend RValue<Long> operator&=(const Long &lhs, RValue<Long> rhs);
|
| 1282 | // friend RValue<Long> operator|=(const Long &lhs, RValue<Long> rhs);
|
| 1283 | // friend RValue<Long> operator^=(const Long &lhs, RValue<Long> rhs);
|
| 1284 | // friend RValue<Long> operator<<=(const Long &lhs, RValue<Long> rhs);
|
| 1285 | // friend RValue<Long> operator>>=(const Long &lhs, RValue<Long> rhs);
|
| 1286 | // friend RValue<Long> operator+(RValue<Long> val);
|
| 1287 | // friend RValue<Long> operator-(RValue<Long> val);
|
| 1288 | // friend RValue<Long> operator~(RValue<Long> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1289 | // friend RValue<Long> operator++(const Long &val, int); // Post-increment
|
| 1290 | // friend const Long &operator++(const Long &val); // Pre-increment
|
| 1291 | // friend RValue<Long> operator--(const Long &val, int); // Post-decrement
|
| 1292 | // friend const Long &operator--(const Long &val); // Pre-decrement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1293 | // friend RValue<Bool> operator<(RValue<Long> lhs, RValue<Long> rhs);
|
| 1294 | // friend RValue<Bool> operator<=(RValue<Long> lhs, RValue<Long> rhs);
|
| 1295 | // friend RValue<Bool> operator>(RValue<Long> lhs, RValue<Long> rhs);
|
| 1296 | // friend RValue<Bool> operator>=(RValue<Long> lhs, RValue<Long> rhs);
|
| 1297 | // friend RValue<Bool> operator!=(RValue<Long> lhs, RValue<Long> rhs);
|
| 1298 | // friend RValue<Bool> operator==(RValue<Long> lhs, RValue<Long> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1299 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1300 | // friend RValue<Long> RoundLong(RValue<Float> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1301 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1302 | friend RValue<Long> AddAtomic( RValue<Pointer<Long> > x, RValue<Long> y);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1303 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1304 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1305 | };
|
| 1306 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1307 | class Long1 : public Variable<Long1>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1308 | {
|
| 1309 | public:
|
| 1310 | // explicit Long1(llvm::Argument *argument);
|
| 1311 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1312 | // explicit Long1(RValue<Short> cast);
|
| 1313 | // explicit Long1(RValue<UShort> cast);
|
| 1314 | // explicit Long1(RValue<Int> cast);
|
| 1315 | // explicit Long1(RValue<UInt> cast);
|
| 1316 | // explicit Long1(RValue<Float> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1317 |
|
| 1318 | explicit Long1(const Reference<UInt> &cast);
|
| 1319 |
|
| 1320 | // Long1();
|
| 1321 | // Long1(qword x);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1322 | Long1(RValue<Long1> rhs);
|
| 1323 | // Long1(RValue<ULong1> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1324 | // Long1(const Long1 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1325 | // Long1(const Reference<Long1> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1326 | // Long1(const ULong1 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1327 | // Long1(const Reference<ULong1> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1328 |
|
| 1329 | // RValue<Long1> operator=(qword rhs) const;
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1330 | // RValue<Long1> operator=(RValue<Long1> rhs) const;
|
| 1331 | // RValue<Long1> operator=(RValue<ULong1> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1332 | // RValue<Long1> operator=(const Long1 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1333 | // RValue<Long1> operator=(const Reference<Long1> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1334 | // RValue<Long1> operator=(const ULong1 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1335 | // RValue<Long1> operator=(const Reference<ULong1> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1336 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1337 | // friend RValue<Long1> operator+(RValue<Long1> lhs, RValue<Long1> rhs);
|
| 1338 | // friend RValue<Long1> operator-(RValue<Long1> lhs, RValue<Long1> rhs);
|
| 1339 | // friend RValue<Long1> operator*(RValue<Long1> lhs, RValue<Long1> rhs);
|
| 1340 | // friend RValue<Long1> operator/(RValue<Long1> lhs, RValue<Long1> rhs);
|
| 1341 | // friend RValue<Long1> operator%(RValue<Long1> lhs, RValue<Long1> rhs);
|
| 1342 | // friend RValue<Long1> operator&(RValue<Long1> lhs, RValue<Long1> rhs);
|
| 1343 | // friend RValue<Long1> operator|(RValue<Long1> lhs, RValue<Long1> rhs);
|
| 1344 | // friend RValue<Long1> operator^(RValue<Long1> lhs, RValue<Long1> rhs);
|
| 1345 | // friend RValue<Long1> operator<<(RValue<Long1> lhs, RValue<Long1> rhs);
|
| 1346 | // friend RValue<Long1> operator>>(RValue<Long1> lhs, RValue<Long1> rhs);
|
| 1347 | // friend RValue<Long1> operator+=(const Long1 &lhs, RValue<Long1> rhs);
|
| 1348 | // friend RValue<Long1> operator-=(const Long1 &lhs, RValue<Long1> rhs);
|
| 1349 | // friend RValue<Long1> operator*=(const Long1 &lhs, RValue<Long1> rhs);
|
| 1350 | // friend RValue<Long1> operator/=(const Long1 &lhs, RValue<Long1> rhs);
|
| 1351 | // friend RValue<Long1> operator%=(const Long1 &lhs, RValue<Long1> rhs);
|
| 1352 | // friend RValue<Long1> operator&=(const Long1 &lhs, RValue<Long1> rhs);
|
| 1353 | // friend RValue<Long1> operator|=(const Long1 &lhs, RValue<Long1> rhs);
|
| 1354 | // friend RValue<Long1> operator^=(const Long1 &lhs, RValue<Long1> rhs);
|
| 1355 | // friend RValue<Long1> operator<<=(const Long1 &lhs, RValue<Long1> rhs);
|
| 1356 | // friend RValue<Long1> operator>>=(const Long1 &lhs, RValue<Long1> rhs);
|
| 1357 | // friend RValue<Long1> operator+(RValue<Long1> val);
|
| 1358 | // friend RValue<Long1> operator-(RValue<Long1> val);
|
| 1359 | // friend RValue<Long1> operator~(RValue<Long1> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1360 | // friend RValue<Long1> operator++(const Long1 &val, int); // Post-increment
|
| 1361 | // friend const Long1 &operator++(const Long1 &val); // Pre-increment
|
| 1362 | // friend RValue<Long1> operator--(const Long1 &val, int); // Post-decrement
|
| 1363 | // friend const Long1 &operator--(const Long1 &val); // Pre-decrement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1364 | // friend RValue<Bool> operator<(RValue<Long1> lhs, RValue<Long1> rhs);
|
| 1365 | // friend RValue<Bool> operator<=(RValue<Long1> lhs, RValue<Long1> rhs);
|
| 1366 | // friend RValue<Bool> operator>(RValue<Long1> lhs, RValue<Long1> rhs);
|
| 1367 | // friend RValue<Bool> operator>=(RValue<Long1> lhs, RValue<Long1> rhs);
|
| 1368 | // friend RValue<Bool> operator!=(RValue<Long1> lhs, RValue<Long1> rhs);
|
| 1369 | // friend RValue<Bool> operator==(RValue<Long1> lhs, RValue<Long1> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1370 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1371 | // friend RValue<Long1> RoundLong1(RValue<Float> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1372 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1373 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1374 | };
|
| 1375 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1376 | class Long2 : public Variable<Long2>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1377 | {
|
| 1378 | public:
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1379 | // explicit Long2(RValue<Long> cast);
|
| 1380 | // explicit Long2(RValue<Long1> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1381 |
|
| 1382 | // Long2();
|
| 1383 | // Long2(int x, int y);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1384 | // Long2(RValue<Long2> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1385 | // Long2(const Long2 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1386 | // Long2(const Reference<Long2> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1387 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1388 | // RValue<Long2> operator=(RValue<Long2> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1389 | // RValue<Long2> operator=(const Long2 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1390 | // RValue<Long2> operator=(const Reference<Long2 &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1391 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1392 | // friend RValue<Long2> operator+(RValue<Long2> lhs, RValue<Long2> rhs);
|
| 1393 | // friend RValue<Long2> operator-(RValue<Long2> lhs, RValue<Long2> rhs);
|
| 1394 | // friend RValue<Long2> operator*(RValue<Long2> lhs, RValue<Long2> rhs);
|
| 1395 | // friend RValue<Long2> operator/(RValue<Long2> lhs, RValue<Long2> rhs);
|
| 1396 | // friend RValue<Long2> operator%(RValue<Long2> lhs, RValue<Long2> rhs);
|
| 1397 | // friend RValue<Long2> operator&(RValue<Long2> lhs, RValue<Long2> rhs);
|
| 1398 | // friend RValue<Long2> operator|(RValue<Long2> lhs, RValue<Long2> rhs);
|
| 1399 | // friend RValue<Long2> operator^(RValue<Long2> lhs, RValue<Long2> rhs);
|
| 1400 | // friend RValue<Long2> operator<<(RValue<Long2> lhs, unsigned char rhs);
|
| 1401 | // friend RValue<Long2> operator>>(RValue<Long2> lhs, unsigned char rhs);
|
| 1402 | // friend RValue<Long2> operator<<(RValue<Long2> lhs, RValue<Long1> rhs);
|
| 1403 | // friend RValue<Long2> operator>>(RValue<Long2> lhs, RValue<Long1> rhs);
|
| 1404 | // friend RValue<Long2> operator+=(const Long2 &lhs, RValue<Long2> rhs);
|
| 1405 | // friend RValue<Long2> operator-=(const Long2 &lhs, RValue<Long2> rhs);
|
| 1406 | // friend RValue<Long2> operator*=(const Long2 &lhs, RValue<Long2> rhs);
|
| 1407 | // friend RValue<Long2> operator/=(const Long2 &lhs, RValue<Long2> rhs);
|
| 1408 | // friend RValue<Long2> operator%=(const Long2 &lhs, RValue<Long2> rhs);
|
| 1409 | // friend RValue<Long2> operator&=(const Long2 &lhs, RValue<Long2> rhs);
|
| 1410 | // friend RValue<Long2> operator|=(const Long2 &lhs, RValue<Long2> rhs);
|
| 1411 | // friend RValue<Long2> operator^=(const Long2 &lhs, RValue<Long2> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1412 | // friend RValue<Long2> operator<<=(const Long2 &lhs, unsigned char rhs);
|
| 1413 | // friend RValue<Long2> operator>>=(const Long2 &lhs, unsigned char rhs);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1414 | // friend RValue<Long2> operator<<=(const Long2 &lhs, RValue<Long1> rhs);
|
| 1415 | // friend RValue<Long2> operator>>=(const Long2 &lhs, RValue<Long1> rhs);
|
| 1416 | // friend RValue<Long2> operator+(RValue<Long2> val);
|
| 1417 | // friend RValue<Long2> operator-(RValue<Long2> val);
|
| 1418 | // friend RValue<Long2> operator~(RValue<Long2> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1419 | // friend RValue<Long2> operator++(const Long2 &val, int); // Post-increment
|
| 1420 | // friend const Long2 &operator++(const Long2 &val); // Pre-increment
|
| 1421 | // friend RValue<Long2> operator--(const Long2 &val, int); // Post-decrement
|
| 1422 | // friend const Long2 &operator--(const Long2 &val); // Pre-decrement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1423 | // friend RValue<Bool> operator<(RValue<Long2> lhs, RValue<Long2> rhs);
|
| 1424 | // friend RValue<Bool> operator<=(RValue<Long2> lhs, RValue<Long2> rhs);
|
| 1425 | // friend RValue<Bool> operator>(RValue<Long2> lhs, RValue<Long2> rhs);
|
| 1426 | // friend RValue<Bool> operator>=(RValue<Long2> lhs, RValue<Long2> rhs);
|
| 1427 | // friend RValue<Bool> operator!=(RValue<Long2> lhs, RValue<Long2> rhs);
|
| 1428 | // friend RValue<Bool> operator==(RValue<Long2> lhs, RValue<Long2> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1429 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1430 | // friend RValue<Long2> RoundInt(RValue<Float4> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1431 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1432 | // friend RValue<Long2> UnpackLow(RValue<Long2> x, RValue<Long2> y);
|
| 1433 | friend RValue<Long2> UnpackHigh(RValue<Long2> x, RValue<Long2> y);
|
| 1434 | // friend RValue<Int> Extract(RValue<Long2> val, int i);
|
| 1435 | // friend RValue<Long2> Insert(RValue<Long2> val, RValue<Int> element, int i);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1436 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1437 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1438 | };
|
| 1439 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1440 | class UInt : public Variable<UInt>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1441 | {
|
| 1442 | public:
|
| 1443 | explicit UInt(llvm::Argument *argument);
|
| 1444 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1445 | explicit UInt(RValue<UShort> cast);
|
| 1446 | explicit UInt(RValue<Long> cast);
|
| 1447 | explicit UInt(RValue<Float> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1448 |
|
| 1449 | UInt();
|
| 1450 | UInt(int x);
|
| 1451 | UInt(unsigned int x);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1452 | UInt(RValue<UInt> rhs);
|
| 1453 | UInt(RValue<Int> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1454 | UInt(const UInt &rhs);
|
| 1455 | UInt(const Int &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1456 | UInt(const Reference<UInt> &rhs);
|
| 1457 | UInt(const Reference<Int> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1458 |
|
| 1459 | RValue<UInt> operator=(unsigned int rhs) const;
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1460 | RValue<UInt> operator=(RValue<UInt> rhs) const;
|
| 1461 | RValue<UInt> operator=(RValue<Int> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1462 | RValue<UInt> operator=(const UInt &rhs) const;
|
| 1463 | RValue<UInt> operator=(const Int &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1464 | RValue<UInt> operator=(const Reference<UInt> &rhs) const;
|
| 1465 | RValue<UInt> operator=(const Reference<Int> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1466 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1467 | friend RValue<UInt> operator+(RValue<UInt> lhs, RValue<UInt> rhs);
|
| 1468 | friend RValue<UInt> operator-(RValue<UInt> lhs, RValue<UInt> rhs);
|
| 1469 | friend RValue<UInt> operator*(RValue<UInt> lhs, RValue<UInt> rhs);
|
| 1470 | friend RValue<UInt> operator/(RValue<UInt> lhs, RValue<UInt> rhs);
|
| 1471 | friend RValue<UInt> operator%(RValue<UInt> lhs, RValue<UInt> rhs);
|
| 1472 | friend RValue<UInt> operator&(RValue<UInt> lhs, RValue<UInt> rhs);
|
| 1473 | friend RValue<UInt> operator|(RValue<UInt> lhs, RValue<UInt> rhs);
|
| 1474 | friend RValue<UInt> operator^(RValue<UInt> lhs, RValue<UInt> rhs);
|
| 1475 | friend RValue<UInt> operator<<(RValue<UInt> lhs, RValue<UInt> rhs);
|
| 1476 | friend RValue<UInt> operator>>(RValue<UInt> lhs, RValue<UInt> rhs);
|
| 1477 | friend RValue<UInt> operator+=(const UInt &lhs, RValue<UInt> rhs);
|
| 1478 | friend RValue<UInt> operator-=(const UInt &lhs, RValue<UInt> rhs);
|
| 1479 | friend RValue<UInt> operator*=(const UInt &lhs, RValue<UInt> rhs);
|
| 1480 | friend RValue<UInt> operator/=(const UInt &lhs, RValue<UInt> rhs);
|
| 1481 | friend RValue<UInt> operator%=(const UInt &lhs, RValue<UInt> rhs);
|
| 1482 | friend RValue<UInt> operator&=(const UInt &lhs, RValue<UInt> rhs);
|
| 1483 | friend RValue<UInt> operator|=(const UInt &lhs, RValue<UInt> rhs);
|
| 1484 | friend RValue<UInt> operator^=(const UInt &lhs, RValue<UInt> rhs);
|
| 1485 | friend RValue<UInt> operator<<=(const UInt &lhs, RValue<UInt> rhs);
|
| 1486 | friend RValue<UInt> operator>>=(const UInt &lhs, RValue<UInt> rhs);
|
| 1487 | friend RValue<UInt> operator+(RValue<UInt> val);
|
| 1488 | friend RValue<UInt> operator-(RValue<UInt> val);
|
| 1489 | friend RValue<UInt> operator~(RValue<UInt> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1490 | friend RValue<UInt> operator++(const UInt &val, int); // Post-increment
|
| 1491 | friend const UInt &operator++(const UInt &val); // Pre-increment
|
| 1492 | friend RValue<UInt> operator--(const UInt &val, int); // Post-decrement
|
| 1493 | friend const UInt &operator--(const UInt &val); // Pre-decrement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1494 | friend RValue<Bool> operator<(RValue<UInt> lhs, RValue<UInt> rhs);
|
| 1495 | friend RValue<Bool> operator<=(RValue<UInt> lhs, RValue<UInt> rhs);
|
| 1496 | friend RValue<Bool> operator>(RValue<UInt> lhs, RValue<UInt> rhs);
|
| 1497 | friend RValue<Bool> operator>=(RValue<UInt> lhs, RValue<UInt> rhs);
|
| 1498 | friend RValue<Bool> operator!=(RValue<UInt> lhs, RValue<UInt> rhs);
|
| 1499 | friend RValue<Bool> operator==(RValue<UInt> lhs, RValue<UInt> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1500 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1501 | friend RValue<UInt> Max(RValue<UInt> x, RValue<UInt> y);
|
| 1502 | friend RValue<UInt> Min(RValue<UInt> x, RValue<UInt> y);
|
| 1503 | friend RValue<UInt> Clamp(RValue<UInt> x, RValue<UInt> min, RValue<UInt> max);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1504 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1505 | // friend RValue<UInt> RoundUInt(RValue<Float> cast);
|
| 1506 |
|
| 1507 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1508 | };
|
| 1509 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1510 | class Int2 : public Variable<Int2>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1511 | {
|
| 1512 | public:
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1513 | // explicit Int2(RValue<Int> cast);
|
| 1514 | explicit Int2(RValue<Int4> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1515 |
|
| 1516 | Int2();
|
| 1517 | Int2(int x, int y);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1518 | Int2(RValue<Int2> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1519 | Int2(const Int2 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1520 | Int2(const Reference<Int2> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1521 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1522 | RValue<Int2> operator=(RValue<Int2> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1523 | RValue<Int2> operator=(const Int2 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1524 | RValue<Int2> operator=(const Reference<Int2> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1525 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1526 | friend RValue<Int2> operator+(RValue<Int2> lhs, RValue<Int2> rhs);
|
| 1527 | friend RValue<Int2> operator-(RValue<Int2> lhs, RValue<Int2> rhs);
|
| 1528 | // friend RValue<Int2> operator*(RValue<Int2> lhs, RValue<Int2> rhs);
|
| 1529 | // friend RValue<Int2> operator/(RValue<Int2> lhs, RValue<Int2> rhs);
|
| 1530 | // friend RValue<Int2> operator%(RValue<Int2> lhs, RValue<Int2> rhs);
|
| 1531 | friend RValue<Int2> operator&(RValue<Int2> lhs, RValue<Int2> rhs);
|
| 1532 | friend RValue<Int2> operator|(RValue<Int2> lhs, RValue<Int2> rhs);
|
| 1533 | friend RValue<Int2> operator^(RValue<Int2> lhs, RValue<Int2> rhs);
|
| 1534 | friend RValue<Int2> operator<<(RValue<Int2> lhs, unsigned char rhs);
|
| 1535 | friend RValue<Int2> operator>>(RValue<Int2> lhs, unsigned char rhs);
|
| 1536 | friend RValue<Int2> operator<<(RValue<Int2> lhs, RValue<Long1> rhs);
|
| 1537 | friend RValue<Int2> operator>>(RValue<Int2> lhs, RValue<Long1> rhs);
|
| 1538 | friend RValue<Int2> operator+=(const Int2 &lhs, RValue<Int2> rhs);
|
| 1539 | friend RValue<Int2> operator-=(const Int2 &lhs, RValue<Int2> rhs);
|
| 1540 | // friend RValue<Int2> operator*=(const Int2 &lhs, RValue<Int2> rhs);
|
| 1541 | // friend RValue<Int2> operator/=(const Int2 &lhs, RValue<Int2> rhs);
|
| 1542 | // friend RValue<Int2> operator%=(const Int2 &lhs, RValue<Int2> rhs);
|
| 1543 | friend RValue<Int2> operator&=(const Int2 &lhs, RValue<Int2> rhs);
|
| 1544 | friend RValue<Int2> operator|=(const Int2 &lhs, RValue<Int2> rhs);
|
| 1545 | friend RValue<Int2> operator^=(const Int2 &lhs, RValue<Int2> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1546 | friend RValue<Int2> operator<<=(const Int2 &lhs, unsigned char rhs);
|
| 1547 | friend RValue<Int2> operator>>=(const Int2 &lhs, unsigned char rhs);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1548 | friend RValue<Int2> operator<<=(const Int2 &lhs, RValue<Long1> rhs);
|
| 1549 | friend RValue<Int2> operator>>=(const Int2 &lhs, RValue<Long1> rhs);
|
| 1550 | // friend RValue<Int2> operator+(RValue<Int2> val);
|
| 1551 | // friend RValue<Int2> operator-(RValue<Int2> val);
|
| 1552 | friend RValue<Int2> operator~(RValue<Int2> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1553 | // friend RValue<Int2> operator++(const Int2 &val, int); // Post-increment
|
| 1554 | // friend const Int2 &operator++(const Int2 &val); // Pre-increment
|
| 1555 | // friend RValue<Int2> operator--(const Int2 &val, int); // Post-decrement
|
| 1556 | // friend const Int2 &operator--(const Int2 &val); // Pre-decrement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1557 | // friend RValue<Bool> operator<(RValue<Int2> lhs, RValue<Int2> rhs);
|
| 1558 | // friend RValue<Bool> operator<=(RValue<Int2> lhs, RValue<Int2> rhs);
|
| 1559 | // friend RValue<Bool> operator>(RValue<Int2> lhs, RValue<Int2> rhs);
|
| 1560 | // friend RValue<Bool> operator>=(RValue<Int2> lhs, RValue<Int2> rhs);
|
| 1561 | // friend RValue<Bool> operator!=(RValue<Int2> lhs, RValue<Int2> rhs);
|
| 1562 | // friend RValue<Bool> operator==(RValue<Int2> lhs, RValue<Int2> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1563 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1564 | // friend RValue<Int2> RoundInt(RValue<Float4> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1565 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1566 | friend RValue<Long1> UnpackLow(RValue<Int2> x, RValue<Int2> y);
|
| 1567 | friend RValue<Long1> UnpackHigh(RValue<Int2> x, RValue<Int2> y);
|
| 1568 | friend RValue<Int> Extract(RValue<Int2> val, int i);
|
| 1569 | // friend RValue<Int2> Insert(RValue<Int2> val, RValue<Int> element, int i);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1570 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1571 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1572 | };
|
| 1573 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1574 | class UInt2 : public Variable<UInt2>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1575 | {
|
| 1576 | public:
|
| 1577 | UInt2();
|
| 1578 | UInt2(unsigned int x, unsigned int y);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1579 | UInt2(RValue<UInt2> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1580 | UInt2(const UInt2 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1581 | UInt2(const Reference<UInt2> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1582 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1583 | RValue<UInt2> operator=(RValue<UInt2> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1584 | RValue<UInt2> operator=(const UInt2 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1585 | RValue<UInt2> operator=(const Reference<UInt2> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1586 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1587 | friend RValue<UInt2> operator+(RValue<UInt2> lhs, RValue<UInt2> rhs);
|
| 1588 | friend RValue<UInt2> operator-(RValue<UInt2> lhs, RValue<UInt2> rhs);
|
| 1589 | // friend RValue<UInt2> operator*(RValue<UInt2> lhs, RValue<UInt2> rhs);
|
| 1590 | // friend RValue<UInt2> operator/(RValue<UInt2> lhs, RValue<UInt2> rhs);
|
| 1591 | // friend RValue<UInt2> operator%(RValue<UInt2> lhs, RValue<UInt2> rhs);
|
| 1592 | friend RValue<UInt2> operator&(RValue<UInt2> lhs, RValue<UInt2> rhs);
|
| 1593 | friend RValue<UInt2> operator|(RValue<UInt2> lhs, RValue<UInt2> rhs);
|
| 1594 | friend RValue<UInt2> operator^(RValue<UInt2> lhs, RValue<UInt2> rhs);
|
| 1595 | friend RValue<UInt2> operator<<(RValue<UInt2> lhs, unsigned char rhs);
|
| 1596 | friend RValue<UInt2> operator>>(RValue<UInt2> lhs, unsigned char rhs);
|
| 1597 | friend RValue<UInt2> operator<<(RValue<UInt2> lhs, RValue<Long1> rhs);
|
| 1598 | friend RValue<UInt2> operator>>(RValue<UInt2> lhs, RValue<Long1> rhs);
|
| 1599 | friend RValue<UInt2> operator+=(const UInt2 &lhs, RValue<UInt2> rhs);
|
| 1600 | friend RValue<UInt2> operator-=(const UInt2 &lhs, RValue<UInt2> rhs);
|
| 1601 | // friend RValue<UInt2> operator*=(const UInt2 &lhs, RValue<UInt2> rhs);
|
| 1602 | // friend RValue<UInt2> operator/=(const UInt2 &lhs, RValue<UInt2> rhs);
|
| 1603 | // friend RValue<UInt2> operator%=(const UInt2 &lhs, RValue<UInt2> rhs);
|
| 1604 | friend RValue<UInt2> operator&=(const UInt2 &lhs, RValue<UInt2> rhs);
|
| 1605 | friend RValue<UInt2> operator|=(const UInt2 &lhs, RValue<UInt2> rhs);
|
| 1606 | friend RValue<UInt2> operator^=(const UInt2 &lhs, RValue<UInt2> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1607 | friend RValue<UInt2> operator<<=(const UInt2 &lhs, unsigned char rhs);
|
| 1608 | friend RValue<UInt2> operator>>=(const UInt2 &lhs, unsigned char rhs);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1609 | friend RValue<UInt2> operator<<=(const UInt2 &lhs, RValue<Long1> rhs);
|
| 1610 | friend RValue<UInt2> operator>>=(const UInt2 &lhs, RValue<Long1> rhs);
|
| 1611 | // friend RValue<UInt2> operator+(RValue<UInt2> val);
|
| 1612 | // friend RValue<UInt2> operator-(RValue<UInt2> val);
|
| 1613 | friend RValue<UInt2> operator~(RValue<UInt2> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1614 | // friend RValue<UInt2> operator++(const UInt2 &val, int); // Post-increment
|
| 1615 | // friend const UInt2 &operator++(const UInt2 &val); // Pre-increment
|
| 1616 | // friend RValue<UInt2> operator--(const UInt2 &val, int); // Post-decrement
|
| 1617 | // friend const UInt2 &operator--(const UInt2 &val); // Pre-decrement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1618 | // friend RValue<Bool> operator<(RValue<UInt2> lhs, RValue<UInt2> rhs);
|
| 1619 | // friend RValue<Bool> operator<=(RValue<UInt2> lhs, RValue<UInt2> rhs);
|
| 1620 | // friend RValue<Bool> operator>(RValue<UInt2> lhs, RValue<UInt2> rhs);
|
| 1621 | // friend RValue<Bool> operator>=(RValue<UInt2> lhs, RValue<UInt2> rhs);
|
| 1622 | // friend RValue<Bool> operator!=(RValue<UInt2> lhs, RValue<UInt2> rhs);
|
| 1623 | // friend RValue<Bool> operator==(RValue<UInt2> lhs, RValue<UInt2> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1624 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1625 | // friend RValue<UInt2> RoundInt(RValue<Float4> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1626 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1627 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1628 | };
|
| 1629 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1630 | class Int4 : public Variable<Int4>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1631 | {
|
| 1632 | public:
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1633 | explicit Int4(RValue<Float4> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1634 |
|
| 1635 | Int4();
|
| 1636 | Int4(int xyzw);
|
| 1637 | Int4(int x, int yzw);
|
| 1638 | Int4(int x, int y, int zw);
|
| 1639 | Int4(int x, int y, int z, int w);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1640 | Int4(RValue<Int4> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1641 | Int4(const Int4 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1642 | Int4(const Reference<Int4> &rhs);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1643 | Int4(RValue<UInt4> rhs);
|
| 1644 | Int4(const UInt4 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1645 | Int4(const Reference<UInt4> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1646 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1647 | RValue<Int4> operator=(RValue<Int4> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1648 | RValue<Int4> operator=(const Int4 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1649 | RValue<Int4> operator=(const Reference<Int4> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1650 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1651 | friend RValue<Int4> operator+(RValue<Int4> lhs, RValue<Int4> rhs);
|
| 1652 | friend RValue<Int4> operator-(RValue<Int4> lhs, RValue<Int4> rhs);
|
| 1653 | friend RValue<Int4> operator*(RValue<Int4> lhs, RValue<Int4> rhs);
|
| 1654 | // friend RValue<Int4> operator/(RValue<Int4> lhs, RValue<Int4> rhs);
|
| 1655 | // friend RValue<Int4> operator%(RValue<Int4> lhs, RValue<Int4> rhs);
|
| 1656 | friend RValue<Int4> operator&(RValue<Int4> lhs, RValue<Int4> rhs);
|
| 1657 | friend RValue<Int4> operator|(RValue<Int4> lhs, RValue<Int4> rhs);
|
| 1658 | friend RValue<Int4> operator^(RValue<Int4> lhs, RValue<Int4> rhs);
|
| 1659 | friend RValue<Int4> operator<<(RValue<Int4> lhs, unsigned char rhs);
|
| 1660 | friend RValue<Int4> operator>>(RValue<Int4> lhs, unsigned char rhs);
|
| 1661 | friend RValue<Int4> operator+=(const Int4 &lhs, RValue<Int4> rhs);
|
| 1662 | friend RValue<Int4> operator-=(const Int4 &lhs, RValue<Int4> rhs);
|
| 1663 | friend RValue<Int4> operator*=(const Int4 &lhs, RValue<Int4> rhs);
|
| 1664 | // friend RValue<Int4> operator/=(const Int4 &lhs, RValue<Int4> rhs);
|
| 1665 | // friend RValue<Int4> operator%=(const Int4 &lhs, RValue<Int4> rhs);
|
| 1666 | friend RValue<Int4> operator&=(const Int4 &lhs, RValue<Int4> rhs);
|
| 1667 | friend RValue<Int4> operator|=(const Int4 &lhs, RValue<Int4> rhs);
|
| 1668 | friend RValue<Int4> operator^=(const Int4 &lhs, RValue<Int4> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1669 | friend RValue<Int4> operator<<=(const Int4 &lhs, unsigned char rhs);
|
| 1670 | friend RValue<Int4> operator>>=(const Int4 &lhs, unsigned char rhs);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1671 | friend RValue<Int4> operator+(RValue<Int4> val);
|
| 1672 | friend RValue<Int4> operator-(RValue<Int4> val);
|
| 1673 | friend RValue<Int4> operator~(RValue<Int4> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1674 | // friend RValue<Int4> operator++(const Int4 &val, int); // Post-increment
|
| 1675 | // friend const Int4 &operator++(const Int4 &val); // Pre-increment
|
| 1676 | // friend RValue<Int4> operator--(const Int4 &val, int); // Post-decrement
|
| 1677 | // friend const Int4 &operator--(const Int4 &val); // Pre-decrement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1678 | // friend RValue<Bool> operator<(RValue<Int4> lhs, RValue<Int4> rhs);
|
| 1679 | // friend RValue<Bool> operator<=(RValue<Int4> lhs, RValue<Int4> rhs);
|
| 1680 | // friend RValue<Bool> operator>(RValue<Int4> lhs, RValue<Int4> rhs);
|
| 1681 | // friend RValue<Bool> operator>=(RValue<Int4> lhs, RValue<Int4> rhs);
|
| 1682 | // friend RValue<Bool> operator!=(RValue<Int4> lhs, RValue<Int4> rhs);
|
| 1683 | // friend RValue<Bool> operator==(RValue<Int4> lhs, RValue<Int4> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1684 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1685 | friend RValue<Int4> CmpEQ(RValue<Int4> x, RValue<Int4> y);
|
| 1686 | friend RValue<Int4> CmpLT(RValue<Int4> x, RValue<Int4> y);
|
| 1687 | friend RValue<Int4> CmpLE(RValue<Int4> x, RValue<Int4> y);
|
| 1688 | friend RValue<Int4> CmpNEQ(RValue<Int4> x, RValue<Int4> y);
|
| 1689 | friend RValue<Int4> CmpNLT(RValue<Int4> x, RValue<Int4> y);
|
| 1690 | friend RValue<Int4> CmpNLE(RValue<Int4> x, RValue<Int4> y);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1691 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1692 | friend RValue<Int4> Max(RValue<Int4> x, RValue<Int4> y);
|
| 1693 | friend RValue<Int4> Min(RValue<Int4> x, RValue<Int4> y);
|
| 1694 |
|
| 1695 | friend RValue<Int4> RoundInt(RValue<Float4> cast);
|
| 1696 | friend RValue<Short8> Pack(RValue<Int4> x, RValue<Int4> y);
|
| 1697 | friend RValue<Int4> Concatenate(RValue<Int2> lo, RValue<Int2> hi);
|
| 1698 | friend RValue<Int> Extract(RValue<Int4> x, int i);
|
| 1699 | friend RValue<Int4> Insert(RValue<Int4> val, RValue<Int> element, int i);
|
| 1700 | friend RValue<Int> SignMask(RValue<Int4> x);
|
| 1701 | friend RValue<Int4> Swizzle(RValue<Int4> x, unsigned char select);
|
| 1702 |
|
| 1703 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1704 |
|
| 1705 | private:
|
| 1706 | void constant(int x, int y, int z, int w);
|
| 1707 | };
|
| 1708 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1709 | class UInt4 : public Variable<UInt4>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1710 | {
|
| 1711 | public:
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1712 | explicit UInt4(RValue<Float4> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1713 |
|
| 1714 | UInt4();
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1715 | UInt4(int xyzw);
|
| 1716 | UInt4(int x, int yzw);
|
| 1717 | UInt4(int x, int y, int zw);
|
| 1718 | UInt4(int x, int y, int z, int w);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1719 | UInt4(unsigned int x, unsigned int y, unsigned int z, unsigned int w);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1720 | UInt4(RValue<UInt4> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1721 | UInt4(const UInt4 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1722 | UInt4(const Reference<UInt4> &rhs);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1723 | UInt4(RValue<Int4> rhs);
|
| 1724 | UInt4(const Int4 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1725 | UInt4(const Reference<Int4> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1726 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1727 | RValue<UInt4> operator=(RValue<UInt4> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1728 | RValue<UInt4> operator=(const UInt4 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1729 | RValue<UInt4> operator=(const Reference<UInt4> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1730 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1731 | friend RValue<UInt4> operator+(RValue<UInt4> lhs, RValue<UInt4> rhs);
|
| 1732 | friend RValue<UInt4> operator-(RValue<UInt4> lhs, RValue<UInt4> rhs);
|
| 1733 | friend RValue<UInt4> operator*(RValue<UInt4> lhs, RValue<UInt4> rhs);
|
| 1734 | // friend RValue<UInt4> operator/(RValue<UInt4> lhs, RValue<UInt4> rhs);
|
| 1735 | // friend RValue<UInt4> operator%(RValue<UInt4> lhs, RValue<UInt4> rhs);
|
| 1736 | friend RValue<UInt4> operator&(RValue<UInt4> lhs, RValue<UInt4> rhs);
|
| 1737 | friend RValue<UInt4> operator|(RValue<UInt4> lhs, RValue<UInt4> rhs);
|
| 1738 | friend RValue<UInt4> operator^(RValue<UInt4> lhs, RValue<UInt4> rhs);
|
| 1739 | friend RValue<UInt4> operator<<(RValue<UInt4> lhs, unsigned char rhs);
|
| 1740 | friend RValue<UInt4> operator>>(RValue<UInt4> lhs, unsigned char rhs);
|
| 1741 | friend RValue<UInt4> operator+=(const UInt4 &lhs, RValue<UInt4> rhs);
|
| 1742 | friend RValue<UInt4> operator-=(const UInt4 &lhs, RValue<UInt4> rhs);
|
| 1743 | friend RValue<UInt4> operator*=(const UInt4 &lhs, RValue<UInt4> rhs);
|
| 1744 | // friend RValue<UInt4> operator/=(const UInt4 &lhs, RValue<UInt4> rhs);
|
| 1745 | // friend RValue<UInt4> operator%=(const UInt4 &lhs, RValue<UInt4> rhs);
|
| 1746 | friend RValue<UInt4> operator&=(const UInt4 &lhs, RValue<UInt4> rhs);
|
| 1747 | friend RValue<UInt4> operator|=(const UInt4 &lhs, RValue<UInt4> rhs);
|
| 1748 | friend RValue<UInt4> operator^=(const UInt4 &lhs, RValue<UInt4> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1749 | friend RValue<UInt4> operator<<=(const UInt4 &lhs, unsigned char rhs);
|
| 1750 | friend RValue<UInt4> operator>>=(const UInt4 &lhs, unsigned char rhs);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1751 | friend RValue<UInt4> operator+(RValue<UInt4> val);
|
| 1752 | friend RValue<UInt4> operator-(RValue<UInt4> val);
|
| 1753 | friend RValue<UInt4> operator~(RValue<UInt4> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1754 | // friend RValue<UInt4> operator++(const UInt4 &val, int); // Post-increment
|
| 1755 | // friend const UInt4 &operator++(const UInt4 &val); // Pre-increment
|
| 1756 | // friend RValue<UInt4> operator--(const UInt4 &val, int); // Post-decrement
|
| 1757 | // friend const UInt4 &operator--(const UInt4 &val); // Pre-decrement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1758 | // friend RValue<Bool> operator<(RValue<UInt4> lhs, RValue<UInt4> rhs);
|
| 1759 | // friend RValue<Bool> operator<=(RValue<UInt4> lhs, RValue<UInt4> rhs);
|
| 1760 | // friend RValue<Bool> operator>(RValue<UInt4> lhs, RValue<UInt4> rhs);
|
| 1761 | // friend RValue<Bool> operator>=(RValue<UInt4> lhs, RValue<UInt4> rhs);
|
| 1762 | // friend RValue<Bool> operator!=(RValue<UInt4> lhs, RValue<UInt4> rhs);
|
| 1763 | // friend RValue<Bool> operator==(RValue<UInt4> lhs, RValue<UInt4> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1764 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1765 | friend RValue<UInt4> CmpEQ(RValue<UInt4> x, RValue<UInt4> y);
|
| 1766 | friend RValue<UInt4> CmpLT(RValue<UInt4> x, RValue<UInt4> y);
|
| 1767 | friend RValue<UInt4> CmpLE(RValue<UInt4> x, RValue<UInt4> y);
|
| 1768 | friend RValue<UInt4> CmpNEQ(RValue<UInt4> x, RValue<UInt4> y);
|
| 1769 | friend RValue<UInt4> CmpNLT(RValue<UInt4> x, RValue<UInt4> y);
|
| 1770 | friend RValue<UInt4> CmpNLE(RValue<UInt4> x, RValue<UInt4> y);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1771 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1772 | friend RValue<UInt4> Max(RValue<UInt4> x, RValue<UInt4> y);
|
| 1773 | friend RValue<UInt4> Min(RValue<UInt4> x, RValue<UInt4> y);
|
| 1774 |
|
| 1775 | // friend RValue<UInt4> RoundInt(RValue<Float4> cast);
|
| 1776 | friend RValue<UShort8> Pack(RValue<UInt4> x, RValue<UInt4> y);
|
| 1777 | friend RValue<UInt4> Concatenate(RValue<UInt2> lo, RValue<UInt2> hi);
|
| 1778 |
|
| 1779 | static llvm::Type *getType();
|
| 1780 |
|
| 1781 | private:
|
| 1782 | void constant(int x, int y, int z, int w);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1783 | };
|
| 1784 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1785 | template<int T>
|
| 1786 | class Swizzle2Float4
|
| 1787 | {
|
| 1788 | friend class Float4;
|
| 1789 |
|
| 1790 | public:
|
| 1791 | operator RValue<Float4>() const;
|
| 1792 |
|
| 1793 | private:
|
| 1794 | Float4 *parent;
|
| 1795 | };
|
| 1796 |
|
| 1797 | template<int T>
|
| 1798 | class SwizzleFloat4
|
| 1799 | {
|
| 1800 | public:
|
| 1801 | operator RValue<Float4>() const;
|
| 1802 |
|
| 1803 | private:
|
| 1804 | Float4 *parent;
|
| 1805 | };
|
| 1806 |
|
| 1807 | template<int T>
|
| 1808 | class SwizzleMaskFloat4
|
| 1809 | {
|
| 1810 | friend class Float4;
|
| 1811 |
|
| 1812 | public:
|
| 1813 | operator RValue<Float4>() const;
|
| 1814 |
|
| 1815 | RValue<Float4> operator=(RValue<Float4> rhs) const;
|
| 1816 | RValue<Float4> operator=(RValue<Float> rhs) const;
|
| 1817 |
|
| 1818 | private:
|
| 1819 | Float4 *parent;
|
| 1820 | };
|
| 1821 |
|
| 1822 | template<int T>
|
| 1823 | class SwizzleMask1Float4
|
| 1824 | {
|
| 1825 | public:
|
| 1826 | operator RValue<Float>() const;
|
| 1827 | operator RValue<Float4>() const;
|
| 1828 |
|
| 1829 | RValue<Float4> operator=(float x) const;
|
| 1830 | RValue<Float4> operator=(RValue<Float4> rhs) const;
|
| 1831 | RValue<Float4> operator=(RValue<Float> rhs) const;
|
| 1832 |
|
| 1833 | private:
|
| 1834 | Float4 *parent;
|
| 1835 | };
|
| 1836 |
|
| 1837 | template<int T>
|
| 1838 | class SwizzleMask2Float4
|
| 1839 | {
|
| 1840 | friend class Float4;
|
| 1841 |
|
| 1842 | public:
|
| 1843 | operator RValue<Float4>() const;
|
| 1844 |
|
| 1845 | RValue<Float4> operator=(RValue<Float4> rhs) const;
|
| 1846 |
|
| 1847 | private:
|
| 1848 | Float4 *parent;
|
| 1849 | };
|
| 1850 |
|
| 1851 | class Float : public Variable<Float>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1852 | {
|
| 1853 | public:
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1854 | explicit Float(RValue<Int> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1855 |
|
| 1856 | Float();
|
| 1857 | Float(float x);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1858 | Float(RValue<Float> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1859 | Float(const Float &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1860 | Float(const Reference<Float> &rhs);
|
| 1861 |
|
| 1862 | template<int T>
|
| 1863 | Float(const SwizzleMask1Float4<T> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1864 |
|
| 1865 | // RValue<Float> operator=(float rhs) const; // FIXME: Implement
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1866 | RValue<Float> operator=(RValue<Float> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1867 | RValue<Float> operator=(const Float &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1868 | RValue<Float> operator=(const Reference<Float> &rhs) const;
|
| 1869 |
|
| 1870 | template<int T>
|
| 1871 | RValue<Float> operator=(const SwizzleMask1Float4<T> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1872 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1873 | friend RValue<Float> operator+(RValue<Float> lhs, RValue<Float> rhs);
|
| 1874 | friend RValue<Float> operator-(RValue<Float> lhs, RValue<Float> rhs);
|
| 1875 | friend RValue<Float> operator*(RValue<Float> lhs, RValue<Float> rhs);
|
| 1876 | friend RValue<Float> operator/(RValue<Float> lhs, RValue<Float> rhs);
|
| 1877 | friend RValue<Float> operator+=(const Float &lhs, RValue<Float> rhs);
|
| 1878 | friend RValue<Float> operator-=(const Float &lhs, RValue<Float> rhs);
|
| 1879 | friend RValue<Float> operator*=(const Float &lhs, RValue<Float> rhs);
|
| 1880 | friend RValue<Float> operator/=(const Float &lhs, RValue<Float> rhs);
|
| 1881 | friend RValue<Float> operator+(RValue<Float> val);
|
| 1882 | friend RValue<Float> operator-(RValue<Float> val);
|
| 1883 | friend RValue<Bool> operator<(RValue<Float> lhs, RValue<Float> rhs);
|
| 1884 | friend RValue<Bool> operator<=(RValue<Float> lhs, RValue<Float> rhs);
|
| 1885 | friend RValue<Bool> operator>(RValue<Float> lhs, RValue<Float> rhs);
|
| 1886 | friend RValue<Bool> operator>=(RValue<Float> lhs, RValue<Float> rhs);
|
| 1887 | friend RValue<Bool> operator!=(RValue<Float> lhs, RValue<Float> rhs);
|
| 1888 | friend RValue<Bool> operator==(RValue<Float> lhs, RValue<Float> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1889 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1890 | friend RValue<Float> Abs(RValue<Float> x);
|
| 1891 | friend RValue<Float> Max(RValue<Float> x, RValue<Float> y);
|
| 1892 | friend RValue<Float> Min(RValue<Float> x, RValue<Float> y);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1893 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1894 | friend RValue<Float> Rcp_pp(RValue<Float> val);
|
| 1895 | friend RValue<Float> RcpSqrt_pp(RValue<Float> val);
|
| 1896 | friend RValue<Float> Sqrt(RValue<Float> x);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1897 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1898 | friend RValue<Float> Round(RValue<Float> val);
|
| 1899 | friend RValue<Float> Trunc(RValue<Float> val);
|
| 1900 | friend RValue<Float> Frac(RValue<Float> val);
|
| 1901 | friend RValue<Float> Floor(RValue<Float> val);
|
| 1902 | friend RValue<Float> Ceil(RValue<Float> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1903 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1904 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1905 | };
|
| 1906 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1907 | class Float2 : public Variable<Float2>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1908 | {
|
| 1909 | public:
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1910 | // explicit Float2(RValue<Byte2> cast);
|
| 1911 | // explicit Float2(RValue<Short2> cast);
|
| 1912 | // explicit Float2(RValue<UShort2> cast);
|
| 1913 | // explicit Float2(RValue<Int2> cast);
|
| 1914 | // explicit Float2(RValue<UInt2> cast);
|
| 1915 | explicit Float2(RValue<Float4> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1916 |
|
| 1917 | // Float2();
|
| 1918 | // Float2(float x, float y);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1919 | // Float2(RValue<Float2> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1920 | // Float2(const Float2 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1921 | // Float2(const Reference<Float2> &rhs);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1922 | // Float2(RValue<Float> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1923 | // Float2(const Float &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1924 | // Float2(const Reference<Float> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1925 |
|
| 1926 | // template<int T>
|
| 1927 | // Float2(const SwizzleMask1Float4<T> &rhs);
|
| 1928 |
|
| 1929 | // RValue<Float2> operator=(float replicate) const;
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1930 | // RValue<Float2> operator=(RValue<Float2> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1931 | // RValue<Float2> operator=(const Float2 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1932 | // RValue<Float2> operator=(const Reference<Float2> &rhs) const;
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1933 | // RValue<Float2> operator=(RValue<Float> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1934 | // RValue<Float2> operator=(const Float &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1935 | // RValue<Float2> operator=(const Reference<Float> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1936 |
|
| 1937 | // template<int T>
|
| 1938 | // RValue<Float2> operator=(const SwizzleMask1Float4<T> &rhs);
|
| 1939 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1940 | // friend RValue<Float2> operator+(RValue<Float2> lhs, RValue<Float2> rhs);
|
| 1941 | // friend RValue<Float2> operator-(RValue<Float2> lhs, RValue<Float2> rhs);
|
| 1942 | // friend RValue<Float2> operator*(RValue<Float2> lhs, RValue<Float2> rhs);
|
| 1943 | // friend RValue<Float2> operator/(RValue<Float2> lhs, RValue<Float2> rhs);
|
| 1944 | // friend RValue<Float2> operator%(RValue<Float2> lhs, RValue<Float2> rhs);
|
| 1945 | // friend RValue<Float2> operator+=(const Float2 &lhs, RValue<Float2> rhs);
|
| 1946 | // friend RValue<Float2> operator-=(const Float2 &lhs, RValue<Float2> rhs);
|
| 1947 | // friend RValue<Float2> operator*=(const Float2 &lhs, RValue<Float2> rhs);
|
| 1948 | // friend RValue<Float2> operator/=(const Float2 &lhs, RValue<Float2> rhs);
|
| 1949 | // friend RValue<Float2> operator%=(const Float2 &lhs, RValue<Float2> rhs);
|
| 1950 | // friend RValue<Float2> operator+(RValue<Float2> val);
|
| 1951 | // friend RValue<Float2> operator-(RValue<Float2> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1952 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1953 | // friend RValue<Float2> Abs(RValue<Float2> x);
|
| 1954 | // friend RValue<Float2> Max(RValue<Float2> x, RValue<Float2> y);
|
| 1955 | // friend RValue<Float2> Min(RValue<Float2> x, RValue<Float2> y);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1956 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1957 | // friend RValue<Float2> Swizzle(RValue<Float2> x, unsigned char select);
|
| 1958 | // friend RValue<Float2> Mask(Float2 &lhs, RValue<Float2> rhs, unsigned char select);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1959 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1960 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1961 | };
|
| 1962 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1963 | class Float4 : public Variable<Float4>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1964 | {
|
| 1965 | public:
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1966 | explicit Float4(RValue<Byte4> cast);
|
| 1967 | explicit Float4(RValue<SByte4> cast);
|
| 1968 | explicit Float4(RValue<Short4> cast);
|
| 1969 | explicit Float4(RValue<UShort4> cast);
|
| 1970 | explicit Float4(RValue<Int4> cast);
|
| 1971 | explicit Float4(RValue<UInt4> cast);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1972 |
|
| 1973 | Float4();
|
| 1974 | Float4(float xyzw);
|
| 1975 | Float4(float x, float yzw);
|
| 1976 | Float4(float x, float y, float zw);
|
| 1977 | Float4(float x, float y, float z, float w);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1978 | Float4(RValue<Float4> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1979 | Float4(const Float4 &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1980 | Float4(const Reference<Float4> &rhs);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1981 | Float4(RValue<Float> rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1982 | Float4(const Float &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1983 | Float4(const Reference<Float> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1984 |
|
| 1985 | template<int T>
|
| 1986 | Float4(const SwizzleMask1Float4<T> &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1987 | template<int T>
|
| 1988 | Float4(const SwizzleFloat4<T> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1989 | template<int X, int Y>
|
| 1990 | Float4(const Swizzle2Float4<X> &x, const Swizzle2Float4<Y> &y);
|
| 1991 | template<int X, int Y>
|
| 1992 | Float4(const SwizzleMask2Float4<X> &x, const Swizzle2Float4<Y> &y);
|
| 1993 | template<int X, int Y>
|
| 1994 | Float4(const Swizzle2Float4<X> &x, const SwizzleMask2Float4<Y> &y);
|
| 1995 | template<int X, int Y>
|
| 1996 | Float4(const SwizzleMask2Float4<X> &x, const SwizzleMask2Float4<Y> &y);
|
| 1997 |
|
| 1998 | RValue<Float4> operator=(float replicate) const;
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 1999 | RValue<Float4> operator=(RValue<Float4> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2000 | RValue<Float4> operator=(const Float4 &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2001 | RValue<Float4> operator=(const Reference<Float4> &rhs) const;
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2002 | RValue<Float4> operator=(RValue<Float> rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2003 | RValue<Float4> operator=(const Float &rhs) const;
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2004 | RValue<Float4> operator=(const Reference<Float> &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2005 |
|
| 2006 | template<int T>
|
| 2007 | RValue<Float4> operator=(const SwizzleMask1Float4<T> &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2008 | template<int T>
|
| 2009 | RValue<Float4> operator=(const SwizzleFloat4<T> &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2010 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2011 | friend RValue<Float4> operator+(RValue<Float4> lhs, RValue<Float4> rhs);
|
| 2012 | friend RValue<Float4> operator-(RValue<Float4> lhs, RValue<Float4> rhs);
|
| 2013 | friend RValue<Float4> operator*(RValue<Float4> lhs, RValue<Float4> rhs);
|
| 2014 | friend RValue<Float4> operator/(RValue<Float4> lhs, RValue<Float4> rhs);
|
| 2015 | friend RValue<Float4> operator%(RValue<Float4> lhs, RValue<Float4> rhs);
|
| 2016 | friend RValue<Float4> operator+=(const Float4 &lhs, RValue<Float4> rhs);
|
| 2017 | friend RValue<Float4> operator-=(const Float4 &lhs, RValue<Float4> rhs);
|
| 2018 | friend RValue<Float4> operator*=(const Float4 &lhs, RValue<Float4> rhs);
|
| 2019 | friend RValue<Float4> operator/=(const Float4 &lhs, RValue<Float4> rhs);
|
| 2020 | friend RValue<Float4> operator%=(const Float4 &lhs, RValue<Float4> rhs);
|
| 2021 | friend RValue<Float4> operator+(RValue<Float4> val);
|
| 2022 | friend RValue<Float4> operator-(RValue<Float4> val);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2023 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2024 | friend RValue<Float4> Abs(RValue<Float4> x);
|
| 2025 | friend RValue<Float4> Max(RValue<Float4> x, RValue<Float4> y);
|
| 2026 | friend RValue<Float4> Min(RValue<Float4> x, RValue<Float4> y);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2027 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2028 | friend RValue<Float4> Rcp_pp(RValue<Float4> val);
|
| 2029 | friend RValue<Float4> RcpSqrt_pp(RValue<Float4> val);
|
| 2030 | friend RValue<Float4> Sqrt(RValue<Float4> x);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2031 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2032 | friend RValue<Float4> Insert(const Float4 &val, RValue<Float> element, int i);
|
| 2033 | friend RValue<Float> Extract(RValue<Float4> x, int i);
|
| 2034 | friend RValue<Float4> Swizzle(RValue<Float4> x, unsigned char select);
|
| 2035 | friend RValue<Float4> ShuffleLowHigh(RValue<Float4> x, RValue<Float4> y, unsigned char imm);
|
| 2036 | friend RValue<Float4> UnpackLow(RValue<Float4> x, RValue<Float4> y);
|
| 2037 | friend RValue<Float4> UnpackHigh(RValue<Float4> x, RValue<Float4> y);
|
| 2038 | friend RValue<Float4> Mask(Float4 &lhs, RValue<Float4> rhs, unsigned char select);
|
| 2039 | friend RValue<Int> SignMask(RValue<Float4> x);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2040 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2041 | friend RValue<Int4> CmpEQ(RValue<Float4> x, RValue<Float4> y);
|
| 2042 | friend RValue<Int4> CmpLT(RValue<Float4> x, RValue<Float4> y);
|
| 2043 | friend RValue<Int4> CmpLE(RValue<Float4> x, RValue<Float4> y);
|
| 2044 | friend RValue<Int4> CmpNEQ(RValue<Float4> x, RValue<Float4> y);
|
| 2045 | friend RValue<Int4> CmpNLT(RValue<Float4> x, RValue<Float4> y);
|
| 2046 | friend RValue<Int4> CmpNLE(RValue<Float4> x, RValue<Float4> y);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2047 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2048 | friend RValue<Float4> Round(RValue<Float4> x);
|
| 2049 | friend RValue<Float4> Trunc(RValue<Float4> x);
|
| 2050 | friend RValue<Float4> Frac(RValue<Float4> x);
|
| 2051 | friend RValue<Float4> Floor(RValue<Float4> x);
|
| 2052 | friend RValue<Float4> Ceil(RValue<Float4> x);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2053 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2054 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2055 |
|
| 2056 | union
|
| 2057 | {
|
| 2058 | SwizzleMask1Float4<0x00> x;
|
| 2059 | SwizzleMask1Float4<0x55> y;
|
| 2060 | SwizzleMask1Float4<0xAA> z;
|
| 2061 | SwizzleMask1Float4<0xFF> w;
|
| 2062 | Swizzle2Float4<0x00> xx;
|
| 2063 | Swizzle2Float4<0x01> yx;
|
| 2064 | Swizzle2Float4<0x02> zx;
|
| 2065 | Swizzle2Float4<0x03> wx;
|
| 2066 | SwizzleMask2Float4<0x54> xy;
|
| 2067 | Swizzle2Float4<0x55> yy;
|
| 2068 | Swizzle2Float4<0x56> zy;
|
| 2069 | Swizzle2Float4<0x57> wy;
|
| 2070 | SwizzleMask2Float4<0xA8> xz;
|
| 2071 | SwizzleMask2Float4<0xA9> yz;
|
| 2072 | Swizzle2Float4<0xAA> zz;
|
| 2073 | Swizzle2Float4<0xAB> wz;
|
| 2074 | SwizzleMask2Float4<0xFC> xw;
|
| 2075 | SwizzleMask2Float4<0xFD> yw;
|
| 2076 | SwizzleMask2Float4<0xFE> zw;
|
| 2077 | Swizzle2Float4<0xFF> ww;
|
| 2078 | SwizzleFloat4<0x00> xxx;
|
| 2079 | SwizzleFloat4<0x01> yxx;
|
| 2080 | SwizzleFloat4<0x02> zxx;
|
| 2081 | SwizzleFloat4<0x03> wxx;
|
| 2082 | SwizzleFloat4<0x04> xyx;
|
| 2083 | SwizzleFloat4<0x05> yyx;
|
| 2084 | SwizzleFloat4<0x06> zyx;
|
| 2085 | SwizzleFloat4<0x07> wyx;
|
| 2086 | SwizzleFloat4<0x08> xzx;
|
| 2087 | SwizzleFloat4<0x09> yzx;
|
| 2088 | SwizzleFloat4<0x0A> zzx;
|
| 2089 | SwizzleFloat4<0x0B> wzx;
|
| 2090 | SwizzleFloat4<0x0C> xwx;
|
| 2091 | SwizzleFloat4<0x0D> ywx;
|
| 2092 | SwizzleFloat4<0x0E> zwx;
|
| 2093 | SwizzleFloat4<0x0F> wwx;
|
| 2094 | SwizzleFloat4<0x50> xxy;
|
| 2095 | SwizzleFloat4<0x51> yxy;
|
| 2096 | SwizzleFloat4<0x52> zxy;
|
| 2097 | SwizzleFloat4<0x53> wxy;
|
| 2098 | SwizzleFloat4<0x54> xyy;
|
| 2099 | SwizzleFloat4<0x55> yyy;
|
| 2100 | SwizzleFloat4<0x56> zyy;
|
| 2101 | SwizzleFloat4<0x57> wyy;
|
| 2102 | SwizzleFloat4<0x58> xzy;
|
| 2103 | SwizzleFloat4<0x59> yzy;
|
| 2104 | SwizzleFloat4<0x5A> zzy;
|
| 2105 | SwizzleFloat4<0x5B> wzy;
|
| 2106 | SwizzleFloat4<0x5C> xwy;
|
| 2107 | SwizzleFloat4<0x5D> ywy;
|
| 2108 | SwizzleFloat4<0x5E> zwy;
|
| 2109 | SwizzleFloat4<0x5F> wwy;
|
| 2110 | SwizzleFloat4<0xA0> xxz;
|
| 2111 | SwizzleFloat4<0xA1> yxz;
|
| 2112 | SwizzleFloat4<0xA2> zxz;
|
| 2113 | SwizzleFloat4<0xA3> wxz;
|
| 2114 | SwizzleMaskFloat4<0xA4> xyz;
|
| 2115 | SwizzleFloat4<0xA5> yyz;
|
| 2116 | SwizzleFloat4<0xA6> zyz;
|
| 2117 | SwizzleFloat4<0xA7> wyz;
|
| 2118 | SwizzleFloat4<0xA8> xzz;
|
| 2119 | SwizzleFloat4<0xA9> yzz;
|
| 2120 | SwizzleFloat4<0xAA> zzz;
|
| 2121 | SwizzleFloat4<0xAB> wzz;
|
| 2122 | SwizzleFloat4<0xAC> xwz;
|
| 2123 | SwizzleFloat4<0xAD> ywz;
|
| 2124 | SwizzleFloat4<0xAE> zwz;
|
| 2125 | SwizzleFloat4<0xAF> wwz;
|
| 2126 | SwizzleFloat4<0xF0> xxw;
|
| 2127 | SwizzleFloat4<0xF1> yxw;
|
| 2128 | SwizzleFloat4<0xF2> zxw;
|
| 2129 | SwizzleFloat4<0xF3> wxw;
|
| 2130 | SwizzleMaskFloat4<0xF4> xyw;
|
| 2131 | SwizzleFloat4<0xF5> yyw;
|
| 2132 | SwizzleFloat4<0xF6> zyw;
|
| 2133 | SwizzleFloat4<0xF7> wyw;
|
| 2134 | SwizzleMaskFloat4<0xF8> xzw;
|
| 2135 | SwizzleMaskFloat4<0xF9> yzw;
|
| 2136 | SwizzleFloat4<0xFA> zzw;
|
| 2137 | SwizzleFloat4<0xFB> wzw;
|
| 2138 | SwizzleFloat4<0xFC> xww;
|
| 2139 | SwizzleFloat4<0xFD> yww;
|
| 2140 | SwizzleFloat4<0xFE> zww;
|
| 2141 | SwizzleFloat4<0xFF> www;
|
| 2142 | SwizzleFloat4<0x00> xxxx;
|
| 2143 | SwizzleFloat4<0x01> yxxx;
|
| 2144 | SwizzleFloat4<0x02> zxxx;
|
| 2145 | SwizzleFloat4<0x03> wxxx;
|
| 2146 | SwizzleFloat4<0x04> xyxx;
|
| 2147 | SwizzleFloat4<0x05> yyxx;
|
| 2148 | SwizzleFloat4<0x06> zyxx;
|
| 2149 | SwizzleFloat4<0x07> wyxx;
|
| 2150 | SwizzleFloat4<0x08> xzxx;
|
| 2151 | SwizzleFloat4<0x09> yzxx;
|
| 2152 | SwizzleFloat4<0x0A> zzxx;
|
| 2153 | SwizzleFloat4<0x0B> wzxx;
|
| 2154 | SwizzleFloat4<0x0C> xwxx;
|
| 2155 | SwizzleFloat4<0x0D> ywxx;
|
| 2156 | SwizzleFloat4<0x0E> zwxx;
|
| 2157 | SwizzleFloat4<0x0F> wwxx;
|
| 2158 | SwizzleFloat4<0x10> xxyx;
|
| 2159 | SwizzleFloat4<0x11> yxyx;
|
| 2160 | SwizzleFloat4<0x12> zxyx;
|
| 2161 | SwizzleFloat4<0x13> wxyx;
|
| 2162 | SwizzleFloat4<0x14> xyyx;
|
| 2163 | SwizzleFloat4<0x15> yyyx;
|
| 2164 | SwizzleFloat4<0x16> zyyx;
|
| 2165 | SwizzleFloat4<0x17> wyyx;
|
| 2166 | SwizzleFloat4<0x18> xzyx;
|
| 2167 | SwizzleFloat4<0x19> yzyx;
|
| 2168 | SwizzleFloat4<0x1A> zzyx;
|
| 2169 | SwizzleFloat4<0x1B> wzyx;
|
| 2170 | SwizzleFloat4<0x1C> xwyx;
|
| 2171 | SwizzleFloat4<0x1D> ywyx;
|
| 2172 | SwizzleFloat4<0x1E> zwyx;
|
| 2173 | SwizzleFloat4<0x1F> wwyx;
|
| 2174 | SwizzleFloat4<0x20> xxzx;
|
| 2175 | SwizzleFloat4<0x21> yxzx;
|
| 2176 | SwizzleFloat4<0x22> zxzx;
|
| 2177 | SwizzleFloat4<0x23> wxzx;
|
| 2178 | SwizzleFloat4<0x24> xyzx;
|
| 2179 | SwizzleFloat4<0x25> yyzx;
|
| 2180 | SwizzleFloat4<0x26> zyzx;
|
| 2181 | SwizzleFloat4<0x27> wyzx;
|
| 2182 | SwizzleFloat4<0x28> xzzx;
|
| 2183 | SwizzleFloat4<0x29> yzzx;
|
| 2184 | SwizzleFloat4<0x2A> zzzx;
|
| 2185 | SwizzleFloat4<0x2B> wzzx;
|
| 2186 | SwizzleFloat4<0x2C> xwzx;
|
| 2187 | SwizzleFloat4<0x2D> ywzx;
|
| 2188 | SwizzleFloat4<0x2E> zwzx;
|
| 2189 | SwizzleFloat4<0x2F> wwzx;
|
| 2190 | SwizzleFloat4<0x30> xxwx;
|
| 2191 | SwizzleFloat4<0x31> yxwx;
|
| 2192 | SwizzleFloat4<0x32> zxwx;
|
| 2193 | SwizzleFloat4<0x33> wxwx;
|
| 2194 | SwizzleFloat4<0x34> xywx;
|
| 2195 | SwizzleFloat4<0x35> yywx;
|
| 2196 | SwizzleFloat4<0x36> zywx;
|
| 2197 | SwizzleFloat4<0x37> wywx;
|
| 2198 | SwizzleFloat4<0x38> xzwx;
|
| 2199 | SwizzleFloat4<0x39> yzwx;
|
| 2200 | SwizzleFloat4<0x3A> zzwx;
|
| 2201 | SwizzleFloat4<0x3B> wzwx;
|
| 2202 | SwizzleFloat4<0x3C> xwwx;
|
| 2203 | SwizzleFloat4<0x3D> ywwx;
|
| 2204 | SwizzleFloat4<0x3E> zwwx;
|
| 2205 | SwizzleFloat4<0x3F> wwwx;
|
| 2206 | SwizzleFloat4<0x40> xxxy;
|
| 2207 | SwizzleFloat4<0x41> yxxy;
|
| 2208 | SwizzleFloat4<0x42> zxxy;
|
| 2209 | SwizzleFloat4<0x43> wxxy;
|
| 2210 | SwizzleFloat4<0x44> xyxy;
|
| 2211 | SwizzleFloat4<0x45> yyxy;
|
| 2212 | SwizzleFloat4<0x46> zyxy;
|
| 2213 | SwizzleFloat4<0x47> wyxy;
|
| 2214 | SwizzleFloat4<0x48> xzxy;
|
| 2215 | SwizzleFloat4<0x49> yzxy;
|
| 2216 | SwizzleFloat4<0x4A> zzxy;
|
| 2217 | SwizzleFloat4<0x4B> wzxy;
|
| 2218 | SwizzleFloat4<0x4C> xwxy;
|
| 2219 | SwizzleFloat4<0x4D> ywxy;
|
| 2220 | SwizzleFloat4<0x4E> zwxy;
|
| 2221 | SwizzleFloat4<0x4F> wwxy;
|
| 2222 | SwizzleFloat4<0x50> xxyy;
|
| 2223 | SwizzleFloat4<0x51> yxyy;
|
| 2224 | SwizzleFloat4<0x52> zxyy;
|
| 2225 | SwizzleFloat4<0x53> wxyy;
|
| 2226 | SwizzleFloat4<0x54> xyyy;
|
| 2227 | SwizzleFloat4<0x55> yyyy;
|
| 2228 | SwizzleFloat4<0x56> zyyy;
|
| 2229 | SwizzleFloat4<0x57> wyyy;
|
| 2230 | SwizzleFloat4<0x58> xzyy;
|
| 2231 | SwizzleFloat4<0x59> yzyy;
|
| 2232 | SwizzleFloat4<0x5A> zzyy;
|
| 2233 | SwizzleFloat4<0x5B> wzyy;
|
| 2234 | SwizzleFloat4<0x5C> xwyy;
|
| 2235 | SwizzleFloat4<0x5D> ywyy;
|
| 2236 | SwizzleFloat4<0x5E> zwyy;
|
| 2237 | SwizzleFloat4<0x5F> wwyy;
|
| 2238 | SwizzleFloat4<0x60> xxzy;
|
| 2239 | SwizzleFloat4<0x61> yxzy;
|
| 2240 | SwizzleFloat4<0x62> zxzy;
|
| 2241 | SwizzleFloat4<0x63> wxzy;
|
| 2242 | SwizzleFloat4<0x64> xyzy;
|
| 2243 | SwizzleFloat4<0x65> yyzy;
|
| 2244 | SwizzleFloat4<0x66> zyzy;
|
| 2245 | SwizzleFloat4<0x67> wyzy;
|
| 2246 | SwizzleFloat4<0x68> xzzy;
|
| 2247 | SwizzleFloat4<0x69> yzzy;
|
| 2248 | SwizzleFloat4<0x6A> zzzy;
|
| 2249 | SwizzleFloat4<0x6B> wzzy;
|
| 2250 | SwizzleFloat4<0x6C> xwzy;
|
| 2251 | SwizzleFloat4<0x6D> ywzy;
|
| 2252 | SwizzleFloat4<0x6E> zwzy;
|
| 2253 | SwizzleFloat4<0x6F> wwzy;
|
| 2254 | SwizzleFloat4<0x70> xxwy;
|
| 2255 | SwizzleFloat4<0x71> yxwy;
|
| 2256 | SwizzleFloat4<0x72> zxwy;
|
| 2257 | SwizzleFloat4<0x73> wxwy;
|
| 2258 | SwizzleFloat4<0x74> xywy;
|
| 2259 | SwizzleFloat4<0x75> yywy;
|
| 2260 | SwizzleFloat4<0x76> zywy;
|
| 2261 | SwizzleFloat4<0x77> wywy;
|
| 2262 | SwizzleFloat4<0x78> xzwy;
|
| 2263 | SwizzleFloat4<0x79> yzwy;
|
| 2264 | SwizzleFloat4<0x7A> zzwy;
|
| 2265 | SwizzleFloat4<0x7B> wzwy;
|
| 2266 | SwizzleFloat4<0x7C> xwwy;
|
| 2267 | SwizzleFloat4<0x7D> ywwy;
|
| 2268 | SwizzleFloat4<0x7E> zwwy;
|
| 2269 | SwizzleFloat4<0x7F> wwwy;
|
| 2270 | SwizzleFloat4<0x80> xxxz;
|
| 2271 | SwizzleFloat4<0x81> yxxz;
|
| 2272 | SwizzleFloat4<0x82> zxxz;
|
| 2273 | SwizzleFloat4<0x83> wxxz;
|
| 2274 | SwizzleFloat4<0x84> xyxz;
|
| 2275 | SwizzleFloat4<0x85> yyxz;
|
| 2276 | SwizzleFloat4<0x86> zyxz;
|
| 2277 | SwizzleFloat4<0x87> wyxz;
|
| 2278 | SwizzleFloat4<0x88> xzxz;
|
| 2279 | SwizzleFloat4<0x89> yzxz;
|
| 2280 | SwizzleFloat4<0x8A> zzxz;
|
| 2281 | SwizzleFloat4<0x8B> wzxz;
|
| 2282 | SwizzleFloat4<0x8C> xwxz;
|
| 2283 | SwizzleFloat4<0x8D> ywxz;
|
| 2284 | SwizzleFloat4<0x8E> zwxz;
|
| 2285 | SwizzleFloat4<0x8F> wwxz;
|
| 2286 | SwizzleFloat4<0x90> xxyz;
|
| 2287 | SwizzleFloat4<0x91> yxyz;
|
| 2288 | SwizzleFloat4<0x92> zxyz;
|
| 2289 | SwizzleFloat4<0x93> wxyz;
|
| 2290 | SwizzleFloat4<0x94> xyyz;
|
| 2291 | SwizzleFloat4<0x95> yyyz;
|
| 2292 | SwizzleFloat4<0x96> zyyz;
|
| 2293 | SwizzleFloat4<0x97> wyyz;
|
| 2294 | SwizzleFloat4<0x98> xzyz;
|
| 2295 | SwizzleFloat4<0x99> yzyz;
|
| 2296 | SwizzleFloat4<0x9A> zzyz;
|
| 2297 | SwizzleFloat4<0x9B> wzyz;
|
| 2298 | SwizzleFloat4<0x9C> xwyz;
|
| 2299 | SwizzleFloat4<0x9D> ywyz;
|
| 2300 | SwizzleFloat4<0x9E> zwyz;
|
| 2301 | SwizzleFloat4<0x9F> wwyz;
|
| 2302 | SwizzleFloat4<0xA0> xxzz;
|
| 2303 | SwizzleFloat4<0xA1> yxzz;
|
| 2304 | SwizzleFloat4<0xA2> zxzz;
|
| 2305 | SwizzleFloat4<0xA3> wxzz;
|
| 2306 | SwizzleFloat4<0xA4> xyzz;
|
| 2307 | SwizzleFloat4<0xA5> yyzz;
|
| 2308 | SwizzleFloat4<0xA6> zyzz;
|
| 2309 | SwizzleFloat4<0xA7> wyzz;
|
| 2310 | SwizzleFloat4<0xA8> xzzz;
|
| 2311 | SwizzleFloat4<0xA9> yzzz;
|
| 2312 | SwizzleFloat4<0xAA> zzzz;
|
| 2313 | SwizzleFloat4<0xAB> wzzz;
|
| 2314 | SwizzleFloat4<0xAC> xwzz;
|
| 2315 | SwizzleFloat4<0xAD> ywzz;
|
| 2316 | SwizzleFloat4<0xAE> zwzz;
|
| 2317 | SwizzleFloat4<0xAF> wwzz;
|
| 2318 | SwizzleFloat4<0xB0> xxwz;
|
| 2319 | SwizzleFloat4<0xB1> yxwz;
|
| 2320 | SwizzleFloat4<0xB2> zxwz;
|
| 2321 | SwizzleFloat4<0xB3> wxwz;
|
| 2322 | SwizzleFloat4<0xB4> xywz;
|
| 2323 | SwizzleFloat4<0xB5> yywz;
|
| 2324 | SwizzleFloat4<0xB6> zywz;
|
| 2325 | SwizzleFloat4<0xB7> wywz;
|
| 2326 | SwizzleFloat4<0xB8> xzwz;
|
| 2327 | SwizzleFloat4<0xB9> yzwz;
|
| 2328 | SwizzleFloat4<0xBA> zzwz;
|
| 2329 | SwizzleFloat4<0xBB> wzwz;
|
| 2330 | SwizzleFloat4<0xBC> xwwz;
|
| 2331 | SwizzleFloat4<0xBD> ywwz;
|
| 2332 | SwizzleFloat4<0xBE> zwwz;
|
| 2333 | SwizzleFloat4<0xBF> wwwz;
|
| 2334 | SwizzleFloat4<0xC0> xxxw;
|
| 2335 | SwizzleFloat4<0xC1> yxxw;
|
| 2336 | SwizzleFloat4<0xC2> zxxw;
|
| 2337 | SwizzleFloat4<0xC3> wxxw;
|
| 2338 | SwizzleFloat4<0xC4> xyxw;
|
| 2339 | SwizzleFloat4<0xC5> yyxw;
|
| 2340 | SwizzleFloat4<0xC6> zyxw;
|
| 2341 | SwizzleFloat4<0xC7> wyxw;
|
| 2342 | SwizzleFloat4<0xC8> xzxw;
|
| 2343 | SwizzleFloat4<0xC9> yzxw;
|
| 2344 | SwizzleFloat4<0xCA> zzxw;
|
| 2345 | SwizzleFloat4<0xCB> wzxw;
|
| 2346 | SwizzleFloat4<0xCC> xwxw;
|
| 2347 | SwizzleFloat4<0xCD> ywxw;
|
| 2348 | SwizzleFloat4<0xCE> zwxw;
|
| 2349 | SwizzleFloat4<0xCF> wwxw;
|
| 2350 | SwizzleFloat4<0xD0> xxyw;
|
| 2351 | SwizzleFloat4<0xD1> yxyw;
|
| 2352 | SwizzleFloat4<0xD2> zxyw;
|
| 2353 | SwizzleFloat4<0xD3> wxyw;
|
| 2354 | SwizzleFloat4<0xD4> xyyw;
|
| 2355 | SwizzleFloat4<0xD5> yyyw;
|
| 2356 | SwizzleFloat4<0xD6> zyyw;
|
| 2357 | SwizzleFloat4<0xD7> wyyw;
|
| 2358 | SwizzleFloat4<0xD8> xzyw;
|
| 2359 | SwizzleFloat4<0xD9> yzyw;
|
| 2360 | SwizzleFloat4<0xDA> zzyw;
|
| 2361 | SwizzleFloat4<0xDB> wzyw;
|
| 2362 | SwizzleFloat4<0xDC> xwyw;
|
| 2363 | SwizzleFloat4<0xDD> ywyw;
|
| 2364 | SwizzleFloat4<0xDE> zwyw;
|
| 2365 | SwizzleFloat4<0xDF> wwyw;
|
| 2366 | SwizzleFloat4<0xE0> xxzw;
|
| 2367 | SwizzleFloat4<0xE1> yxzw;
|
| 2368 | SwizzleFloat4<0xE2> zxzw;
|
| 2369 | SwizzleFloat4<0xE3> wxzw;
|
| 2370 | SwizzleMaskFloat4<0xE4> xyzw;
|
| 2371 | SwizzleFloat4<0xE5> yyzw;
|
| 2372 | SwizzleFloat4<0xE6> zyzw;
|
| 2373 | SwizzleFloat4<0xE7> wyzw;
|
| 2374 | SwizzleFloat4<0xE8> xzzw;
|
| 2375 | SwizzleFloat4<0xE9> yzzw;
|
| 2376 | SwizzleFloat4<0xEA> zzzw;
|
| 2377 | SwizzleFloat4<0xEB> wzzw;
|
| 2378 | SwizzleFloat4<0xEC> xwzw;
|
| 2379 | SwizzleFloat4<0xED> ywzw;
|
| 2380 | SwizzleFloat4<0xEE> zwzw;
|
| 2381 | SwizzleFloat4<0xEF> wwzw;
|
| 2382 | SwizzleFloat4<0xF0> xxww;
|
| 2383 | SwizzleFloat4<0xF1> yxww;
|
| 2384 | SwizzleFloat4<0xF2> zxww;
|
| 2385 | SwizzleFloat4<0xF3> wxww;
|
| 2386 | SwizzleFloat4<0xF4> xyww;
|
| 2387 | SwizzleFloat4<0xF5> yyww;
|
| 2388 | SwizzleFloat4<0xF6> zyww;
|
| 2389 | SwizzleFloat4<0xF7> wyww;
|
| 2390 | SwizzleFloat4<0xF8> xzww;
|
| 2391 | SwizzleFloat4<0xF9> yzww;
|
| 2392 | SwizzleFloat4<0xFA> zzww;
|
| 2393 | SwizzleFloat4<0xFB> wzww;
|
| 2394 | SwizzleFloat4<0xFC> xwww;
|
| 2395 | SwizzleFloat4<0xFD> ywww;
|
| 2396 | SwizzleFloat4<0xFE> zwww;
|
| 2397 | SwizzleFloat4<0xFF> wwww;
|
| 2398 | };
|
| 2399 |
|
| 2400 | private:
|
| 2401 | void constant(float x, float y, float z, float w);
|
| 2402 | };
|
| 2403 |
|
| 2404 | template<class T>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2405 | class Pointer : public Variable<Pointer<T> >
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2406 | {
|
| 2407 | public:
|
| 2408 | template<class S>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2409 | Pointer(RValue<Pointer<S> > pointerS, int alignment = 1) : alignment(alignment)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2410 | {
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2411 | llvm::Value *pointerT = Nucleus::createBitCast(pointerS.value, Nucleus::getPointerType(T::getType()));
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2412 | LValue::storeValue(pointerT);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2413 | }
|
| 2414 |
|
| 2415 | template<class S>
|
| 2416 | Pointer(const Pointer<S> &pointer, int alignment = 1) : alignment(alignment)
|
| 2417 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2418 | llvm::Value *pointerS = pointer.loadValue(alignment);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2419 | llvm::Value *pointerT = Nucleus::createBitCast(pointerS, Nucleus::getPointerType(T::getType()));
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2420 | LValue::storeValue(pointerT);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2421 | }
|
| 2422 |
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2423 | explicit Pointer(llvm::Argument *argument);
|
| 2424 | explicit Pointer(const void *external);
|
| 2425 |
|
| 2426 | Pointer();
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2427 | Pointer(RValue<Pointer<T> > rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2428 | Pointer(const Pointer<T> &rhs);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2429 | Pointer(const Reference<Pointer<T> > &rhs);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2430 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2431 | RValue<Pointer<T> > operator=(RValue<Pointer<T> > rhs) const;
|
| 2432 | RValue<Pointer<T> > operator=(const Pointer<T> &rhs) const;
|
| 2433 | RValue<Pointer<T> > operator=(const Reference<Pointer<T> > &rhs) const;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2434 |
|
| 2435 | Reference<T> operator*();
|
| 2436 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2437 | friend RValue<Pointer<Byte> > operator+(RValue<Pointer<Byte> > lhs, int offset);
|
| 2438 | friend RValue<Pointer<Byte> > operator+(RValue<Pointer<Byte> > lhs, RValue<Int> offset);
|
| 2439 | friend RValue<Pointer<Byte> > operator+(RValue<Pointer<Byte> > lhs, RValue<UInt> offset);
|
| 2440 | friend RValue<Pointer<Byte> > operator+=(const Pointer<Byte> &lhs, int offset);
|
| 2441 | friend RValue<Pointer<Byte> > operator+=(const Pointer<Byte> &lhs, RValue<Int> offset);
|
| 2442 | friend RValue<Pointer<Byte> > operator+=(const Pointer<Byte> &lhs, RValue<UInt> offset);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2443 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2444 | friend RValue<Pointer<Byte> > operator-(RValue<Pointer<Byte> > lhs, int offset);
|
| 2445 | friend RValue<Pointer<Byte> > operator-(RValue<Pointer<Byte> > lhs, RValue<Int> offset);
|
| 2446 | friend RValue<Pointer<Byte> > operator-(RValue<Pointer<Byte> > lhs, RValue<UInt> offset);
|
| 2447 | friend RValue<Pointer<Byte> > operator-=(const Pointer<Byte> &lhs, int offset);
|
| 2448 | friend RValue<Pointer<Byte> > operator-=(const Pointer<Byte> &lhs, RValue<Int> offset);
|
| 2449 | friend RValue<Pointer<Byte> > operator-=(const Pointer<Byte> &lhs, RValue<UInt> offset);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2450 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2451 | static llvm::Type *getType();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2452 |
|
| 2453 | private:
|
| 2454 | const int alignment;
|
| 2455 | };
|
| 2456 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2457 | template<class T, int S = 1>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2458 | class Array : public Variable<T>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2459 | {
|
| 2460 | public:
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2461 | Array(int size = S);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2462 |
|
| 2463 | Reference<T> operator[](int index);
|
| 2464 | Reference<T> operator[](RValue<Int> index);
|
| 2465 | Reference<T> operator[](RValue<UInt> index);
|
| 2466 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2467 | // friend RValue<Array<T> > operator++(const Array<T> &val, int); // Post-increment
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2468 | // friend const Array<T> &operator++(const Array<T> &val); // Pre-increment
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2469 | // friend RValue<Array<T> > operator--(const Array<T> &val, int); // Post-decrement
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2470 | // friend const Array<T> &operator--(const Array<T> &val); // Pre-decrement
|
| 2471 | };
|
| 2472 |
|
| 2473 | llvm::BasicBlock *beginLoop();
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2474 | bool branch(RValue<Bool> cmp, llvm::BasicBlock *bodyBB, llvm::BasicBlock *endBB);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2475 | bool elseBlock(llvm::BasicBlock *falseBB);
|
| 2476 |
|
| 2477 | void Return();
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2478 | void Return(bool ret);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2479 | void Return(const Int &ret);
|
| 2480 |
|
| 2481 | template<class T>
|
| 2482 | void Return(const Pointer<T> &ret);
|
| 2483 |
|
| 2484 | template<class T>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2485 | void Return(RValue<Pointer<T> > ret);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2486 |
|
| 2487 | template<class R = Void, class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void>
|
| 2488 | class Function
|
| 2489 | {
|
| 2490 | public:
|
| 2491 | Function();
|
| 2492 |
|
| 2493 | virtual ~Function();
|
| 2494 |
|
| 2495 | llvm::Argument *arg(int index);
|
| 2496 |
|
| 2497 | Routine *operator()(const wchar_t *name, ...);
|
| 2498 |
|
| 2499 | private:
|
| 2500 | Nucleus *core;
|
| 2501 | llvm::Function *function;
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2502 | std::vector<llvm::Type*> arguments;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2503 | };
|
| 2504 |
|
| 2505 | RValue<Long> Ticks();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2506 | }
|
| 2507 |
|
| 2508 | namespace sw
|
| 2509 | {
|
| 2510 | template<class T>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2511 | Variable<T>::Variable(int arraySize) : LValue(T::getType(), arraySize)
|
| 2512 | {
|
| 2513 | }
|
| 2514 |
|
| 2515 | template<class T>
|
| 2516 | RValue<Pointer<T> > Variable<T>::operator&()
|
| 2517 | {
|
| 2518 | return RValue<Pointer<T> >(LValue::address);
|
| 2519 | }
|
| 2520 |
|
| 2521 | template<class T>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2522 | Reference<T>::Reference(llvm::Value *pointer, int alignment) : alignment(alignment)
|
| 2523 | {
|
| 2524 | address = pointer;
|
| 2525 | }
|
| 2526 |
|
| 2527 | template<class T>
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2528 | RValue<T> Reference<T>::operator=(RValue<T> rhs) const
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2529 | {
|
| 2530 | Nucleus::createStore(rhs.value, address, false, alignment);
|
| 2531 |
|
| 2532 | return rhs;
|
| 2533 | }
|
| 2534 |
|
| 2535 | template<class T>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2536 | RValue<T> Reference<T>::operator=(const Reference<T> &ref) const
|
| 2537 | {
|
| 2538 | llvm::Value *tmp = Nucleus::createLoad(ref.address, false, ref.alignment);
|
| 2539 | Nucleus::createStore(tmp, address, false, alignment);
|
| 2540 |
|
| 2541 | return RValue<T>(tmp);
|
| 2542 | }
|
| 2543 |
|
| 2544 | template<class T>
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2545 | RValue<T> Reference<T>::operator+=(RValue<T> rhs) const
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2546 | {
|
| 2547 | return *this = *this + rhs;
|
| 2548 | }
|
| 2549 |
|
| 2550 | template<class T>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2551 | llvm::Value *Reference<T>::loadValue() const
|
| 2552 | {
|
| 2553 | return Nucleus::createLoad(address, false, alignment);
|
| 2554 | }
|
| 2555 |
|
| 2556 | template<class T>
|
| 2557 | int Reference<T>::getAlignment() const
|
| 2558 | {
|
| 2559 | return alignment;
|
| 2560 | }
|
| 2561 |
|
| 2562 | template<class T>
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2563 | RValue<T>::RValue(llvm::Value *rvalue)
|
| 2564 | {
|
| 2565 | value = rvalue;
|
| 2566 | }
|
| 2567 |
|
| 2568 | template<class T>
|
| 2569 | RValue<T>::RValue(const T &lvalue)
|
| 2570 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2571 | value = lvalue.loadValue();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2572 | }
|
| 2573 |
|
| 2574 | template<class T>
|
| 2575 | RValue<T>::RValue(typename IntLiteral<T>::type i)
|
| 2576 | {
|
| 2577 | value = (llvm::Value*)Nucleus::createConstantInt(i);
|
| 2578 | }
|
| 2579 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2580 | template<class T>
|
| 2581 | RValue<T>::RValue(typename FloatLiteral<T>::type f)
|
| 2582 | {
|
| 2583 | value = (llvm::Value*)Nucleus::createConstantFloat(f);
|
| 2584 | }
|
| 2585 |
|
| 2586 | template<class T>
|
| 2587 | RValue<T>::RValue(const Reference<T> &ref)
|
| 2588 | {
|
| 2589 | value = ref.loadValue();
|
| 2590 | }
|
| 2591 |
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2592 | template<int T>
|
| 2593 | Swizzle2Float4<T>::operator RValue<Float4>() const
|
| 2594 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2595 | llvm::Value *vector = parent->loadValue();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2596 |
|
| 2597 | return RValue<Float4>(Nucleus::createSwizzle(vector, T));
|
| 2598 | }
|
| 2599 |
|
| 2600 | template<int T>
|
| 2601 | SwizzleFloat4<T>::operator RValue<Float4>() const
|
| 2602 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2603 | llvm::Value *vector = parent->loadValue();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2604 |
|
| 2605 | return RValue<Float4>(Nucleus::createSwizzle(vector, T));
|
| 2606 | }
|
| 2607 |
|
| 2608 | template<int T>
|
| 2609 | SwizzleMaskFloat4<T>::operator RValue<Float4>() const
|
| 2610 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2611 | llvm::Value *vector = parent->loadValue();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2612 |
|
| 2613 | return RValue<Float4>(Nucleus::createSwizzle(vector, T));
|
| 2614 | }
|
| 2615 |
|
| 2616 | template<int T>
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2617 | RValue<Float4> SwizzleMaskFloat4<T>::operator=(RValue<Float4> rhs) const
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2618 | {
|
| 2619 | return Mask(*parent, rhs, T);
|
| 2620 | }
|
| 2621 |
|
| 2622 | template<int T>
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2623 | RValue<Float4> SwizzleMaskFloat4<T>::operator=(RValue<Float> rhs) const
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2624 | {
|
| 2625 | return Mask(*parent, Float4(rhs), T);
|
| 2626 | }
|
| 2627 |
|
| 2628 | template<int T>
|
| 2629 | SwizzleMask1Float4<T>::operator RValue<Float>() const // FIXME: Call a non-template function
|
| 2630 | {
|
| 2631 | return Extract(*parent, T & 0x3);
|
| 2632 | }
|
| 2633 |
|
| 2634 | template<int T>
|
| 2635 | SwizzleMask1Float4<T>::operator RValue<Float4>() const
|
| 2636 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2637 | llvm::Value *vector = parent->loadValue();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2638 |
|
| 2639 | return RValue<Float4>(Nucleus::createSwizzle(vector, T));
|
| 2640 | }
|
| 2641 |
|
| 2642 | template<int T>
|
| 2643 | RValue<Float4> SwizzleMask1Float4<T>::operator=(float x) const
|
| 2644 | {
|
| 2645 | return Insert(*parent, Float(x), T & 0x3);
|
| 2646 | }
|
| 2647 |
|
| 2648 | template<int T>
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2649 | RValue<Float4> SwizzleMask1Float4<T>::operator=(RValue<Float4> rhs) const
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2650 | {
|
| 2651 | return Mask(*parent, Float4(rhs), T);
|
| 2652 | }
|
| 2653 |
|
| 2654 | template<int T>
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2655 | RValue<Float4> SwizzleMask1Float4<T>::operator=(RValue<Float> rhs) const // FIXME: Call a non-template function
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2656 | {
|
| 2657 | return Insert(*parent, rhs, T & 0x3);
|
| 2658 | }
|
| 2659 |
|
| 2660 | template<int T>
|
| 2661 | SwizzleMask2Float4<T>::operator RValue<Float4>() const
|
| 2662 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2663 | llvm::Value *vector = parent->loadValue();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2664 |
|
| 2665 | return RValue<Float4>(Nucleus::createSwizzle(vector, T));
|
| 2666 | }
|
| 2667 |
|
| 2668 | template<int T>
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2669 | RValue<Float4> SwizzleMask2Float4<T>::operator=(RValue<Float4> rhs) const
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2670 | {
|
| 2671 | return Mask(*parent, Float4(rhs), T);
|
| 2672 | }
|
| 2673 |
|
| 2674 | template<int T>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2675 | Float::Float(const SwizzleMask1Float4<T> &rhs)
|
| 2676 | {
|
| 2677 | *this = rhs.operator RValue<Float>();
|
| 2678 | }
|
| 2679 |
|
| 2680 | template<int T>
|
| 2681 | RValue<Float> Float::operator=(const SwizzleMask1Float4<T> &rhs) const
|
| 2682 | {
|
| 2683 | return *this = rhs.operator RValue<Float>();
|
| 2684 | }
|
| 2685 |
|
| 2686 | template<int T>
|
| 2687 | Float4::Float4(const SwizzleMask1Float4<T> &rhs)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2688 | {
|
| 2689 | xyzw.parent = this;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2690 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2691 | *this = rhs.operator RValue<Float4>();
|
| 2692 | }
|
| 2693 |
|
| 2694 | template<int T>
|
| 2695 | Float4::Float4(const SwizzleFloat4<T> &rhs)
|
| 2696 | {
|
| 2697 | xyzw.parent = this;
|
| 2698 |
|
| 2699 | *this = rhs.operator RValue<Float4>();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2700 | }
|
| 2701 |
|
| 2702 | template<int X, int Y>
|
| 2703 | Float4::Float4(const Swizzle2Float4<X> &x, const Swizzle2Float4<Y> &y)
|
| 2704 | {
|
| 2705 | xyzw.parent = this;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2706 |
|
| 2707 | *this = ShuffleLowHigh(*x.parent, *y.parent, (X & 0xF) | (Y & 0xF) << 4);
|
| 2708 | }
|
| 2709 |
|
| 2710 | template<int X, int Y>
|
| 2711 | Float4::Float4(const SwizzleMask2Float4<X> &x, const Swizzle2Float4<Y> &y)
|
| 2712 | {
|
| 2713 | xyzw.parent = this;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2714 |
|
| 2715 | *this = ShuffleLowHigh(*x.parent, *y.parent, (X & 0xF) | (Y & 0xF) << 4);
|
| 2716 | }
|
| 2717 |
|
| 2718 | template<int X, int Y>
|
| 2719 | Float4::Float4(const Swizzle2Float4<X> &x, const SwizzleMask2Float4<Y> &y)
|
| 2720 | {
|
| 2721 | xyzw.parent = this;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2722 |
|
| 2723 | *this = ShuffleLowHigh(*x.parent, *y.parent, (X & 0xF) | (Y & 0xF) << 4);
|
| 2724 | }
|
| 2725 |
|
| 2726 | template<int X, int Y>
|
| 2727 | Float4::Float4(const SwizzleMask2Float4<X> &x, const SwizzleMask2Float4<Y> &y)
|
| 2728 | {
|
| 2729 | xyzw.parent = this;
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2730 |
|
| 2731 | *this = ShuffleLowHigh(*x.parent, *y.parent, (X & 0xF) | (Y & 0xF) << 4);
|
| 2732 | }
|
| 2733 |
|
| 2734 | template<int T>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2735 | RValue<Float4> Float4::operator=(const SwizzleMask1Float4<T> &rhs)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2736 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2737 | return *this = rhs.operator RValue<Float4>();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2738 | }
|
| 2739 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2740 | template<int T>
|
| 2741 | RValue<Float4> Float4::operator=(const SwizzleFloat4<T> &rhs)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2742 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2743 | return *this = rhs.operator RValue<Float4>();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2744 | }
|
| 2745 |
|
| 2746 | template<class T>
|
| 2747 | Pointer<T>::Pointer(llvm::Argument *argument) : alignment(1)
|
| 2748 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2749 | LValue::storeValue((llvm::Value*)argument);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2750 | }
|
| 2751 |
|
| 2752 | template<class T>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2753 | Pointer<T>::Pointer(const void *external) : alignment((intptr_t)external & 0x0000000F ? 1 : 16)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2754 | {
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2755 | llvm::Module *module = Nucleus::getModule();
|
| 2756 | const llvm::GlobalValue *globalPointer = Nucleus::getGlobalValueAtAddress(const_cast<void*>(external)); // FIXME: Const
|
| 2757 |
|
| 2758 | if(!globalPointer)
|
| 2759 | {
|
| 2760 | globalPointer = Nucleus::createGlobalValue(T::getType(), false, alignment);
|
| 2761 |
|
| 2762 | Nucleus::addGlobalMapping(globalPointer, const_cast<void*>(external)); // FIXME: Const
|
| 2763 | }
|
| 2764 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2765 | LValue::storeValue((llvm::Value*)globalPointer); // FIXME: Const
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2766 | }
|
| 2767 |
|
| 2768 | template<class T>
|
| 2769 | Pointer<T>::Pointer() : alignment(1)
|
| 2770 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2771 | LValue::storeValue(Nucleus::createNullPointer(T::getType()));
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2772 | }
|
| 2773 |
|
| 2774 | template<class T>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2775 | Pointer<T>::Pointer(RValue<Pointer<T> > rhs) : alignment(1)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2776 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2777 | LValue::storeValue(rhs.value);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2778 | }
|
| 2779 |
|
| 2780 | template<class T>
|
| 2781 | Pointer<T>::Pointer(const Pointer<T> &rhs) : alignment(rhs.alignment)
|
| 2782 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2783 | llvm::Value *value = rhs.loadValue();
|
| 2784 | LValue::storeValue(value);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2785 | }
|
| 2786 |
|
| 2787 | template<class T>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2788 | Pointer<T>::Pointer(const Reference<Pointer<T> > &rhs) : alignment(rhs.getAlignment())
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2789 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2790 | llvm::Value *value = rhs.loadValue();
|
| 2791 | LValue::storeValue(value);
|
| 2792 | }
|
| 2793 |
|
| 2794 | template<class T>
|
| 2795 | RValue<Pointer<T> > Pointer<T>::operator=(RValue<Pointer<T> > rhs) const
|
| 2796 | {
|
| 2797 | LValue::storeValue(rhs.value);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2798 |
|
| 2799 | return rhs;
|
| 2800 | }
|
| 2801 |
|
| 2802 | template<class T>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2803 | RValue<Pointer<T> > Pointer<T>::operator=(const Pointer<T> &rhs) const
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2804 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2805 | llvm::Value *value = rhs.loadValue();
|
| 2806 | LValue::storeValue(value);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2807 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2808 | return RValue<Pointer<T> >(value);
|
| 2809 | }
|
| 2810 |
|
| 2811 | template<class T>
|
| 2812 | RValue<Pointer<T> > Pointer<T>::operator=(const Reference<Pointer<T> > &rhs) const
|
| 2813 | {
|
| 2814 | llvm::Value *value = rhs.loadValue();
|
| 2815 | LValue::storeValue(value);
|
| 2816 |
|
| 2817 | return RValue<Pointer<T> >(value);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2818 | }
|
| 2819 |
|
| 2820 | template<class T>
|
| 2821 | Reference<T> Pointer<T>::operator*()
|
| 2822 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2823 | return Reference<T>(LValue::loadValue(), alignment);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2824 | }
|
| 2825 |
|
| 2826 | template<class T>
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2827 | llvm::Type *Pointer<T>::getType()
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2828 | {
|
| 2829 | return Nucleus::getPointerType(T::getType());
|
| 2830 | }
|
| 2831 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2832 | template<class T, int S>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2833 | Array<T, S>::Array(int size) : Variable<T>(size)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2834 | {
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2835 | }
|
| 2836 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2837 | template<class T, int S>
|
| 2838 | Reference<T> Array<T, S>::operator[](int index)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2839 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2840 | llvm::Value *element = LValue::getAddress((llvm::Value*)Nucleus::createConstantInt(index));
|
| 2841 |
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2842 | return Reference<T>(element);
|
| 2843 | }
|
| 2844 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2845 | template<class T, int S>
|
| 2846 | Reference<T> Array<T, S>::operator[](RValue<Int> index)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2847 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2848 | llvm::Value *element = LValue::getAddress(index.value);
|
| 2849 |
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2850 | return Reference<T>(element);
|
| 2851 | }
|
| 2852 |
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2853 | template<class T, int S>
|
| 2854 | Reference<T> Array<T, S>::operator[](RValue<UInt> index)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2855 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2856 | llvm::Value *element = LValue::getAddress(index.value);
|
| 2857 |
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2858 | return Reference<T>(element);
|
| 2859 | }
|
| 2860 |
|
| 2861 | // template<class T>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2862 | // RValue<Array<T> > operator++(const Array<T> &val, int)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2863 | // {
|
| 2864 | // // FIXME: Requires storing the address of the array
|
| 2865 | // }
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2866 |
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2867 | // template<class T>
|
| 2868 | // const Array<T> &operator++(const Array<T> &val)
|
| 2869 | // {
|
| 2870 | // // FIXME: Requires storing the address of the array
|
| 2871 | // }
|
| 2872 |
|
| 2873 | // template<class T>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2874 | // RValue<Array<T> > operator--(const Array<T> &val, int)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2875 | // {
|
| 2876 | // // FIXME: Requires storing the address of the array
|
| 2877 | // }
|
| 2878 |
|
| 2879 | // template<class T>
|
| 2880 | // const Array<T> &operator--(const Array<T> &val)
|
| 2881 | // {
|
| 2882 | // // FIXME: Requires storing the address of the array
|
| 2883 | // }
|
| 2884 |
|
| 2885 | template<class T>
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2886 | RValue<T> IfThenElse(RValue<Bool> condition, RValue<T> ifTrue, RValue<T> ifFalse)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2887 | {
|
| 2888 | return RValue<T>(Nucleus::createSelect(condition.value, ifTrue.value, ifFalse.value));
|
| 2889 | }
|
| 2890 |
|
| 2891 | template<class T>
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2892 | RValue<T> IfThenElse(RValue<Bool> condition, const T &ifTrue, RValue<T> ifFalse)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2893 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2894 | llvm::Value *trueValue = ifTrue.loadValue();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2895 |
|
| 2896 | return RValue<T>(Nucleus::createSelect(condition.value, trueValue, ifFalse.value));
|
| 2897 | }
|
| 2898 |
|
| 2899 | template<class T>
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2900 | RValue<T> IfThenElse(RValue<Bool> condition, RValue<T> ifTrue, const T &ifFalse)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2901 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2902 | llvm::Value *falseValue = ifFalse.loadValue();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2903 |
|
| 2904 | return RValue<T>(Nucleus::createSelect(condition.value, ifTrue.value, falseValue));
|
| 2905 | }
|
| 2906 |
|
| 2907 | template<class T>
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2908 | RValue<T> IfThenElse(RValue<Bool> condition, const T &ifTrue, const T &ifFalse)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2909 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2910 | llvm::Value *trueValue = ifTrue.loadValue();
|
| 2911 | llvm::Value *falseValue = ifFalse.loadValue();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2912 |
|
| 2913 | return RValue<T>(Nucleus::createSelect(condition.value, trueValue, falseValue));
|
| 2914 | }
|
| 2915 |
|
| 2916 | template<class T>
|
| 2917 | void Return(const Pointer<T> &ret)
|
| 2918 | {
|
| 2919 | Nucleus::createRet(Nucleus::createLoad(ret.address));
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2920 | Nucleus::setInsertBlock(Nucleus::createBasicBlock());
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2921 | }
|
| 2922 |
|
| 2923 | template<class T>
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2924 | void Return(RValue<Pointer<T> > ret)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2925 | {
|
| 2926 | Nucleus::createRet(ret.value);
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2927 | Nucleus::setInsertBlock(Nucleus::createBasicBlock());
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2928 | }
|
| 2929 |
|
| 2930 | template<class R, class A1, class A2, class A3, class A4>
|
| 2931 | Function<R, A1, A2, A3, A4>::Function()
|
| 2932 | {
|
| 2933 | core = new Nucleus();
|
| 2934 |
|
| 2935 | if(!A1::isVoid()) arguments.push_back(A1::getType());
|
| 2936 | if(!A2::isVoid()) arguments.push_back(A2::getType());
|
| 2937 | if(!A3::isVoid()) arguments.push_back(A3::getType());
|
| 2938 | if(!A4::isVoid()) arguments.push_back(A4::getType());
|
| 2939 |
|
| 2940 | function = Nucleus::createFunction(R::getType(), arguments);
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2941 | Nucleus::setFunction(function);
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2942 | }
|
| 2943 |
|
| 2944 | template<class R, class A1, class A2, class A3, class A4>
|
| 2945 | Function<R, A1, A2, A3, A4>::~Function()
|
| 2946 | {
|
| 2947 | delete core;
|
| 2948 | }
|
| 2949 |
|
| 2950 | template<class R, class A1, class A2, class A3, class A4>
|
| 2951 | llvm::Argument *Function<R, A1, A2, A3, A4>::arg(int index)
|
| 2952 | {
|
| 2953 | return Nucleus::getArgument(function, index);
|
| 2954 | }
|
| 2955 |
|
| 2956 | template<class R, class A1, class A2, class A3, class A4>
|
| 2957 | Routine *Function<R, A1, A2, A3, A4>::operator()(const wchar_t *name, ...)
|
| 2958 | {
|
| 2959 | wchar_t fullName[1024 + 1];
|
| 2960 |
|
| 2961 | va_list vararg;
|
| 2962 | va_start(vararg, name);
|
| 2963 | vswprintf(fullName, 1024, name, vararg);
|
| 2964 | va_end(vararg);
|
| 2965 |
|
| 2966 | return core->acquireRoutine(fullName, true);
|
| 2967 | }
|
| 2968 |
|
| 2969 | template<class T, class S>
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2970 | RValue<T> ReinterpretCast(RValue<S> val)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2971 | {
|
| 2972 | return RValue<T>(Nucleus::createBitCast(val.value, T::getType()));
|
| 2973 | }
|
| 2974 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2975 | template<class T>
|
| 2976 | RValue<T> ReinterpretCast(const LValue &var)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2977 | {
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2978 | llvm::Value *val = var.loadValue();
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2979 |
|
| 2980 | return RValue<T>(Nucleus::createBitCast(val, T::getType()));
|
| 2981 | }
|
| 2982 |
|
| 2983 | template<class T, class S>
|
| 2984 | RValue<T> ReinterpretCast(const Reference<S> &var)
|
| 2985 | {
|
| 2986 | return ReinterpretCast<T>(RValue<S>(var));
|
| 2987 | }
|
| 2988 |
|
| 2989 | template<class T, class S>
|
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 2990 | RValue<T> As(RValue<S> val)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2991 | {
|
| 2992 | return ReinterpretCast<T>(val);
|
| 2993 | }
|
| 2994 |
|
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2995 | template<class T>
|
| 2996 | RValue<T> As(const LValue &var)
|
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2997 | {
|
| 2998 | return ReinterpretCast<T>(var);
|
| 2999 | }
|
| 3000 |
|
| 3001 | template<class T, class S>
|
| 3002 | RValue<T> As(const Reference<S> &val)
|
| 3003 | {
|
| 3004 | return ReinterpretCast<T>(val);
|
| 3005 | }
|
| 3006 | }
|
| 3007 |
|
| 3008 | #endif // sw_Nucleus_hpp
|