Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 1 | // Copyright 2016 The SwiftShader Authors. All Rights Reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | #include "Nucleus.hpp" |
| 16 | |
| 17 | #include "Reactor.hpp" |
| 18 | #include "Routine.hpp" |
| 19 | |
| 20 | #include "src/IceTypes.h" |
| 21 | #include "src/IceCfg.h" |
| 22 | #include "src/IceELFStreamer.h" |
| 23 | #include "src/IceGlobalContext.h" |
| 24 | #include "src/IceCfgNode.h" |
| 25 | #include "src/IceELFObjectWriter.h" |
| 26 | |
| 27 | #include "llvm/Support/FileSystem.h" |
| 28 | #include "llvm/Support/raw_os_ostream.h" |
| 29 | |
| 30 | #define WIN32_LEAN_AND_MEAN |
| 31 | #define NOMINMAX |
| 32 | #include <Windows.h> |
| 33 | |
| 34 | #include <mutex> |
| 35 | #include <limits> |
| 36 | #include <iostream> |
| 37 | #include <cassert> |
| 38 | |
| 39 | namespace |
| 40 | { |
| 41 | Ice::GlobalContext *context = nullptr; |
| 42 | Ice::Cfg *function = nullptr; |
| 43 | Ice::CfgNode *basicBlock = nullptr; |
| 44 | Ice::CfgLocalAllocatorScope *allocator = nullptr; |
| 45 | sw::Routine *routine = nullptr; |
| 46 | |
| 47 | std::mutex codegenMutex; |
| 48 | |
| 49 | Ice::ELFFileStreamer *elfFile = nullptr; |
| 50 | Ice::Fdstream *out = nullptr; |
| 51 | } |
| 52 | |
| 53 | namespace sw |
| 54 | { |
| 55 | class Value : public Ice::Variable {}; |
Nicolas Capens | b955d5b | 2016-09-28 22:36:28 -0400 | [diff] [blame] | 56 | class Constant : public Ice::Constant {}; |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 57 | class BasicBlock : public Ice::CfgNode {}; |
| 58 | |
| 59 | Ice::Type T(Type *t) |
| 60 | { |
| 61 | return (Ice::Type)reinterpret_cast<std::intptr_t>(t); |
| 62 | } |
| 63 | |
| 64 | Type *T(Ice::Type t) |
| 65 | { |
| 66 | return reinterpret_cast<Type*>(t); |
| 67 | } |
| 68 | |
| 69 | Value *V(Ice::Variable *v) |
| 70 | { |
| 71 | return reinterpret_cast<Value*>(v); |
| 72 | } |
| 73 | |
Nicolas Capens | b955d5b | 2016-09-28 22:36:28 -0400 | [diff] [blame] | 74 | Constant *C(Ice::Constant *c) |
| 75 | { |
| 76 | return reinterpret_cast<Constant*>(c); |
| 77 | } |
| 78 | |
Nicolas Capens | 611642a | 2016-09-28 16:45:04 -0400 | [diff] [blame] | 79 | BasicBlock *B(Ice::CfgNode *b) |
| 80 | { |
| 81 | return reinterpret_cast<BasicBlock*>(b); |
| 82 | } |
| 83 | |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 84 | Optimization optimization[10] = {InstructionCombining, Disabled}; |
| 85 | |
| 86 | void *loadImage(uint8_t *const elfImage) |
| 87 | { |
| 88 | using ElfHeader = std::conditional<sizeof(void*) == 8, Elf64_Ehdr, Elf32_Ehdr>::type; |
| 89 | ElfHeader *elfHeader = (ElfHeader*)elfImage; |
| 90 | |
| 91 | if(!elfHeader->checkMagic()) |
| 92 | { |
| 93 | return nullptr; |
| 94 | } |
| 95 | |
| 96 | using SectionHeader = std::conditional<sizeof(void*) == 8, Elf64_Shdr, Elf32_Shdr>::type; |
| 97 | SectionHeader *sectionHeader = (SectionHeader*)(elfImage + elfHeader->e_shoff); |
| 98 | void *entry = nullptr; |
| 99 | |
| 100 | for(int i = 0; i < elfHeader->e_shnum; i++) |
| 101 | { |
| 102 | if(sectionHeader[i].sh_type == SHT_PROGBITS && sectionHeader[i].sh_flags & SHF_EXECINSTR) |
| 103 | { |
| 104 | entry = elfImage + sectionHeader[i].sh_offset; |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | return entry; |
| 109 | } |
| 110 | |
| 111 | template<typename T> |
| 112 | struct ExecutableAllocator |
| 113 | { |
| 114 | ExecutableAllocator() {}; |
| 115 | template<class U> ExecutableAllocator(const ExecutableAllocator<U> &other) {}; |
| 116 | |
| 117 | using value_type = T; |
| 118 | using size_type = std::size_t; |
| 119 | |
| 120 | T *allocate(size_type n) |
| 121 | { |
| 122 | return (T*)VirtualAlloc(NULL, sizeof(T) * n, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); |
| 123 | } |
| 124 | |
| 125 | void deallocate(T *p, size_type n) |
| 126 | { |
| 127 | VirtualFree(p, 0, MEM_RELEASE); |
| 128 | } |
| 129 | }; |
| 130 | |
| 131 | class ELFMemoryStreamer : public Ice::ELFStreamer, public Routine |
| 132 | { |
| 133 | ELFMemoryStreamer(const ELFMemoryStreamer &) = delete; |
| 134 | ELFMemoryStreamer &operator=(const ELFMemoryStreamer &) = delete; |
| 135 | |
| 136 | public: |
| 137 | ELFMemoryStreamer() : Routine() |
| 138 | { |
| 139 | position = 0; |
| 140 | buffer.reserve(0x1000); |
| 141 | } |
| 142 | |
| 143 | virtual ~ELFMemoryStreamer() |
| 144 | { |
| 145 | if(buffer.size() != 0) |
| 146 | { |
| 147 | DWORD exeProtection; |
| 148 | VirtualProtect(&buffer[0], buffer.size(), oldProtection, &exeProtection); |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | void write8(uint8_t Value) override |
| 153 | { |
| 154 | if(position == (uint64_t)buffer.size()) |
| 155 | { |
| 156 | buffer.push_back(Value); |
| 157 | position++; |
| 158 | } |
| 159 | else if(position < (uint64_t)buffer.size()) |
| 160 | { |
| 161 | buffer[position] = Value; |
| 162 | position++; |
| 163 | } |
| 164 | else assert(false && "UNIMPLEMENTED"); |
| 165 | } |
| 166 | |
| 167 | void writeBytes(llvm::StringRef Bytes) override |
| 168 | { |
| 169 | std::size_t oldSize = buffer.size(); |
| 170 | buffer.resize(oldSize + Bytes.size()); |
| 171 | memcpy(&buffer[oldSize], Bytes.begin(), Bytes.size()); |
| 172 | position += Bytes.size(); |
| 173 | } |
| 174 | |
| 175 | uint64_t tell() const override { return position; } |
| 176 | |
| 177 | void seek(uint64_t Off) override { position = Off; } |
| 178 | |
| 179 | const void *getEntry() override |
| 180 | { |
| 181 | VirtualProtect(&buffer[0], buffer.size(), PAGE_EXECUTE_READ, &oldProtection); |
| 182 | position = std::numeric_limits<std::size_t>::max(); // Can't write more data after this |
| 183 | |
| 184 | return loadImage(&buffer[0]); |
| 185 | } |
| 186 | |
| 187 | private: |
| 188 | std::vector<uint8_t, ExecutableAllocator<uint8_t>> buffer; |
| 189 | std::size_t position; |
| 190 | DWORD oldProtection; |
| 191 | }; |
| 192 | |
| 193 | Nucleus::Nucleus() |
| 194 | { |
| 195 | ::codegenMutex.lock(); // Reactor is currently not thread safe |
| 196 | |
| 197 | Ice::ClFlags::Flags.setTargetArch(sizeof(void*) == 8 ? Ice::Target_X8664 : Ice::Target_X8632); |
| 198 | Ice::ClFlags::Flags.setOutFileType(Ice::FT_Elf); |
| 199 | Ice::ClFlags::Flags.setOptLevel(Ice::Opt_2); |
| 200 | Ice::ClFlags::Flags.setApplicationBinaryInterface(Ice::ABI_Platform); |
| 201 | |
| 202 | std::unique_ptr<Ice::Ostream> cout(new llvm::raw_os_ostream(std::cout)); |
| 203 | |
| 204 | if(false) // Write out to a file |
| 205 | { |
| 206 | std::error_code errorCode; |
| 207 | ::out = new Ice::Fdstream("out.o", errorCode, llvm::sys::fs::F_None); |
| 208 | ::elfFile = new Ice::ELFFileStreamer(*out); |
| 209 | ::context = new Ice::GlobalContext(cout.get(), cout.get(), cout.get(), elfFile); |
| 210 | } |
| 211 | else |
| 212 | { |
| 213 | ELFMemoryStreamer *elfMemory = new ELFMemoryStreamer(); |
| 214 | ::context = new Ice::GlobalContext(cout.get(), cout.get(), cout.get(), elfMemory); |
| 215 | ::routine = elfMemory; |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | Nucleus::~Nucleus() |
| 220 | { |
| 221 | delete ::allocator; |
| 222 | delete ::function; |
| 223 | delete ::context; |
| 224 | |
| 225 | delete ::elfFile; |
| 226 | delete ::out; |
| 227 | |
| 228 | ::codegenMutex.unlock(); |
| 229 | } |
| 230 | |
| 231 | Routine *Nucleus::acquireRoutine(const wchar_t *name, bool runOptimizations) |
| 232 | { |
| 233 | if(basicBlock->getInsts().empty() || basicBlock->getInsts().back().getKind() != Ice::Inst::Ret) |
| 234 | { |
| 235 | createRetVoid(); |
| 236 | } |
| 237 | |
| 238 | std::wstring wideName(name); |
| 239 | std::string asciiName(wideName.begin(), wideName.end()); |
| 240 | ::function->setFunctionName(Ice::GlobalString::createWithString(::context, asciiName)); |
| 241 | |
| 242 | ::function->translate(); |
| 243 | |
| 244 | ::context->emitFileHeader(); |
| 245 | ::function->emitIAS(); |
| 246 | auto assembler = ::function->releaseAssembler(); |
| 247 | ::context->getObjectWriter()->writeFunctionCode(::function->getFunctionName(), false, assembler.get()); |
| 248 | ::context->getObjectWriter()->writeNonUserSections(); |
| 249 | |
| 250 | return ::routine; |
| 251 | } |
| 252 | |
| 253 | void Nucleus::optimize() |
| 254 | { |
| 255 | } |
| 256 | |
| 257 | Value *Nucleus::allocateStackVariable(Type *t, int arraySize) |
| 258 | { |
Nicolas Capens | e12780d | 2016-09-27 14:18:07 -0400 | [diff] [blame] | 259 | assert(arraySize == 0 && "UNIMPLEMENTED"); |
| 260 | |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 261 | Ice::Type type = T(t); |
Nicolas Capens | 8820f64 | 2016-09-30 04:42:43 -0400 | [diff] [blame] | 262 | int size = Ice::typeWidthInBytes(type); |
Nicolas Capens | e12780d | 2016-09-27 14:18:07 -0400 | [diff] [blame] | 263 | |
| 264 | auto bytes = Ice::ConstantInteger32::create(::context, type, size); |
| 265 | auto address = ::function->makeVariable(T(getPointerType(t))); |
| 266 | auto alloca = Ice::InstAlloca::create(::function, address, bytes, size); |
| 267 | ::function->getEntryNode()->getInsts().push_front(alloca); |
| 268 | |
| 269 | return V(address); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 270 | } |
| 271 | |
| 272 | BasicBlock *Nucleus::createBasicBlock() |
| 273 | { |
Nicolas Capens | 611642a | 2016-09-28 16:45:04 -0400 | [diff] [blame] | 274 | return B(::function->makeNode()); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 275 | } |
| 276 | |
| 277 | BasicBlock *Nucleus::getInsertBlock() |
| 278 | { |
Nicolas Capens | 611642a | 2016-09-28 16:45:04 -0400 | [diff] [blame] | 279 | return B(::basicBlock); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 280 | } |
| 281 | |
| 282 | void Nucleus::setInsertBlock(BasicBlock *basicBlock) |
| 283 | { |
Nicolas Capens | 611642a | 2016-09-28 16:45:04 -0400 | [diff] [blame] | 284 | assert(::basicBlock->getInsts().back().getTerminatorEdges().size() >= 0 && "Previous basic block must have a terminator"); |
| 285 | ::basicBlock = basicBlock; |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 286 | } |
| 287 | |
| 288 | BasicBlock *Nucleus::getPredecessor(BasicBlock *basicBlock) |
| 289 | { |
| 290 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 291 | } |
| 292 | |
| 293 | void Nucleus::createFunction(Type *ReturnType, std::vector<Type*> &Params) |
| 294 | { |
| 295 | uint32_t sequenceNumber = 0; |
| 296 | ::function = Ice::Cfg::create(::context, sequenceNumber).release(); |
| 297 | ::allocator = new Ice::CfgLocalAllocatorScope(::function); |
| 298 | |
| 299 | for(Type *type : Params) |
| 300 | { |
| 301 | Ice::Variable *arg = ::function->makeVariable(T(type)); |
| 302 | ::function->addArg(arg); |
| 303 | } |
| 304 | |
| 305 | Ice::CfgNode *node = ::function->makeNode(); |
| 306 | ::function->setEntryNode(node); |
| 307 | ::basicBlock = node; |
| 308 | } |
| 309 | |
| 310 | Value *Nucleus::getArgument(unsigned int index) |
| 311 | { |
| 312 | return V(::function->getArgs()[index]); |
| 313 | } |
| 314 | |
| 315 | void Nucleus::createRetVoid() |
| 316 | { |
| 317 | assert(false && "UNIMPLEMENTED"); |
| 318 | } |
| 319 | |
| 320 | void Nucleus::createRet(Value *v) |
| 321 | { |
| 322 | assert(false && "UNIMPLEMENTED"); |
| 323 | } |
| 324 | |
| 325 | void Nucleus::createBr(BasicBlock *dest) |
| 326 | { |
Nicolas Capens | 611642a | 2016-09-28 16:45:04 -0400 | [diff] [blame] | 327 | auto br = Ice::InstBr::create(::function, dest); |
| 328 | ::basicBlock->appendInst(br); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 329 | } |
| 330 | |
| 331 | void Nucleus::createCondBr(Value *cond, BasicBlock *ifTrue, BasicBlock *ifFalse) |
| 332 | { |
Nicolas Capens | 611642a | 2016-09-28 16:45:04 -0400 | [diff] [blame] | 333 | auto br = Ice::InstBr::create(::function, cond, ifTrue, ifFalse); |
| 334 | ::basicBlock->appendInst(br); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 335 | } |
| 336 | |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 337 | static Value *createArithmetic(Ice::InstArithmetic::OpKind op, Value *lhs, Value *rhs) |
| 338 | { |
| 339 | assert(lhs->getType() == rhs->getType()); |
| 340 | |
| 341 | Ice::Variable *result = ::function->makeVariable(lhs->getType()); |
| 342 | Ice::InstArithmetic *arithmetic = Ice::InstArithmetic::create(::function, op, result, lhs, rhs); |
| 343 | ::basicBlock->appendInst(arithmetic); |
| 344 | |
| 345 | return V(result); |
| 346 | } |
| 347 | |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 348 | Value *Nucleus::createAdd(Value *lhs, Value *rhs) |
| 349 | { |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 350 | return createArithmetic(Ice::InstArithmetic::Add, lhs, rhs); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 351 | } |
| 352 | |
| 353 | Value *Nucleus::createSub(Value *lhs, Value *rhs) |
| 354 | { |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 355 | return createArithmetic(Ice::InstArithmetic::Sub, lhs, rhs); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 356 | } |
| 357 | |
| 358 | Value *Nucleus::createMul(Value *lhs, Value *rhs) |
| 359 | { |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 360 | return createArithmetic(Ice::InstArithmetic::Mul, lhs, rhs); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 361 | } |
| 362 | |
| 363 | Value *Nucleus::createUDiv(Value *lhs, Value *rhs) |
| 364 | { |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 365 | return createArithmetic(Ice::InstArithmetic::Udiv, lhs, rhs); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 366 | } |
| 367 | |
| 368 | Value *Nucleus::createSDiv(Value *lhs, Value *rhs) |
| 369 | { |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 370 | return createArithmetic(Ice::InstArithmetic::Sdiv, lhs, rhs); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 371 | } |
| 372 | |
| 373 | Value *Nucleus::createFAdd(Value *lhs, Value *rhs) |
| 374 | { |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 375 | return createArithmetic(Ice::InstArithmetic::Fadd, lhs, rhs); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 376 | } |
| 377 | |
| 378 | Value *Nucleus::createFSub(Value *lhs, Value *rhs) |
| 379 | { |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 380 | return createArithmetic(Ice::InstArithmetic::Fsub, lhs, rhs); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 381 | } |
| 382 | |
| 383 | Value *Nucleus::createFMul(Value *lhs, Value *rhs) |
| 384 | { |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 385 | return createArithmetic(Ice::InstArithmetic::Fmul, lhs, rhs); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 386 | } |
| 387 | |
| 388 | Value *Nucleus::createFDiv(Value *lhs, Value *rhs) |
| 389 | { |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 390 | return createArithmetic(Ice::InstArithmetic::Fdiv, lhs, rhs); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 391 | } |
| 392 | |
| 393 | Value *Nucleus::createURem(Value *lhs, Value *rhs) |
| 394 | { |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 395 | return createArithmetic(Ice::InstArithmetic::Urem, lhs, rhs); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 396 | } |
| 397 | |
| 398 | Value *Nucleus::createSRem(Value *lhs, Value *rhs) |
| 399 | { |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 400 | return createArithmetic(Ice::InstArithmetic::Srem, lhs, rhs); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 401 | } |
| 402 | |
| 403 | Value *Nucleus::createFRem(Value *lhs, Value *rhs) |
| 404 | { |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 405 | return createArithmetic(Ice::InstArithmetic::Frem, lhs, rhs); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 406 | } |
| 407 | |
| 408 | Value *Nucleus::createShl(Value *lhs, Value *rhs) |
| 409 | { |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 410 | return createArithmetic(Ice::InstArithmetic::Shl, lhs, rhs); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 411 | } |
| 412 | |
| 413 | Value *Nucleus::createLShr(Value *lhs, Value *rhs) |
| 414 | { |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 415 | return createArithmetic(Ice::InstArithmetic::Lshr, lhs, rhs); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 416 | } |
| 417 | |
| 418 | Value *Nucleus::createAShr(Value *lhs, Value *rhs) |
| 419 | { |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 420 | return createArithmetic(Ice::InstArithmetic::Ashr, lhs, rhs); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 421 | } |
| 422 | |
| 423 | Value *Nucleus::createAnd(Value *lhs, Value *rhs) |
| 424 | { |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 425 | return createArithmetic(Ice::InstArithmetic::And, lhs, rhs); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 426 | } |
| 427 | |
| 428 | Value *Nucleus::createOr(Value *lhs, Value *rhs) |
| 429 | { |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 430 | return createArithmetic(Ice::InstArithmetic::Or, lhs, rhs); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 431 | } |
| 432 | |
| 433 | Value *Nucleus::createXor(Value *lhs, Value *rhs) |
| 434 | { |
Nicolas Capens | 7d9f76d | 2016-09-29 13:39:44 -0400 | [diff] [blame] | 435 | return createArithmetic(Ice::InstArithmetic::Xor, lhs, rhs); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 436 | } |
| 437 | |
Nicolas Capens | b955d5b | 2016-09-28 22:36:28 -0400 | [diff] [blame] | 438 | Value *Nucleus::createAssign(Constant *constant) |
| 439 | { |
| 440 | Ice::Variable *value = ::function->makeVariable(constant->getType()); |
| 441 | auto assign = Ice::InstAssign::create(::function, value, constant); |
| 442 | ::basicBlock->appendInst(assign); |
| 443 | |
| 444 | return V(value); |
| 445 | } |
| 446 | |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 447 | Value *Nucleus::createNeg(Value *v) |
| 448 | { |
| 449 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 450 | } |
| 451 | |
| 452 | Value *Nucleus::createFNeg(Value *v) |
| 453 | { |
| 454 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 455 | } |
| 456 | |
| 457 | Value *Nucleus::createNot(Value *v) |
| 458 | { |
| 459 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 460 | } |
| 461 | |
Nicolas Capens | e12780d | 2016-09-27 14:18:07 -0400 | [diff] [blame] | 462 | Value *Nucleus::createLoad(Value *ptr, Type *type, bool isVolatile, unsigned int align) |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 463 | { |
Nicolas Capens | e12780d | 2016-09-27 14:18:07 -0400 | [diff] [blame] | 464 | Ice::Variable *value = ::function->makeVariable(T(type)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 465 | auto load = Ice::InstLoad::create(::function, value, ptr, align); |
| 466 | ::basicBlock->appendInst(load); |
| 467 | return V(value); |
| 468 | } |
| 469 | |
Nicolas Capens | 6d73871 | 2016-09-30 04:15:22 -0400 | [diff] [blame] | 470 | Value *Nucleus::createStore(Value *value, Value *ptr, Type *type, bool isVolatile, unsigned int align) |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 471 | { |
| 472 | auto store = Ice::InstStore::create(::function, value, ptr, align); |
| 473 | ::basicBlock->appendInst(store); |
| 474 | return value; |
| 475 | } |
| 476 | |
Nicolas Capens | 6d73871 | 2016-09-30 04:15:22 -0400 | [diff] [blame] | 477 | Constant *Nucleus::createStore(Constant *constant, Value *ptr, Type *type, bool isVolatile, unsigned int align) |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 478 | { |
Nicolas Capens | b955d5b | 2016-09-28 22:36:28 -0400 | [diff] [blame] | 479 | auto store = Ice::InstStore::create(::function, constant, ptr, align); |
| 480 | ::basicBlock->appendInst(store); |
| 481 | return constant; |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 482 | } |
| 483 | |
Nicolas Capens | 6d73871 | 2016-09-30 04:15:22 -0400 | [diff] [blame] | 484 | Value *Nucleus::createGEP(Value *ptr, Type *type, Value *index) |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 485 | { |
Nicolas Capens | 8820f64 | 2016-09-30 04:42:43 -0400 | [diff] [blame] | 486 | assert(index->getType() == Ice::IceType_i32); |
| 487 | |
| 488 | if(!Ice::isByteSizedType(T(type))) |
| 489 | { |
| 490 | index = createMul(index, createAssign(createConstantInt((int)Ice::typeWidthInBytes(T(type))))); |
| 491 | } |
| 492 | |
| 493 | if(sizeof(void*) == 8) |
| 494 | { |
| 495 | index = createSExt(index, T(Ice::IceType_i64)); |
| 496 | } |
| 497 | |
| 498 | return createAdd(ptr, index); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 499 | } |
| 500 | |
| 501 | Value *Nucleus::createAtomicAdd(Value *ptr, Value *value) |
| 502 | { |
| 503 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 504 | } |
| 505 | |
Nicolas Capens | a0c2fc5 | 2016-09-30 05:04:21 -0400 | [diff] [blame] | 506 | static Value *createCast(Ice::InstCast::OpKind op, Value *v, Type *destType) |
| 507 | { |
| 508 | if(T(v->getType()) == destType) |
| 509 | { |
| 510 | return v; |
| 511 | } |
| 512 | |
| 513 | Ice::Variable *result = ::function->makeVariable(T(destType)); |
| 514 | Ice::InstCast *cast = Ice::InstCast::create(::function, op, result, v); |
| 515 | ::basicBlock->appendInst(cast); |
| 516 | |
| 517 | return V(result); |
| 518 | } |
| 519 | |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 520 | Value *Nucleus::createTrunc(Value *v, Type *destType) |
| 521 | { |
Nicolas Capens | a0c2fc5 | 2016-09-30 05:04:21 -0400 | [diff] [blame] | 522 | return createCast(Ice::InstCast::Trunc, v, destType); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 523 | } |
| 524 | |
| 525 | Value *Nucleus::createZExt(Value *v, Type *destType) |
| 526 | { |
Nicolas Capens | a0c2fc5 | 2016-09-30 05:04:21 -0400 | [diff] [blame] | 527 | return createCast(Ice::InstCast::Zext, v, destType); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 528 | } |
| 529 | |
| 530 | Value *Nucleus::createSExt(Value *v, Type *destType) |
| 531 | { |
Nicolas Capens | a0c2fc5 | 2016-09-30 05:04:21 -0400 | [diff] [blame] | 532 | return createCast(Ice::InstCast::Sext, v, destType); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 533 | } |
| 534 | |
| 535 | Value *Nucleus::createFPToSI(Value *v, Type *destType) |
| 536 | { |
Nicolas Capens | a0c2fc5 | 2016-09-30 05:04:21 -0400 | [diff] [blame] | 537 | return createCast(Ice::InstCast::Fptosi, v, destType); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 538 | } |
| 539 | |
| 540 | Value *Nucleus::createUIToFP(Value *v, Type *destType) |
| 541 | { |
Nicolas Capens | a0c2fc5 | 2016-09-30 05:04:21 -0400 | [diff] [blame] | 542 | return createCast(Ice::InstCast::Uitofp, v, destType); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 543 | } |
| 544 | |
| 545 | Value *Nucleus::createSIToFP(Value *v, Type *destType) |
| 546 | { |
Nicolas Capens | a0c2fc5 | 2016-09-30 05:04:21 -0400 | [diff] [blame] | 547 | return createCast(Ice::InstCast::Sitofp, v, destType); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 548 | } |
| 549 | |
| 550 | Value *Nucleus::createFPTrunc(Value *v, Type *destType) |
| 551 | { |
Nicolas Capens | a0c2fc5 | 2016-09-30 05:04:21 -0400 | [diff] [blame] | 552 | return createCast(Ice::InstCast::Fptrunc, v, destType); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 553 | } |
| 554 | |
| 555 | Value *Nucleus::createFPExt(Value *v, Type *destType) |
| 556 | { |
Nicolas Capens | a0c2fc5 | 2016-09-30 05:04:21 -0400 | [diff] [blame] | 557 | return createCast(Ice::InstCast::Fpext, v, destType); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 558 | } |
| 559 | |
| 560 | Value *Nucleus::createBitCast(Value *v, Type *destType) |
| 561 | { |
Nicolas Capens | a0c2fc5 | 2016-09-30 05:04:21 -0400 | [diff] [blame] | 562 | return createCast(Ice::InstCast::Bitcast, v, destType); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 563 | } |
| 564 | |
| 565 | Value *Nucleus::createIntCast(Value *v, Type *destType, bool isSigned) |
| 566 | { |
| 567 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 568 | } |
| 569 | |
| 570 | Value *Nucleus::createICmpEQ(Value *lhs, Value *rhs) |
| 571 | { |
| 572 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 573 | } |
| 574 | |
| 575 | Value *Nucleus::createICmpNE(Value *lhs, Value *rhs) |
| 576 | { |
| 577 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 578 | } |
| 579 | |
| 580 | Value *Nucleus::createICmpUGT(Value *lhs, Value *rhs) |
| 581 | { |
| 582 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 583 | } |
| 584 | |
| 585 | Value *Nucleus::createICmpUGE(Value *lhs, Value *rhs) |
| 586 | { |
| 587 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 588 | } |
| 589 | |
| 590 | Value *Nucleus::createICmpULT(Value *lhs, Value *rhs) |
| 591 | { |
| 592 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 593 | } |
| 594 | |
| 595 | Value *Nucleus::createICmpULE(Value *lhs, Value *rhs) |
| 596 | { |
| 597 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 598 | } |
| 599 | |
| 600 | Value *Nucleus::createICmpSGT(Value *lhs, Value *rhs) |
| 601 | { |
| 602 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 603 | } |
| 604 | |
| 605 | Value *Nucleus::createICmpSGE(Value *lhs, Value *rhs) |
| 606 | { |
| 607 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 608 | } |
| 609 | |
| 610 | Value *Nucleus::createICmpSLT(Value *lhs, Value *rhs) |
| 611 | { |
Nicolas Capens | 611642a | 2016-09-28 16:45:04 -0400 | [diff] [blame] | 612 | assert(lhs->getType() == rhs->getType()); |
| 613 | |
| 614 | auto result = ::function->makeVariable(Ice::IceType_i1); |
| 615 | auto cmp = Ice::InstIcmp::create(::function, Ice::InstIcmp::Slt, result, lhs, rhs); |
| 616 | ::basicBlock->appendInst(cmp); |
| 617 | |
| 618 | return V(result); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 619 | } |
| 620 | |
| 621 | Value *Nucleus::createICmpSLE(Value *lhs, Value *rhs) |
| 622 | { |
| 623 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 624 | } |
| 625 | |
| 626 | Value *Nucleus::createFCmpOEQ(Value *lhs, Value *rhs) |
| 627 | { |
| 628 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 629 | } |
| 630 | |
| 631 | Value *Nucleus::createFCmpOGT(Value *lhs, Value *rhs) |
| 632 | { |
| 633 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 634 | } |
| 635 | |
| 636 | Value *Nucleus::createFCmpOGE(Value *lhs, Value *rhs) |
| 637 | { |
| 638 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 639 | } |
| 640 | |
| 641 | Value *Nucleus::createFCmpOLT(Value *lhs, Value *rhs) |
| 642 | { |
| 643 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 644 | } |
| 645 | |
| 646 | Value *Nucleus::createFCmpOLE(Value *lhs, Value *rhs) |
| 647 | { |
| 648 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 649 | } |
| 650 | |
| 651 | Value *Nucleus::createFCmpONE(Value *lhs, Value *rhs) |
| 652 | { |
| 653 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 654 | } |
| 655 | |
| 656 | Value *Nucleus::createFCmpORD(Value *lhs, Value *rhs) |
| 657 | { |
| 658 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 659 | } |
| 660 | |
| 661 | Value *Nucleus::createFCmpUNO(Value *lhs, Value *rhs) |
| 662 | { |
| 663 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 664 | } |
| 665 | |
| 666 | Value *Nucleus::createFCmpUEQ(Value *lhs, Value *rhs) |
| 667 | { |
| 668 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 669 | } |
| 670 | |
| 671 | Value *Nucleus::createFCmpUGT(Value *lhs, Value *rhs) |
| 672 | { |
| 673 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 674 | } |
| 675 | |
| 676 | Value *Nucleus::createFCmpUGE(Value *lhs, Value *rhs) |
| 677 | { |
| 678 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 679 | } |
| 680 | |
| 681 | Value *Nucleus::createFCmpULT(Value *lhs, Value *rhs) |
| 682 | { |
| 683 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 684 | } |
| 685 | |
| 686 | Value *Nucleus::createFCmpULE(Value *lhs, Value *rhs) |
| 687 | { |
| 688 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 689 | } |
| 690 | |
| 691 | Value *Nucleus::createFCmpUNE(Value *lhs, Value *rhs) |
| 692 | { |
| 693 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 694 | } |
| 695 | |
Nicolas Capens | e95d534 | 2016-09-30 11:37:28 -0400 | [diff] [blame] | 696 | Value *Nucleus::createExtractElement(Value *vector, Type *type, int index) |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 697 | { |
Nicolas Capens | 9709d4f | 2016-09-30 11:44:14 -0400 | [diff] [blame] | 698 | auto result = ::function->makeVariable(T(type)); |
| 699 | auto extract = Ice::InstExtractElement::create(::function, result, vector, ::context->getConstantInt32(index)); |
| 700 | ::basicBlock->appendInst(extract); |
| 701 | |
| 702 | return V(result); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 703 | } |
| 704 | |
| 705 | Value *Nucleus::createInsertElement(Value *vector, Value *element, int index) |
| 706 | { |
Nicolas Capens | 9709d4f | 2016-09-30 11:44:14 -0400 | [diff] [blame] | 707 | auto result = ::function->makeVariable(vector->getType()); |
| 708 | auto insert = Ice::InstInsertElement::create(::function, result, vector, element, ::context->getConstantInt32(index)); |
| 709 | ::basicBlock->appendInst(insert); |
| 710 | |
| 711 | return V(result); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 712 | } |
| 713 | |
Nicolas Capens | e89cd58 | 2016-09-30 14:23:47 -0400 | [diff] [blame] | 714 | Value *Nucleus::createShuffleVector(Value *V1, Value *V2, const int *select) |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 715 | { |
Nicolas Capens | 619c0ab | 2016-09-30 14:46:24 -0400 | [diff] [blame] | 716 | assert(V1->getType() == V2->getType()); |
| 717 | |
| 718 | int size = Ice::typeNumElements(V1->getType()); |
| 719 | auto result = ::function->makeVariable(V1->getType()); |
| 720 | auto shuffle = Ice::InstShuffleVector::create(::function, result, V1, V2); |
| 721 | |
| 722 | for(int i = 0; i < size; i++) |
| 723 | { |
| 724 | shuffle->addIndex(llvm::cast<Ice::ConstantInteger32>(::context->getConstantInt32(select[i]))); |
| 725 | } |
| 726 | |
| 727 | ::basicBlock->appendInst(shuffle); |
| 728 | |
| 729 | return V(result); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 730 | } |
| 731 | |
| 732 | Value *Nucleus::createSelect(Value *C, Value *ifTrue, Value *ifFalse) |
| 733 | { |
| 734 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 735 | } |
| 736 | |
| 737 | Value *Nucleus::createSwitch(Value *v, BasicBlock *Dest, unsigned NumCases) |
| 738 | { |
| 739 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 740 | } |
| 741 | |
| 742 | void Nucleus::addSwitchCase(Value *Switch, int Case, BasicBlock *Branch) |
| 743 | { |
| 744 | assert(false && "UNIMPLEMENTED"); return; |
| 745 | } |
| 746 | |
| 747 | void Nucleus::createUnreachable() |
| 748 | { |
| 749 | assert(false && "UNIMPLEMENTED"); |
| 750 | } |
| 751 | |
Nicolas Capens | e95d534 | 2016-09-30 11:37:28 -0400 | [diff] [blame] | 752 | static Value *createSwizzle4(Value *val, unsigned char select) |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 753 | { |
Nicolas Capens | 619c0ab | 2016-09-30 14:46:24 -0400 | [diff] [blame] | 754 | int swizzle[4] = |
| 755 | { |
| 756 | (select >> 0) & 0x03, |
| 757 | (select >> 2) & 0x03, |
| 758 | (select >> 4) & 0x03, |
| 759 | (select >> 6) & 0x03, |
| 760 | }; |
Nicolas Capens | 9709d4f | 2016-09-30 11:44:14 -0400 | [diff] [blame] | 761 | |
Nicolas Capens | 619c0ab | 2016-09-30 14:46:24 -0400 | [diff] [blame] | 762 | return Nucleus::createShuffleVector(val, val, swizzle); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 763 | } |
| 764 | |
Nicolas Capens | e95d534 | 2016-09-30 11:37:28 -0400 | [diff] [blame] | 765 | static Value *createMask4(Value *lhs, Value *rhs, unsigned char select) |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 766 | { |
| 767 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 768 | } |
| 769 | |
| 770 | Constant *Nucleus::createConstantPointer(const void *address, Type *Ty, bool isConstant, unsigned int Align) |
| 771 | { |
| 772 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 773 | } |
| 774 | |
| 775 | Type *Nucleus::getPointerType(Type *ElementType) |
| 776 | { |
Nicolas Capens | e12780d | 2016-09-27 14:18:07 -0400 | [diff] [blame] | 777 | if(sizeof(void*) == 8) |
| 778 | { |
| 779 | return T(Ice::IceType_i64); |
| 780 | } |
| 781 | else |
| 782 | { |
| 783 | return T(Ice::IceType_i32); |
| 784 | } |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 785 | } |
| 786 | |
| 787 | Constant *Nucleus::createNullValue(Type *Ty) |
| 788 | { |
| 789 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 790 | } |
| 791 | |
| 792 | Constant *Nucleus::createConstantInt(int64_t i) |
| 793 | { |
| 794 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 795 | } |
| 796 | |
| 797 | Constant *Nucleus::createConstantInt(int i) |
| 798 | { |
Nicolas Capens | b955d5b | 2016-09-28 22:36:28 -0400 | [diff] [blame] | 799 | return C(::context->getConstantInt32(i)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 800 | } |
| 801 | |
| 802 | Constant *Nucleus::createConstantInt(unsigned int i) |
| 803 | { |
| 804 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 805 | } |
| 806 | |
| 807 | Constant *Nucleus::createConstantBool(bool b) |
| 808 | { |
| 809 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 810 | } |
| 811 | |
| 812 | Constant *Nucleus::createConstantByte(signed char i) |
| 813 | { |
| 814 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 815 | } |
| 816 | |
| 817 | Constant *Nucleus::createConstantByte(unsigned char i) |
| 818 | { |
| 819 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 820 | } |
| 821 | |
| 822 | Constant *Nucleus::createConstantShort(short i) |
| 823 | { |
| 824 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 825 | } |
| 826 | |
| 827 | Constant *Nucleus::createConstantShort(unsigned short i) |
| 828 | { |
| 829 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 830 | } |
| 831 | |
| 832 | Constant *Nucleus::createConstantFloat(float x) |
| 833 | { |
| 834 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 835 | } |
| 836 | |
| 837 | Constant *Nucleus::createNullPointer(Type *Ty) |
| 838 | { |
| 839 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 840 | } |
| 841 | |
| 842 | Constant *Nucleus::createConstantVector(Constant *const *Vals, unsigned NumVals) |
| 843 | { |
| 844 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 845 | } |
| 846 | |
| 847 | Type *Void::getType() |
| 848 | { |
| 849 | return T(Ice::IceType_void); |
| 850 | } |
| 851 | |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 852 | Bool::Bool(Argument<Bool> argument) |
| 853 | { |
| 854 | storeValue(argument.value); |
| 855 | } |
| 856 | |
| 857 | Bool::Bool() |
| 858 | { |
| 859 | } |
| 860 | |
| 861 | Bool::Bool(bool x) |
| 862 | { |
| 863 | storeValue(Nucleus::createConstantBool(x)); |
| 864 | } |
| 865 | |
| 866 | Bool::Bool(RValue<Bool> rhs) |
| 867 | { |
| 868 | storeValue(rhs.value); |
| 869 | } |
| 870 | |
| 871 | Bool::Bool(const Bool &rhs) |
| 872 | { |
| 873 | Value *value = rhs.loadValue(); |
| 874 | storeValue(value); |
| 875 | } |
| 876 | |
| 877 | Bool::Bool(const Reference<Bool> &rhs) |
| 878 | { |
| 879 | Value *value = rhs.loadValue(); |
| 880 | storeValue(value); |
| 881 | } |
| 882 | |
| 883 | RValue<Bool> Bool::operator=(RValue<Bool> rhs) const |
| 884 | { |
| 885 | storeValue(rhs.value); |
| 886 | |
| 887 | return rhs; |
| 888 | } |
| 889 | |
| 890 | RValue<Bool> Bool::operator=(const Bool &rhs) const |
| 891 | { |
| 892 | Value *value = rhs.loadValue(); |
| 893 | storeValue(value); |
| 894 | |
| 895 | return RValue<Bool>(value); |
| 896 | } |
| 897 | |
| 898 | RValue<Bool> Bool::operator=(const Reference<Bool> &rhs) const |
| 899 | { |
| 900 | Value *value = rhs.loadValue(); |
| 901 | storeValue(value); |
| 902 | |
| 903 | return RValue<Bool>(value); |
| 904 | } |
| 905 | |
| 906 | RValue<Bool> operator!(RValue<Bool> val) |
| 907 | { |
| 908 | return RValue<Bool>(Nucleus::createNot(val.value)); |
| 909 | } |
| 910 | |
| 911 | RValue<Bool> operator&&(RValue<Bool> lhs, RValue<Bool> rhs) |
| 912 | { |
| 913 | return RValue<Bool>(Nucleus::createAnd(lhs.value, rhs.value)); |
| 914 | } |
| 915 | |
| 916 | RValue<Bool> operator||(RValue<Bool> lhs, RValue<Bool> rhs) |
| 917 | { |
| 918 | return RValue<Bool>(Nucleus::createOr(lhs.value, rhs.value)); |
| 919 | } |
| 920 | |
| 921 | Type *Bool::getType() |
| 922 | { |
| 923 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 924 | } |
| 925 | |
| 926 | Byte::Byte(Argument<Byte> argument) |
| 927 | { |
| 928 | storeValue(argument.value); |
| 929 | } |
| 930 | |
| 931 | Byte::Byte(RValue<Int> cast) |
| 932 | { |
| 933 | Value *integer = Nucleus::createTrunc(cast.value, Byte::getType()); |
| 934 | |
| 935 | storeValue(integer); |
| 936 | } |
| 937 | |
| 938 | Byte::Byte(RValue<UInt> cast) |
| 939 | { |
| 940 | Value *integer = Nucleus::createTrunc(cast.value, Byte::getType()); |
| 941 | |
| 942 | storeValue(integer); |
| 943 | } |
| 944 | |
| 945 | Byte::Byte(RValue<UShort> cast) |
| 946 | { |
| 947 | Value *integer = Nucleus::createTrunc(cast.value, Byte::getType()); |
| 948 | |
| 949 | storeValue(integer); |
| 950 | } |
| 951 | |
| 952 | Byte::Byte() |
| 953 | { |
| 954 | } |
| 955 | |
| 956 | Byte::Byte(int x) |
| 957 | { |
| 958 | storeValue(Nucleus::createConstantByte((unsigned char)x)); |
| 959 | } |
| 960 | |
| 961 | Byte::Byte(unsigned char x) |
| 962 | { |
| 963 | storeValue(Nucleus::createConstantByte(x)); |
| 964 | } |
| 965 | |
| 966 | Byte::Byte(RValue<Byte> rhs) |
| 967 | { |
| 968 | storeValue(rhs.value); |
| 969 | } |
| 970 | |
| 971 | Byte::Byte(const Byte &rhs) |
| 972 | { |
| 973 | Value *value = rhs.loadValue(); |
| 974 | storeValue(value); |
| 975 | } |
| 976 | |
| 977 | Byte::Byte(const Reference<Byte> &rhs) |
| 978 | { |
| 979 | Value *value = rhs.loadValue(); |
| 980 | storeValue(value); |
| 981 | } |
| 982 | |
| 983 | RValue<Byte> Byte::operator=(RValue<Byte> rhs) const |
| 984 | { |
| 985 | storeValue(rhs.value); |
| 986 | |
| 987 | return rhs; |
| 988 | } |
| 989 | |
| 990 | RValue<Byte> Byte::operator=(const Byte &rhs) const |
| 991 | { |
| 992 | Value *value = rhs.loadValue(); |
| 993 | storeValue(value); |
| 994 | |
| 995 | return RValue<Byte>(value); |
| 996 | } |
| 997 | |
| 998 | RValue<Byte> Byte::operator=(const Reference<Byte> &rhs) const |
| 999 | { |
| 1000 | Value *value = rhs.loadValue(); |
| 1001 | storeValue(value); |
| 1002 | |
| 1003 | return RValue<Byte>(value); |
| 1004 | } |
| 1005 | |
| 1006 | RValue<Byte> operator+(RValue<Byte> lhs, RValue<Byte> rhs) |
| 1007 | { |
| 1008 | return RValue<Byte>(Nucleus::createAdd(lhs.value, rhs.value)); |
| 1009 | } |
| 1010 | |
| 1011 | RValue<Byte> operator-(RValue<Byte> lhs, RValue<Byte> rhs) |
| 1012 | { |
| 1013 | return RValue<Byte>(Nucleus::createSub(lhs.value, rhs.value)); |
| 1014 | } |
| 1015 | |
| 1016 | RValue<Byte> operator*(RValue<Byte> lhs, RValue<Byte> rhs) |
| 1017 | { |
| 1018 | return RValue<Byte>(Nucleus::createMul(lhs.value, rhs.value)); |
| 1019 | } |
| 1020 | |
| 1021 | RValue<Byte> operator/(RValue<Byte> lhs, RValue<Byte> rhs) |
| 1022 | { |
| 1023 | return RValue<Byte>(Nucleus::createUDiv(lhs.value, rhs.value)); |
| 1024 | } |
| 1025 | |
| 1026 | RValue<Byte> operator%(RValue<Byte> lhs, RValue<Byte> rhs) |
| 1027 | { |
| 1028 | return RValue<Byte>(Nucleus::createURem(lhs.value, rhs.value)); |
| 1029 | } |
| 1030 | |
| 1031 | RValue<Byte> operator&(RValue<Byte> lhs, RValue<Byte> rhs) |
| 1032 | { |
| 1033 | return RValue<Byte>(Nucleus::createAnd(lhs.value, rhs.value)); |
| 1034 | } |
| 1035 | |
| 1036 | RValue<Byte> operator|(RValue<Byte> lhs, RValue<Byte> rhs) |
| 1037 | { |
| 1038 | return RValue<Byte>(Nucleus::createOr(lhs.value, rhs.value)); |
| 1039 | } |
| 1040 | |
| 1041 | RValue<Byte> operator^(RValue<Byte> lhs, RValue<Byte> rhs) |
| 1042 | { |
| 1043 | return RValue<Byte>(Nucleus::createXor(lhs.value, rhs.value)); |
| 1044 | } |
| 1045 | |
| 1046 | RValue<Byte> operator<<(RValue<Byte> lhs, RValue<Byte> rhs) |
| 1047 | { |
| 1048 | return RValue<Byte>(Nucleus::createShl(lhs.value, rhs.value)); |
| 1049 | } |
| 1050 | |
| 1051 | RValue<Byte> operator>>(RValue<Byte> lhs, RValue<Byte> rhs) |
| 1052 | { |
| 1053 | return RValue<Byte>(Nucleus::createLShr(lhs.value, rhs.value)); |
| 1054 | } |
| 1055 | |
| 1056 | RValue<Byte> operator+=(const Byte &lhs, RValue<Byte> rhs) |
| 1057 | { |
| 1058 | return lhs = lhs + rhs; |
| 1059 | } |
| 1060 | |
| 1061 | RValue<Byte> operator-=(const Byte &lhs, RValue<Byte> rhs) |
| 1062 | { |
| 1063 | return lhs = lhs - rhs; |
| 1064 | } |
| 1065 | |
| 1066 | RValue<Byte> operator*=(const Byte &lhs, RValue<Byte> rhs) |
| 1067 | { |
| 1068 | return lhs = lhs * rhs; |
| 1069 | } |
| 1070 | |
| 1071 | RValue<Byte> operator/=(const Byte &lhs, RValue<Byte> rhs) |
| 1072 | { |
| 1073 | return lhs = lhs / rhs; |
| 1074 | } |
| 1075 | |
| 1076 | RValue<Byte> operator%=(const Byte &lhs, RValue<Byte> rhs) |
| 1077 | { |
| 1078 | return lhs = lhs % rhs; |
| 1079 | } |
| 1080 | |
| 1081 | RValue<Byte> operator&=(const Byte &lhs, RValue<Byte> rhs) |
| 1082 | { |
| 1083 | return lhs = lhs & rhs; |
| 1084 | } |
| 1085 | |
| 1086 | RValue<Byte> operator|=(const Byte &lhs, RValue<Byte> rhs) |
| 1087 | { |
| 1088 | return lhs = lhs | rhs; |
| 1089 | } |
| 1090 | |
| 1091 | RValue<Byte> operator^=(const Byte &lhs, RValue<Byte> rhs) |
| 1092 | { |
| 1093 | return lhs = lhs ^ rhs; |
| 1094 | } |
| 1095 | |
| 1096 | RValue<Byte> operator<<=(const Byte &lhs, RValue<Byte> rhs) |
| 1097 | { |
| 1098 | return lhs = lhs << rhs; |
| 1099 | } |
| 1100 | |
| 1101 | RValue<Byte> operator>>=(const Byte &lhs, RValue<Byte> rhs) |
| 1102 | { |
| 1103 | return lhs = lhs >> rhs; |
| 1104 | } |
| 1105 | |
| 1106 | RValue<Byte> operator+(RValue<Byte> val) |
| 1107 | { |
| 1108 | return val; |
| 1109 | } |
| 1110 | |
| 1111 | RValue<Byte> operator-(RValue<Byte> val) |
| 1112 | { |
| 1113 | return RValue<Byte>(Nucleus::createNeg(val.value)); |
| 1114 | } |
| 1115 | |
| 1116 | RValue<Byte> operator~(RValue<Byte> val) |
| 1117 | { |
| 1118 | return RValue<Byte>(Nucleus::createNot(val.value)); |
| 1119 | } |
| 1120 | |
| 1121 | RValue<Byte> operator++(const Byte &val, int) // Post-increment |
| 1122 | { |
| 1123 | RValue<Byte> res = val; |
| 1124 | |
| 1125 | assert(false && "UNIMPLEMENTED"); |
| 1126 | |
| 1127 | return res; |
| 1128 | } |
| 1129 | |
| 1130 | const Byte &operator++(const Byte &val) // Pre-increment |
| 1131 | { |
| 1132 | assert(false && "UNIMPLEMENTED"); |
| 1133 | |
| 1134 | return val; |
| 1135 | } |
| 1136 | |
| 1137 | RValue<Byte> operator--(const Byte &val, int) // Post-decrement |
| 1138 | { |
| 1139 | RValue<Byte> res = val; |
| 1140 | |
| 1141 | assert(false && "UNIMPLEMENTED"); |
| 1142 | |
| 1143 | return res; |
| 1144 | } |
| 1145 | |
| 1146 | const Byte &operator--(const Byte &val) // Pre-decrement |
| 1147 | { |
| 1148 | assert(false && "UNIMPLEMENTED"); |
| 1149 | |
| 1150 | return val; |
| 1151 | } |
| 1152 | |
| 1153 | RValue<Bool> operator<(RValue<Byte> lhs, RValue<Byte> rhs) |
| 1154 | { |
| 1155 | return RValue<Bool>(Nucleus::createICmpULT(lhs.value, rhs.value)); |
| 1156 | } |
| 1157 | |
| 1158 | RValue<Bool> operator<=(RValue<Byte> lhs, RValue<Byte> rhs) |
| 1159 | { |
| 1160 | return RValue<Bool>(Nucleus::createICmpULE(lhs.value, rhs.value)); |
| 1161 | } |
| 1162 | |
| 1163 | RValue<Bool> operator>(RValue<Byte> lhs, RValue<Byte> rhs) |
| 1164 | { |
| 1165 | return RValue<Bool>(Nucleus::createICmpUGT(lhs.value, rhs.value)); |
| 1166 | } |
| 1167 | |
| 1168 | RValue<Bool> operator>=(RValue<Byte> lhs, RValue<Byte> rhs) |
| 1169 | { |
| 1170 | return RValue<Bool>(Nucleus::createICmpUGE(lhs.value, rhs.value)); |
| 1171 | } |
| 1172 | |
| 1173 | RValue<Bool> operator!=(RValue<Byte> lhs, RValue<Byte> rhs) |
| 1174 | { |
| 1175 | return RValue<Bool>(Nucleus::createICmpNE(lhs.value, rhs.value)); |
| 1176 | } |
| 1177 | |
| 1178 | RValue<Bool> operator==(RValue<Byte> lhs, RValue<Byte> rhs) |
| 1179 | { |
| 1180 | return RValue<Bool>(Nucleus::createICmpEQ(lhs.value, rhs.value)); |
| 1181 | } |
| 1182 | |
| 1183 | Type *Byte::getType() |
| 1184 | { |
Nicolas Capens | 6d73871 | 2016-09-30 04:15:22 -0400 | [diff] [blame] | 1185 | return T(Ice::IceType_i8); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 1186 | } |
| 1187 | |
| 1188 | SByte::SByte(Argument<SByte> argument) |
| 1189 | { |
| 1190 | storeValue(argument.value); |
| 1191 | } |
| 1192 | |
| 1193 | SByte::SByte(RValue<Int> cast) |
| 1194 | { |
| 1195 | Value *integer = Nucleus::createTrunc(cast.value, SByte::getType()); |
| 1196 | |
| 1197 | storeValue(integer); |
| 1198 | } |
| 1199 | |
| 1200 | SByte::SByte(RValue<Short> cast) |
| 1201 | { |
| 1202 | Value *integer = Nucleus::createTrunc(cast.value, SByte::getType()); |
| 1203 | |
| 1204 | storeValue(integer); |
| 1205 | } |
| 1206 | |
| 1207 | SByte::SByte() |
| 1208 | { |
| 1209 | } |
| 1210 | |
| 1211 | SByte::SByte(signed char x) |
| 1212 | { |
| 1213 | storeValue(Nucleus::createConstantByte(x)); |
| 1214 | } |
| 1215 | |
| 1216 | SByte::SByte(RValue<SByte> rhs) |
| 1217 | { |
| 1218 | storeValue(rhs.value); |
| 1219 | } |
| 1220 | |
| 1221 | SByte::SByte(const SByte &rhs) |
| 1222 | { |
| 1223 | Value *value = rhs.loadValue(); |
| 1224 | storeValue(value); |
| 1225 | } |
| 1226 | |
| 1227 | SByte::SByte(const Reference<SByte> &rhs) |
| 1228 | { |
| 1229 | Value *value = rhs.loadValue(); |
| 1230 | storeValue(value); |
| 1231 | } |
| 1232 | |
| 1233 | RValue<SByte> SByte::operator=(RValue<SByte> rhs) const |
| 1234 | { |
| 1235 | storeValue(rhs.value); |
| 1236 | |
| 1237 | return rhs; |
| 1238 | } |
| 1239 | |
| 1240 | RValue<SByte> SByte::operator=(const SByte &rhs) const |
| 1241 | { |
| 1242 | Value *value = rhs.loadValue(); |
| 1243 | storeValue(value); |
| 1244 | |
| 1245 | return RValue<SByte>(value); |
| 1246 | } |
| 1247 | |
| 1248 | RValue<SByte> SByte::operator=(const Reference<SByte> &rhs) const |
| 1249 | { |
| 1250 | Value *value = rhs.loadValue(); |
| 1251 | storeValue(value); |
| 1252 | |
| 1253 | return RValue<SByte>(value); |
| 1254 | } |
| 1255 | |
| 1256 | RValue<SByte> operator+(RValue<SByte> lhs, RValue<SByte> rhs) |
| 1257 | { |
| 1258 | return RValue<SByte>(Nucleus::createAdd(lhs.value, rhs.value)); |
| 1259 | } |
| 1260 | |
| 1261 | RValue<SByte> operator-(RValue<SByte> lhs, RValue<SByte> rhs) |
| 1262 | { |
| 1263 | return RValue<SByte>(Nucleus::createSub(lhs.value, rhs.value)); |
| 1264 | } |
| 1265 | |
| 1266 | RValue<SByte> operator*(RValue<SByte> lhs, RValue<SByte> rhs) |
| 1267 | { |
| 1268 | return RValue<SByte>(Nucleus::createMul(lhs.value, rhs.value)); |
| 1269 | } |
| 1270 | |
| 1271 | RValue<SByte> operator/(RValue<SByte> lhs, RValue<SByte> rhs) |
| 1272 | { |
| 1273 | return RValue<SByte>(Nucleus::createSDiv(lhs.value, rhs.value)); |
| 1274 | } |
| 1275 | |
| 1276 | RValue<SByte> operator%(RValue<SByte> lhs, RValue<SByte> rhs) |
| 1277 | { |
| 1278 | return RValue<SByte>(Nucleus::createSRem(lhs.value, rhs.value)); |
| 1279 | } |
| 1280 | |
| 1281 | RValue<SByte> operator&(RValue<SByte> lhs, RValue<SByte> rhs) |
| 1282 | { |
| 1283 | return RValue<SByte>(Nucleus::createAnd(lhs.value, rhs.value)); |
| 1284 | } |
| 1285 | |
| 1286 | RValue<SByte> operator|(RValue<SByte> lhs, RValue<SByte> rhs) |
| 1287 | { |
| 1288 | return RValue<SByte>(Nucleus::createOr(lhs.value, rhs.value)); |
| 1289 | } |
| 1290 | |
| 1291 | RValue<SByte> operator^(RValue<SByte> lhs, RValue<SByte> rhs) |
| 1292 | { |
| 1293 | return RValue<SByte>(Nucleus::createXor(lhs.value, rhs.value)); |
| 1294 | } |
| 1295 | |
| 1296 | RValue<SByte> operator<<(RValue<SByte> lhs, RValue<SByte> rhs) |
| 1297 | { |
| 1298 | return RValue<SByte>(Nucleus::createShl(lhs.value, rhs.value)); |
| 1299 | } |
| 1300 | |
| 1301 | RValue<SByte> operator>>(RValue<SByte> lhs, RValue<SByte> rhs) |
| 1302 | { |
| 1303 | return RValue<SByte>(Nucleus::createAShr(lhs.value, rhs.value)); |
| 1304 | } |
| 1305 | |
| 1306 | RValue<SByte> operator+=(const SByte &lhs, RValue<SByte> rhs) |
| 1307 | { |
| 1308 | return lhs = lhs + rhs; |
| 1309 | } |
| 1310 | |
| 1311 | RValue<SByte> operator-=(const SByte &lhs, RValue<SByte> rhs) |
| 1312 | { |
| 1313 | return lhs = lhs - rhs; |
| 1314 | } |
| 1315 | |
| 1316 | RValue<SByte> operator*=(const SByte &lhs, RValue<SByte> rhs) |
| 1317 | { |
| 1318 | return lhs = lhs * rhs; |
| 1319 | } |
| 1320 | |
| 1321 | RValue<SByte> operator/=(const SByte &lhs, RValue<SByte> rhs) |
| 1322 | { |
| 1323 | return lhs = lhs / rhs; |
| 1324 | } |
| 1325 | |
| 1326 | RValue<SByte> operator%=(const SByte &lhs, RValue<SByte> rhs) |
| 1327 | { |
| 1328 | return lhs = lhs % rhs; |
| 1329 | } |
| 1330 | |
| 1331 | RValue<SByte> operator&=(const SByte &lhs, RValue<SByte> rhs) |
| 1332 | { |
| 1333 | return lhs = lhs & rhs; |
| 1334 | } |
| 1335 | |
| 1336 | RValue<SByte> operator|=(const SByte &lhs, RValue<SByte> rhs) |
| 1337 | { |
| 1338 | return lhs = lhs | rhs; |
| 1339 | } |
| 1340 | |
| 1341 | RValue<SByte> operator^=(const SByte &lhs, RValue<SByte> rhs) |
| 1342 | { |
| 1343 | return lhs = lhs ^ rhs; |
| 1344 | } |
| 1345 | |
| 1346 | RValue<SByte> operator<<=(const SByte &lhs, RValue<SByte> rhs) |
| 1347 | { |
| 1348 | return lhs = lhs << rhs; |
| 1349 | } |
| 1350 | |
| 1351 | RValue<SByte> operator>>=(const SByte &lhs, RValue<SByte> rhs) |
| 1352 | { |
| 1353 | return lhs = lhs >> rhs; |
| 1354 | } |
| 1355 | |
| 1356 | RValue<SByte> operator+(RValue<SByte> val) |
| 1357 | { |
| 1358 | return val; |
| 1359 | } |
| 1360 | |
| 1361 | RValue<SByte> operator-(RValue<SByte> val) |
| 1362 | { |
| 1363 | return RValue<SByte>(Nucleus::createNeg(val.value)); |
| 1364 | } |
| 1365 | |
| 1366 | RValue<SByte> operator~(RValue<SByte> val) |
| 1367 | { |
| 1368 | return RValue<SByte>(Nucleus::createNot(val.value)); |
| 1369 | } |
| 1370 | |
| 1371 | RValue<SByte> operator++(const SByte &val, int) // Post-increment |
| 1372 | { |
| 1373 | RValue<SByte> res = val; |
| 1374 | |
| 1375 | assert(false && "UNIMPLEMENTED"); |
| 1376 | |
| 1377 | return res; |
| 1378 | } |
| 1379 | |
| 1380 | const SByte &operator++(const SByte &val) // Pre-increment |
| 1381 | { |
| 1382 | assert(false && "UNIMPLEMENTED"); |
| 1383 | assert(false && "UNIMPLEMENTED"); |
| 1384 | |
| 1385 | return val; |
| 1386 | } |
| 1387 | |
| 1388 | RValue<SByte> operator--(const SByte &val, int) // Post-decrement |
| 1389 | { |
| 1390 | RValue<SByte> res = val; |
| 1391 | |
| 1392 | assert(false && "UNIMPLEMENTED"); |
| 1393 | assert(false && "UNIMPLEMENTED"); |
| 1394 | |
| 1395 | return res; |
| 1396 | } |
| 1397 | |
| 1398 | const SByte &operator--(const SByte &val) // Pre-decrement |
| 1399 | { |
| 1400 | assert(false && "UNIMPLEMENTED"); |
| 1401 | assert(false && "UNIMPLEMENTED"); |
| 1402 | |
| 1403 | return val; |
| 1404 | } |
| 1405 | |
| 1406 | RValue<Bool> operator<(RValue<SByte> lhs, RValue<SByte> rhs) |
| 1407 | { |
| 1408 | return RValue<Bool>(Nucleus::createICmpSLT(lhs.value, rhs.value)); |
| 1409 | } |
| 1410 | |
| 1411 | RValue<Bool> operator<=(RValue<SByte> lhs, RValue<SByte> rhs) |
| 1412 | { |
| 1413 | return RValue<Bool>(Nucleus::createICmpSLE(lhs.value, rhs.value)); |
| 1414 | } |
| 1415 | |
| 1416 | RValue<Bool> operator>(RValue<SByte> lhs, RValue<SByte> rhs) |
| 1417 | { |
| 1418 | return RValue<Bool>(Nucleus::createICmpSGT(lhs.value, rhs.value)); |
| 1419 | } |
| 1420 | |
| 1421 | RValue<Bool> operator>=(RValue<SByte> lhs, RValue<SByte> rhs) |
| 1422 | { |
| 1423 | return RValue<Bool>(Nucleus::createICmpSGE(lhs.value, rhs.value)); |
| 1424 | } |
| 1425 | |
| 1426 | RValue<Bool> operator!=(RValue<SByte> lhs, RValue<SByte> rhs) |
| 1427 | { |
| 1428 | return RValue<Bool>(Nucleus::createICmpNE(lhs.value, rhs.value)); |
| 1429 | } |
| 1430 | |
| 1431 | RValue<Bool> operator==(RValue<SByte> lhs, RValue<SByte> rhs) |
| 1432 | { |
| 1433 | return RValue<Bool>(Nucleus::createICmpEQ(lhs.value, rhs.value)); |
| 1434 | } |
| 1435 | |
| 1436 | Type *SByte::getType() |
| 1437 | { |
| 1438 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 1439 | } |
| 1440 | |
| 1441 | Short::Short(Argument<Short> argument) |
| 1442 | { |
| 1443 | storeValue(argument.value); |
| 1444 | } |
| 1445 | |
| 1446 | Short::Short(RValue<Int> cast) |
| 1447 | { |
| 1448 | Value *integer = Nucleus::createTrunc(cast.value, Short::getType()); |
| 1449 | |
| 1450 | storeValue(integer); |
| 1451 | } |
| 1452 | |
| 1453 | Short::Short() |
| 1454 | { |
| 1455 | } |
| 1456 | |
| 1457 | Short::Short(short x) |
| 1458 | { |
| 1459 | storeValue(Nucleus::createConstantShort(x)); |
| 1460 | } |
| 1461 | |
| 1462 | Short::Short(RValue<Short> rhs) |
| 1463 | { |
| 1464 | storeValue(rhs.value); |
| 1465 | } |
| 1466 | |
| 1467 | Short::Short(const Short &rhs) |
| 1468 | { |
| 1469 | Value *value = rhs.loadValue(); |
| 1470 | storeValue(value); |
| 1471 | } |
| 1472 | |
| 1473 | Short::Short(const Reference<Short> &rhs) |
| 1474 | { |
| 1475 | Value *value = rhs.loadValue(); |
| 1476 | storeValue(value); |
| 1477 | } |
| 1478 | |
| 1479 | RValue<Short> Short::operator=(RValue<Short> rhs) const |
| 1480 | { |
| 1481 | storeValue(rhs.value); |
| 1482 | |
| 1483 | return rhs; |
| 1484 | } |
| 1485 | |
| 1486 | RValue<Short> Short::operator=(const Short &rhs) const |
| 1487 | { |
| 1488 | Value *value = rhs.loadValue(); |
| 1489 | storeValue(value); |
| 1490 | |
| 1491 | return RValue<Short>(value); |
| 1492 | } |
| 1493 | |
| 1494 | RValue<Short> Short::operator=(const Reference<Short> &rhs) const |
| 1495 | { |
| 1496 | Value *value = rhs.loadValue(); |
| 1497 | storeValue(value); |
| 1498 | |
| 1499 | return RValue<Short>(value); |
| 1500 | } |
| 1501 | |
| 1502 | RValue<Short> operator+(RValue<Short> lhs, RValue<Short> rhs) |
| 1503 | { |
| 1504 | return RValue<Short>(Nucleus::createAdd(lhs.value, rhs.value)); |
| 1505 | } |
| 1506 | |
| 1507 | RValue<Short> operator-(RValue<Short> lhs, RValue<Short> rhs) |
| 1508 | { |
| 1509 | return RValue<Short>(Nucleus::createSub(lhs.value, rhs.value)); |
| 1510 | } |
| 1511 | |
| 1512 | RValue<Short> operator*(RValue<Short> lhs, RValue<Short> rhs) |
| 1513 | { |
| 1514 | return RValue<Short>(Nucleus::createMul(lhs.value, rhs.value)); |
| 1515 | } |
| 1516 | |
| 1517 | RValue<Short> operator/(RValue<Short> lhs, RValue<Short> rhs) |
| 1518 | { |
| 1519 | return RValue<Short>(Nucleus::createSDiv(lhs.value, rhs.value)); |
| 1520 | } |
| 1521 | |
| 1522 | RValue<Short> operator%(RValue<Short> lhs, RValue<Short> rhs) |
| 1523 | { |
| 1524 | return RValue<Short>(Nucleus::createSRem(lhs.value, rhs.value)); |
| 1525 | } |
| 1526 | |
| 1527 | RValue<Short> operator&(RValue<Short> lhs, RValue<Short> rhs) |
| 1528 | { |
| 1529 | return RValue<Short>(Nucleus::createAnd(lhs.value, rhs.value)); |
| 1530 | } |
| 1531 | |
| 1532 | RValue<Short> operator|(RValue<Short> lhs, RValue<Short> rhs) |
| 1533 | { |
| 1534 | return RValue<Short>(Nucleus::createOr(lhs.value, rhs.value)); |
| 1535 | } |
| 1536 | |
| 1537 | RValue<Short> operator^(RValue<Short> lhs, RValue<Short> rhs) |
| 1538 | { |
| 1539 | return RValue<Short>(Nucleus::createXor(lhs.value, rhs.value)); |
| 1540 | } |
| 1541 | |
| 1542 | RValue<Short> operator<<(RValue<Short> lhs, RValue<Short> rhs) |
| 1543 | { |
| 1544 | return RValue<Short>(Nucleus::createShl(lhs.value, rhs.value)); |
| 1545 | } |
| 1546 | |
| 1547 | RValue<Short> operator>>(RValue<Short> lhs, RValue<Short> rhs) |
| 1548 | { |
| 1549 | return RValue<Short>(Nucleus::createAShr(lhs.value, rhs.value)); |
| 1550 | } |
| 1551 | |
| 1552 | RValue<Short> operator+=(const Short &lhs, RValue<Short> rhs) |
| 1553 | { |
| 1554 | return lhs = lhs + rhs; |
| 1555 | } |
| 1556 | |
| 1557 | RValue<Short> operator-=(const Short &lhs, RValue<Short> rhs) |
| 1558 | { |
| 1559 | return lhs = lhs - rhs; |
| 1560 | } |
| 1561 | |
| 1562 | RValue<Short> operator*=(const Short &lhs, RValue<Short> rhs) |
| 1563 | { |
| 1564 | return lhs = lhs * rhs; |
| 1565 | } |
| 1566 | |
| 1567 | RValue<Short> operator/=(const Short &lhs, RValue<Short> rhs) |
| 1568 | { |
| 1569 | return lhs = lhs / rhs; |
| 1570 | } |
| 1571 | |
| 1572 | RValue<Short> operator%=(const Short &lhs, RValue<Short> rhs) |
| 1573 | { |
| 1574 | return lhs = lhs % rhs; |
| 1575 | } |
| 1576 | |
| 1577 | RValue<Short> operator&=(const Short &lhs, RValue<Short> rhs) |
| 1578 | { |
| 1579 | return lhs = lhs & rhs; |
| 1580 | } |
| 1581 | |
| 1582 | RValue<Short> operator|=(const Short &lhs, RValue<Short> rhs) |
| 1583 | { |
| 1584 | return lhs = lhs | rhs; |
| 1585 | } |
| 1586 | |
| 1587 | RValue<Short> operator^=(const Short &lhs, RValue<Short> rhs) |
| 1588 | { |
| 1589 | return lhs = lhs ^ rhs; |
| 1590 | } |
| 1591 | |
| 1592 | RValue<Short> operator<<=(const Short &lhs, RValue<Short> rhs) |
| 1593 | { |
| 1594 | return lhs = lhs << rhs; |
| 1595 | } |
| 1596 | |
| 1597 | RValue<Short> operator>>=(const Short &lhs, RValue<Short> rhs) |
| 1598 | { |
| 1599 | return lhs = lhs >> rhs; |
| 1600 | } |
| 1601 | |
| 1602 | RValue<Short> operator+(RValue<Short> val) |
| 1603 | { |
| 1604 | return val; |
| 1605 | } |
| 1606 | |
| 1607 | RValue<Short> operator-(RValue<Short> val) |
| 1608 | { |
| 1609 | return RValue<Short>(Nucleus::createNeg(val.value)); |
| 1610 | } |
| 1611 | |
| 1612 | RValue<Short> operator~(RValue<Short> val) |
| 1613 | { |
| 1614 | return RValue<Short>(Nucleus::createNot(val.value)); |
| 1615 | } |
| 1616 | |
| 1617 | RValue<Short> operator++(const Short &val, int) // Post-increment |
| 1618 | { |
| 1619 | RValue<Short> res = val; |
| 1620 | |
| 1621 | assert(false && "UNIMPLEMENTED"); |
| 1622 | assert(false && "UNIMPLEMENTED"); |
| 1623 | |
| 1624 | return res; |
| 1625 | } |
| 1626 | |
| 1627 | const Short &operator++(const Short &val) // Pre-increment |
| 1628 | { |
| 1629 | assert(false && "UNIMPLEMENTED"); |
| 1630 | assert(false && "UNIMPLEMENTED"); |
| 1631 | |
| 1632 | return val; |
| 1633 | } |
| 1634 | |
| 1635 | RValue<Short> operator--(const Short &val, int) // Post-decrement |
| 1636 | { |
| 1637 | RValue<Short> res = val; |
| 1638 | |
| 1639 | assert(false && "UNIMPLEMENTED"); |
| 1640 | assert(false && "UNIMPLEMENTED"); |
| 1641 | |
| 1642 | return res; |
| 1643 | } |
| 1644 | |
| 1645 | const Short &operator--(const Short &val) // Pre-decrement |
| 1646 | { |
| 1647 | assert(false && "UNIMPLEMENTED"); |
| 1648 | assert(false && "UNIMPLEMENTED"); |
| 1649 | |
| 1650 | return val; |
| 1651 | } |
| 1652 | |
| 1653 | RValue<Bool> operator<(RValue<Short> lhs, RValue<Short> rhs) |
| 1654 | { |
| 1655 | return RValue<Bool>(Nucleus::createICmpSLT(lhs.value, rhs.value)); |
| 1656 | } |
| 1657 | |
| 1658 | RValue<Bool> operator<=(RValue<Short> lhs, RValue<Short> rhs) |
| 1659 | { |
| 1660 | return RValue<Bool>(Nucleus::createICmpSLE(lhs.value, rhs.value)); |
| 1661 | } |
| 1662 | |
| 1663 | RValue<Bool> operator>(RValue<Short> lhs, RValue<Short> rhs) |
| 1664 | { |
| 1665 | return RValue<Bool>(Nucleus::createICmpSGT(lhs.value, rhs.value)); |
| 1666 | } |
| 1667 | |
| 1668 | RValue<Bool> operator>=(RValue<Short> lhs, RValue<Short> rhs) |
| 1669 | { |
| 1670 | return RValue<Bool>(Nucleus::createICmpSGE(lhs.value, rhs.value)); |
| 1671 | } |
| 1672 | |
| 1673 | RValue<Bool> operator!=(RValue<Short> lhs, RValue<Short> rhs) |
| 1674 | { |
| 1675 | return RValue<Bool>(Nucleus::createICmpNE(lhs.value, rhs.value)); |
| 1676 | } |
| 1677 | |
| 1678 | RValue<Bool> operator==(RValue<Short> lhs, RValue<Short> rhs) |
| 1679 | { |
| 1680 | return RValue<Bool>(Nucleus::createICmpEQ(lhs.value, rhs.value)); |
| 1681 | } |
| 1682 | |
| 1683 | Type *Short::getType() |
| 1684 | { |
| 1685 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 1686 | } |
| 1687 | |
| 1688 | UShort::UShort(Argument<UShort> argument) |
| 1689 | { |
| 1690 | storeValue(argument.value); |
| 1691 | } |
| 1692 | |
| 1693 | UShort::UShort(RValue<UInt> cast) |
| 1694 | { |
| 1695 | Value *integer = Nucleus::createTrunc(cast.value, UShort::getType()); |
| 1696 | |
| 1697 | storeValue(integer); |
| 1698 | } |
| 1699 | |
| 1700 | UShort::UShort(RValue<Int> cast) |
| 1701 | { |
| 1702 | Value *integer = Nucleus::createTrunc(cast.value, UShort::getType()); |
| 1703 | |
| 1704 | storeValue(integer); |
| 1705 | } |
| 1706 | |
| 1707 | UShort::UShort() |
| 1708 | { |
| 1709 | } |
| 1710 | |
| 1711 | UShort::UShort(unsigned short x) |
| 1712 | { |
| 1713 | storeValue(Nucleus::createConstantShort(x)); |
| 1714 | } |
| 1715 | |
| 1716 | UShort::UShort(RValue<UShort> rhs) |
| 1717 | { |
| 1718 | storeValue(rhs.value); |
| 1719 | } |
| 1720 | |
| 1721 | UShort::UShort(const UShort &rhs) |
| 1722 | { |
| 1723 | Value *value = rhs.loadValue(); |
| 1724 | storeValue(value); |
| 1725 | } |
| 1726 | |
| 1727 | UShort::UShort(const Reference<UShort> &rhs) |
| 1728 | { |
| 1729 | Value *value = rhs.loadValue(); |
| 1730 | storeValue(value); |
| 1731 | } |
| 1732 | |
| 1733 | RValue<UShort> UShort::operator=(RValue<UShort> rhs) const |
| 1734 | { |
| 1735 | storeValue(rhs.value); |
| 1736 | |
| 1737 | return rhs; |
| 1738 | } |
| 1739 | |
| 1740 | RValue<UShort> UShort::operator=(const UShort &rhs) const |
| 1741 | { |
| 1742 | Value *value = rhs.loadValue(); |
| 1743 | storeValue(value); |
| 1744 | |
| 1745 | return RValue<UShort>(value); |
| 1746 | } |
| 1747 | |
| 1748 | RValue<UShort> UShort::operator=(const Reference<UShort> &rhs) const |
| 1749 | { |
| 1750 | Value *value = rhs.loadValue(); |
| 1751 | storeValue(value); |
| 1752 | |
| 1753 | return RValue<UShort>(value); |
| 1754 | } |
| 1755 | |
| 1756 | RValue<UShort> operator+(RValue<UShort> lhs, RValue<UShort> rhs) |
| 1757 | { |
| 1758 | return RValue<UShort>(Nucleus::createAdd(lhs.value, rhs.value)); |
| 1759 | } |
| 1760 | |
| 1761 | RValue<UShort> operator-(RValue<UShort> lhs, RValue<UShort> rhs) |
| 1762 | { |
| 1763 | return RValue<UShort>(Nucleus::createSub(lhs.value, rhs.value)); |
| 1764 | } |
| 1765 | |
| 1766 | RValue<UShort> operator*(RValue<UShort> lhs, RValue<UShort> rhs) |
| 1767 | { |
| 1768 | return RValue<UShort>(Nucleus::createMul(lhs.value, rhs.value)); |
| 1769 | } |
| 1770 | |
| 1771 | RValue<UShort> operator/(RValue<UShort> lhs, RValue<UShort> rhs) |
| 1772 | { |
| 1773 | return RValue<UShort>(Nucleus::createUDiv(lhs.value, rhs.value)); |
| 1774 | } |
| 1775 | |
| 1776 | RValue<UShort> operator%(RValue<UShort> lhs, RValue<UShort> rhs) |
| 1777 | { |
| 1778 | return RValue<UShort>(Nucleus::createURem(lhs.value, rhs.value)); |
| 1779 | } |
| 1780 | |
| 1781 | RValue<UShort> operator&(RValue<UShort> lhs, RValue<UShort> rhs) |
| 1782 | { |
| 1783 | return RValue<UShort>(Nucleus::createAnd(lhs.value, rhs.value)); |
| 1784 | } |
| 1785 | |
| 1786 | RValue<UShort> operator|(RValue<UShort> lhs, RValue<UShort> rhs) |
| 1787 | { |
| 1788 | return RValue<UShort>(Nucleus::createOr(lhs.value, rhs.value)); |
| 1789 | } |
| 1790 | |
| 1791 | RValue<UShort> operator^(RValue<UShort> lhs, RValue<UShort> rhs) |
| 1792 | { |
| 1793 | return RValue<UShort>(Nucleus::createXor(lhs.value, rhs.value)); |
| 1794 | } |
| 1795 | |
| 1796 | RValue<UShort> operator<<(RValue<UShort> lhs, RValue<UShort> rhs) |
| 1797 | { |
| 1798 | return RValue<UShort>(Nucleus::createShl(lhs.value, rhs.value)); |
| 1799 | } |
| 1800 | |
| 1801 | RValue<UShort> operator>>(RValue<UShort> lhs, RValue<UShort> rhs) |
| 1802 | { |
| 1803 | return RValue<UShort>(Nucleus::createLShr(lhs.value, rhs.value)); |
| 1804 | } |
| 1805 | |
| 1806 | RValue<UShort> operator+=(const UShort &lhs, RValue<UShort> rhs) |
| 1807 | { |
| 1808 | return lhs = lhs + rhs; |
| 1809 | } |
| 1810 | |
| 1811 | RValue<UShort> operator-=(const UShort &lhs, RValue<UShort> rhs) |
| 1812 | { |
| 1813 | return lhs = lhs - rhs; |
| 1814 | } |
| 1815 | |
| 1816 | RValue<UShort> operator*=(const UShort &lhs, RValue<UShort> rhs) |
| 1817 | { |
| 1818 | return lhs = lhs * rhs; |
| 1819 | } |
| 1820 | |
| 1821 | RValue<UShort> operator/=(const UShort &lhs, RValue<UShort> rhs) |
| 1822 | { |
| 1823 | return lhs = lhs / rhs; |
| 1824 | } |
| 1825 | |
| 1826 | RValue<UShort> operator%=(const UShort &lhs, RValue<UShort> rhs) |
| 1827 | { |
| 1828 | return lhs = lhs % rhs; |
| 1829 | } |
| 1830 | |
| 1831 | RValue<UShort> operator&=(const UShort &lhs, RValue<UShort> rhs) |
| 1832 | { |
| 1833 | return lhs = lhs & rhs; |
| 1834 | } |
| 1835 | |
| 1836 | RValue<UShort> operator|=(const UShort &lhs, RValue<UShort> rhs) |
| 1837 | { |
| 1838 | return lhs = lhs | rhs; |
| 1839 | } |
| 1840 | |
| 1841 | RValue<UShort> operator^=(const UShort &lhs, RValue<UShort> rhs) |
| 1842 | { |
| 1843 | return lhs = lhs ^ rhs; |
| 1844 | } |
| 1845 | |
| 1846 | RValue<UShort> operator<<=(const UShort &lhs, RValue<UShort> rhs) |
| 1847 | { |
| 1848 | return lhs = lhs << rhs; |
| 1849 | } |
| 1850 | |
| 1851 | RValue<UShort> operator>>=(const UShort &lhs, RValue<UShort> rhs) |
| 1852 | { |
| 1853 | return lhs = lhs >> rhs; |
| 1854 | } |
| 1855 | |
| 1856 | RValue<UShort> operator+(RValue<UShort> val) |
| 1857 | { |
| 1858 | return val; |
| 1859 | } |
| 1860 | |
| 1861 | RValue<UShort> operator-(RValue<UShort> val) |
| 1862 | { |
| 1863 | return RValue<UShort>(Nucleus::createNeg(val.value)); |
| 1864 | } |
| 1865 | |
| 1866 | RValue<UShort> operator~(RValue<UShort> val) |
| 1867 | { |
| 1868 | return RValue<UShort>(Nucleus::createNot(val.value)); |
| 1869 | } |
| 1870 | |
| 1871 | RValue<UShort> operator++(const UShort &val, int) // Post-increment |
| 1872 | { |
| 1873 | RValue<UShort> res = val; |
| 1874 | |
| 1875 | assert(false && "UNIMPLEMENTED"); |
| 1876 | assert(false && "UNIMPLEMENTED"); |
| 1877 | |
| 1878 | return res; |
| 1879 | } |
| 1880 | |
| 1881 | const UShort &operator++(const UShort &val) // Pre-increment |
| 1882 | { |
| 1883 | assert(false && "UNIMPLEMENTED"); |
| 1884 | assert(false && "UNIMPLEMENTED"); |
| 1885 | |
| 1886 | return val; |
| 1887 | } |
| 1888 | |
| 1889 | RValue<UShort> operator--(const UShort &val, int) // Post-decrement |
| 1890 | { |
| 1891 | RValue<UShort> res = val; |
| 1892 | |
| 1893 | assert(false && "UNIMPLEMENTED"); |
| 1894 | assert(false && "UNIMPLEMENTED"); |
| 1895 | |
| 1896 | return res; |
| 1897 | } |
| 1898 | |
| 1899 | const UShort &operator--(const UShort &val) // Pre-decrement |
| 1900 | { |
| 1901 | assert(false && "UNIMPLEMENTED"); |
| 1902 | assert(false && "UNIMPLEMENTED"); |
| 1903 | |
| 1904 | return val; |
| 1905 | } |
| 1906 | |
| 1907 | RValue<Bool> operator<(RValue<UShort> lhs, RValue<UShort> rhs) |
| 1908 | { |
| 1909 | return RValue<Bool>(Nucleus::createICmpULT(lhs.value, rhs.value)); |
| 1910 | } |
| 1911 | |
| 1912 | RValue<Bool> operator<=(RValue<UShort> lhs, RValue<UShort> rhs) |
| 1913 | { |
| 1914 | return RValue<Bool>(Nucleus::createICmpULE(lhs.value, rhs.value)); |
| 1915 | } |
| 1916 | |
| 1917 | RValue<Bool> operator>(RValue<UShort> lhs, RValue<UShort> rhs) |
| 1918 | { |
| 1919 | return RValue<Bool>(Nucleus::createICmpUGT(lhs.value, rhs.value)); |
| 1920 | } |
| 1921 | |
| 1922 | RValue<Bool> operator>=(RValue<UShort> lhs, RValue<UShort> rhs) |
| 1923 | { |
| 1924 | return RValue<Bool>(Nucleus::createICmpUGE(lhs.value, rhs.value)); |
| 1925 | } |
| 1926 | |
| 1927 | RValue<Bool> operator!=(RValue<UShort> lhs, RValue<UShort> rhs) |
| 1928 | { |
| 1929 | return RValue<Bool>(Nucleus::createICmpNE(lhs.value, rhs.value)); |
| 1930 | } |
| 1931 | |
| 1932 | RValue<Bool> operator==(RValue<UShort> lhs, RValue<UShort> rhs) |
| 1933 | { |
| 1934 | return RValue<Bool>(Nucleus::createICmpEQ(lhs.value, rhs.value)); |
| 1935 | } |
| 1936 | |
| 1937 | Type *UShort::getType() |
| 1938 | { |
| 1939 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 1940 | } |
| 1941 | |
Nicolas Capens | 16b5f15 | 2016-10-13 13:39:01 -0400 | [diff] [blame^] | 1942 | Byte4::Byte4(RValue<Byte8> cast) |
| 1943 | { |
| 1944 | // xyzw.parent = this; |
| 1945 | |
| 1946 | storeValue(Nucleus::createBitCast(cast.value, getType())); |
| 1947 | } |
| 1948 | |
| 1949 | Byte4::Byte4(const Reference<Byte4> &rhs) |
| 1950 | { |
| 1951 | // xyzw.parent = this; |
| 1952 | |
| 1953 | assert(false && "UNIMPLEMENTED"); |
| 1954 | } |
| 1955 | |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 1956 | Type *Byte4::getType() |
| 1957 | { |
Nicolas Capens | 16b5f15 | 2016-10-13 13:39:01 -0400 | [diff] [blame^] | 1958 | assert(false && "UNIMPLEMENTED"); return nullptr; |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 1959 | } |
| 1960 | |
| 1961 | Type *SByte4::getType() |
| 1962 | { |
Nicolas Capens | 16b5f15 | 2016-10-13 13:39:01 -0400 | [diff] [blame^] | 1963 | assert(false && "UNIMPLEMENTED"); return nullptr; |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 1964 | } |
| 1965 | |
| 1966 | Byte8::Byte8() |
| 1967 | { |
| 1968 | // xyzw.parent = this; |
| 1969 | } |
| 1970 | |
| 1971 | Byte8::Byte8(uint8_t x0, uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, uint8_t x5, uint8_t x6, uint8_t x7) |
| 1972 | { |
| 1973 | // xyzw.parent = this; |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 1974 | |
Nicolas Capens | 16b5f15 | 2016-10-13 13:39:01 -0400 | [diff] [blame^] | 1975 | assert(false && "UNIMPLEMENTED"); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 1976 | } |
| 1977 | |
| 1978 | Byte8::Byte8(RValue<Byte8> rhs) |
| 1979 | { |
| 1980 | // xyzw.parent = this; |
| 1981 | |
| 1982 | storeValue(rhs.value); |
| 1983 | } |
| 1984 | |
| 1985 | Byte8::Byte8(const Byte8 &rhs) |
| 1986 | { |
| 1987 | // xyzw.parent = this; |
| 1988 | |
| 1989 | Value *value = rhs.loadValue(); |
| 1990 | storeValue(value); |
| 1991 | } |
| 1992 | |
| 1993 | Byte8::Byte8(const Reference<Byte8> &rhs) |
| 1994 | { |
| 1995 | // xyzw.parent = this; |
| 1996 | |
| 1997 | Value *value = rhs.loadValue(); |
| 1998 | storeValue(value); |
| 1999 | } |
| 2000 | |
| 2001 | RValue<Byte8> Byte8::operator=(RValue<Byte8> rhs) const |
| 2002 | { |
| 2003 | storeValue(rhs.value); |
| 2004 | |
| 2005 | return rhs; |
| 2006 | } |
| 2007 | |
| 2008 | RValue<Byte8> Byte8::operator=(const Byte8 &rhs) const |
| 2009 | { |
| 2010 | Value *value = rhs.loadValue(); |
| 2011 | storeValue(value); |
| 2012 | |
| 2013 | return RValue<Byte8>(value); |
| 2014 | } |
| 2015 | |
| 2016 | RValue<Byte8> Byte8::operator=(const Reference<Byte8> &rhs) const |
| 2017 | { |
| 2018 | Value *value = rhs.loadValue(); |
| 2019 | storeValue(value); |
| 2020 | |
| 2021 | return RValue<Byte8>(value); |
| 2022 | } |
| 2023 | |
| 2024 | RValue<Byte8> operator+(RValue<Byte8> lhs, RValue<Byte8> rhs) |
| 2025 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2026 | assert(false && "UNIMPLEMENTED"); return RValue<Byte8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2027 | } |
| 2028 | |
| 2029 | RValue<Byte8> operator-(RValue<Byte8> lhs, RValue<Byte8> rhs) |
| 2030 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2031 | assert(false && "UNIMPLEMENTED"); return RValue<Byte8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2032 | } |
| 2033 | |
| 2034 | // RValue<Byte8> operator*(RValue<Byte8> lhs, RValue<Byte8> rhs) |
| 2035 | // { |
| 2036 | // return RValue<Byte8>(Nucleus::createMul(lhs.value, rhs.value)); |
| 2037 | // } |
| 2038 | |
| 2039 | // RValue<Byte8> operator/(RValue<Byte8> lhs, RValue<Byte8> rhs) |
| 2040 | // { |
| 2041 | // return RValue<Byte8>(Nucleus::createUDiv(lhs.value, rhs.value)); |
| 2042 | // } |
| 2043 | |
| 2044 | // RValue<Byte8> operator%(RValue<Byte8> lhs, RValue<Byte8> rhs) |
| 2045 | // { |
| 2046 | // return RValue<Byte8>(Nucleus::createURem(lhs.value, rhs.value)); |
| 2047 | // } |
| 2048 | |
| 2049 | RValue<Byte8> operator&(RValue<Byte8> lhs, RValue<Byte8> rhs) |
| 2050 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2051 | assert(false && "UNIMPLEMENTED"); return RValue<Byte8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2052 | } |
| 2053 | |
| 2054 | RValue<Byte8> operator|(RValue<Byte8> lhs, RValue<Byte8> rhs) |
| 2055 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2056 | assert(false && "UNIMPLEMENTED"); return RValue<Byte8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2057 | } |
| 2058 | |
| 2059 | RValue<Byte8> operator^(RValue<Byte8> lhs, RValue<Byte8> rhs) |
| 2060 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2061 | assert(false && "UNIMPLEMENTED"); return RValue<Byte8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2062 | } |
| 2063 | |
| 2064 | // RValue<Byte8> operator<<(RValue<Byte8> lhs, unsigned char rhs) |
| 2065 | // { |
| 2066 | // return RValue<Byte8>(Nucleus::createShl(lhs.value, rhs.value)); |
| 2067 | // } |
| 2068 | |
| 2069 | // RValue<Byte8> operator>>(RValue<Byte8> lhs, unsigned char rhs) |
| 2070 | // { |
| 2071 | // return RValue<Byte8>(Nucleus::createLShr(lhs.value, rhs.value)); |
| 2072 | // } |
| 2073 | |
| 2074 | RValue<Byte8> operator+=(const Byte8 &lhs, RValue<Byte8> rhs) |
| 2075 | { |
| 2076 | return lhs = lhs + rhs; |
| 2077 | } |
| 2078 | |
| 2079 | RValue<Byte8> operator-=(const Byte8 &lhs, RValue<Byte8> rhs) |
| 2080 | { |
| 2081 | return lhs = lhs - rhs; |
| 2082 | } |
| 2083 | |
| 2084 | // RValue<Byte8> operator*=(const Byte8 &lhs, RValue<Byte8> rhs) |
| 2085 | // { |
| 2086 | // return lhs = lhs * rhs; |
| 2087 | // } |
| 2088 | |
| 2089 | // RValue<Byte8> operator/=(const Byte8 &lhs, RValue<Byte8> rhs) |
| 2090 | // { |
| 2091 | // return lhs = lhs / rhs; |
| 2092 | // } |
| 2093 | |
| 2094 | // RValue<Byte8> operator%=(const Byte8 &lhs, RValue<Byte8> rhs) |
| 2095 | // { |
| 2096 | // return lhs = lhs % rhs; |
| 2097 | // } |
| 2098 | |
| 2099 | RValue<Byte8> operator&=(const Byte8 &lhs, RValue<Byte8> rhs) |
| 2100 | { |
| 2101 | return lhs = lhs & rhs; |
| 2102 | } |
| 2103 | |
| 2104 | RValue<Byte8> operator|=(const Byte8 &lhs, RValue<Byte8> rhs) |
| 2105 | { |
| 2106 | return lhs = lhs | rhs; |
| 2107 | } |
| 2108 | |
| 2109 | RValue<Byte8> operator^=(const Byte8 &lhs, RValue<Byte8> rhs) |
| 2110 | { |
| 2111 | return lhs = lhs ^ rhs; |
| 2112 | } |
| 2113 | |
| 2114 | // RValue<Byte8> operator<<=(const Byte8 &lhs, RValue<Byte8> rhs) |
| 2115 | // { |
| 2116 | // return lhs = lhs << rhs; |
| 2117 | // } |
| 2118 | |
| 2119 | // RValue<Byte8> operator>>=(const Byte8 &lhs, RValue<Byte8> rhs) |
| 2120 | // { |
| 2121 | // return lhs = lhs >> rhs; |
| 2122 | // } |
| 2123 | |
| 2124 | // RValue<Byte8> operator+(RValue<Byte8> val) |
| 2125 | // { |
| 2126 | // return val; |
| 2127 | // } |
| 2128 | |
| 2129 | // RValue<Byte8> operator-(RValue<Byte8> val) |
| 2130 | // { |
| 2131 | // return RValue<Byte8>(Nucleus::createNeg(val.value)); |
| 2132 | // } |
| 2133 | |
| 2134 | RValue<Byte8> operator~(RValue<Byte8> val) |
| 2135 | { |
| 2136 | return RValue<Byte8>(Nucleus::createNot(val.value)); |
| 2137 | } |
| 2138 | |
| 2139 | RValue<Byte8> AddSat(RValue<Byte8> x, RValue<Byte8> y) |
| 2140 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2141 | assert(false && "UNIMPLEMENTED"); return RValue<Byte8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2142 | } |
| 2143 | |
| 2144 | RValue<Byte8> SubSat(RValue<Byte8> x, RValue<Byte8> y) |
| 2145 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2146 | assert(false && "UNIMPLEMENTED"); return RValue<Byte8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2147 | } |
| 2148 | |
| 2149 | RValue<Short4> Unpack(RValue<Byte4> x) |
| 2150 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2151 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2152 | } |
| 2153 | |
| 2154 | RValue<Short4> UnpackLow(RValue<Byte8> x, RValue<Byte8> y) |
| 2155 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2156 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2157 | } |
| 2158 | |
| 2159 | RValue<Short4> UnpackHigh(RValue<Byte8> x, RValue<Byte8> y) |
| 2160 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2161 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2162 | } |
| 2163 | |
| 2164 | RValue<Int> SignMask(RValue<Byte8> x) |
| 2165 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2166 | assert(false && "UNIMPLEMENTED"); return RValue<Int>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2167 | } |
| 2168 | |
| 2169 | // RValue<Byte8> CmpGT(RValue<Byte8> x, RValue<Byte8> y) |
| 2170 | // { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2171 | // assert(false && "UNIMPLEMENTED"); return RValue<Byte8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2172 | // } |
| 2173 | |
| 2174 | RValue<Byte8> CmpEQ(RValue<Byte8> x, RValue<Byte8> y) |
| 2175 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2176 | assert(false && "UNIMPLEMENTED"); return RValue<Byte8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2177 | } |
| 2178 | |
| 2179 | Type *Byte8::getType() |
| 2180 | { |
| 2181 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 2182 | } |
| 2183 | |
| 2184 | SByte8::SByte8() |
| 2185 | { |
| 2186 | // xyzw.parent = this; |
| 2187 | } |
| 2188 | |
| 2189 | SByte8::SByte8(uint8_t x0, uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, uint8_t x5, uint8_t x6, uint8_t x7) |
| 2190 | { |
| 2191 | // xyzw.parent = this; |
| 2192 | |
| 2193 | assert(false && "UNIMPLEMENTED"); |
| 2194 | } |
| 2195 | |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2196 | SByte8::SByte8(RValue<SByte8> rhs) |
| 2197 | { |
| 2198 | // xyzw.parent = this; |
| 2199 | |
| 2200 | storeValue(rhs.value); |
| 2201 | } |
| 2202 | |
| 2203 | SByte8::SByte8(const SByte8 &rhs) |
| 2204 | { |
| 2205 | // xyzw.parent = this; |
| 2206 | |
| 2207 | Value *value = rhs.loadValue(); |
| 2208 | storeValue(value); |
| 2209 | } |
| 2210 | |
| 2211 | SByte8::SByte8(const Reference<SByte8> &rhs) |
| 2212 | { |
| 2213 | // xyzw.parent = this; |
| 2214 | |
| 2215 | Value *value = rhs.loadValue(); |
| 2216 | storeValue(value); |
| 2217 | } |
| 2218 | |
| 2219 | RValue<SByte8> SByte8::operator=(RValue<SByte8> rhs) const |
| 2220 | { |
| 2221 | storeValue(rhs.value); |
| 2222 | |
| 2223 | return rhs; |
| 2224 | } |
| 2225 | |
| 2226 | RValue<SByte8> SByte8::operator=(const SByte8 &rhs) const |
| 2227 | { |
| 2228 | Value *value = rhs.loadValue(); |
| 2229 | storeValue(value); |
| 2230 | |
| 2231 | return RValue<SByte8>(value); |
| 2232 | } |
| 2233 | |
| 2234 | RValue<SByte8> SByte8::operator=(const Reference<SByte8> &rhs) const |
| 2235 | { |
| 2236 | Value *value = rhs.loadValue(); |
| 2237 | storeValue(value); |
| 2238 | |
| 2239 | return RValue<SByte8>(value); |
| 2240 | } |
| 2241 | |
| 2242 | RValue<SByte8> operator+(RValue<SByte8> lhs, RValue<SByte8> rhs) |
| 2243 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2244 | assert(false && "UNIMPLEMENTED"); return RValue<SByte8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2245 | } |
| 2246 | |
| 2247 | RValue<SByte8> operator-(RValue<SByte8> lhs, RValue<SByte8> rhs) |
| 2248 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2249 | assert(false && "UNIMPLEMENTED"); return RValue<SByte8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2250 | } |
| 2251 | |
| 2252 | // RValue<SByte8> operator*(RValue<SByte8> lhs, RValue<SByte8> rhs) |
| 2253 | // { |
| 2254 | // return RValue<SByte8>(Nucleus::createMul(lhs.value, rhs.value)); |
| 2255 | // } |
| 2256 | |
| 2257 | // RValue<SByte8> operator/(RValue<SByte8> lhs, RValue<SByte8> rhs) |
| 2258 | // { |
| 2259 | // return RValue<SByte8>(Nucleus::createSDiv(lhs.value, rhs.value)); |
| 2260 | // } |
| 2261 | |
| 2262 | // RValue<SByte8> operator%(RValue<SByte8> lhs, RValue<SByte8> rhs) |
| 2263 | // { |
| 2264 | // return RValue<SByte8>(Nucleus::createSRem(lhs.value, rhs.value)); |
| 2265 | // } |
| 2266 | |
| 2267 | RValue<SByte8> operator&(RValue<SByte8> lhs, RValue<SByte8> rhs) |
| 2268 | { |
| 2269 | return RValue<SByte8>(Nucleus::createAnd(lhs.value, rhs.value)); |
| 2270 | } |
| 2271 | |
| 2272 | RValue<SByte8> operator|(RValue<SByte8> lhs, RValue<SByte8> rhs) |
| 2273 | { |
| 2274 | return RValue<SByte8>(Nucleus::createOr(lhs.value, rhs.value)); |
| 2275 | } |
| 2276 | |
| 2277 | RValue<SByte8> operator^(RValue<SByte8> lhs, RValue<SByte8> rhs) |
| 2278 | { |
| 2279 | return RValue<SByte8>(Nucleus::createXor(lhs.value, rhs.value)); |
| 2280 | } |
| 2281 | |
| 2282 | // RValue<SByte8> operator<<(RValue<SByte8> lhs, unsigned char rhs) |
| 2283 | // { |
| 2284 | // return RValue<SByte8>(Nucleus::createShl(lhs.value, rhs.value)); |
| 2285 | // } |
| 2286 | |
| 2287 | // RValue<SByte8> operator>>(RValue<SByte8> lhs, unsigned char rhs) |
| 2288 | // { |
| 2289 | // return RValue<SByte8>(Nucleus::createAShr(lhs.value, rhs.value)); |
| 2290 | // } |
| 2291 | |
| 2292 | RValue<SByte8> operator+=(const SByte8 &lhs, RValue<SByte8> rhs) |
| 2293 | { |
| 2294 | return lhs = lhs + rhs; |
| 2295 | } |
| 2296 | |
| 2297 | RValue<SByte8> operator-=(const SByte8 &lhs, RValue<SByte8> rhs) |
| 2298 | { |
| 2299 | return lhs = lhs - rhs; |
| 2300 | } |
| 2301 | |
| 2302 | // RValue<SByte8> operator*=(const SByte8 &lhs, RValue<SByte8> rhs) |
| 2303 | // { |
| 2304 | // return lhs = lhs * rhs; |
| 2305 | // } |
| 2306 | |
| 2307 | // RValue<SByte8> operator/=(const SByte8 &lhs, RValue<SByte8> rhs) |
| 2308 | // { |
| 2309 | // return lhs = lhs / rhs; |
| 2310 | // } |
| 2311 | |
| 2312 | // RValue<SByte8> operator%=(const SByte8 &lhs, RValue<SByte8> rhs) |
| 2313 | // { |
| 2314 | // return lhs = lhs % rhs; |
| 2315 | // } |
| 2316 | |
| 2317 | RValue<SByte8> operator&=(const SByte8 &lhs, RValue<SByte8> rhs) |
| 2318 | { |
| 2319 | return lhs = lhs & rhs; |
| 2320 | } |
| 2321 | |
| 2322 | RValue<SByte8> operator|=(const SByte8 &lhs, RValue<SByte8> rhs) |
| 2323 | { |
| 2324 | return lhs = lhs | rhs; |
| 2325 | } |
| 2326 | |
| 2327 | RValue<SByte8> operator^=(const SByte8 &lhs, RValue<SByte8> rhs) |
| 2328 | { |
| 2329 | return lhs = lhs ^ rhs; |
| 2330 | } |
| 2331 | |
| 2332 | // RValue<SByte8> operator<<=(const SByte8 &lhs, RValue<SByte8> rhs) |
| 2333 | // { |
| 2334 | // return lhs = lhs << rhs; |
| 2335 | // } |
| 2336 | |
| 2337 | // RValue<SByte8> operator>>=(const SByte8 &lhs, RValue<SByte8> rhs) |
| 2338 | // { |
| 2339 | // return lhs = lhs >> rhs; |
| 2340 | // } |
| 2341 | |
| 2342 | // RValue<SByte8> operator+(RValue<SByte8> val) |
| 2343 | // { |
| 2344 | // return val; |
| 2345 | // } |
| 2346 | |
| 2347 | // RValue<SByte8> operator-(RValue<SByte8> val) |
| 2348 | // { |
| 2349 | // return RValue<SByte8>(Nucleus::createNeg(val.value)); |
| 2350 | // } |
| 2351 | |
| 2352 | RValue<SByte8> operator~(RValue<SByte8> val) |
| 2353 | { |
| 2354 | return RValue<SByte8>(Nucleus::createNot(val.value)); |
| 2355 | } |
| 2356 | |
| 2357 | RValue<SByte8> AddSat(RValue<SByte8> x, RValue<SByte8> y) |
| 2358 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2359 | assert(false && "UNIMPLEMENTED"); return RValue<SByte8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2360 | } |
| 2361 | |
| 2362 | RValue<SByte8> SubSat(RValue<SByte8> x, RValue<SByte8> y) |
| 2363 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2364 | assert(false && "UNIMPLEMENTED"); return RValue<SByte8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2365 | } |
| 2366 | |
| 2367 | RValue<Short4> UnpackLow(RValue<SByte8> x, RValue<SByte8> y) |
| 2368 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2369 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2370 | } |
| 2371 | |
| 2372 | RValue<Short4> UnpackHigh(RValue<SByte8> x, RValue<SByte8> y) |
| 2373 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2374 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2375 | } |
| 2376 | |
| 2377 | RValue<Int> SignMask(RValue<SByte8> x) |
| 2378 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2379 | assert(false && "UNIMPLEMENTED"); return RValue<Int>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2380 | } |
| 2381 | |
| 2382 | RValue<Byte8> CmpGT(RValue<SByte8> x, RValue<SByte8> y) |
| 2383 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2384 | assert(false && "UNIMPLEMENTED"); return RValue<Byte8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2385 | } |
| 2386 | |
| 2387 | RValue<Byte8> CmpEQ(RValue<SByte8> x, RValue<SByte8> y) |
| 2388 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2389 | assert(false && "UNIMPLEMENTED"); return RValue<Byte8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2390 | } |
| 2391 | |
| 2392 | Type *SByte8::getType() |
| 2393 | { |
| 2394 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 2395 | } |
| 2396 | |
| 2397 | Byte16::Byte16(RValue<Byte16> rhs) |
| 2398 | { |
| 2399 | // xyzw.parent = this; |
| 2400 | |
| 2401 | storeValue(rhs.value); |
| 2402 | } |
| 2403 | |
| 2404 | Byte16::Byte16(const Byte16 &rhs) |
| 2405 | { |
| 2406 | // xyzw.parent = this; |
| 2407 | |
| 2408 | Value *value = rhs.loadValue(); |
| 2409 | storeValue(value); |
| 2410 | } |
| 2411 | |
| 2412 | Byte16::Byte16(const Reference<Byte16> &rhs) |
| 2413 | { |
| 2414 | // xyzw.parent = this; |
| 2415 | |
| 2416 | Value *value = rhs.loadValue(); |
| 2417 | storeValue(value); |
| 2418 | } |
| 2419 | |
| 2420 | RValue<Byte16> Byte16::operator=(RValue<Byte16> rhs) const |
| 2421 | { |
| 2422 | storeValue(rhs.value); |
| 2423 | |
| 2424 | return rhs; |
| 2425 | } |
| 2426 | |
| 2427 | RValue<Byte16> Byte16::operator=(const Byte16 &rhs) const |
| 2428 | { |
| 2429 | Value *value = rhs.loadValue(); |
| 2430 | storeValue(value); |
| 2431 | |
| 2432 | return RValue<Byte16>(value); |
| 2433 | } |
| 2434 | |
| 2435 | RValue<Byte16> Byte16::operator=(const Reference<Byte16> &rhs) const |
| 2436 | { |
| 2437 | Value *value = rhs.loadValue(); |
| 2438 | storeValue(value); |
| 2439 | |
| 2440 | return RValue<Byte16>(value); |
| 2441 | } |
| 2442 | |
| 2443 | Type *Byte16::getType() |
| 2444 | { |
| 2445 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 2446 | } |
| 2447 | |
| 2448 | Type *SByte16::getType() |
| 2449 | { |
| 2450 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 2451 | } |
| 2452 | |
Nicolas Capens | 16b5f15 | 2016-10-13 13:39:01 -0400 | [diff] [blame^] | 2453 | Short2::Short2(RValue<Short4> cast) |
| 2454 | { |
| 2455 | assert(false && "UNIMPLEMENTED"); |
| 2456 | } |
| 2457 | |
| 2458 | Type *Short2::getType() |
| 2459 | { |
| 2460 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 2461 | } |
| 2462 | |
| 2463 | UShort2::UShort2(RValue<UShort4> cast) |
| 2464 | { |
| 2465 | assert(false && "UNIMPLEMENTED"); |
| 2466 | } |
| 2467 | |
| 2468 | Type *UShort2::getType() |
| 2469 | { |
| 2470 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 2471 | } |
| 2472 | |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2473 | Short4::Short4(RValue<Int> cast) |
| 2474 | { |
| 2475 | Value *extend = Nucleus::createZExt(cast.value, Long::getType()); |
| 2476 | Value *swizzle = Swizzle(RValue<Short4>(extend), 0x00).value; |
| 2477 | |
| 2478 | storeValue(swizzle); |
| 2479 | } |
| 2480 | |
| 2481 | Short4::Short4(RValue<Int4> cast) |
| 2482 | { |
| 2483 | assert(false && "UNIMPLEMENTED"); |
| 2484 | } |
| 2485 | |
| 2486 | // Short4::Short4(RValue<Float> cast) |
| 2487 | // { |
| 2488 | // } |
| 2489 | |
| 2490 | Short4::Short4(RValue<Float4> cast) |
| 2491 | { |
| 2492 | assert(false && "UNIMPLEMENTED"); |
| 2493 | } |
| 2494 | |
| 2495 | Short4::Short4() |
| 2496 | { |
| 2497 | // xyzw.parent = this; |
| 2498 | } |
| 2499 | |
| 2500 | Short4::Short4(short xyzw) |
| 2501 | { |
| 2502 | // xyzw.parent = this; |
| 2503 | |
| 2504 | assert(false && "UNIMPLEMENTED"); |
| 2505 | } |
| 2506 | |
| 2507 | Short4::Short4(short x, short y, short z, short w) |
| 2508 | { |
| 2509 | // xyzw.parent = this; |
| 2510 | |
| 2511 | assert(false && "UNIMPLEMENTED"); |
| 2512 | } |
| 2513 | |
| 2514 | Short4::Short4(RValue<Short4> rhs) |
| 2515 | { |
| 2516 | // xyzw.parent = this; |
| 2517 | |
| 2518 | storeValue(rhs.value); |
| 2519 | } |
| 2520 | |
| 2521 | Short4::Short4(const Short4 &rhs) |
| 2522 | { |
| 2523 | // xyzw.parent = this; |
| 2524 | |
| 2525 | Value *value = rhs.loadValue(); |
| 2526 | storeValue(value); |
| 2527 | } |
| 2528 | |
| 2529 | Short4::Short4(const Reference<Short4> &rhs) |
| 2530 | { |
| 2531 | // xyzw.parent = this; |
| 2532 | |
| 2533 | Value *value = rhs.loadValue(); |
| 2534 | storeValue(value); |
| 2535 | } |
| 2536 | |
| 2537 | Short4::Short4(RValue<UShort4> rhs) |
| 2538 | { |
| 2539 | // xyzw.parent = this; |
| 2540 | |
| 2541 | storeValue(rhs.value); |
| 2542 | } |
| 2543 | |
| 2544 | Short4::Short4(const UShort4 &rhs) |
| 2545 | { |
| 2546 | // xyzw.parent = this; |
| 2547 | |
| 2548 | storeValue(rhs.loadValue()); |
| 2549 | } |
| 2550 | |
| 2551 | Short4::Short4(const Reference<UShort4> &rhs) |
| 2552 | { |
| 2553 | // xyzw.parent = this; |
| 2554 | |
| 2555 | storeValue(rhs.loadValue()); |
| 2556 | } |
| 2557 | |
| 2558 | RValue<Short4> Short4::operator=(RValue<Short4> rhs) const |
| 2559 | { |
| 2560 | storeValue(rhs.value); |
| 2561 | |
| 2562 | return rhs; |
| 2563 | } |
| 2564 | |
| 2565 | RValue<Short4> Short4::operator=(const Short4 &rhs) const |
| 2566 | { |
| 2567 | Value *value = rhs.loadValue(); |
| 2568 | storeValue(value); |
| 2569 | |
| 2570 | return RValue<Short4>(value); |
| 2571 | } |
| 2572 | |
| 2573 | RValue<Short4> Short4::operator=(const Reference<Short4> &rhs) const |
| 2574 | { |
| 2575 | Value *value = rhs.loadValue(); |
| 2576 | storeValue(value); |
| 2577 | |
| 2578 | return RValue<Short4>(value); |
| 2579 | } |
| 2580 | |
| 2581 | RValue<Short4> Short4::operator=(RValue<UShort4> rhs) const |
| 2582 | { |
| 2583 | storeValue(rhs.value); |
| 2584 | |
| 2585 | return RValue<Short4>(rhs); |
| 2586 | } |
| 2587 | |
| 2588 | RValue<Short4> Short4::operator=(const UShort4 &rhs) const |
| 2589 | { |
| 2590 | Value *value = rhs.loadValue(); |
| 2591 | storeValue(value); |
| 2592 | |
| 2593 | return RValue<Short4>(value); |
| 2594 | } |
| 2595 | |
| 2596 | RValue<Short4> Short4::operator=(const Reference<UShort4> &rhs) const |
| 2597 | { |
| 2598 | Value *value = rhs.loadValue(); |
| 2599 | storeValue(value); |
| 2600 | |
| 2601 | return RValue<Short4>(value); |
| 2602 | } |
| 2603 | |
| 2604 | RValue<Short4> operator+(RValue<Short4> lhs, RValue<Short4> rhs) |
| 2605 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2606 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2607 | } |
| 2608 | |
| 2609 | RValue<Short4> operator-(RValue<Short4> lhs, RValue<Short4> rhs) |
| 2610 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2611 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2612 | } |
| 2613 | |
| 2614 | RValue<Short4> operator*(RValue<Short4> lhs, RValue<Short4> rhs) |
| 2615 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2616 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2617 | } |
| 2618 | |
| 2619 | // RValue<Short4> operator/(RValue<Short4> lhs, RValue<Short4> rhs) |
| 2620 | // { |
| 2621 | // return RValue<Short4>(Nucleus::createSDiv(lhs.value, rhs.value)); |
| 2622 | // } |
| 2623 | |
| 2624 | // RValue<Short4> operator%(RValue<Short4> lhs, RValue<Short4> rhs) |
| 2625 | // { |
| 2626 | // return RValue<Short4>(Nucleus::createSRem(lhs.value, rhs.value)); |
| 2627 | // } |
| 2628 | |
| 2629 | RValue<Short4> operator&(RValue<Short4> lhs, RValue<Short4> rhs) |
| 2630 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2631 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2632 | } |
| 2633 | |
| 2634 | RValue<Short4> operator|(RValue<Short4> lhs, RValue<Short4> rhs) |
| 2635 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2636 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2637 | } |
| 2638 | |
| 2639 | RValue<Short4> operator^(RValue<Short4> lhs, RValue<Short4> rhs) |
| 2640 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2641 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2642 | } |
| 2643 | |
| 2644 | RValue<Short4> operator<<(RValue<Short4> lhs, unsigned char rhs) |
| 2645 | { |
| 2646 | // return RValue<Short4>(Nucleus::createShl(lhs.value, rhs.value)); |
| 2647 | |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2648 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2649 | } |
| 2650 | |
| 2651 | RValue<Short4> operator>>(RValue<Short4> lhs, unsigned char rhs) |
| 2652 | { |
| 2653 | // return RValue<Short4>(Nucleus::createAShr(lhs.value, rhs.value)); |
| 2654 | |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2655 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2656 | } |
| 2657 | |
| 2658 | RValue<Short4> operator<<(RValue<Short4> lhs, RValue<Long1> rhs) |
| 2659 | { |
| 2660 | // return RValue<Short4>(Nucleus::createShl(lhs.value, rhs.value)); |
| 2661 | |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2662 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2663 | } |
| 2664 | |
| 2665 | RValue<Short4> operator>>(RValue<Short4> lhs, RValue<Long1> rhs) |
| 2666 | { |
| 2667 | // return RValue<Short4>(Nucleus::createAShr(lhs.value, rhs.value)); |
| 2668 | |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2669 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2670 | } |
| 2671 | |
| 2672 | RValue<Short4> operator+=(const Short4 &lhs, RValue<Short4> rhs) |
| 2673 | { |
| 2674 | return lhs = lhs + rhs; |
| 2675 | } |
| 2676 | |
| 2677 | RValue<Short4> operator-=(const Short4 &lhs, RValue<Short4> rhs) |
| 2678 | { |
| 2679 | return lhs = lhs - rhs; |
| 2680 | } |
| 2681 | |
| 2682 | RValue<Short4> operator*=(const Short4 &lhs, RValue<Short4> rhs) |
| 2683 | { |
| 2684 | return lhs = lhs * rhs; |
| 2685 | } |
| 2686 | |
| 2687 | // RValue<Short4> operator/=(const Short4 &lhs, RValue<Short4> rhs) |
| 2688 | // { |
| 2689 | // return lhs = lhs / rhs; |
| 2690 | // } |
| 2691 | |
| 2692 | // RValue<Short4> operator%=(const Short4 &lhs, RValue<Short4> rhs) |
| 2693 | // { |
| 2694 | // return lhs = lhs % rhs; |
| 2695 | // } |
| 2696 | |
| 2697 | RValue<Short4> operator&=(const Short4 &lhs, RValue<Short4> rhs) |
| 2698 | { |
| 2699 | return lhs = lhs & rhs; |
| 2700 | } |
| 2701 | |
| 2702 | RValue<Short4> operator|=(const Short4 &lhs, RValue<Short4> rhs) |
| 2703 | { |
| 2704 | return lhs = lhs | rhs; |
| 2705 | } |
| 2706 | |
| 2707 | RValue<Short4> operator^=(const Short4 &lhs, RValue<Short4> rhs) |
| 2708 | { |
| 2709 | return lhs = lhs ^ rhs; |
| 2710 | } |
| 2711 | |
| 2712 | RValue<Short4> operator<<=(const Short4 &lhs, unsigned char rhs) |
| 2713 | { |
| 2714 | return lhs = lhs << rhs; |
| 2715 | } |
| 2716 | |
| 2717 | RValue<Short4> operator>>=(const Short4 &lhs, unsigned char rhs) |
| 2718 | { |
| 2719 | return lhs = lhs >> rhs; |
| 2720 | } |
| 2721 | |
| 2722 | RValue<Short4> operator<<=(const Short4 &lhs, RValue<Long1> rhs) |
| 2723 | { |
| 2724 | return lhs = lhs << rhs; |
| 2725 | } |
| 2726 | |
| 2727 | RValue<Short4> operator>>=(const Short4 &lhs, RValue<Long1> rhs) |
| 2728 | { |
| 2729 | return lhs = lhs >> rhs; |
| 2730 | } |
| 2731 | |
| 2732 | // RValue<Short4> operator+(RValue<Short4> val) |
| 2733 | // { |
| 2734 | // return val; |
| 2735 | // } |
| 2736 | |
| 2737 | RValue<Short4> operator-(RValue<Short4> val) |
| 2738 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2739 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2740 | } |
| 2741 | |
| 2742 | RValue<Short4> operator~(RValue<Short4> val) |
| 2743 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2744 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2745 | } |
| 2746 | |
| 2747 | RValue<Short4> RoundShort4(RValue<Float4> cast) |
| 2748 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2749 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2750 | } |
| 2751 | |
| 2752 | RValue<Short4> Max(RValue<Short4> x, RValue<Short4> y) |
| 2753 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2754 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2755 | } |
| 2756 | |
| 2757 | RValue<Short4> Min(RValue<Short4> x, RValue<Short4> y) |
| 2758 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2759 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2760 | } |
| 2761 | |
| 2762 | RValue<Short4> AddSat(RValue<Short4> x, RValue<Short4> y) |
| 2763 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2764 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2765 | } |
| 2766 | |
| 2767 | RValue<Short4> SubSat(RValue<Short4> x, RValue<Short4> y) |
| 2768 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2769 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2770 | } |
| 2771 | |
| 2772 | RValue<Short4> MulHigh(RValue<Short4> x, RValue<Short4> y) |
| 2773 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2774 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2775 | } |
| 2776 | |
| 2777 | RValue<Int2> MulAdd(RValue<Short4> x, RValue<Short4> y) |
| 2778 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2779 | assert(false && "UNIMPLEMENTED"); return RValue<Int2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2780 | } |
| 2781 | |
| 2782 | RValue<SByte8> Pack(RValue<Short4> x, RValue<Short4> y) |
| 2783 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2784 | assert(false && "UNIMPLEMENTED"); return RValue<SByte8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2785 | } |
| 2786 | |
| 2787 | RValue<Int2> UnpackLow(RValue<Short4> x, RValue<Short4> y) |
| 2788 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2789 | assert(false && "UNIMPLEMENTED"); return RValue<Int2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2790 | } |
| 2791 | |
| 2792 | RValue<Int2> UnpackHigh(RValue<Short4> x, RValue<Short4> y) |
| 2793 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2794 | assert(false && "UNIMPLEMENTED"); return RValue<Int2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2795 | } |
| 2796 | |
| 2797 | RValue<Short4> Swizzle(RValue<Short4> x, unsigned char select) |
| 2798 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2799 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2800 | } |
| 2801 | |
| 2802 | RValue<Short4> Insert(RValue<Short4> val, RValue<Short> element, int i) |
| 2803 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2804 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2805 | } |
| 2806 | |
| 2807 | RValue<Short> Extract(RValue<Short4> val, int i) |
| 2808 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2809 | assert(false && "UNIMPLEMENTED"); return RValue<Short>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2810 | } |
| 2811 | |
| 2812 | RValue<Short4> CmpGT(RValue<Short4> x, RValue<Short4> y) |
| 2813 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2814 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2815 | } |
| 2816 | |
| 2817 | RValue<Short4> CmpEQ(RValue<Short4> x, RValue<Short4> y) |
| 2818 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2819 | assert(false && "UNIMPLEMENTED"); return RValue<Short4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2820 | } |
| 2821 | |
| 2822 | Type *Short4::getType() |
| 2823 | { |
| 2824 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 2825 | } |
| 2826 | |
| 2827 | UShort4::UShort4(RValue<Int4> cast) |
| 2828 | { |
| 2829 | *this = Short4(cast); |
| 2830 | } |
| 2831 | |
| 2832 | UShort4::UShort4(RValue<Float4> cast, bool saturate) |
| 2833 | { |
| 2834 | assert(false && "UNIMPLEMENTED"); |
| 2835 | } |
| 2836 | |
| 2837 | UShort4::UShort4() |
| 2838 | { |
| 2839 | // xyzw.parent = this; |
| 2840 | } |
| 2841 | |
| 2842 | UShort4::UShort4(unsigned short xyzw) |
| 2843 | { |
| 2844 | // xyzw.parent = this; |
| 2845 | |
| 2846 | assert(false && "UNIMPLEMENTED"); |
| 2847 | } |
| 2848 | |
| 2849 | UShort4::UShort4(unsigned short x, unsigned short y, unsigned short z, unsigned short w) |
| 2850 | { |
| 2851 | // xyzw.parent = this; |
| 2852 | |
| 2853 | assert(false && "UNIMPLEMENTED"); |
| 2854 | } |
| 2855 | |
| 2856 | UShort4::UShort4(RValue<UShort4> rhs) |
| 2857 | { |
| 2858 | // xyzw.parent = this; |
| 2859 | |
| 2860 | storeValue(rhs.value); |
| 2861 | } |
| 2862 | |
| 2863 | UShort4::UShort4(const UShort4 &rhs) |
| 2864 | { |
| 2865 | // xyzw.parent = this; |
| 2866 | |
| 2867 | Value *value = rhs.loadValue(); |
| 2868 | storeValue(value); |
| 2869 | } |
| 2870 | |
| 2871 | UShort4::UShort4(const Reference<UShort4> &rhs) |
| 2872 | { |
| 2873 | // xyzw.parent = this; |
| 2874 | |
| 2875 | Value *value = rhs.loadValue(); |
| 2876 | storeValue(value); |
| 2877 | } |
| 2878 | |
| 2879 | UShort4::UShort4(RValue<Short4> rhs) |
| 2880 | { |
| 2881 | // xyzw.parent = this; |
| 2882 | |
| 2883 | storeValue(rhs.value); |
| 2884 | } |
| 2885 | |
| 2886 | UShort4::UShort4(const Short4 &rhs) |
| 2887 | { |
| 2888 | // xyzw.parent = this; |
| 2889 | |
| 2890 | Value *value = rhs.loadValue(); |
| 2891 | storeValue(value); |
| 2892 | } |
| 2893 | |
| 2894 | UShort4::UShort4(const Reference<Short4> &rhs) |
| 2895 | { |
| 2896 | // xyzw.parent = this; |
| 2897 | |
| 2898 | Value *value = rhs.loadValue(); |
| 2899 | storeValue(value); |
| 2900 | } |
| 2901 | |
| 2902 | RValue<UShort4> UShort4::operator=(RValue<UShort4> rhs) const |
| 2903 | { |
| 2904 | storeValue(rhs.value); |
| 2905 | |
| 2906 | return rhs; |
| 2907 | } |
| 2908 | |
| 2909 | RValue<UShort4> UShort4::operator=(const UShort4 &rhs) const |
| 2910 | { |
| 2911 | Value *value = rhs.loadValue(); |
| 2912 | storeValue(value); |
| 2913 | |
| 2914 | return RValue<UShort4>(value); |
| 2915 | } |
| 2916 | |
| 2917 | RValue<UShort4> UShort4::operator=(const Reference<UShort4> &rhs) const |
| 2918 | { |
| 2919 | Value *value = rhs.loadValue(); |
| 2920 | storeValue(value); |
| 2921 | |
| 2922 | return RValue<UShort4>(value); |
| 2923 | } |
| 2924 | |
| 2925 | RValue<UShort4> UShort4::operator=(RValue<Short4> rhs) const |
| 2926 | { |
| 2927 | storeValue(rhs.value); |
| 2928 | |
| 2929 | return RValue<UShort4>(rhs); |
| 2930 | } |
| 2931 | |
| 2932 | RValue<UShort4> UShort4::operator=(const Short4 &rhs) const |
| 2933 | { |
| 2934 | Value *value = rhs.loadValue(); |
| 2935 | storeValue(value); |
| 2936 | |
| 2937 | return RValue<UShort4>(value); |
| 2938 | } |
| 2939 | |
| 2940 | RValue<UShort4> UShort4::operator=(const Reference<Short4> &rhs) const |
| 2941 | { |
| 2942 | Value *value = rhs.loadValue(); |
| 2943 | storeValue(value); |
| 2944 | |
| 2945 | return RValue<UShort4>(value); |
| 2946 | } |
| 2947 | |
| 2948 | RValue<UShort4> operator+(RValue<UShort4> lhs, RValue<UShort4> rhs) |
| 2949 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2950 | assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2951 | } |
| 2952 | |
| 2953 | RValue<UShort4> operator-(RValue<UShort4> lhs, RValue<UShort4> rhs) |
| 2954 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2955 | assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2956 | } |
| 2957 | |
| 2958 | RValue<UShort4> operator*(RValue<UShort4> lhs, RValue<UShort4> rhs) |
| 2959 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2960 | assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2961 | } |
| 2962 | |
Nicolas Capens | 16b5f15 | 2016-10-13 13:39:01 -0400 | [diff] [blame^] | 2963 | RValue<UShort4> operator&(RValue<UShort4> lhs, RValue<UShort4> rhs) |
| 2964 | { |
| 2965 | assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr)); |
| 2966 | } |
| 2967 | |
| 2968 | RValue<UShort4> operator|(RValue<UShort4> lhs, RValue<UShort4> rhs) |
| 2969 | { |
| 2970 | assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr)); |
| 2971 | } |
| 2972 | |
| 2973 | RValue<UShort4> operator^(RValue<UShort4> lhs, RValue<UShort4> rhs) |
| 2974 | { |
| 2975 | assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr)); |
| 2976 | } |
| 2977 | |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2978 | RValue<UShort4> operator<<(RValue<UShort4> lhs, unsigned char rhs) |
| 2979 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2980 | assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2981 | } |
| 2982 | |
| 2983 | RValue<UShort4> operator>>(RValue<UShort4> lhs, unsigned char rhs) |
| 2984 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2985 | assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2986 | } |
| 2987 | |
| 2988 | RValue<UShort4> operator<<(RValue<UShort4> lhs, RValue<Long1> rhs) |
| 2989 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2990 | assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2991 | } |
| 2992 | |
| 2993 | RValue<UShort4> operator>>(RValue<UShort4> lhs, RValue<Long1> rhs) |
| 2994 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 2995 | assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 2996 | } |
| 2997 | |
| 2998 | RValue<UShort4> operator<<=(const UShort4 &lhs, unsigned char rhs) |
| 2999 | { |
| 3000 | return lhs = lhs << rhs; |
| 3001 | } |
| 3002 | |
| 3003 | RValue<UShort4> operator>>=(const UShort4 &lhs, unsigned char rhs) |
| 3004 | { |
| 3005 | return lhs = lhs >> rhs; |
| 3006 | } |
| 3007 | |
| 3008 | RValue<UShort4> operator<<=(const UShort4 &lhs, RValue<Long1> rhs) |
| 3009 | { |
| 3010 | return lhs = lhs << rhs; |
| 3011 | } |
| 3012 | |
| 3013 | RValue<UShort4> operator>>=(const UShort4 &lhs, RValue<Long1> rhs) |
| 3014 | { |
| 3015 | return lhs = lhs >> rhs; |
| 3016 | } |
| 3017 | |
| 3018 | RValue<UShort4> operator~(RValue<UShort4> val) |
| 3019 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3020 | assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3021 | } |
| 3022 | |
| 3023 | RValue<UShort4> Max(RValue<UShort4> x, RValue<UShort4> y) |
| 3024 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3025 | assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3026 | } |
| 3027 | |
| 3028 | RValue<UShort4> Min(RValue<UShort4> x, RValue<UShort4> y) |
| 3029 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3030 | assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3031 | } |
| 3032 | |
| 3033 | RValue<UShort4> AddSat(RValue<UShort4> x, RValue<UShort4> y) |
| 3034 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3035 | assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3036 | } |
| 3037 | |
| 3038 | RValue<UShort4> SubSat(RValue<UShort4> x, RValue<UShort4> y) |
| 3039 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3040 | assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3041 | } |
| 3042 | |
| 3043 | RValue<UShort4> MulHigh(RValue<UShort4> x, RValue<UShort4> y) |
| 3044 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3045 | assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3046 | } |
| 3047 | |
| 3048 | RValue<UShort4> Average(RValue<UShort4> x, RValue<UShort4> y) |
| 3049 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3050 | assert(false && "UNIMPLEMENTED"); return RValue<UShort4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3051 | } |
| 3052 | |
| 3053 | RValue<Byte8> Pack(RValue<UShort4> x, RValue<UShort4> y) |
| 3054 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3055 | assert(false && "UNIMPLEMENTED"); return RValue<Byte8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3056 | } |
| 3057 | |
| 3058 | Type *UShort4::getType() |
| 3059 | { |
| 3060 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 3061 | } |
| 3062 | |
| 3063 | Short8::Short8(short c0, short c1, short c2, short c3, short c4, short c5, short c6, short c7) |
| 3064 | { |
| 3065 | // xyzw.parent = this; |
| 3066 | |
| 3067 | assert(false && "UNIMPLEMENTED"); |
| 3068 | } |
| 3069 | |
| 3070 | Short8::Short8(RValue<Short8> rhs) |
| 3071 | { |
| 3072 | // xyzw.parent = this; |
| 3073 | |
| 3074 | storeValue(rhs.value); |
| 3075 | } |
| 3076 | |
| 3077 | Short8::Short8(const Reference<Short8> &rhs) |
| 3078 | { |
| 3079 | // xyzw.parent = this; |
| 3080 | |
| 3081 | Value *value = rhs.loadValue(); |
| 3082 | storeValue(value); |
| 3083 | } |
| 3084 | |
| 3085 | Short8::Short8(RValue<Short4> lo, RValue<Short4> hi) |
| 3086 | { |
| 3087 | assert(false && "UNIMPLEMENTED"); |
| 3088 | } |
| 3089 | |
| 3090 | RValue<Short8> operator+(RValue<Short8> lhs, RValue<Short8> rhs) |
| 3091 | { |
| 3092 | return RValue<Short8>(Nucleus::createAdd(lhs.value, rhs.value)); |
| 3093 | } |
| 3094 | |
| 3095 | RValue<Short8> operator&(RValue<Short8> lhs, RValue<Short8> rhs) |
| 3096 | { |
| 3097 | return RValue<Short8>(Nucleus::createAnd(lhs.value, rhs.value)); |
| 3098 | } |
| 3099 | |
| 3100 | RValue<Short8> operator<<(RValue<Short8> lhs, unsigned char rhs) |
| 3101 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3102 | assert(false && "UNIMPLEMENTED"); return RValue<Short8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3103 | } |
| 3104 | |
| 3105 | RValue<Short8> operator>>(RValue<Short8> lhs, unsigned char rhs) |
| 3106 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3107 | assert(false && "UNIMPLEMENTED"); return RValue<Short8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3108 | } |
| 3109 | |
| 3110 | RValue<Int4> MulAdd(RValue<Short8> x, RValue<Short8> y) |
| 3111 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3112 | assert(false && "UNIMPLEMENTED"); return RValue<Int4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3113 | } |
| 3114 | |
| 3115 | RValue<Int4> Abs(RValue<Int4> x) |
| 3116 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3117 | assert(false && "UNIMPLEMENTED"); return RValue<Int4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3118 | } |
| 3119 | |
| 3120 | RValue<Short8> MulHigh(RValue<Short8> x, RValue<Short8> y) |
| 3121 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3122 | assert(false && "UNIMPLEMENTED"); return RValue<Short8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3123 | } |
| 3124 | |
| 3125 | Type *Short8::getType() |
| 3126 | { |
| 3127 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 3128 | } |
| 3129 | |
| 3130 | UShort8::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) |
| 3131 | { |
| 3132 | // xyzw.parent = this; |
| 3133 | |
| 3134 | assert(false && "UNIMPLEMENTED"); |
| 3135 | } |
| 3136 | |
| 3137 | UShort8::UShort8(RValue<UShort8> rhs) |
| 3138 | { |
| 3139 | // xyzw.parent = this; |
| 3140 | |
| 3141 | storeValue(rhs.value); |
| 3142 | } |
| 3143 | |
| 3144 | UShort8::UShort8(const Reference<UShort8> &rhs) |
| 3145 | { |
| 3146 | // xyzw.parent = this; |
| 3147 | |
| 3148 | Value *value = rhs.loadValue(); |
| 3149 | storeValue(value); |
| 3150 | } |
| 3151 | |
| 3152 | UShort8::UShort8(RValue<UShort4> lo, RValue<UShort4> hi) |
| 3153 | { |
| 3154 | assert(false && "UNIMPLEMENTED"); |
| 3155 | } |
| 3156 | |
| 3157 | RValue<UShort8> UShort8::operator=(RValue<UShort8> rhs) const |
| 3158 | { |
| 3159 | storeValue(rhs.value); |
| 3160 | |
| 3161 | return rhs; |
| 3162 | } |
| 3163 | |
| 3164 | RValue<UShort8> UShort8::operator=(const UShort8 &rhs) const |
| 3165 | { |
| 3166 | Value *value = rhs.loadValue(); |
| 3167 | storeValue(value); |
| 3168 | |
| 3169 | return RValue<UShort8>(value); |
| 3170 | } |
| 3171 | |
| 3172 | RValue<UShort8> UShort8::operator=(const Reference<UShort8> &rhs) const |
| 3173 | { |
| 3174 | Value *value = rhs.loadValue(); |
| 3175 | storeValue(value); |
| 3176 | |
| 3177 | return RValue<UShort8>(value); |
| 3178 | } |
| 3179 | |
| 3180 | RValue<UShort8> operator&(RValue<UShort8> lhs, RValue<UShort8> rhs) |
| 3181 | { |
| 3182 | return RValue<UShort8>(Nucleus::createAnd(lhs.value, rhs.value)); |
| 3183 | } |
| 3184 | |
| 3185 | RValue<UShort8> operator<<(RValue<UShort8> lhs, unsigned char rhs) |
| 3186 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3187 | assert(false && "UNIMPLEMENTED"); return RValue<UShort8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3188 | } |
| 3189 | |
| 3190 | RValue<UShort8> operator>>(RValue<UShort8> lhs, unsigned char rhs) |
| 3191 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3192 | assert(false && "UNIMPLEMENTED"); return RValue<UShort8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3193 | } |
| 3194 | |
| 3195 | RValue<UShort8> operator+(RValue<UShort8> lhs, RValue<UShort8> rhs) |
| 3196 | { |
| 3197 | return RValue<UShort8>(Nucleus::createAdd(lhs.value, rhs.value)); |
| 3198 | } |
| 3199 | |
| 3200 | RValue<UShort8> operator*(RValue<UShort8> lhs, RValue<UShort8> rhs) |
| 3201 | { |
| 3202 | return RValue<UShort8>(Nucleus::createMul(lhs.value, rhs.value)); |
| 3203 | } |
| 3204 | |
| 3205 | RValue<UShort8> operator+=(const UShort8 &lhs, RValue<UShort8> rhs) |
| 3206 | { |
| 3207 | return lhs = lhs + rhs; |
| 3208 | } |
| 3209 | |
| 3210 | RValue<UShort8> operator~(RValue<UShort8> val) |
| 3211 | { |
| 3212 | return RValue<UShort8>(Nucleus::createNot(val.value)); |
| 3213 | } |
| 3214 | |
| 3215 | RValue<UShort8> Swizzle(RValue<UShort8> x, char select0, char select1, char select2, char select3, char select4, char select5, char select6, char select7) |
| 3216 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3217 | assert(false && "UNIMPLEMENTED"); return RValue<UShort8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3218 | } |
| 3219 | |
| 3220 | RValue<UShort8> MulHigh(RValue<UShort8> x, RValue<UShort8> y) |
| 3221 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3222 | assert(false && "UNIMPLEMENTED"); return RValue<UShort8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3223 | } |
| 3224 | |
| 3225 | // FIXME: Implement as Shuffle(x, y, Select(i0, ..., i16)) and Shuffle(x, y, SELECT_PACK_REPEAT(element)) |
| 3226 | // RValue<UShort8> PackRepeat(RValue<Byte16> x, RValue<Byte16> y, int element) |
| 3227 | // { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3228 | // assert(false && "UNIMPLEMENTED"); return RValue<UShort8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3229 | // } |
| 3230 | |
| 3231 | Type *UShort8::getType() |
| 3232 | { |
| 3233 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 3234 | } |
| 3235 | |
| 3236 | Int::Int(Argument<Int> argument) |
| 3237 | { |
| 3238 | storeValue(argument.value); |
| 3239 | } |
| 3240 | |
| 3241 | Int::Int(RValue<Byte> cast) |
| 3242 | { |
| 3243 | Value *integer = Nucleus::createZExt(cast.value, Int::getType()); |
| 3244 | |
| 3245 | storeValue(integer); |
| 3246 | } |
| 3247 | |
| 3248 | Int::Int(RValue<SByte> cast) |
| 3249 | { |
| 3250 | Value *integer = Nucleus::createSExt(cast.value, Int::getType()); |
| 3251 | |
| 3252 | storeValue(integer); |
| 3253 | } |
| 3254 | |
| 3255 | Int::Int(RValue<Short> cast) |
| 3256 | { |
| 3257 | Value *integer = Nucleus::createSExt(cast.value, Int::getType()); |
| 3258 | |
| 3259 | storeValue(integer); |
| 3260 | } |
| 3261 | |
| 3262 | Int::Int(RValue<UShort> cast) |
| 3263 | { |
| 3264 | Value *integer = Nucleus::createZExt(cast.value, Int::getType()); |
| 3265 | |
| 3266 | storeValue(integer); |
| 3267 | } |
| 3268 | |
| 3269 | Int::Int(RValue<Int2> cast) |
| 3270 | { |
| 3271 | *this = Extract(cast, 0); |
| 3272 | } |
| 3273 | |
| 3274 | Int::Int(RValue<Long> cast) |
| 3275 | { |
| 3276 | Value *integer = Nucleus::createTrunc(cast.value, Int::getType()); |
| 3277 | |
| 3278 | storeValue(integer); |
| 3279 | } |
| 3280 | |
| 3281 | Int::Int(RValue<Float> cast) |
| 3282 | { |
| 3283 | Value *integer = Nucleus::createFPToSI(cast.value, Int::getType()); |
| 3284 | |
| 3285 | storeValue(integer); |
| 3286 | } |
| 3287 | |
| 3288 | Int::Int() |
| 3289 | { |
| 3290 | } |
| 3291 | |
| 3292 | Int::Int(int x) |
| 3293 | { |
| 3294 | storeValue(Nucleus::createConstantInt(x)); |
| 3295 | } |
| 3296 | |
| 3297 | Int::Int(RValue<Int> rhs) |
| 3298 | { |
| 3299 | storeValue(rhs.value); |
| 3300 | } |
| 3301 | |
| 3302 | Int::Int(RValue<UInt> rhs) |
| 3303 | { |
| 3304 | storeValue(rhs.value); |
| 3305 | } |
| 3306 | |
| 3307 | Int::Int(const Int &rhs) |
| 3308 | { |
| 3309 | Value *value = rhs.loadValue(); |
| 3310 | storeValue(value); |
| 3311 | } |
| 3312 | |
| 3313 | Int::Int(const Reference<Int> &rhs) |
| 3314 | { |
| 3315 | Value *value = rhs.loadValue(); |
| 3316 | storeValue(value); |
| 3317 | } |
| 3318 | |
| 3319 | Int::Int(const UInt &rhs) |
| 3320 | { |
| 3321 | Value *value = rhs.loadValue(); |
| 3322 | storeValue(value); |
| 3323 | } |
| 3324 | |
| 3325 | Int::Int(const Reference<UInt> &rhs) |
| 3326 | { |
| 3327 | Value *value = rhs.loadValue(); |
| 3328 | storeValue(value); |
| 3329 | } |
| 3330 | |
| 3331 | RValue<Int> Int::operator=(int rhs) const |
| 3332 | { |
| 3333 | return RValue<Int>(storeValue(Nucleus::createConstantInt(rhs))); |
| 3334 | } |
| 3335 | |
| 3336 | RValue<Int> Int::operator=(RValue<Int> rhs) const |
| 3337 | { |
| 3338 | storeValue(rhs.value); |
| 3339 | |
| 3340 | return rhs; |
| 3341 | } |
| 3342 | |
| 3343 | RValue<Int> Int::operator=(RValue<UInt> rhs) const |
| 3344 | { |
| 3345 | storeValue(rhs.value); |
| 3346 | |
| 3347 | return RValue<Int>(rhs); |
| 3348 | } |
| 3349 | |
| 3350 | RValue<Int> Int::operator=(const Int &rhs) const |
| 3351 | { |
| 3352 | Value *value = rhs.loadValue(); |
| 3353 | storeValue(value); |
| 3354 | |
| 3355 | return RValue<Int>(value); |
| 3356 | } |
| 3357 | |
| 3358 | RValue<Int> Int::operator=(const Reference<Int> &rhs) const |
| 3359 | { |
| 3360 | Value *value = rhs.loadValue(); |
| 3361 | storeValue(value); |
| 3362 | |
| 3363 | return RValue<Int>(value); |
| 3364 | } |
| 3365 | |
| 3366 | RValue<Int> Int::operator=(const UInt &rhs) const |
| 3367 | { |
| 3368 | Value *value = rhs.loadValue(); |
| 3369 | storeValue(value); |
| 3370 | |
| 3371 | return RValue<Int>(value); |
| 3372 | } |
| 3373 | |
| 3374 | RValue<Int> Int::operator=(const Reference<UInt> &rhs) const |
| 3375 | { |
| 3376 | Value *value = rhs.loadValue(); |
| 3377 | storeValue(value); |
| 3378 | |
| 3379 | return RValue<Int>(value); |
| 3380 | } |
| 3381 | |
| 3382 | RValue<Int> operator+(RValue<Int> lhs, RValue<Int> rhs) |
| 3383 | { |
| 3384 | return RValue<Int>(Nucleus::createAdd(lhs.value, rhs.value)); |
| 3385 | } |
| 3386 | |
| 3387 | RValue<Int> operator-(RValue<Int> lhs, RValue<Int> rhs) |
| 3388 | { |
| 3389 | return RValue<Int>(Nucleus::createSub(lhs.value, rhs.value)); |
| 3390 | } |
| 3391 | |
| 3392 | RValue<Int> operator*(RValue<Int> lhs, RValue<Int> rhs) |
| 3393 | { |
| 3394 | return RValue<Int>(Nucleus::createMul(lhs.value, rhs.value)); |
| 3395 | } |
| 3396 | |
| 3397 | RValue<Int> operator/(RValue<Int> lhs, RValue<Int> rhs) |
| 3398 | { |
| 3399 | return RValue<Int>(Nucleus::createSDiv(lhs.value, rhs.value)); |
| 3400 | } |
| 3401 | |
| 3402 | RValue<Int> operator%(RValue<Int> lhs, RValue<Int> rhs) |
| 3403 | { |
| 3404 | return RValue<Int>(Nucleus::createSRem(lhs.value, rhs.value)); |
| 3405 | } |
| 3406 | |
| 3407 | RValue<Int> operator&(RValue<Int> lhs, RValue<Int> rhs) |
| 3408 | { |
| 3409 | return RValue<Int>(Nucleus::createAnd(lhs.value, rhs.value)); |
| 3410 | } |
| 3411 | |
| 3412 | RValue<Int> operator|(RValue<Int> lhs, RValue<Int> rhs) |
| 3413 | { |
| 3414 | return RValue<Int>(Nucleus::createOr(lhs.value, rhs.value)); |
| 3415 | } |
| 3416 | |
| 3417 | RValue<Int> operator^(RValue<Int> lhs, RValue<Int> rhs) |
| 3418 | { |
| 3419 | return RValue<Int>(Nucleus::createXor(lhs.value, rhs.value)); |
| 3420 | } |
| 3421 | |
| 3422 | RValue<Int> operator<<(RValue<Int> lhs, RValue<Int> rhs) |
| 3423 | { |
| 3424 | return RValue<Int>(Nucleus::createShl(lhs.value, rhs.value)); |
| 3425 | } |
| 3426 | |
| 3427 | RValue<Int> operator>>(RValue<Int> lhs, RValue<Int> rhs) |
| 3428 | { |
| 3429 | return RValue<Int>(Nucleus::createAShr(lhs.value, rhs.value)); |
| 3430 | } |
| 3431 | |
| 3432 | RValue<Int> operator+=(const Int &lhs, RValue<Int> rhs) |
| 3433 | { |
| 3434 | return lhs = lhs + rhs; |
| 3435 | } |
| 3436 | |
| 3437 | RValue<Int> operator-=(const Int &lhs, RValue<Int> rhs) |
| 3438 | { |
| 3439 | return lhs = lhs - rhs; |
| 3440 | } |
| 3441 | |
| 3442 | RValue<Int> operator*=(const Int &lhs, RValue<Int> rhs) |
| 3443 | { |
| 3444 | return lhs = lhs * rhs; |
| 3445 | } |
| 3446 | |
| 3447 | RValue<Int> operator/=(const Int &lhs, RValue<Int> rhs) |
| 3448 | { |
| 3449 | return lhs = lhs / rhs; |
| 3450 | } |
| 3451 | |
| 3452 | RValue<Int> operator%=(const Int &lhs, RValue<Int> rhs) |
| 3453 | { |
| 3454 | return lhs = lhs % rhs; |
| 3455 | } |
| 3456 | |
| 3457 | RValue<Int> operator&=(const Int &lhs, RValue<Int> rhs) |
| 3458 | { |
| 3459 | return lhs = lhs & rhs; |
| 3460 | } |
| 3461 | |
| 3462 | RValue<Int> operator|=(const Int &lhs, RValue<Int> rhs) |
| 3463 | { |
| 3464 | return lhs = lhs | rhs; |
| 3465 | } |
| 3466 | |
| 3467 | RValue<Int> operator^=(const Int &lhs, RValue<Int> rhs) |
| 3468 | { |
| 3469 | return lhs = lhs ^ rhs; |
| 3470 | } |
| 3471 | |
| 3472 | RValue<Int> operator<<=(const Int &lhs, RValue<Int> rhs) |
| 3473 | { |
| 3474 | return lhs = lhs << rhs; |
| 3475 | } |
| 3476 | |
| 3477 | RValue<Int> operator>>=(const Int &lhs, RValue<Int> rhs) |
| 3478 | { |
| 3479 | return lhs = lhs >> rhs; |
| 3480 | } |
| 3481 | |
| 3482 | RValue<Int> operator+(RValue<Int> val) |
| 3483 | { |
| 3484 | return val; |
| 3485 | } |
| 3486 | |
| 3487 | RValue<Int> operator-(RValue<Int> val) |
| 3488 | { |
| 3489 | return RValue<Int>(Nucleus::createNeg(val.value)); |
| 3490 | } |
| 3491 | |
| 3492 | RValue<Int> operator~(RValue<Int> val) |
| 3493 | { |
| 3494 | return RValue<Int>(Nucleus::createNot(val.value)); |
| 3495 | } |
| 3496 | |
| 3497 | RValue<Int> operator++(const Int &val, int) // Post-increment |
| 3498 | { |
Nicolas Capens | 611642a | 2016-09-28 16:45:04 -0400 | [diff] [blame] | 3499 | auto oldValue = val.loadValue(); |
| 3500 | auto newValue = ::function->makeVariable(Ice::IceType_i32); |
| 3501 | auto inc = Ice::InstArithmetic::create(::function, Ice::InstArithmetic::Add, newValue, oldValue, ::context->getConstantInt32(1)); |
| 3502 | ::basicBlock->appendInst(inc); |
| 3503 | val.storeValue(V(newValue)); |
| 3504 | |
| 3505 | return RValue<Int>(oldValue); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3506 | } |
| 3507 | |
| 3508 | const Int &operator++(const Int &val) // Pre-increment |
| 3509 | { |
| 3510 | assert(false && "UNIMPLEMENTED"); return val; |
| 3511 | } |
| 3512 | |
| 3513 | RValue<Int> operator--(const Int &val, int) // Post-decrement |
| 3514 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3515 | assert(false && "UNIMPLEMENTED"); return RValue<Int>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3516 | } |
| 3517 | |
| 3518 | const Int &operator--(const Int &val) // Pre-decrement |
| 3519 | { |
| 3520 | assert(false && "UNIMPLEMENTED"); return val; |
| 3521 | } |
| 3522 | |
| 3523 | RValue<Bool> operator<(RValue<Int> lhs, RValue<Int> rhs) |
| 3524 | { |
| 3525 | return RValue<Bool>(Nucleus::createICmpSLT(lhs.value, rhs.value)); |
| 3526 | } |
| 3527 | |
| 3528 | RValue<Bool> operator<=(RValue<Int> lhs, RValue<Int> rhs) |
| 3529 | { |
| 3530 | return RValue<Bool>(Nucleus::createICmpSLE(lhs.value, rhs.value)); |
| 3531 | } |
| 3532 | |
| 3533 | RValue<Bool> operator>(RValue<Int> lhs, RValue<Int> rhs) |
| 3534 | { |
| 3535 | return RValue<Bool>(Nucleus::createICmpSGT(lhs.value, rhs.value)); |
| 3536 | } |
| 3537 | |
| 3538 | RValue<Bool> operator>=(RValue<Int> lhs, RValue<Int> rhs) |
| 3539 | { |
| 3540 | return RValue<Bool>(Nucleus::createICmpSGE(lhs.value, rhs.value)); |
| 3541 | } |
| 3542 | |
| 3543 | RValue<Bool> operator!=(RValue<Int> lhs, RValue<Int> rhs) |
| 3544 | { |
| 3545 | return RValue<Bool>(Nucleus::createICmpNE(lhs.value, rhs.value)); |
| 3546 | } |
| 3547 | |
| 3548 | RValue<Bool> operator==(RValue<Int> lhs, RValue<Int> rhs) |
| 3549 | { |
| 3550 | return RValue<Bool>(Nucleus::createICmpEQ(lhs.value, rhs.value)); |
| 3551 | } |
| 3552 | |
| 3553 | RValue<Int> Max(RValue<Int> x, RValue<Int> y) |
| 3554 | { |
| 3555 | return IfThenElse(x > y, x, y); |
| 3556 | } |
| 3557 | |
| 3558 | RValue<Int> Min(RValue<Int> x, RValue<Int> y) |
| 3559 | { |
| 3560 | return IfThenElse(x < y, x, y); |
| 3561 | } |
| 3562 | |
| 3563 | RValue<Int> Clamp(RValue<Int> x, RValue<Int> min, RValue<Int> max) |
| 3564 | { |
| 3565 | return Min(Max(x, min), max); |
| 3566 | } |
| 3567 | |
| 3568 | RValue<Int> RoundInt(RValue<Float> cast) |
| 3569 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3570 | assert(false && "UNIMPLEMENTED"); return RValue<Int>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3571 | } |
| 3572 | |
| 3573 | Type *Int::getType() |
| 3574 | { |
| 3575 | return T(Ice::IceType_i32); |
| 3576 | } |
| 3577 | |
| 3578 | Long::Long(RValue<Int> cast) |
| 3579 | { |
| 3580 | Value *integer = Nucleus::createSExt(cast.value, Long::getType()); |
| 3581 | |
| 3582 | storeValue(integer); |
| 3583 | } |
| 3584 | |
| 3585 | Long::Long(RValue<UInt> cast) |
| 3586 | { |
| 3587 | Value *integer = Nucleus::createZExt(cast.value, Long::getType()); |
| 3588 | |
| 3589 | storeValue(integer); |
| 3590 | } |
| 3591 | |
| 3592 | Long::Long() |
| 3593 | { |
| 3594 | } |
| 3595 | |
| 3596 | Long::Long(RValue<Long> rhs) |
| 3597 | { |
| 3598 | storeValue(rhs.value); |
| 3599 | } |
| 3600 | |
| 3601 | RValue<Long> Long::operator=(int64_t rhs) const |
| 3602 | { |
| 3603 | return RValue<Long>(storeValue(Nucleus::createConstantInt(rhs))); |
| 3604 | } |
| 3605 | |
| 3606 | RValue<Long> Long::operator=(RValue<Long> rhs) const |
| 3607 | { |
| 3608 | storeValue(rhs.value); |
| 3609 | |
| 3610 | return rhs; |
| 3611 | } |
| 3612 | |
| 3613 | RValue<Long> Long::operator=(const Long &rhs) const |
| 3614 | { |
| 3615 | Value *value = rhs.loadValue(); |
| 3616 | storeValue(value); |
| 3617 | |
| 3618 | return RValue<Long>(value); |
| 3619 | } |
| 3620 | |
| 3621 | RValue<Long> Long::operator=(const Reference<Long> &rhs) const |
| 3622 | { |
| 3623 | Value *value = rhs.loadValue(); |
| 3624 | storeValue(value); |
| 3625 | |
| 3626 | return RValue<Long>(value); |
| 3627 | } |
| 3628 | |
| 3629 | RValue<Long> operator+(RValue<Long> lhs, RValue<Long> rhs) |
| 3630 | { |
| 3631 | return RValue<Long>(Nucleus::createAdd(lhs.value, rhs.value)); |
| 3632 | } |
| 3633 | |
| 3634 | RValue<Long> operator-(RValue<Long> lhs, RValue<Long> rhs) |
| 3635 | { |
| 3636 | return RValue<Long>(Nucleus::createSub(lhs.value, rhs.value)); |
| 3637 | } |
| 3638 | |
| 3639 | RValue<Long> operator+=(const Long &lhs, RValue<Long> rhs) |
| 3640 | { |
| 3641 | return lhs = lhs + rhs; |
| 3642 | } |
| 3643 | |
| 3644 | RValue<Long> operator-=(const Long &lhs, RValue<Long> rhs) |
| 3645 | { |
| 3646 | return lhs = lhs - rhs; |
| 3647 | } |
| 3648 | |
| 3649 | RValue<Long> AddAtomic(RValue<Pointer<Long> > x, RValue<Long> y) |
| 3650 | { |
| 3651 | return RValue<Long>(Nucleus::createAtomicAdd(x.value, y.value)); |
| 3652 | } |
| 3653 | |
| 3654 | Type *Long::getType() |
| 3655 | { |
| 3656 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 3657 | } |
| 3658 | |
| 3659 | Long1::Long1(const RValue<UInt> cast) |
| 3660 | { |
| 3661 | assert(false && "UNIMPLEMENTED"); |
| 3662 | } |
| 3663 | |
| 3664 | Long1::Long1(RValue<Long1> rhs) |
| 3665 | { |
| 3666 | storeValue(rhs.value); |
| 3667 | } |
| 3668 | |
| 3669 | Type *Long1::getType() |
| 3670 | { |
| 3671 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 3672 | } |
| 3673 | |
| 3674 | RValue<Long2> UnpackHigh(RValue<Long2> x, RValue<Long2> y) |
| 3675 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3676 | assert(false && "UNIMPLEMENTED"); return RValue<Long2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3677 | } |
| 3678 | |
| 3679 | Type *Long2::getType() |
| 3680 | { |
| 3681 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 3682 | } |
| 3683 | |
| 3684 | UInt::UInt(Argument<UInt> argument) |
| 3685 | { |
| 3686 | storeValue(argument.value); |
| 3687 | } |
| 3688 | |
| 3689 | UInt::UInt(RValue<UShort> cast) |
| 3690 | { |
| 3691 | Value *integer = Nucleus::createZExt(cast.value, UInt::getType()); |
| 3692 | |
| 3693 | storeValue(integer); |
| 3694 | } |
| 3695 | |
| 3696 | UInt::UInt(RValue<Long> cast) |
| 3697 | { |
| 3698 | Value *integer = Nucleus::createTrunc(cast.value, UInt::getType()); |
| 3699 | |
| 3700 | storeValue(integer); |
| 3701 | } |
| 3702 | |
| 3703 | UInt::UInt(RValue<Float> cast) |
| 3704 | { |
| 3705 | assert(false && "UNIMPLEMENTED"); |
| 3706 | } |
| 3707 | |
| 3708 | UInt::UInt() |
| 3709 | { |
| 3710 | } |
| 3711 | |
| 3712 | UInt::UInt(int x) |
| 3713 | { |
| 3714 | storeValue(Nucleus::createConstantInt(x)); |
| 3715 | } |
| 3716 | |
| 3717 | UInt::UInt(unsigned int x) |
| 3718 | { |
| 3719 | storeValue(Nucleus::createConstantInt(x)); |
| 3720 | } |
| 3721 | |
| 3722 | UInt::UInt(RValue<UInt> rhs) |
| 3723 | { |
| 3724 | storeValue(rhs.value); |
| 3725 | } |
| 3726 | |
| 3727 | UInt::UInt(RValue<Int> rhs) |
| 3728 | { |
| 3729 | storeValue(rhs.value); |
| 3730 | } |
| 3731 | |
| 3732 | UInt::UInt(const UInt &rhs) |
| 3733 | { |
| 3734 | Value *value = rhs.loadValue(); |
| 3735 | storeValue(value); |
| 3736 | } |
| 3737 | |
| 3738 | UInt::UInt(const Reference<UInt> &rhs) |
| 3739 | { |
| 3740 | Value *value = rhs.loadValue(); |
| 3741 | storeValue(value); |
| 3742 | } |
| 3743 | |
| 3744 | UInt::UInt(const Int &rhs) |
| 3745 | { |
| 3746 | Value *value = rhs.loadValue(); |
| 3747 | storeValue(value); |
| 3748 | } |
| 3749 | |
| 3750 | UInt::UInt(const Reference<Int> &rhs) |
| 3751 | { |
| 3752 | Value *value = rhs.loadValue(); |
| 3753 | storeValue(value); |
| 3754 | } |
| 3755 | |
| 3756 | RValue<UInt> UInt::operator=(unsigned int rhs) const |
| 3757 | { |
| 3758 | return RValue<UInt>(storeValue(Nucleus::createConstantInt(rhs))); |
| 3759 | } |
| 3760 | |
| 3761 | RValue<UInt> UInt::operator=(RValue<UInt> rhs) const |
| 3762 | { |
| 3763 | storeValue(rhs.value); |
| 3764 | |
| 3765 | return rhs; |
| 3766 | } |
| 3767 | |
| 3768 | RValue<UInt> UInt::operator=(RValue<Int> rhs) const |
| 3769 | { |
| 3770 | storeValue(rhs.value); |
| 3771 | |
| 3772 | return RValue<UInt>(rhs); |
| 3773 | } |
| 3774 | |
| 3775 | RValue<UInt> UInt::operator=(const UInt &rhs) const |
| 3776 | { |
| 3777 | Value *value = rhs.loadValue(); |
| 3778 | storeValue(value); |
| 3779 | |
| 3780 | return RValue<UInt>(value); |
| 3781 | } |
| 3782 | |
| 3783 | RValue<UInt> UInt::operator=(const Reference<UInt> &rhs) const |
| 3784 | { |
| 3785 | Value *value = rhs.loadValue(); |
| 3786 | storeValue(value); |
| 3787 | |
| 3788 | return RValue<UInt>(value); |
| 3789 | } |
| 3790 | |
| 3791 | RValue<UInt> UInt::operator=(const Int &rhs) const |
| 3792 | { |
| 3793 | Value *value = rhs.loadValue(); |
| 3794 | storeValue(value); |
| 3795 | |
| 3796 | return RValue<UInt>(value); |
| 3797 | } |
| 3798 | |
| 3799 | RValue<UInt> UInt::operator=(const Reference<Int> &rhs) const |
| 3800 | { |
| 3801 | Value *value = rhs.loadValue(); |
| 3802 | storeValue(value); |
| 3803 | |
| 3804 | return RValue<UInt>(value); |
| 3805 | } |
| 3806 | |
| 3807 | RValue<UInt> operator+(RValue<UInt> lhs, RValue<UInt> rhs) |
| 3808 | { |
| 3809 | return RValue<UInt>(Nucleus::createAdd(lhs.value, rhs.value)); |
| 3810 | } |
| 3811 | |
| 3812 | RValue<UInt> operator-(RValue<UInt> lhs, RValue<UInt> rhs) |
| 3813 | { |
| 3814 | return RValue<UInt>(Nucleus::createSub(lhs.value, rhs.value)); |
| 3815 | } |
| 3816 | |
| 3817 | RValue<UInt> operator*(RValue<UInt> lhs, RValue<UInt> rhs) |
| 3818 | { |
| 3819 | return RValue<UInt>(Nucleus::createMul(lhs.value, rhs.value)); |
| 3820 | } |
| 3821 | |
| 3822 | RValue<UInt> operator/(RValue<UInt> lhs, RValue<UInt> rhs) |
| 3823 | { |
| 3824 | return RValue<UInt>(Nucleus::createUDiv(lhs.value, rhs.value)); |
| 3825 | } |
| 3826 | |
| 3827 | RValue<UInt> operator%(RValue<UInt> lhs, RValue<UInt> rhs) |
| 3828 | { |
| 3829 | return RValue<UInt>(Nucleus::createURem(lhs.value, rhs.value)); |
| 3830 | } |
| 3831 | |
| 3832 | RValue<UInt> operator&(RValue<UInt> lhs, RValue<UInt> rhs) |
| 3833 | { |
| 3834 | return RValue<UInt>(Nucleus::createAnd(lhs.value, rhs.value)); |
| 3835 | } |
| 3836 | |
| 3837 | RValue<UInt> operator|(RValue<UInt> lhs, RValue<UInt> rhs) |
| 3838 | { |
| 3839 | return RValue<UInt>(Nucleus::createOr(lhs.value, rhs.value)); |
| 3840 | } |
| 3841 | |
| 3842 | RValue<UInt> operator^(RValue<UInt> lhs, RValue<UInt> rhs) |
| 3843 | { |
| 3844 | return RValue<UInt>(Nucleus::createXor(lhs.value, rhs.value)); |
| 3845 | } |
| 3846 | |
| 3847 | RValue<UInt> operator<<(RValue<UInt> lhs, RValue<UInt> rhs) |
| 3848 | { |
| 3849 | return RValue<UInt>(Nucleus::createShl(lhs.value, rhs.value)); |
| 3850 | } |
| 3851 | |
| 3852 | RValue<UInt> operator>>(RValue<UInt> lhs, RValue<UInt> rhs) |
| 3853 | { |
| 3854 | return RValue<UInt>(Nucleus::createLShr(lhs.value, rhs.value)); |
| 3855 | } |
| 3856 | |
| 3857 | RValue<UInt> operator+=(const UInt &lhs, RValue<UInt> rhs) |
| 3858 | { |
| 3859 | return lhs = lhs + rhs; |
| 3860 | } |
| 3861 | |
| 3862 | RValue<UInt> operator-=(const UInt &lhs, RValue<UInt> rhs) |
| 3863 | { |
| 3864 | return lhs = lhs - rhs; |
| 3865 | } |
| 3866 | |
| 3867 | RValue<UInt> operator*=(const UInt &lhs, RValue<UInt> rhs) |
| 3868 | { |
| 3869 | return lhs = lhs * rhs; |
| 3870 | } |
| 3871 | |
| 3872 | RValue<UInt> operator/=(const UInt &lhs, RValue<UInt> rhs) |
| 3873 | { |
| 3874 | return lhs = lhs / rhs; |
| 3875 | } |
| 3876 | |
| 3877 | RValue<UInt> operator%=(const UInt &lhs, RValue<UInt> rhs) |
| 3878 | { |
| 3879 | return lhs = lhs % rhs; |
| 3880 | } |
| 3881 | |
| 3882 | RValue<UInt> operator&=(const UInt &lhs, RValue<UInt> rhs) |
| 3883 | { |
| 3884 | return lhs = lhs & rhs; |
| 3885 | } |
| 3886 | |
| 3887 | RValue<UInt> operator|=(const UInt &lhs, RValue<UInt> rhs) |
| 3888 | { |
| 3889 | return lhs = lhs | rhs; |
| 3890 | } |
| 3891 | |
| 3892 | RValue<UInt> operator^=(const UInt &lhs, RValue<UInt> rhs) |
| 3893 | { |
| 3894 | return lhs = lhs ^ rhs; |
| 3895 | } |
| 3896 | |
| 3897 | RValue<UInt> operator<<=(const UInt &lhs, RValue<UInt> rhs) |
| 3898 | { |
| 3899 | return lhs = lhs << rhs; |
| 3900 | } |
| 3901 | |
| 3902 | RValue<UInt> operator>>=(const UInt &lhs, RValue<UInt> rhs) |
| 3903 | { |
| 3904 | return lhs = lhs >> rhs; |
| 3905 | } |
| 3906 | |
| 3907 | RValue<UInt> operator+(RValue<UInt> val) |
| 3908 | { |
| 3909 | return val; |
| 3910 | } |
| 3911 | |
| 3912 | RValue<UInt> operator-(RValue<UInt> val) |
| 3913 | { |
| 3914 | return RValue<UInt>(Nucleus::createNeg(val.value)); |
| 3915 | } |
| 3916 | |
| 3917 | RValue<UInt> operator~(RValue<UInt> val) |
| 3918 | { |
| 3919 | return RValue<UInt>(Nucleus::createNot(val.value)); |
| 3920 | } |
| 3921 | |
| 3922 | RValue<UInt> operator++(const UInt &val, int) // Post-increment |
| 3923 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3924 | assert(false && "UNIMPLEMENTED"); return RValue<UInt>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3925 | } |
| 3926 | |
| 3927 | const UInt &operator++(const UInt &val) // Pre-increment |
| 3928 | { |
| 3929 | assert(false && "UNIMPLEMENTED"); return val; |
| 3930 | } |
| 3931 | |
| 3932 | RValue<UInt> operator--(const UInt &val, int) // Post-decrement |
| 3933 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3934 | assert(false && "UNIMPLEMENTED"); return RValue<UInt>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3935 | } |
| 3936 | |
| 3937 | const UInt &operator--(const UInt &val) // Pre-decrement |
| 3938 | { |
| 3939 | assert(false && "UNIMPLEMENTED"); return val; |
| 3940 | } |
| 3941 | |
| 3942 | RValue<UInt> Max(RValue<UInt> x, RValue<UInt> y) |
| 3943 | { |
| 3944 | return IfThenElse(x > y, x, y); |
| 3945 | } |
| 3946 | |
| 3947 | RValue<UInt> Min(RValue<UInt> x, RValue<UInt> y) |
| 3948 | { |
| 3949 | return IfThenElse(x < y, x, y); |
| 3950 | } |
| 3951 | |
| 3952 | RValue<UInt> Clamp(RValue<UInt> x, RValue<UInt> min, RValue<UInt> max) |
| 3953 | { |
| 3954 | return Min(Max(x, min), max); |
| 3955 | } |
| 3956 | |
| 3957 | RValue<Bool> operator<(RValue<UInt> lhs, RValue<UInt> rhs) |
| 3958 | { |
| 3959 | return RValue<Bool>(Nucleus::createICmpULT(lhs.value, rhs.value)); |
| 3960 | } |
| 3961 | |
| 3962 | RValue<Bool> operator<=(RValue<UInt> lhs, RValue<UInt> rhs) |
| 3963 | { |
| 3964 | return RValue<Bool>(Nucleus::createICmpULE(lhs.value, rhs.value)); |
| 3965 | } |
| 3966 | |
| 3967 | RValue<Bool> operator>(RValue<UInt> lhs, RValue<UInt> rhs) |
| 3968 | { |
| 3969 | return RValue<Bool>(Nucleus::createICmpUGT(lhs.value, rhs.value)); |
| 3970 | } |
| 3971 | |
| 3972 | RValue<Bool> operator>=(RValue<UInt> lhs, RValue<UInt> rhs) |
| 3973 | { |
| 3974 | return RValue<Bool>(Nucleus::createICmpUGE(lhs.value, rhs.value)); |
| 3975 | } |
| 3976 | |
| 3977 | RValue<Bool> operator!=(RValue<UInt> lhs, RValue<UInt> rhs) |
| 3978 | { |
| 3979 | return RValue<Bool>(Nucleus::createICmpNE(lhs.value, rhs.value)); |
| 3980 | } |
| 3981 | |
| 3982 | RValue<Bool> operator==(RValue<UInt> lhs, RValue<UInt> rhs) |
| 3983 | { |
| 3984 | return RValue<Bool>(Nucleus::createICmpEQ(lhs.value, rhs.value)); |
| 3985 | } |
| 3986 | |
| 3987 | // RValue<UInt> RoundUInt(RValue<Float> cast) |
| 3988 | // { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 3989 | // assert(false && "UNIMPLEMENTED"); return RValue<UInt>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 3990 | // } |
| 3991 | |
| 3992 | Type *UInt::getType() |
| 3993 | { |
| 3994 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 3995 | } |
| 3996 | |
| 3997 | // Int2::Int2(RValue<Int> cast) |
| 3998 | // { |
| 3999 | // Value *extend = Nucleus::createZExt(cast.value, Long::getType()); |
| 4000 | // Value *vector = Nucleus::createBitCast(extend, Int2::getType()); |
| 4001 | // |
| 4002 | // Constant *shuffle[2]; |
| 4003 | // shuffle[0] = Nucleus::createConstantInt(0); |
| 4004 | // shuffle[1] = Nucleus::createConstantInt(0); |
| 4005 | // |
| 4006 | // Value *replicate = Nucleus::createShuffleVector(vector, UndefValue::get(Int2::getType()), Nucleus::createConstantVector(shuffle, 2)); |
| 4007 | // |
| 4008 | // storeValue(replicate); |
| 4009 | // } |
| 4010 | |
| 4011 | Int2::Int2(RValue<Int4> cast) |
| 4012 | { |
| 4013 | Value *long2 = Nucleus::createBitCast(cast.value, Long2::getType()); |
Nicolas Capens | e95d534 | 2016-09-30 11:37:28 -0400 | [diff] [blame] | 4014 | Value *element = Nucleus::createExtractElement(long2, Long2::getType(), 0); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4015 | Value *int2 = Nucleus::createBitCast(element, Int2::getType()); |
| 4016 | |
| 4017 | storeValue(int2); |
| 4018 | } |
| 4019 | |
| 4020 | Int2::Int2() |
| 4021 | { |
| 4022 | // xy.parent = this; |
| 4023 | } |
| 4024 | |
| 4025 | Int2::Int2(int x, int y) |
| 4026 | { |
| 4027 | // xy.parent = this; |
| 4028 | |
| 4029 | assert(false && "UNIMPLEMENTED"); |
| 4030 | } |
| 4031 | |
| 4032 | Int2::Int2(RValue<Int2> rhs) |
| 4033 | { |
| 4034 | // xy.parent = this; |
| 4035 | |
| 4036 | storeValue(rhs.value); |
| 4037 | } |
| 4038 | |
| 4039 | Int2::Int2(const Int2 &rhs) |
| 4040 | { |
| 4041 | // xy.parent = this; |
| 4042 | |
| 4043 | Value *value = rhs.loadValue(); |
| 4044 | storeValue(value); |
| 4045 | } |
| 4046 | |
| 4047 | Int2::Int2(const Reference<Int2> &rhs) |
| 4048 | { |
| 4049 | // xy.parent = this; |
| 4050 | |
| 4051 | Value *value = rhs.loadValue(); |
| 4052 | storeValue(value); |
| 4053 | } |
| 4054 | |
| 4055 | Int2::Int2(RValue<Int> lo, RValue<Int> hi) |
| 4056 | { |
| 4057 | assert(false && "UNIMPLEMENTED"); |
| 4058 | } |
| 4059 | |
| 4060 | RValue<Int2> Int2::operator=(RValue<Int2> rhs) const |
| 4061 | { |
| 4062 | storeValue(rhs.value); |
| 4063 | |
| 4064 | return rhs; |
| 4065 | } |
| 4066 | |
| 4067 | RValue<Int2> Int2::operator=(const Int2 &rhs) const |
| 4068 | { |
| 4069 | Value *value = rhs.loadValue(); |
| 4070 | storeValue(value); |
| 4071 | |
| 4072 | return RValue<Int2>(value); |
| 4073 | } |
| 4074 | |
| 4075 | RValue<Int2> Int2::operator=(const Reference<Int2> &rhs) const |
| 4076 | { |
| 4077 | Value *value = rhs.loadValue(); |
| 4078 | storeValue(value); |
| 4079 | |
| 4080 | return RValue<Int2>(value); |
| 4081 | } |
| 4082 | |
| 4083 | RValue<Int2> operator+(RValue<Int2> lhs, RValue<Int2> rhs) |
| 4084 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4085 | assert(false && "UNIMPLEMENTED"); return RValue<Int2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4086 | } |
| 4087 | |
| 4088 | RValue<Int2> operator-(RValue<Int2> lhs, RValue<Int2> rhs) |
| 4089 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4090 | assert(false && "UNIMPLEMENTED"); return RValue<Int2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4091 | } |
| 4092 | |
| 4093 | // RValue<Int2> operator*(RValue<Int2> lhs, RValue<Int2> rhs) |
| 4094 | // { |
| 4095 | // return RValue<Int2>(Nucleus::createMul(lhs.value, rhs.value)); |
| 4096 | // } |
| 4097 | |
| 4098 | // RValue<Int2> operator/(RValue<Int2> lhs, RValue<Int2> rhs) |
| 4099 | // { |
| 4100 | // return RValue<Int2>(Nucleus::createSDiv(lhs.value, rhs.value)); |
| 4101 | // } |
| 4102 | |
| 4103 | // RValue<Int2> operator%(RValue<Int2> lhs, RValue<Int2> rhs) |
| 4104 | // { |
| 4105 | // return RValue<Int2>(Nucleus::createSRem(lhs.value, rhs.value)); |
| 4106 | // } |
| 4107 | |
| 4108 | RValue<Int2> operator&(RValue<Int2> lhs, RValue<Int2> rhs) |
| 4109 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4110 | assert(false && "UNIMPLEMENTED"); return RValue<Int2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4111 | } |
| 4112 | |
| 4113 | RValue<Int2> operator|(RValue<Int2> lhs, RValue<Int2> rhs) |
| 4114 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4115 | assert(false && "UNIMPLEMENTED"); return RValue<Int2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4116 | } |
| 4117 | |
| 4118 | RValue<Int2> operator^(RValue<Int2> lhs, RValue<Int2> rhs) |
| 4119 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4120 | assert(false && "UNIMPLEMENTED"); return RValue<Int2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4121 | } |
| 4122 | |
| 4123 | RValue<Int2> operator<<(RValue<Int2> lhs, unsigned char rhs) |
| 4124 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4125 | assert(false && "UNIMPLEMENTED"); return RValue<Int2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4126 | } |
| 4127 | |
| 4128 | RValue<Int2> operator>>(RValue<Int2> lhs, unsigned char rhs) |
| 4129 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4130 | assert(false && "UNIMPLEMENTED"); return RValue<Int2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4131 | } |
| 4132 | |
| 4133 | RValue<Int2> operator<<(RValue<Int2> lhs, RValue<Long1> rhs) |
| 4134 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4135 | assert(false && "UNIMPLEMENTED"); return RValue<Int2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4136 | } |
| 4137 | |
| 4138 | RValue<Int2> operator>>(RValue<Int2> lhs, RValue<Long1> rhs) |
| 4139 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4140 | assert(false && "UNIMPLEMENTED"); return RValue<Int2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4141 | } |
| 4142 | |
| 4143 | RValue<Int2> operator+=(const Int2 &lhs, RValue<Int2> rhs) |
| 4144 | { |
| 4145 | return lhs = lhs + rhs; |
| 4146 | } |
| 4147 | |
| 4148 | RValue<Int2> operator-=(const Int2 &lhs, RValue<Int2> rhs) |
| 4149 | { |
| 4150 | return lhs = lhs - rhs; |
| 4151 | } |
| 4152 | |
| 4153 | // RValue<Int2> operator*=(const Int2 &lhs, RValue<Int2> rhs) |
| 4154 | // { |
| 4155 | // return lhs = lhs * rhs; |
| 4156 | // } |
| 4157 | |
| 4158 | // RValue<Int2> operator/=(const Int2 &lhs, RValue<Int2> rhs) |
| 4159 | // { |
| 4160 | // return lhs = lhs / rhs; |
| 4161 | // } |
| 4162 | |
| 4163 | // RValue<Int2> operator%=(const Int2 &lhs, RValue<Int2> rhs) |
| 4164 | // { |
| 4165 | // return lhs = lhs % rhs; |
| 4166 | // } |
| 4167 | |
| 4168 | RValue<Int2> operator&=(const Int2 &lhs, RValue<Int2> rhs) |
| 4169 | { |
| 4170 | return lhs = lhs & rhs; |
| 4171 | } |
| 4172 | |
| 4173 | RValue<Int2> operator|=(const Int2 &lhs, RValue<Int2> rhs) |
| 4174 | { |
| 4175 | return lhs = lhs | rhs; |
| 4176 | } |
| 4177 | |
| 4178 | RValue<Int2> operator^=(const Int2 &lhs, RValue<Int2> rhs) |
| 4179 | { |
| 4180 | return lhs = lhs ^ rhs; |
| 4181 | } |
| 4182 | |
| 4183 | RValue<Int2> operator<<=(const Int2 &lhs, unsigned char rhs) |
| 4184 | { |
| 4185 | return lhs = lhs << rhs; |
| 4186 | } |
| 4187 | |
| 4188 | RValue<Int2> operator>>=(const Int2 &lhs, unsigned char rhs) |
| 4189 | { |
| 4190 | return lhs = lhs >> rhs; |
| 4191 | } |
| 4192 | |
| 4193 | RValue<Int2> operator<<=(const Int2 &lhs, RValue<Long1> rhs) |
| 4194 | { |
| 4195 | return lhs = lhs << rhs; |
| 4196 | } |
| 4197 | |
| 4198 | RValue<Int2> operator>>=(const Int2 &lhs, RValue<Long1> rhs) |
| 4199 | { |
| 4200 | return lhs = lhs >> rhs; |
| 4201 | } |
| 4202 | |
| 4203 | // RValue<Int2> operator+(RValue<Int2> val) |
| 4204 | // { |
| 4205 | // return val; |
| 4206 | // } |
| 4207 | |
| 4208 | // RValue<Int2> operator-(RValue<Int2> val) |
| 4209 | // { |
| 4210 | // return RValue<Int2>(Nucleus::createNeg(val.value)); |
| 4211 | // } |
| 4212 | |
| 4213 | RValue<Int2> operator~(RValue<Int2> val) |
| 4214 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4215 | assert(false && "UNIMPLEMENTED"); return RValue<Int2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4216 | } |
| 4217 | |
| 4218 | RValue<Long1> UnpackLow(RValue<Int2> x, RValue<Int2> y) |
| 4219 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4220 | assert(false && "UNIMPLEMENTED"); return RValue<Long1>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4221 | } |
| 4222 | |
| 4223 | RValue<Long1> UnpackHigh(RValue<Int2> x, RValue<Int2> y) |
| 4224 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4225 | assert(false && "UNIMPLEMENTED"); return RValue<Long1>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4226 | } |
| 4227 | |
| 4228 | RValue<Int> Extract(RValue<Int2> val, int i) |
| 4229 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4230 | assert(false && "UNIMPLEMENTED"); return RValue<Int>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4231 | } |
| 4232 | |
| 4233 | RValue<Int2> Insert(RValue<Int2> val, RValue<Int> element, int i) |
| 4234 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4235 | assert(false && "UNIMPLEMENTED"); return RValue<Int2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4236 | } |
| 4237 | |
| 4238 | Type *Int2::getType() |
| 4239 | { |
| 4240 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 4241 | } |
| 4242 | |
| 4243 | UInt2::UInt2() |
| 4244 | { |
| 4245 | // xy.parent = this; |
| 4246 | } |
| 4247 | |
| 4248 | UInt2::UInt2(unsigned int x, unsigned int y) |
| 4249 | { |
| 4250 | // xy.parent = this; |
| 4251 | |
| 4252 | assert(false && "UNIMPLEMENTED"); |
| 4253 | } |
| 4254 | |
| 4255 | UInt2::UInt2(RValue<UInt2> rhs) |
| 4256 | { |
| 4257 | // xy.parent = this; |
| 4258 | |
| 4259 | storeValue(rhs.value); |
| 4260 | } |
| 4261 | |
| 4262 | UInt2::UInt2(const UInt2 &rhs) |
| 4263 | { |
| 4264 | // xy.parent = this; |
| 4265 | |
| 4266 | Value *value = rhs.loadValue(); |
| 4267 | storeValue(value); |
| 4268 | } |
| 4269 | |
| 4270 | UInt2::UInt2(const Reference<UInt2> &rhs) |
| 4271 | { |
| 4272 | // xy.parent = this; |
| 4273 | |
| 4274 | Value *value = rhs.loadValue(); |
| 4275 | storeValue(value); |
| 4276 | } |
| 4277 | |
| 4278 | RValue<UInt2> UInt2::operator=(RValue<UInt2> rhs) const |
| 4279 | { |
| 4280 | storeValue(rhs.value); |
| 4281 | |
| 4282 | return rhs; |
| 4283 | } |
| 4284 | |
| 4285 | RValue<UInt2> UInt2::operator=(const UInt2 &rhs) const |
| 4286 | { |
| 4287 | Value *value = rhs.loadValue(); |
| 4288 | storeValue(value); |
| 4289 | |
| 4290 | return RValue<UInt2>(value); |
| 4291 | } |
| 4292 | |
| 4293 | RValue<UInt2> UInt2::operator=(const Reference<UInt2> &rhs) const |
| 4294 | { |
| 4295 | Value *value = rhs.loadValue(); |
| 4296 | storeValue(value); |
| 4297 | |
| 4298 | return RValue<UInt2>(value); |
| 4299 | } |
| 4300 | |
| 4301 | RValue<UInt2> operator+(RValue<UInt2> lhs, RValue<UInt2> rhs) |
| 4302 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4303 | assert(false && "UNIMPLEMENTED"); return RValue<UInt2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4304 | } |
| 4305 | |
| 4306 | RValue<UInt2> operator-(RValue<UInt2> lhs, RValue<UInt2> rhs) |
| 4307 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4308 | assert(false && "UNIMPLEMENTED"); return RValue<UInt2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4309 | } |
| 4310 | |
| 4311 | // RValue<UInt2> operator*(RValue<UInt2> lhs, RValue<UInt2> rhs) |
| 4312 | // { |
| 4313 | // return RValue<UInt2>(Nucleus::createMul(lhs.value, rhs.value)); |
| 4314 | // } |
| 4315 | |
| 4316 | // RValue<UInt2> operator/(RValue<UInt2> lhs, RValue<UInt2> rhs) |
| 4317 | // { |
| 4318 | // return RValue<UInt2>(Nucleus::createUDiv(lhs.value, rhs.value)); |
| 4319 | // } |
| 4320 | |
| 4321 | // RValue<UInt2> operator%(RValue<UInt2> lhs, RValue<UInt2> rhs) |
| 4322 | // { |
| 4323 | // return RValue<UInt2>(Nucleus::createURem(lhs.value, rhs.value)); |
| 4324 | // } |
| 4325 | |
| 4326 | RValue<UInt2> operator&(RValue<UInt2> lhs, RValue<UInt2> rhs) |
| 4327 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4328 | assert(false && "UNIMPLEMENTED"); return RValue<UInt2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4329 | } |
| 4330 | |
| 4331 | RValue<UInt2> operator|(RValue<UInt2> lhs, RValue<UInt2> rhs) |
| 4332 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4333 | assert(false && "UNIMPLEMENTED"); return RValue<UInt2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4334 | } |
| 4335 | |
| 4336 | RValue<UInt2> operator^(RValue<UInt2> lhs, RValue<UInt2> rhs) |
| 4337 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4338 | assert(false && "UNIMPLEMENTED"); return RValue<UInt2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4339 | } |
| 4340 | |
| 4341 | RValue<UInt2> operator<<(RValue<UInt2> lhs, unsigned char rhs) |
| 4342 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4343 | assert(false && "UNIMPLEMENTED"); return RValue<UInt2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4344 | } |
| 4345 | |
| 4346 | RValue<UInt2> operator>>(RValue<UInt2> lhs, unsigned char rhs) |
| 4347 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4348 | assert(false && "UNIMPLEMENTED"); return RValue<UInt2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4349 | } |
| 4350 | |
| 4351 | RValue<UInt2> operator<<(RValue<UInt2> lhs, RValue<Long1> rhs) |
| 4352 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4353 | assert(false && "UNIMPLEMENTED"); return RValue<UInt2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4354 | } |
| 4355 | |
| 4356 | RValue<UInt2> operator>>(RValue<UInt2> lhs, RValue<Long1> rhs) |
| 4357 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4358 | assert(false && "UNIMPLEMENTED"); return RValue<UInt2>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4359 | } |
| 4360 | |
| 4361 | RValue<UInt2> operator+=(const UInt2 &lhs, RValue<UInt2> rhs) |
| 4362 | { |
| 4363 | return lhs = lhs + rhs; |
| 4364 | } |
| 4365 | |
| 4366 | RValue<UInt2> operator-=(const UInt2 &lhs, RValue<UInt2> rhs) |
| 4367 | { |
| 4368 | return lhs = lhs - rhs; |
| 4369 | } |
| 4370 | |
| 4371 | // RValue<UInt2> operator*=(const UInt2 &lhs, RValue<UInt2> rhs) |
| 4372 | // { |
| 4373 | // return lhs = lhs * rhs; |
| 4374 | // } |
| 4375 | |
| 4376 | // RValue<UInt2> operator/=(const UInt2 &lhs, RValue<UInt2> rhs) |
| 4377 | // { |
| 4378 | // return lhs = lhs / rhs; |
| 4379 | // } |
| 4380 | |
| 4381 | // RValue<UInt2> operator%=(const UInt2 &lhs, RValue<UInt2> rhs) |
| 4382 | // { |
| 4383 | // return lhs = lhs % rhs; |
| 4384 | // } |
| 4385 | |
| 4386 | RValue<UInt2> operator&=(const UInt2 &lhs, RValue<UInt2> rhs) |
| 4387 | { |
| 4388 | return lhs = lhs & rhs; |
| 4389 | } |
| 4390 | |
| 4391 | RValue<UInt2> operator|=(const UInt2 &lhs, RValue<UInt2> rhs) |
| 4392 | { |
| 4393 | return lhs = lhs | rhs; |
| 4394 | } |
| 4395 | |
| 4396 | RValue<UInt2> operator^=(const UInt2 &lhs, RValue<UInt2> rhs) |
| 4397 | { |
| 4398 | return lhs = lhs ^ rhs; |
| 4399 | } |
| 4400 | |
| 4401 | RValue<UInt2> operator<<=(const UInt2 &lhs, unsigned char rhs) |
| 4402 | { |
| 4403 | return lhs = lhs << rhs; |
| 4404 | } |
| 4405 | |
| 4406 | RValue<UInt2> operator>>=(const UInt2 &lhs, unsigned char rhs) |
| 4407 | { |
| 4408 | return lhs = lhs >> rhs; |
| 4409 | } |
| 4410 | |
| 4411 | RValue<UInt2> operator<<=(const UInt2 &lhs, RValue<Long1> rhs) |
| 4412 | { |
| 4413 | return lhs = lhs << rhs; |
| 4414 | } |
| 4415 | |
| 4416 | RValue<UInt2> operator>>=(const UInt2 &lhs, RValue<Long1> rhs) |
| 4417 | { |
| 4418 | return lhs = lhs >> rhs; |
| 4419 | } |
| 4420 | |
| 4421 | // RValue<UInt2> operator+(RValue<UInt2> val) |
| 4422 | // { |
| 4423 | // return val; |
| 4424 | // } |
| 4425 | |
| 4426 | // RValue<UInt2> operator-(RValue<UInt2> val) |
| 4427 | // { |
| 4428 | // return RValue<UInt2>(Nucleus::createNeg(val.value)); |
| 4429 | // } |
| 4430 | |
| 4431 | RValue<UInt2> operator~(RValue<UInt2> val) |
| 4432 | { |
| 4433 | return RValue<UInt2>(Nucleus::createNot(val.value)); |
| 4434 | } |
| 4435 | |
| 4436 | Type *UInt2::getType() |
| 4437 | { |
| 4438 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 4439 | } |
| 4440 | |
| 4441 | Int4::Int4(RValue<Byte4> cast) |
| 4442 | { |
| 4443 | assert(false && "UNIMPLEMENTED"); |
| 4444 | } |
| 4445 | |
| 4446 | Int4::Int4(RValue<SByte4> cast) |
| 4447 | { |
| 4448 | assert(false && "UNIMPLEMENTED"); |
| 4449 | } |
| 4450 | |
| 4451 | Int4::Int4(RValue<Float4> cast) |
| 4452 | { |
| 4453 | // xyzw.parent = this; |
| 4454 | |
| 4455 | Value *xyzw = Nucleus::createFPToSI(cast.value, Int4::getType()); |
| 4456 | |
| 4457 | storeValue(xyzw); |
| 4458 | } |
| 4459 | |
| 4460 | Int4::Int4(RValue<Short4> cast) |
| 4461 | { |
| 4462 | assert(false && "UNIMPLEMENTED"); |
| 4463 | } |
| 4464 | |
| 4465 | Int4::Int4(RValue<UShort4> cast) |
| 4466 | { |
| 4467 | assert(false && "UNIMPLEMENTED"); |
| 4468 | } |
| 4469 | |
| 4470 | Int4::Int4() |
| 4471 | { |
| 4472 | // xyzw.parent = this; |
| 4473 | } |
| 4474 | |
| 4475 | Int4::Int4(int xyzw) |
| 4476 | { |
| 4477 | constant(xyzw, xyzw, xyzw, xyzw); |
| 4478 | } |
| 4479 | |
| 4480 | Int4::Int4(int x, int yzw) |
| 4481 | { |
| 4482 | constant(x, yzw, yzw, yzw); |
| 4483 | } |
| 4484 | |
| 4485 | Int4::Int4(int x, int y, int zw) |
| 4486 | { |
| 4487 | constant(x, y, zw, zw); |
| 4488 | } |
| 4489 | |
| 4490 | Int4::Int4(int x, int y, int z, int w) |
| 4491 | { |
| 4492 | constant(x, y, z, w); |
| 4493 | } |
| 4494 | |
| 4495 | void Int4::constant(int x, int y, int z, int w) |
| 4496 | { |
| 4497 | // xyzw.parent = this; |
| 4498 | |
| 4499 | Constant *constantVector[4]; |
| 4500 | constantVector[0] = Nucleus::createConstantInt(x); |
| 4501 | constantVector[1] = Nucleus::createConstantInt(y); |
| 4502 | constantVector[2] = Nucleus::createConstantInt(z); |
| 4503 | constantVector[3] = Nucleus::createConstantInt(w); |
| 4504 | |
| 4505 | storeValue(Nucleus::createConstantVector(constantVector, 4)); |
| 4506 | } |
| 4507 | |
| 4508 | Int4::Int4(RValue<Int4> rhs) |
| 4509 | { |
| 4510 | // xyzw.parent = this; |
| 4511 | |
| 4512 | storeValue(rhs.value); |
| 4513 | } |
| 4514 | |
| 4515 | Int4::Int4(const Int4 &rhs) |
| 4516 | { |
| 4517 | // xyzw.parent = this; |
| 4518 | |
| 4519 | Value *value = rhs.loadValue(); |
| 4520 | storeValue(value); |
| 4521 | } |
| 4522 | |
| 4523 | Int4::Int4(const Reference<Int4> &rhs) |
| 4524 | { |
| 4525 | // xyzw.parent = this; |
| 4526 | |
| 4527 | Value *value = rhs.loadValue(); |
| 4528 | storeValue(value); |
| 4529 | } |
| 4530 | |
| 4531 | Int4::Int4(RValue<UInt4> rhs) |
| 4532 | { |
| 4533 | // xyzw.parent = this; |
| 4534 | |
| 4535 | storeValue(rhs.value); |
| 4536 | } |
| 4537 | |
| 4538 | Int4::Int4(const UInt4 &rhs) |
| 4539 | { |
| 4540 | // xyzw.parent = this; |
| 4541 | |
| 4542 | Value *value = rhs.loadValue(); |
| 4543 | storeValue(value); |
| 4544 | } |
| 4545 | |
| 4546 | Int4::Int4(const Reference<UInt4> &rhs) |
| 4547 | { |
| 4548 | // xyzw.parent = this; |
| 4549 | |
| 4550 | Value *value = rhs.loadValue(); |
| 4551 | storeValue(value); |
| 4552 | } |
| 4553 | |
| 4554 | Int4::Int4(RValue<Int2> lo, RValue<Int2> hi) |
| 4555 | { |
| 4556 | assert(false && "UNIMPLEMENTED"); |
| 4557 | } |
| 4558 | |
| 4559 | Int4::Int4(RValue<Int> rhs) |
| 4560 | { |
| 4561 | // xyzw.parent = this; |
| 4562 | |
| 4563 | assert(false && "UNIMPLEMENTED"); |
| 4564 | } |
| 4565 | |
| 4566 | Int4::Int4(const Int &rhs) |
| 4567 | { |
| 4568 | // xyzw.parent = this; |
| 4569 | |
| 4570 | *this = RValue<Int>(rhs.loadValue()); |
| 4571 | } |
| 4572 | |
| 4573 | Int4::Int4(const Reference<Int> &rhs) |
| 4574 | { |
| 4575 | // xyzw.parent = this; |
| 4576 | |
| 4577 | *this = RValue<Int>(rhs.loadValue()); |
| 4578 | } |
| 4579 | |
| 4580 | RValue<Int4> Int4::operator=(RValue<Int4> rhs) const |
| 4581 | { |
| 4582 | storeValue(rhs.value); |
| 4583 | |
| 4584 | return rhs; |
| 4585 | } |
| 4586 | |
| 4587 | RValue<Int4> Int4::operator=(const Int4 &rhs) const |
| 4588 | { |
| 4589 | Value *value = rhs.loadValue(); |
| 4590 | storeValue(value); |
| 4591 | |
| 4592 | return RValue<Int4>(value); |
| 4593 | } |
| 4594 | |
| 4595 | RValue<Int4> Int4::operator=(const Reference<Int4> &rhs) const |
| 4596 | { |
| 4597 | Value *value = rhs.loadValue(); |
| 4598 | storeValue(value); |
| 4599 | |
| 4600 | return RValue<Int4>(value); |
| 4601 | } |
| 4602 | |
| 4603 | RValue<Int4> operator+(RValue<Int4> lhs, RValue<Int4> rhs) |
| 4604 | { |
| 4605 | return RValue<Int4>(Nucleus::createAdd(lhs.value, rhs.value)); |
| 4606 | } |
| 4607 | |
| 4608 | RValue<Int4> operator-(RValue<Int4> lhs, RValue<Int4> rhs) |
| 4609 | { |
| 4610 | return RValue<Int4>(Nucleus::createSub(lhs.value, rhs.value)); |
| 4611 | } |
| 4612 | |
| 4613 | RValue<Int4> operator*(RValue<Int4> lhs, RValue<Int4> rhs) |
| 4614 | { |
| 4615 | return RValue<Int4>(Nucleus::createMul(lhs.value, rhs.value)); |
| 4616 | } |
| 4617 | |
| 4618 | RValue<Int4> operator/(RValue<Int4> lhs, RValue<Int4> rhs) |
| 4619 | { |
| 4620 | return RValue<Int4>(Nucleus::createSDiv(lhs.value, rhs.value)); |
| 4621 | } |
| 4622 | |
| 4623 | RValue<Int4> operator%(RValue<Int4> lhs, RValue<Int4> rhs) |
| 4624 | { |
| 4625 | return RValue<Int4>(Nucleus::createSRem(lhs.value, rhs.value)); |
| 4626 | } |
| 4627 | |
| 4628 | RValue<Int4> operator&(RValue<Int4> lhs, RValue<Int4> rhs) |
| 4629 | { |
| 4630 | return RValue<Int4>(Nucleus::createAnd(lhs.value, rhs.value)); |
| 4631 | } |
| 4632 | |
| 4633 | RValue<Int4> operator|(RValue<Int4> lhs, RValue<Int4> rhs) |
| 4634 | { |
| 4635 | return RValue<Int4>(Nucleus::createOr(lhs.value, rhs.value)); |
| 4636 | } |
| 4637 | |
| 4638 | RValue<Int4> operator^(RValue<Int4> lhs, RValue<Int4> rhs) |
| 4639 | { |
| 4640 | return RValue<Int4>(Nucleus::createXor(lhs.value, rhs.value)); |
| 4641 | } |
| 4642 | |
| 4643 | RValue<Int4> operator<<(RValue<Int4> lhs, unsigned char rhs) |
| 4644 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4645 | assert(false && "UNIMPLEMENTED"); return RValue<Int4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4646 | } |
| 4647 | |
| 4648 | RValue<Int4> operator>>(RValue<Int4> lhs, unsigned char rhs) |
| 4649 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4650 | assert(false && "UNIMPLEMENTED"); return RValue<Int4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4651 | } |
| 4652 | |
| 4653 | RValue<Int4> operator<<(RValue<Int4> lhs, RValue<Int4> rhs) |
| 4654 | { |
| 4655 | return RValue<Int4>(Nucleus::createShl(lhs.value, rhs.value)); |
| 4656 | } |
| 4657 | |
| 4658 | RValue<Int4> operator>>(RValue<Int4> lhs, RValue<Int4> rhs) |
| 4659 | { |
| 4660 | return RValue<Int4>(Nucleus::createAShr(lhs.value, rhs.value)); |
| 4661 | } |
| 4662 | |
| 4663 | RValue<Int4> operator+=(const Int4 &lhs, RValue<Int4> rhs) |
| 4664 | { |
| 4665 | return lhs = lhs + rhs; |
| 4666 | } |
| 4667 | |
| 4668 | RValue<Int4> operator-=(const Int4 &lhs, RValue<Int4> rhs) |
| 4669 | { |
| 4670 | return lhs = lhs - rhs; |
| 4671 | } |
| 4672 | |
| 4673 | RValue<Int4> operator*=(const Int4 &lhs, RValue<Int4> rhs) |
| 4674 | { |
| 4675 | return lhs = lhs * rhs; |
| 4676 | } |
| 4677 | |
| 4678 | // RValue<Int4> operator/=(const Int4 &lhs, RValue<Int4> rhs) |
| 4679 | // { |
| 4680 | // return lhs = lhs / rhs; |
| 4681 | // } |
| 4682 | |
| 4683 | // RValue<Int4> operator%=(const Int4 &lhs, RValue<Int4> rhs) |
| 4684 | // { |
| 4685 | // return lhs = lhs % rhs; |
| 4686 | // } |
| 4687 | |
| 4688 | RValue<Int4> operator&=(const Int4 &lhs, RValue<Int4> rhs) |
| 4689 | { |
| 4690 | return lhs = lhs & rhs; |
| 4691 | } |
| 4692 | |
| 4693 | RValue<Int4> operator|=(const Int4 &lhs, RValue<Int4> rhs) |
| 4694 | { |
| 4695 | return lhs = lhs | rhs; |
| 4696 | } |
| 4697 | |
| 4698 | RValue<Int4> operator^=(const Int4 &lhs, RValue<Int4> rhs) |
| 4699 | { |
| 4700 | return lhs = lhs ^ rhs; |
| 4701 | } |
| 4702 | |
| 4703 | RValue<Int4> operator<<=(const Int4 &lhs, unsigned char rhs) |
| 4704 | { |
| 4705 | return lhs = lhs << rhs; |
| 4706 | } |
| 4707 | |
| 4708 | RValue<Int4> operator>>=(const Int4 &lhs, unsigned char rhs) |
| 4709 | { |
| 4710 | return lhs = lhs >> rhs; |
| 4711 | } |
| 4712 | |
| 4713 | RValue<Int4> operator+(RValue<Int4> val) |
| 4714 | { |
| 4715 | return val; |
| 4716 | } |
| 4717 | |
| 4718 | RValue<Int4> operator-(RValue<Int4> val) |
| 4719 | { |
| 4720 | return RValue<Int4>(Nucleus::createNeg(val.value)); |
| 4721 | } |
| 4722 | |
| 4723 | RValue<Int4> operator~(RValue<Int4> val) |
| 4724 | { |
| 4725 | return RValue<Int4>(Nucleus::createNot(val.value)); |
| 4726 | } |
| 4727 | |
| 4728 | RValue<Int4> CmpEQ(RValue<Int4> x, RValue<Int4> y) |
| 4729 | { |
| 4730 | return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpEQ(x.value, y.value), Int4::getType())); |
| 4731 | } |
| 4732 | |
| 4733 | RValue<Int4> CmpLT(RValue<Int4> x, RValue<Int4> y) |
| 4734 | { |
| 4735 | return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpSLT(x.value, y.value), Int4::getType())); |
| 4736 | } |
| 4737 | |
| 4738 | RValue<Int4> CmpLE(RValue<Int4> x, RValue<Int4> y) |
| 4739 | { |
| 4740 | return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpSLE(x.value, y.value), Int4::getType())); |
| 4741 | } |
| 4742 | |
| 4743 | RValue<Int4> CmpNEQ(RValue<Int4> x, RValue<Int4> y) |
| 4744 | { |
| 4745 | return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpNE(x.value, y.value), Int4::getType())); |
| 4746 | } |
| 4747 | |
| 4748 | RValue<Int4> CmpNLT(RValue<Int4> x, RValue<Int4> y) |
| 4749 | { |
| 4750 | return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpSGE(x.value, y.value), Int4::getType())); |
| 4751 | } |
| 4752 | |
| 4753 | RValue<Int4> CmpNLE(RValue<Int4> x, RValue<Int4> y) |
| 4754 | { |
| 4755 | return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpSGT(x.value, y.value), Int4::getType())); |
| 4756 | } |
| 4757 | |
| 4758 | RValue<Int4> Max(RValue<Int4> x, RValue<Int4> y) |
| 4759 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4760 | assert(false && "UNIMPLEMENTED"); return RValue<Int4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4761 | } |
| 4762 | |
| 4763 | RValue<Int4> Min(RValue<Int4> x, RValue<Int4> y) |
| 4764 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4765 | assert(false && "UNIMPLEMENTED"); return RValue<Int4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4766 | } |
| 4767 | |
| 4768 | RValue<Int4> RoundInt(RValue<Float4> cast) |
| 4769 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4770 | assert(false && "UNIMPLEMENTED"); return RValue<Int4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4771 | } |
| 4772 | |
| 4773 | RValue<Short8> Pack(RValue<Int4> x, RValue<Int4> y) |
| 4774 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4775 | assert(false && "UNIMPLEMENTED"); return RValue<Short8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4776 | } |
| 4777 | |
| 4778 | RValue<Int> Extract(RValue<Int4> x, int i) |
| 4779 | { |
Nicolas Capens | e95d534 | 2016-09-30 11:37:28 -0400 | [diff] [blame] | 4780 | return RValue<Int>(Nucleus::createExtractElement(x.value, Int::getType(), i)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4781 | } |
| 4782 | |
| 4783 | RValue<Int4> Insert(RValue<Int4> x, RValue<Int> element, int i) |
| 4784 | { |
| 4785 | return RValue<Int4>(Nucleus::createInsertElement(x.value, element.value, i)); |
| 4786 | } |
| 4787 | |
| 4788 | RValue<Int> SignMask(RValue<Int4> x) |
| 4789 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4790 | assert(false && "UNIMPLEMENTED"); return RValue<Int>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4791 | } |
| 4792 | |
| 4793 | RValue<Int4> Swizzle(RValue<Int4> x, unsigned char select) |
| 4794 | { |
Nicolas Capens | e95d534 | 2016-09-30 11:37:28 -0400 | [diff] [blame] | 4795 | return RValue<Int4>(createSwizzle4(x.value, select)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4796 | } |
| 4797 | |
| 4798 | Type *Int4::getType() |
| 4799 | { |
| 4800 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 4801 | } |
| 4802 | |
| 4803 | UInt4::UInt4(RValue<Float4> cast) |
| 4804 | { |
| 4805 | // xyzw.parent = this; |
| 4806 | |
| 4807 | assert(false && "UNIMPLEMENTED"); |
| 4808 | } |
| 4809 | |
| 4810 | UInt4::UInt4() |
| 4811 | { |
| 4812 | // xyzw.parent = this; |
| 4813 | } |
| 4814 | |
| 4815 | UInt4::UInt4(int xyzw) |
| 4816 | { |
| 4817 | constant(xyzw, xyzw, xyzw, xyzw); |
| 4818 | } |
| 4819 | |
| 4820 | UInt4::UInt4(int x, int yzw) |
| 4821 | { |
| 4822 | constant(x, yzw, yzw, yzw); |
| 4823 | } |
| 4824 | |
| 4825 | UInt4::UInt4(int x, int y, int zw) |
| 4826 | { |
| 4827 | constant(x, y, zw, zw); |
| 4828 | } |
| 4829 | |
| 4830 | UInt4::UInt4(int x, int y, int z, int w) |
| 4831 | { |
| 4832 | constant(x, y, z, w); |
| 4833 | } |
| 4834 | |
| 4835 | void UInt4::constant(int x, int y, int z, int w) |
| 4836 | { |
| 4837 | // xyzw.parent = this; |
| 4838 | |
| 4839 | Constant *constantVector[4]; |
| 4840 | constantVector[0] = Nucleus::createConstantInt(x); |
| 4841 | constantVector[1] = Nucleus::createConstantInt(y); |
| 4842 | constantVector[2] = Nucleus::createConstantInt(z); |
| 4843 | constantVector[3] = Nucleus::createConstantInt(w); |
| 4844 | |
| 4845 | storeValue(Nucleus::createConstantVector(constantVector, 4)); |
| 4846 | } |
| 4847 | |
| 4848 | UInt4::UInt4(RValue<UInt4> rhs) |
| 4849 | { |
| 4850 | // xyzw.parent = this; |
| 4851 | |
| 4852 | storeValue(rhs.value); |
| 4853 | } |
| 4854 | |
| 4855 | UInt4::UInt4(const UInt4 &rhs) |
| 4856 | { |
| 4857 | // xyzw.parent = this; |
| 4858 | |
| 4859 | Value *value = rhs.loadValue(); |
| 4860 | storeValue(value); |
| 4861 | } |
| 4862 | |
| 4863 | UInt4::UInt4(const Reference<UInt4> &rhs) |
| 4864 | { |
| 4865 | // xyzw.parent = this; |
| 4866 | |
| 4867 | Value *value = rhs.loadValue(); |
| 4868 | storeValue(value); |
| 4869 | } |
| 4870 | |
| 4871 | UInt4::UInt4(RValue<Int4> rhs) |
| 4872 | { |
| 4873 | // xyzw.parent = this; |
| 4874 | |
| 4875 | storeValue(rhs.value); |
| 4876 | } |
| 4877 | |
| 4878 | UInt4::UInt4(const Int4 &rhs) |
| 4879 | { |
| 4880 | // xyzw.parent = this; |
| 4881 | |
| 4882 | Value *value = rhs.loadValue(); |
| 4883 | storeValue(value); |
| 4884 | } |
| 4885 | |
| 4886 | UInt4::UInt4(const Reference<Int4> &rhs) |
| 4887 | { |
| 4888 | // xyzw.parent = this; |
| 4889 | |
| 4890 | Value *value = rhs.loadValue(); |
| 4891 | storeValue(value); |
| 4892 | } |
| 4893 | |
| 4894 | UInt4::UInt4(RValue<UInt2> lo, RValue<UInt2> hi) |
| 4895 | { |
| 4896 | assert(false && "UNIMPLEMENTED"); |
| 4897 | } |
| 4898 | |
| 4899 | RValue<UInt4> UInt4::operator=(RValue<UInt4> rhs) const |
| 4900 | { |
| 4901 | storeValue(rhs.value); |
| 4902 | |
| 4903 | return rhs; |
| 4904 | } |
| 4905 | |
| 4906 | RValue<UInt4> UInt4::operator=(const UInt4 &rhs) const |
| 4907 | { |
| 4908 | Value *value = rhs.loadValue(); |
| 4909 | storeValue(value); |
| 4910 | |
| 4911 | return RValue<UInt4>(value); |
| 4912 | } |
| 4913 | |
| 4914 | RValue<UInt4> UInt4::operator=(const Reference<UInt4> &rhs) const |
| 4915 | { |
| 4916 | Value *value = rhs.loadValue(); |
| 4917 | storeValue(value); |
| 4918 | |
| 4919 | return RValue<UInt4>(value); |
| 4920 | } |
| 4921 | |
| 4922 | RValue<UInt4> operator+(RValue<UInt4> lhs, RValue<UInt4> rhs) |
| 4923 | { |
| 4924 | return RValue<UInt4>(Nucleus::createAdd(lhs.value, rhs.value)); |
| 4925 | } |
| 4926 | |
| 4927 | RValue<UInt4> operator-(RValue<UInt4> lhs, RValue<UInt4> rhs) |
| 4928 | { |
| 4929 | return RValue<UInt4>(Nucleus::createSub(lhs.value, rhs.value)); |
| 4930 | } |
| 4931 | |
| 4932 | RValue<UInt4> operator*(RValue<UInt4> lhs, RValue<UInt4> rhs) |
| 4933 | { |
| 4934 | return RValue<UInt4>(Nucleus::createMul(lhs.value, rhs.value)); |
| 4935 | } |
| 4936 | |
| 4937 | RValue<UInt4> operator/(RValue<UInt4> lhs, RValue<UInt4> rhs) |
| 4938 | { |
| 4939 | return RValue<UInt4>(Nucleus::createUDiv(lhs.value, rhs.value)); |
| 4940 | } |
| 4941 | |
| 4942 | RValue<UInt4> operator%(RValue<UInt4> lhs, RValue<UInt4> rhs) |
| 4943 | { |
| 4944 | return RValue<UInt4>(Nucleus::createURem(lhs.value, rhs.value)); |
| 4945 | } |
| 4946 | |
| 4947 | RValue<UInt4> operator&(RValue<UInt4> lhs, RValue<UInt4> rhs) |
| 4948 | { |
| 4949 | return RValue<UInt4>(Nucleus::createAnd(lhs.value, rhs.value)); |
| 4950 | } |
| 4951 | |
| 4952 | RValue<UInt4> operator|(RValue<UInt4> lhs, RValue<UInt4> rhs) |
| 4953 | { |
| 4954 | return RValue<UInt4>(Nucleus::createOr(lhs.value, rhs.value)); |
| 4955 | } |
| 4956 | |
| 4957 | RValue<UInt4> operator^(RValue<UInt4> lhs, RValue<UInt4> rhs) |
| 4958 | { |
| 4959 | return RValue<UInt4>(Nucleus::createXor(lhs.value, rhs.value)); |
| 4960 | } |
| 4961 | |
| 4962 | RValue<UInt4> operator<<(RValue<UInt4> lhs, unsigned char rhs) |
| 4963 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4964 | assert(false && "UNIMPLEMENTED"); return RValue<UInt4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4965 | } |
| 4966 | |
| 4967 | RValue<UInt4> operator>>(RValue<UInt4> lhs, unsigned char rhs) |
| 4968 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 4969 | assert(false && "UNIMPLEMENTED"); return RValue<UInt4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 4970 | } |
| 4971 | |
| 4972 | RValue<UInt4> operator<<(RValue<UInt4> lhs, RValue<UInt4> rhs) |
| 4973 | { |
| 4974 | return RValue<UInt4>(Nucleus::createShl(lhs.value, rhs.value)); |
| 4975 | } |
| 4976 | |
| 4977 | RValue<UInt4> operator>>(RValue<UInt4> lhs, RValue<UInt4> rhs) |
| 4978 | { |
| 4979 | return RValue<UInt4>(Nucleus::createLShr(lhs.value, rhs.value)); |
| 4980 | } |
| 4981 | |
| 4982 | RValue<UInt4> operator+=(const UInt4 &lhs, RValue<UInt4> rhs) |
| 4983 | { |
| 4984 | return lhs = lhs + rhs; |
| 4985 | } |
| 4986 | |
| 4987 | RValue<UInt4> operator-=(const UInt4 &lhs, RValue<UInt4> rhs) |
| 4988 | { |
| 4989 | return lhs = lhs - rhs; |
| 4990 | } |
| 4991 | |
| 4992 | RValue<UInt4> operator*=(const UInt4 &lhs, RValue<UInt4> rhs) |
| 4993 | { |
| 4994 | return lhs = lhs * rhs; |
| 4995 | } |
| 4996 | |
| 4997 | // RValue<UInt4> operator/=(const UInt4 &lhs, RValue<UInt4> rhs) |
| 4998 | // { |
| 4999 | // return lhs = lhs / rhs; |
| 5000 | // } |
| 5001 | |
| 5002 | // RValue<UInt4> operator%=(const UInt4 &lhs, RValue<UInt4> rhs) |
| 5003 | // { |
| 5004 | // return lhs = lhs % rhs; |
| 5005 | // } |
| 5006 | |
| 5007 | RValue<UInt4> operator&=(const UInt4 &lhs, RValue<UInt4> rhs) |
| 5008 | { |
| 5009 | return lhs = lhs & rhs; |
| 5010 | } |
| 5011 | |
| 5012 | RValue<UInt4> operator|=(const UInt4 &lhs, RValue<UInt4> rhs) |
| 5013 | { |
| 5014 | return lhs = lhs | rhs; |
| 5015 | } |
| 5016 | |
| 5017 | RValue<UInt4> operator^=(const UInt4 &lhs, RValue<UInt4> rhs) |
| 5018 | { |
| 5019 | return lhs = lhs ^ rhs; |
| 5020 | } |
| 5021 | |
| 5022 | RValue<UInt4> operator<<=(const UInt4 &lhs, unsigned char rhs) |
| 5023 | { |
| 5024 | return lhs = lhs << rhs; |
| 5025 | } |
| 5026 | |
| 5027 | RValue<UInt4> operator>>=(const UInt4 &lhs, unsigned char rhs) |
| 5028 | { |
| 5029 | return lhs = lhs >> rhs; |
| 5030 | } |
| 5031 | |
| 5032 | RValue<UInt4> operator+(RValue<UInt4> val) |
| 5033 | { |
| 5034 | return val; |
| 5035 | } |
| 5036 | |
| 5037 | RValue<UInt4> operator-(RValue<UInt4> val) |
| 5038 | { |
| 5039 | return RValue<UInt4>(Nucleus::createNeg(val.value)); |
| 5040 | } |
| 5041 | |
| 5042 | RValue<UInt4> operator~(RValue<UInt4> val) |
| 5043 | { |
| 5044 | return RValue<UInt4>(Nucleus::createNot(val.value)); |
| 5045 | } |
| 5046 | |
| 5047 | RValue<UInt4> CmpEQ(RValue<UInt4> x, RValue<UInt4> y) |
| 5048 | { |
| 5049 | return RValue<UInt4>(Nucleus::createSExt(Nucleus::createICmpEQ(x.value, y.value), Int4::getType())); |
| 5050 | } |
| 5051 | |
| 5052 | RValue<UInt4> CmpLT(RValue<UInt4> x, RValue<UInt4> y) |
| 5053 | { |
| 5054 | return RValue<UInt4>(Nucleus::createSExt(Nucleus::createICmpULT(x.value, y.value), Int4::getType())); |
| 5055 | } |
| 5056 | |
| 5057 | RValue<UInt4> CmpLE(RValue<UInt4> x, RValue<UInt4> y) |
| 5058 | { |
| 5059 | return RValue<UInt4>(Nucleus::createSExt(Nucleus::createICmpULE(x.value, y.value), Int4::getType())); |
| 5060 | } |
| 5061 | |
| 5062 | RValue<UInt4> CmpNEQ(RValue<UInt4> x, RValue<UInt4> y) |
| 5063 | { |
| 5064 | return RValue<UInt4>(Nucleus::createSExt(Nucleus::createICmpNE(x.value, y.value), Int4::getType())); |
| 5065 | } |
| 5066 | |
| 5067 | RValue<UInt4> CmpNLT(RValue<UInt4> x, RValue<UInt4> y) |
| 5068 | { |
| 5069 | return RValue<UInt4>(Nucleus::createSExt(Nucleus::createICmpUGE(x.value, y.value), Int4::getType())); |
| 5070 | } |
| 5071 | |
| 5072 | RValue<UInt4> CmpNLE(RValue<UInt4> x, RValue<UInt4> y) |
| 5073 | { |
| 5074 | return RValue<UInt4>(Nucleus::createSExt(Nucleus::createICmpUGT(x.value, y.value), Int4::getType())); |
| 5075 | } |
| 5076 | |
| 5077 | RValue<UInt4> Max(RValue<UInt4> x, RValue<UInt4> y) |
| 5078 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5079 | assert(false && "UNIMPLEMENTED"); return RValue<UInt4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5080 | } |
| 5081 | |
| 5082 | RValue<UInt4> Min(RValue<UInt4> x, RValue<UInt4> y) |
| 5083 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5084 | assert(false && "UNIMPLEMENTED"); return RValue<UInt4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5085 | } |
| 5086 | |
| 5087 | RValue<UShort8> Pack(RValue<UInt4> x, RValue<UInt4> y) |
| 5088 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5089 | assert(false && "UNIMPLEMENTED"); return RValue<UShort8>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5090 | } |
| 5091 | |
| 5092 | Type *UInt4::getType() |
| 5093 | { |
| 5094 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 5095 | } |
| 5096 | |
| 5097 | Float::Float(RValue<Int> cast) |
| 5098 | { |
| 5099 | Value *integer = Nucleus::createSIToFP(cast.value, Float::getType()); |
| 5100 | |
| 5101 | storeValue(integer); |
| 5102 | } |
| 5103 | |
| 5104 | Float::Float() |
| 5105 | { |
| 5106 | } |
| 5107 | |
| 5108 | Float::Float(float x) |
| 5109 | { |
| 5110 | storeValue(Nucleus::createConstantFloat(x)); |
| 5111 | } |
| 5112 | |
| 5113 | Float::Float(RValue<Float> rhs) |
| 5114 | { |
| 5115 | storeValue(rhs.value); |
| 5116 | } |
| 5117 | |
| 5118 | Float::Float(const Float &rhs) |
| 5119 | { |
| 5120 | Value *value = rhs.loadValue(); |
| 5121 | storeValue(value); |
| 5122 | } |
| 5123 | |
| 5124 | Float::Float(const Reference<Float> &rhs) |
| 5125 | { |
| 5126 | Value *value = rhs.loadValue(); |
| 5127 | storeValue(value); |
| 5128 | } |
| 5129 | |
| 5130 | RValue<Float> Float::operator=(RValue<Float> rhs) const |
| 5131 | { |
| 5132 | storeValue(rhs.value); |
| 5133 | |
| 5134 | return rhs; |
| 5135 | } |
| 5136 | |
| 5137 | RValue<Float> Float::operator=(const Float &rhs) const |
| 5138 | { |
| 5139 | Value *value = rhs.loadValue(); |
| 5140 | storeValue(value); |
| 5141 | |
| 5142 | return RValue<Float>(value); |
| 5143 | } |
| 5144 | |
| 5145 | RValue<Float> Float::operator=(const Reference<Float> &rhs) const |
| 5146 | { |
| 5147 | Value *value = rhs.loadValue(); |
| 5148 | storeValue(value); |
| 5149 | |
| 5150 | return RValue<Float>(value); |
| 5151 | } |
| 5152 | |
| 5153 | RValue<Float> operator+(RValue<Float> lhs, RValue<Float> rhs) |
| 5154 | { |
| 5155 | return RValue<Float>(Nucleus::createFAdd(lhs.value, rhs.value)); |
| 5156 | } |
| 5157 | |
| 5158 | RValue<Float> operator-(RValue<Float> lhs, RValue<Float> rhs) |
| 5159 | { |
| 5160 | return RValue<Float>(Nucleus::createFSub(lhs.value, rhs.value)); |
| 5161 | } |
| 5162 | |
| 5163 | RValue<Float> operator*(RValue<Float> lhs, RValue<Float> rhs) |
| 5164 | { |
| 5165 | return RValue<Float>(Nucleus::createFMul(lhs.value, rhs.value)); |
| 5166 | } |
| 5167 | |
| 5168 | RValue<Float> operator/(RValue<Float> lhs, RValue<Float> rhs) |
| 5169 | { |
| 5170 | return RValue<Float>(Nucleus::createFDiv(lhs.value, rhs.value)); |
| 5171 | } |
| 5172 | |
| 5173 | RValue<Float> operator+=(const Float &lhs, RValue<Float> rhs) |
| 5174 | { |
| 5175 | return lhs = lhs + rhs; |
| 5176 | } |
| 5177 | |
| 5178 | RValue<Float> operator-=(const Float &lhs, RValue<Float> rhs) |
| 5179 | { |
| 5180 | return lhs = lhs - rhs; |
| 5181 | } |
| 5182 | |
| 5183 | RValue<Float> operator*=(const Float &lhs, RValue<Float> rhs) |
| 5184 | { |
| 5185 | return lhs = lhs * rhs; |
| 5186 | } |
| 5187 | |
| 5188 | RValue<Float> operator/=(const Float &lhs, RValue<Float> rhs) |
| 5189 | { |
| 5190 | return lhs = lhs / rhs; |
| 5191 | } |
| 5192 | |
| 5193 | RValue<Float> operator+(RValue<Float> val) |
| 5194 | { |
| 5195 | return val; |
| 5196 | } |
| 5197 | |
| 5198 | RValue<Float> operator-(RValue<Float> val) |
| 5199 | { |
| 5200 | return RValue<Float>(Nucleus::createFNeg(val.value)); |
| 5201 | } |
| 5202 | |
| 5203 | RValue<Bool> operator<(RValue<Float> lhs, RValue<Float> rhs) |
| 5204 | { |
| 5205 | return RValue<Bool>(Nucleus::createFCmpOLT(lhs.value, rhs.value)); |
| 5206 | } |
| 5207 | |
| 5208 | RValue<Bool> operator<=(RValue<Float> lhs, RValue<Float> rhs) |
| 5209 | { |
| 5210 | return RValue<Bool>(Nucleus::createFCmpOLE(lhs.value, rhs.value)); |
| 5211 | } |
| 5212 | |
| 5213 | RValue<Bool> operator>(RValue<Float> lhs, RValue<Float> rhs) |
| 5214 | { |
| 5215 | return RValue<Bool>(Nucleus::createFCmpOGT(lhs.value, rhs.value)); |
| 5216 | } |
| 5217 | |
| 5218 | RValue<Bool> operator>=(RValue<Float> lhs, RValue<Float> rhs) |
| 5219 | { |
| 5220 | return RValue<Bool>(Nucleus::createFCmpOGE(lhs.value, rhs.value)); |
| 5221 | } |
| 5222 | |
| 5223 | RValue<Bool> operator!=(RValue<Float> lhs, RValue<Float> rhs) |
| 5224 | { |
| 5225 | return RValue<Bool>(Nucleus::createFCmpONE(lhs.value, rhs.value)); |
| 5226 | } |
| 5227 | |
| 5228 | RValue<Bool> operator==(RValue<Float> lhs, RValue<Float> rhs) |
| 5229 | { |
| 5230 | return RValue<Bool>(Nucleus::createFCmpOEQ(lhs.value, rhs.value)); |
| 5231 | } |
| 5232 | |
| 5233 | RValue<Float> Abs(RValue<Float> x) |
| 5234 | { |
| 5235 | return IfThenElse(x > 0.0f, x, -x); |
| 5236 | } |
| 5237 | |
| 5238 | RValue<Float> Max(RValue<Float> x, RValue<Float> y) |
| 5239 | { |
| 5240 | return IfThenElse(x > y, x, y); |
| 5241 | } |
| 5242 | |
| 5243 | RValue<Float> Min(RValue<Float> x, RValue<Float> y) |
| 5244 | { |
| 5245 | return IfThenElse(x < y, x, y); |
| 5246 | } |
| 5247 | |
| 5248 | RValue<Float> Rcp_pp(RValue<Float> x, bool exactAtPow2) |
| 5249 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5250 | assert(false && "UNIMPLEMENTED"); return RValue<Float>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5251 | } |
| 5252 | |
| 5253 | RValue<Float> RcpSqrt_pp(RValue<Float> x) |
| 5254 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5255 | assert(false && "UNIMPLEMENTED"); return RValue<Float>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5256 | } |
| 5257 | |
| 5258 | RValue<Float> Sqrt(RValue<Float> x) |
| 5259 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5260 | assert(false && "UNIMPLEMENTED"); return RValue<Float>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5261 | } |
| 5262 | |
| 5263 | RValue<Float> Round(RValue<Float> x) |
| 5264 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5265 | assert(false && "UNIMPLEMENTED"); return RValue<Float>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5266 | } |
| 5267 | |
| 5268 | RValue<Float> Trunc(RValue<Float> x) |
| 5269 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5270 | assert(false && "UNIMPLEMENTED"); return RValue<Float>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5271 | } |
| 5272 | |
| 5273 | RValue<Float> Frac(RValue<Float> x) |
| 5274 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5275 | assert(false && "UNIMPLEMENTED"); return RValue<Float>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5276 | } |
| 5277 | |
| 5278 | RValue<Float> Floor(RValue<Float> x) |
| 5279 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5280 | assert(false && "UNIMPLEMENTED"); return RValue<Float>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5281 | } |
| 5282 | |
| 5283 | RValue<Float> Ceil(RValue<Float> x) |
| 5284 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5285 | assert(false && "UNIMPLEMENTED"); return RValue<Float>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5286 | } |
| 5287 | |
| 5288 | Type *Float::getType() |
| 5289 | { |
Nicolas Capens | 9709d4f | 2016-09-30 11:44:14 -0400 | [diff] [blame] | 5290 | return T(Ice::IceType_f32); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5291 | } |
| 5292 | |
| 5293 | Float2::Float2(RValue<Float4> cast) |
| 5294 | { |
| 5295 | // xyzw.parent = this; |
| 5296 | |
| 5297 | Value *int64x2 = Nucleus::createBitCast(cast.value, Long2::getType()); |
Nicolas Capens | e95d534 | 2016-09-30 11:37:28 -0400 | [diff] [blame] | 5298 | Value *int64 = Nucleus::createExtractElement(int64x2, Long::getType(), 0); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5299 | Value *float2 = Nucleus::createBitCast(int64, Float2::getType()); |
| 5300 | |
| 5301 | storeValue(float2); |
| 5302 | } |
| 5303 | |
| 5304 | Type *Float2::getType() |
| 5305 | { |
| 5306 | assert(false && "UNIMPLEMENTED"); return nullptr; |
| 5307 | } |
| 5308 | |
| 5309 | Float4::Float4(RValue<Byte4> cast) |
| 5310 | { |
| 5311 | xyzw.parent = this; |
| 5312 | |
| 5313 | assert(false && "UNIMPLEMENTED"); |
| 5314 | } |
| 5315 | |
| 5316 | Float4::Float4(RValue<SByte4> cast) |
| 5317 | { |
| 5318 | xyzw.parent = this; |
| 5319 | |
| 5320 | assert(false && "UNIMPLEMENTED"); |
| 5321 | } |
| 5322 | |
| 5323 | Float4::Float4(RValue<Short4> cast) |
| 5324 | { |
| 5325 | xyzw.parent = this; |
| 5326 | |
| 5327 | Int4 c(cast); |
| 5328 | storeValue(Nucleus::createSIToFP(RValue<Int4>(c).value, Float4::getType())); |
| 5329 | } |
| 5330 | |
| 5331 | Float4::Float4(RValue<UShort4> cast) |
| 5332 | { |
| 5333 | xyzw.parent = this; |
| 5334 | |
| 5335 | Int4 c(cast); |
| 5336 | storeValue(Nucleus::createSIToFP(RValue<Int4>(c).value, Float4::getType())); |
| 5337 | } |
| 5338 | |
| 5339 | Float4::Float4(RValue<Int4> cast) |
| 5340 | { |
| 5341 | xyzw.parent = this; |
| 5342 | |
| 5343 | Value *xyzw = Nucleus::createSIToFP(cast.value, Float4::getType()); |
| 5344 | |
| 5345 | storeValue(xyzw); |
| 5346 | } |
| 5347 | |
| 5348 | Float4::Float4(RValue<UInt4> cast) |
| 5349 | { |
| 5350 | xyzw.parent = this; |
| 5351 | |
| 5352 | Value *xyzw = Nucleus::createUIToFP(cast.value, Float4::getType()); |
| 5353 | |
| 5354 | storeValue(xyzw); |
| 5355 | } |
| 5356 | |
| 5357 | Float4::Float4() |
| 5358 | { |
| 5359 | xyzw.parent = this; |
| 5360 | } |
| 5361 | |
| 5362 | Float4::Float4(float xyzw) |
| 5363 | { |
| 5364 | constant(xyzw, xyzw, xyzw, xyzw); |
| 5365 | } |
| 5366 | |
| 5367 | Float4::Float4(float x, float yzw) |
| 5368 | { |
| 5369 | constant(x, yzw, yzw, yzw); |
| 5370 | } |
| 5371 | |
| 5372 | Float4::Float4(float x, float y, float zw) |
| 5373 | { |
| 5374 | constant(x, y, zw, zw); |
| 5375 | } |
| 5376 | |
| 5377 | Float4::Float4(float x, float y, float z, float w) |
| 5378 | { |
| 5379 | constant(x, y, z, w); |
| 5380 | } |
| 5381 | |
| 5382 | void Float4::constant(float x, float y, float z, float w) |
| 5383 | { |
| 5384 | xyzw.parent = this; |
| 5385 | |
| 5386 | Constant *constantVector[4]; |
| 5387 | constantVector[0] = Nucleus::createConstantFloat(x); |
| 5388 | constantVector[1] = Nucleus::createConstantFloat(y); |
| 5389 | constantVector[2] = Nucleus::createConstantFloat(z); |
| 5390 | constantVector[3] = Nucleus::createConstantFloat(w); |
| 5391 | |
| 5392 | storeValue(Nucleus::createConstantVector(constantVector, 4)); |
| 5393 | } |
| 5394 | |
| 5395 | Float4::Float4(RValue<Float4> rhs) |
| 5396 | { |
| 5397 | xyzw.parent = this; |
| 5398 | |
| 5399 | storeValue(rhs.value); |
| 5400 | } |
| 5401 | |
| 5402 | Float4::Float4(const Float4 &rhs) |
| 5403 | { |
| 5404 | xyzw.parent = this; |
| 5405 | |
| 5406 | Value *value = rhs.loadValue(); |
| 5407 | storeValue(value); |
| 5408 | } |
| 5409 | |
| 5410 | Float4::Float4(const Reference<Float4> &rhs) |
| 5411 | { |
| 5412 | xyzw.parent = this; |
| 5413 | |
| 5414 | Value *value = rhs.loadValue(); |
| 5415 | storeValue(value); |
| 5416 | } |
| 5417 | |
| 5418 | Float4::Float4(RValue<Float> rhs) |
| 5419 | { |
| 5420 | xyzw.parent = this; |
| 5421 | |
| 5422 | assert(false && "UNIMPLEMENTED"); |
| 5423 | } |
| 5424 | |
| 5425 | Float4::Float4(const Float &rhs) |
| 5426 | { |
| 5427 | xyzw.parent = this; |
| 5428 | |
| 5429 | *this = RValue<Float>(rhs.loadValue()); |
| 5430 | } |
| 5431 | |
| 5432 | Float4::Float4(const Reference<Float> &rhs) |
| 5433 | { |
| 5434 | xyzw.parent = this; |
| 5435 | |
| 5436 | *this = RValue<Float>(rhs.loadValue()); |
| 5437 | } |
| 5438 | |
| 5439 | RValue<Float4> Float4::operator=(float x) const |
| 5440 | { |
| 5441 | return *this = Float4(x, x, x, x); |
| 5442 | } |
| 5443 | |
| 5444 | RValue<Float4> Float4::operator=(RValue<Float4> rhs) const |
| 5445 | { |
| 5446 | storeValue(rhs.value); |
| 5447 | |
| 5448 | return rhs; |
| 5449 | } |
| 5450 | |
| 5451 | RValue<Float4> Float4::operator=(const Float4 &rhs) const |
| 5452 | { |
| 5453 | Value *value = rhs.loadValue(); |
| 5454 | storeValue(value); |
| 5455 | |
| 5456 | return RValue<Float4>(value); |
| 5457 | } |
| 5458 | |
| 5459 | RValue<Float4> Float4::operator=(const Reference<Float4> &rhs) const |
| 5460 | { |
| 5461 | Value *value = rhs.loadValue(); |
| 5462 | storeValue(value); |
| 5463 | |
| 5464 | return RValue<Float4>(value); |
| 5465 | } |
| 5466 | |
| 5467 | RValue<Float4> Float4::operator=(RValue<Float> rhs) const |
| 5468 | { |
| 5469 | return *this = Float4(rhs); |
| 5470 | } |
| 5471 | |
| 5472 | RValue<Float4> Float4::operator=(const Float &rhs) const |
| 5473 | { |
| 5474 | return *this = Float4(rhs); |
| 5475 | } |
| 5476 | |
| 5477 | RValue<Float4> Float4::operator=(const Reference<Float> &rhs) const |
| 5478 | { |
| 5479 | return *this = Float4(rhs); |
| 5480 | } |
| 5481 | |
| 5482 | RValue<Float4> operator+(RValue<Float4> lhs, RValue<Float4> rhs) |
| 5483 | { |
| 5484 | return RValue<Float4>(Nucleus::createFAdd(lhs.value, rhs.value)); |
| 5485 | } |
| 5486 | |
| 5487 | RValue<Float4> operator-(RValue<Float4> lhs, RValue<Float4> rhs) |
| 5488 | { |
| 5489 | return RValue<Float4>(Nucleus::createFSub(lhs.value, rhs.value)); |
| 5490 | } |
| 5491 | |
| 5492 | RValue<Float4> operator*(RValue<Float4> lhs, RValue<Float4> rhs) |
| 5493 | { |
| 5494 | return RValue<Float4>(Nucleus::createFMul(lhs.value, rhs.value)); |
| 5495 | } |
| 5496 | |
| 5497 | RValue<Float4> operator/(RValue<Float4> lhs, RValue<Float4> rhs) |
| 5498 | { |
| 5499 | return RValue<Float4>(Nucleus::createFDiv(lhs.value, rhs.value)); |
| 5500 | } |
| 5501 | |
| 5502 | RValue<Float4> operator%(RValue<Float4> lhs, RValue<Float4> rhs) |
| 5503 | { |
| 5504 | return RValue<Float4>(Nucleus::createFRem(lhs.value, rhs.value)); |
| 5505 | } |
| 5506 | |
| 5507 | RValue<Float4> operator+=(const Float4 &lhs, RValue<Float4> rhs) |
| 5508 | { |
| 5509 | return lhs = lhs + rhs; |
| 5510 | } |
| 5511 | |
| 5512 | RValue<Float4> operator-=(const Float4 &lhs, RValue<Float4> rhs) |
| 5513 | { |
| 5514 | return lhs = lhs - rhs; |
| 5515 | } |
| 5516 | |
| 5517 | RValue<Float4> operator*=(const Float4 &lhs, RValue<Float4> rhs) |
| 5518 | { |
| 5519 | return lhs = lhs * rhs; |
| 5520 | } |
| 5521 | |
| 5522 | RValue<Float4> operator/=(const Float4 &lhs, RValue<Float4> rhs) |
| 5523 | { |
| 5524 | return lhs = lhs / rhs; |
| 5525 | } |
| 5526 | |
| 5527 | RValue<Float4> operator%=(const Float4 &lhs, RValue<Float4> rhs) |
| 5528 | { |
| 5529 | return lhs = lhs % rhs; |
| 5530 | } |
| 5531 | |
| 5532 | RValue<Float4> operator+(RValue<Float4> val) |
| 5533 | { |
| 5534 | return val; |
| 5535 | } |
| 5536 | |
| 5537 | RValue<Float4> operator-(RValue<Float4> val) |
| 5538 | { |
| 5539 | return RValue<Float4>(Nucleus::createFNeg(val.value)); |
| 5540 | } |
| 5541 | |
| 5542 | RValue<Float4> Abs(RValue<Float4> x) |
| 5543 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5544 | assert(false && "UNIMPLEMENTED"); return RValue<Float4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5545 | } |
| 5546 | |
| 5547 | RValue<Float4> Max(RValue<Float4> x, RValue<Float4> y) |
| 5548 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5549 | assert(false && "UNIMPLEMENTED"); return RValue<Float4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5550 | } |
| 5551 | |
| 5552 | RValue<Float4> Min(RValue<Float4> x, RValue<Float4> y) |
| 5553 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5554 | assert(false && "UNIMPLEMENTED"); return RValue<Float4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5555 | } |
| 5556 | |
| 5557 | RValue<Float4> Rcp_pp(RValue<Float4> x, bool exactAtPow2) |
| 5558 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5559 | assert(false && "UNIMPLEMENTED"); return RValue<Float4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5560 | } |
| 5561 | |
| 5562 | RValue<Float4> RcpSqrt_pp(RValue<Float4> x) |
| 5563 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5564 | assert(false && "UNIMPLEMENTED"); return RValue<Float4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5565 | } |
| 5566 | |
| 5567 | RValue<Float4> Sqrt(RValue<Float4> x) |
| 5568 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5569 | assert(false && "UNIMPLEMENTED"); return RValue<Float4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5570 | } |
| 5571 | |
| 5572 | RValue<Float4> Insert(const Float4 &val, RValue<Float> element, int i) |
| 5573 | { |
| 5574 | Value *value = val.loadValue(); |
| 5575 | Value *insert = Nucleus::createInsertElement(value, element.value, i); |
| 5576 | |
| 5577 | val = RValue<Float4>(insert); |
| 5578 | |
| 5579 | return val; |
| 5580 | } |
| 5581 | |
| 5582 | RValue<Float> Extract(RValue<Float4> x, int i) |
| 5583 | { |
Nicolas Capens | e95d534 | 2016-09-30 11:37:28 -0400 | [diff] [blame] | 5584 | return RValue<Float>(Nucleus::createExtractElement(x.value, Float::getType(), i)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5585 | } |
| 5586 | |
| 5587 | RValue<Float4> Swizzle(RValue<Float4> x, unsigned char select) |
| 5588 | { |
Nicolas Capens | e95d534 | 2016-09-30 11:37:28 -0400 | [diff] [blame] | 5589 | return RValue<Float4>(createSwizzle4(x.value, select)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5590 | } |
| 5591 | |
| 5592 | RValue<Float4> ShuffleLowHigh(RValue<Float4> x, RValue<Float4> y, unsigned char imm) |
| 5593 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5594 | assert(false && "UNIMPLEMENTED"); return RValue<Float4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5595 | } |
| 5596 | |
| 5597 | RValue<Float4> UnpackLow(RValue<Float4> x, RValue<Float4> y) |
| 5598 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5599 | assert(false && "UNIMPLEMENTED"); return RValue<Float4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5600 | } |
| 5601 | |
| 5602 | RValue<Float4> UnpackHigh(RValue<Float4> x, RValue<Float4> y) |
| 5603 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5604 | assert(false && "UNIMPLEMENTED"); return RValue<Float4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5605 | } |
| 5606 | |
| 5607 | RValue<Float4> Mask(Float4 &lhs, RValue<Float4> rhs, unsigned char select) |
| 5608 | { |
| 5609 | Value *vector = lhs.loadValue(); |
Nicolas Capens | e95d534 | 2016-09-30 11:37:28 -0400 | [diff] [blame] | 5610 | Value *shuffle = createMask4(vector, rhs.value, select); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5611 | lhs.storeValue(shuffle); |
| 5612 | |
| 5613 | return RValue<Float4>(shuffle); |
| 5614 | } |
| 5615 | |
| 5616 | RValue<Int> SignMask(RValue<Float4> x) |
| 5617 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5618 | assert(false && "UNIMPLEMENTED"); return RValue<Int>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5619 | } |
| 5620 | |
| 5621 | RValue<Int4> CmpEQ(RValue<Float4> x, RValue<Float4> y) |
| 5622 | { |
| 5623 | return RValue<Int4>(Nucleus::createSExt(Nucleus::createFCmpOEQ(x.value, y.value), Int4::getType())); |
| 5624 | } |
| 5625 | |
| 5626 | RValue<Int4> CmpLT(RValue<Float4> x, RValue<Float4> y) |
| 5627 | { |
| 5628 | return RValue<Int4>(Nucleus::createSExt(Nucleus::createFCmpOLT(x.value, y.value), Int4::getType())); |
| 5629 | } |
| 5630 | |
| 5631 | RValue<Int4> CmpLE(RValue<Float4> x, RValue<Float4> y) |
| 5632 | { |
| 5633 | return RValue<Int4>(Nucleus::createSExt(Nucleus::createFCmpOLE(x.value, y.value), Int4::getType())); |
| 5634 | } |
| 5635 | |
| 5636 | RValue<Int4> CmpNEQ(RValue<Float4> x, RValue<Float4> y) |
| 5637 | { |
| 5638 | return RValue<Int4>(Nucleus::createSExt(Nucleus::createFCmpONE(x.value, y.value), Int4::getType())); |
| 5639 | } |
| 5640 | |
| 5641 | RValue<Int4> CmpNLT(RValue<Float4> x, RValue<Float4> y) |
| 5642 | { |
| 5643 | return RValue<Int4>(Nucleus::createSExt(Nucleus::createFCmpOGE(x.value, y.value), Int4::getType())); |
| 5644 | } |
| 5645 | |
| 5646 | RValue<Int4> CmpNLE(RValue<Float4> x, RValue<Float4> y) |
| 5647 | { |
| 5648 | return RValue<Int4>(Nucleus::createSExt(Nucleus::createFCmpOGT(x.value, y.value), Int4::getType())); |
| 5649 | } |
| 5650 | |
| 5651 | RValue<Float4> Round(RValue<Float4> x) |
| 5652 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5653 | assert(false && "UNIMPLEMENTED"); return RValue<Float4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5654 | } |
| 5655 | |
| 5656 | RValue<Float4> Trunc(RValue<Float4> x) |
| 5657 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5658 | assert(false && "UNIMPLEMENTED"); return RValue<Float4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5659 | } |
| 5660 | |
| 5661 | RValue<Float4> Frac(RValue<Float4> x) |
| 5662 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5663 | assert(false && "UNIMPLEMENTED"); return RValue<Float4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5664 | } |
| 5665 | |
| 5666 | RValue<Float4> Floor(RValue<Float4> x) |
| 5667 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5668 | assert(false && "UNIMPLEMENTED"); return RValue<Float4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5669 | } |
| 5670 | |
| 5671 | RValue<Float4> Ceil(RValue<Float4> x) |
| 5672 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5673 | assert(false && "UNIMPLEMENTED"); return RValue<Float4>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5674 | } |
| 5675 | |
| 5676 | Type *Float4::getType() |
| 5677 | { |
Nicolas Capens | 9709d4f | 2016-09-30 11:44:14 -0400 | [diff] [blame] | 5678 | return T(Ice::IceType_v4f32); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5679 | } |
| 5680 | |
| 5681 | RValue<Pointer<Byte>> operator+(RValue<Pointer<Byte>> lhs, int offset) |
| 5682 | { |
Nicolas Capens | 8820f64 | 2016-09-30 04:42:43 -0400 | [diff] [blame] | 5683 | return lhs + RValue<Int>(Nucleus::createConstantInt(offset)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5684 | } |
| 5685 | |
| 5686 | RValue<Pointer<Byte>> operator+(RValue<Pointer<Byte>> lhs, RValue<Int> offset) |
| 5687 | { |
Nicolas Capens | 6d73871 | 2016-09-30 04:15:22 -0400 | [diff] [blame] | 5688 | return RValue<Pointer<Byte>>(Nucleus::createGEP(lhs.value, Byte::getType(), offset.value)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5689 | } |
| 5690 | |
| 5691 | RValue<Pointer<Byte>> operator+(RValue<Pointer<Byte>> lhs, RValue<UInt> offset) |
| 5692 | { |
Nicolas Capens | 6d73871 | 2016-09-30 04:15:22 -0400 | [diff] [blame] | 5693 | return RValue<Pointer<Byte>>(Nucleus::createGEP(lhs.value, Byte::getType(), offset.value)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5694 | } |
| 5695 | |
| 5696 | RValue<Pointer<Byte>> operator+=(const Pointer<Byte> &lhs, int offset) |
| 5697 | { |
| 5698 | return lhs = lhs + offset; |
| 5699 | } |
| 5700 | |
| 5701 | RValue<Pointer<Byte>> operator+=(const Pointer<Byte> &lhs, RValue<Int> offset) |
| 5702 | { |
| 5703 | return lhs = lhs + offset; |
| 5704 | } |
| 5705 | |
| 5706 | RValue<Pointer<Byte>> operator+=(const Pointer<Byte> &lhs, RValue<UInt> offset) |
| 5707 | { |
| 5708 | return lhs = lhs + offset; |
| 5709 | } |
| 5710 | |
| 5711 | RValue<Pointer<Byte>> operator-(RValue<Pointer<Byte>> lhs, int offset) |
| 5712 | { |
| 5713 | return lhs + -offset; |
| 5714 | } |
| 5715 | |
| 5716 | RValue<Pointer<Byte>> operator-(RValue<Pointer<Byte>> lhs, RValue<Int> offset) |
| 5717 | { |
| 5718 | return lhs + -offset; |
| 5719 | } |
| 5720 | |
| 5721 | RValue<Pointer<Byte>> operator-(RValue<Pointer<Byte>> lhs, RValue<UInt> offset) |
| 5722 | { |
| 5723 | return lhs + -offset; |
| 5724 | } |
| 5725 | |
| 5726 | RValue<Pointer<Byte>> operator-=(const Pointer<Byte> &lhs, int offset) |
| 5727 | { |
| 5728 | return lhs = lhs - offset; |
| 5729 | } |
| 5730 | |
| 5731 | RValue<Pointer<Byte>> operator-=(const Pointer<Byte> &lhs, RValue<Int> offset) |
| 5732 | { |
| 5733 | return lhs = lhs - offset; |
| 5734 | } |
| 5735 | |
| 5736 | RValue<Pointer<Byte>> operator-=(const Pointer<Byte> &lhs, RValue<UInt> offset) |
| 5737 | { |
| 5738 | return lhs = lhs - offset; |
| 5739 | } |
| 5740 | |
| 5741 | void Return() |
| 5742 | { |
| 5743 | Nucleus::createRetVoid(); |
| 5744 | Nucleus::setInsertBlock(Nucleus::createBasicBlock()); |
| 5745 | Nucleus::createUnreachable(); |
| 5746 | } |
| 5747 | |
| 5748 | void Return(bool ret) |
| 5749 | { |
| 5750 | Ice::Operand *Ret = Ice::ConstantInteger32::create(::context, Ice::IceType_i32, ret ? 1 : 0); |
| 5751 | Ice::InstRet *retu = Ice::InstRet::create(::function, Ret); |
| 5752 | ::basicBlock->appendInst(retu); |
| 5753 | } |
| 5754 | |
| 5755 | void Return(const Int &ret) |
| 5756 | { |
| 5757 | Ice::InstRet *retu = Ice::InstRet::create(::function, ret.loadValue()); |
| 5758 | ::basicBlock->appendInst(retu); |
| 5759 | } |
| 5760 | |
| 5761 | BasicBlock *beginLoop() |
| 5762 | { |
| 5763 | BasicBlock *loopBB = Nucleus::createBasicBlock(); |
| 5764 | |
| 5765 | Nucleus::createBr(loopBB); |
| 5766 | Nucleus::setInsertBlock(loopBB); |
| 5767 | |
| 5768 | return loopBB; |
| 5769 | } |
| 5770 | |
| 5771 | bool branch(RValue<Bool> cmp, BasicBlock *bodyBB, BasicBlock *endBB) |
| 5772 | { |
| 5773 | Nucleus::createCondBr(cmp.value, bodyBB, endBB); |
| 5774 | Nucleus::setInsertBlock(bodyBB); |
| 5775 | |
| 5776 | return true; |
| 5777 | } |
| 5778 | |
| 5779 | bool elseBlock(BasicBlock *falseBB) |
| 5780 | { |
| 5781 | Nucleus::setInsertBlock(falseBB); |
| 5782 | |
| 5783 | return true; |
| 5784 | } |
| 5785 | |
| 5786 | RValue<Long> Ticks() |
| 5787 | { |
Nicolas Capens | c37252c | 2016-09-28 16:11:54 -0400 | [diff] [blame] | 5788 | assert(false && "UNIMPLEMENTED"); return RValue<Long>(V(nullptr)); |
Nicolas Capens | 598f8d8 | 2016-09-26 15:09:10 -0400 | [diff] [blame] | 5789 | } |
| 5790 | } |
| 5791 | |