Lines Matching defs:Nucleus
15 #include "Nucleus.hpp"
67 RoutineManager *Nucleus::routineManager = 0;
68 ExecutionEngine *Nucleus::executionEngine = 0;
69 Builder *Nucleus::builder = 0;
70 LLVMContext *Nucleus::context = 0;
71 Module *Nucleus::module = 0;
72 llvm::Function *Nucleus::function = 0;
73 BackoffLock Nucleus::codegenMutex;
79 Nucleus::Nucleus()
131 Nucleus::~Nucleus()
143 Routine *Nucleus::acquireRoutine(const wchar_t *name, bool runOptimizations)
189 void Nucleus::optimize()
227 void Nucleus::setFunction(llvm::Function *function)
229 Nucleus::function = function;
234 Module *Nucleus::getModule()
239 llvm::Function *Nucleus::getFunction()
244 llvm::LLVMContext *Nucleus::getContext()
249 Value *Nucleus::allocateStackVariable(Type *type, int arraySize)
259 declaration = new AllocaInst(type, Nucleus::createConstantInt(arraySize));
271 BasicBlock *Nucleus::createBasicBlock()
273 return BasicBlock::Create(*context, "", Nucleus::getFunction());
276 BasicBlock *Nucleus::getInsertBlock()
281 void Nucleus::setInsertBlock(BasicBlock *basicBlock)
287 BasicBlock *Nucleus::getPredecessor(BasicBlock *basicBlock)
292 llvm::Function *Nucleus::createFunction(llvm::Type *ReturnType, std::vector<llvm::Type*> &Params)
295 llvm::Function *function = llvm::Function::Create(functionType, llvm::GlobalValue::InternalLinkage, "", Nucleus::getModule());
301 llvm::Value *Nucleus::getArgument(llvm::Function *function, unsigned int index)
314 Value *Nucleus::createRetVoid()
321 Value *Nucleus::createRet(Value *V)
328 Value *Nucleus::createBr(BasicBlock *dest)
333 Value *Nucleus::createCondBr(Value *cond, BasicBlock *ifTrue, BasicBlock *ifFalse)
338 Value *Nucleus::createAdd(Value *lhs, Value *rhs)
343 Value *Nucleus::createSub(Value *lhs, Value *rhs)
348 Value *Nucleus::createMul(Value *lhs, Value *rhs)
353 Value *Nucleus::createUDiv(Value *lhs, Value *rhs)
358 Value *Nucleus::createSDiv(Value *lhs, Value *rhs)
363 Value *Nucleus::createFAdd(Value *lhs, Value *rhs)
368 Value *Nucleus::createFSub(Value *lhs, Value *rhs)
373 Value *Nucleus::createFMul(Value *lhs, Value *rhs)
378 Value *Nucleus::createFDiv(Value *lhs, Value *rhs)
383 Value *Nucleus::createURem(Value *lhs, Value *rhs)
388 Value *Nucleus::createSRem(Value *lhs, Value *rhs)
393 Value *Nucleus::createFRem(Value *lhs, Value *rhs)
398 Value *Nucleus::createShl(Value *lhs, Value *rhs)
403 Value *Nucleus::createLShr(Value *lhs, Value *rhs)
408 Value *Nucleus::createAShr(Value *lhs, Value *rhs)
413 Value *Nucleus::createAnd(Value *lhs, Value *rhs)
418 Value *Nucleus::createOr(Value *lhs, Value *rhs)
423 Value *Nucleus::createXor(Value *lhs, Value *rhs)
428 Value *Nucleus::createNeg(Value *V)
433 Value *Nucleus::createFNeg(Value *V)
438 Value *Nucleus::createNot(Value *V)
443 Value *Nucleus::createLoad(Value *ptr, bool isVolatile, unsigned int align)
448 Value *Nucleus::createStore(Value *value, Value *ptr, bool isVolatile, unsigned int align)
453 Value *Nucleus::createGEP(Value *ptr, Value *index)
458 Value *Nucleus::createAtomicAdd(Value *ptr, Value *value)
463 Value *Nucleus::createTrunc(Value *V, Type *destType)
468 Value *Nucleus::createZExt(Value *V, Type *destType)
473 Value *Nucleus::createSExt(Value *V, Type *destType)
478 Value *Nucleus::createFPToUI(Value *V, Type *destType)
483 Value *Nucleus::createFPToSI(Value *V, Type *destType)
488 Value *Nucleus::createUIToFP(Value *V, Type *destType)
493 Value *Nucleus::createSIToFP(Value *V, Type *destType)
498 Value *Nucleus::createFPTrunc(Value *V, Type *destType)
503 Value *Nucleus::createFPExt(Value *V, Type *destType)
508 Value *Nucleus::createPtrToInt(Value *V, Type *destType)
513 Value *Nucleus::createIntToPtr(Value *V, Type *destType)
518 Value *Nucleus::createBitCast(Value *V, Type *destType)
523 Value *Nucleus::createIntCast(Value *V, Type *destType, bool isSigned)
528 Value *Nucleus::createICmpEQ(Value *lhs, Value *rhs)
533 Value *Nucleus::createICmpNE(Value *lhs, Value *rhs)
538 Value *Nucleus::createICmpUGT(Value *lhs, Value *rhs)
543 Value *Nucleus::createICmpUGE(Value *lhs, Value *rhs)
548 Value *Nucleus::createICmpULT(Value *lhs, Value *rhs)
553 Value *Nucleus::createICmpULE(Value *lhs, Value *rhs)
558 Value *Nucleus::createICmpSGT(Value *lhs, Value *rhs)
563 Value *Nucleus::createICmpSGE(Value *lhs, Value *rhs)
568 Value *Nucleus::createICmpSLT(Value *lhs, Value *rhs)
573 Value *Nucleus::createICmpSLE(Value *lhs, Value *rhs)
578 Value *Nucleus::createFCmpOEQ(Value *lhs, Value *rhs)
583 Value *Nucleus::createFCmpOGT(Value *lhs, Value *rhs)
588 Value *Nucleus::createFCmpOGE(Value *lhs, Value *rhs)
593 Value *Nucleus::createFCmpOLT(Value *lhs, Value *rhs)
598 Value *Nucleus::createFCmpOLE(Value *lhs, Value *rhs)
603 Value *Nucleus::createFCmpONE(Value *lhs, Value *rhs)
608 Value *Nucleus::createFCmpORD(Value *lhs, Value *rhs)
613 Value *Nucleus::createFCmpUNO(Value *lhs, Value *rhs)
618 Value *Nucleus::createFCmpUEQ(Value *lhs, Value *rhs)
623 Value *Nucleus::createFCmpUGT(Value *lhs, Value *rhs)
628 Value *Nucleus::createFCmpUGE(Value *lhs, Value *rhs)
633 Value *Nucleus::createFCmpULT(Value *lhs, Value *rhs)
638 Value *Nucleus::createFCmpULE(Value *lhs, Value *rhs)
643 Value *Nucleus::createFCmpUNE(Value *lhs, Value *rhs)
648 Value *Nucleus::createCall(Value *callee)
653 Value *Nucleus::createCall(Value *callee, Value *arg)
658 Value *Nucleus::createCall(Value *callee, Value *arg1, Value *arg2)
663 Value *Nucleus::createCall(Value *callee, Value *arg1, Value *arg2, Value *arg3)
668 Value *Nucleus::createCall(Value *callee, Value *arg1, Value *arg2, Value *arg3, Value *arg4)
673 Value *Nucleus::createExtractElement(Value *vector, int index)
678 Value *Nucleus::createInsertElement(Value *vector, Value *element, int index)
683 Value *Nucleus::createShuffleVector(Value *V1, Value *V2, Value *mask)
688 Value *Nucleus::createSelect(Value *C, Value *ifTrue, Value *ifFalse)
693 Value *Nucleus::createSwitch(llvm::Value *V, llvm::BasicBlock *Dest, unsigned NumCases)
698 void Nucleus::addSwitchCase(llvm::Value *Switch, int Case, llvm::BasicBlock *Branch)
700 static_cast<SwitchInst*>(Switch)->addCase(Nucleus::createConstantInt(Case), Branch);
703 Value *Nucleus::createUnreachable()
708 Value *Nucleus::createSwizzle(Value *val, unsigned char select)
711 swizzle[0] = Nucleus::createConstantInt((select >> 0) & 0x03);
712 swizzle[1] = Nucleus::createConstantInt((select >> 2) & 0x03);
713 swizzle[2] = Nucleus::createConstantInt((select >> 4) & 0x03);
714 swizzle[3] = Nucleus::createConstantInt((select >> 6) & 0x03);
716 Value *shuffle = Nucleus::createShuffleVector(val, UndefValue::get(val->getType()), Nucleus::createConstantVector(swizzle, 4));
721 Value *Nucleus::createMask(Value *lhs, Value *rhs, unsigned char select)
731 swizzle[0] = Nucleus::createConstantInt(mask[0] ? 4 : 0);
732 swizzle[1] = Nucleus::createConstantInt(mask[1] ? 5 : 1);
733 swizzle[2] = Nucleus::createConstantInt(mask[2] ? 6 : 2);
734 swizzle[3] = Nucleus::createConstantInt(mask[3] ? 7 : 3);
736 Value *shuffle = Nucleus::createShuffleVector(lhs, rhs, Nucleus::createConstantVector(swizzle, 4));
741 const llvm::GlobalValue *Nucleus::getGlobalValueAtAddress(void *Addr)
746 void Nucleus::addGlobalMapping(const llvm::GlobalValue *GV, void *Addr)
751 llvm::GlobalValue *Nucleus::createGlobalValue(llvm::Type *Ty, bool isConstant, unsigned int Align)
753 llvm::GlobalValue *global = new llvm::GlobalVariable(*Nucleus::getModule(), Ty, isConstant, llvm::GlobalValue::ExternalLinkage, 0, "");
759 llvm::Type *Nucleus::getPointerType(llvm::Type *ElementType)
764 llvm::Constant *Nucleus::createNullValue(llvm::Type *Ty)
769 llvm::ConstantInt *Nucleus::createConstantInt(int64_t i)
774 llvm::ConstantInt *Nucleus::createConstantInt(int i)
779 llvm::ConstantInt *Nucleus::createConstantInt(unsigned int i)
784 llvm::ConstantInt *Nucleus::createConstantBool(bool b)
789 llvm::ConstantInt *Nucleus::createConstantByte(signed char i)
794 llvm::ConstantInt *Nucleus::createConstantByte(unsigned char i)
799 llvm::ConstantInt *Nucleus::createConstantShort(short i)
804 llvm::ConstantInt *Nucleus::createConstantShort(unsigned short i)
809 llvm::Constant *Nucleus::createConstantFloat(float x)
814 llvm::Value *Nucleus::createNullPointer(llvm::Type *Ty)
819 llvm::Value *Nucleus::createConstantVector(llvm::Constant *const *Vals, unsigned NumVals)
826 return Type::getVoidTy(*Nucleus::getContext());
831 address = Nucleus::allocateStackVariable(type, arraySize);
836 return Nucleus::createLoad(address, false, alignment);
841 return Nucleus::createStore(value, address, false, alignment);
846 return Nucleus::createGEP(address, index);
851 return Type::getX86_MMXTy(*Nucleus::getContext());
865 storeValue(Nucleus::createConstantBool(x));
910 return RValue<Bool>(Nucleus::createNot(val.value));
915 return RValue<Bool>(Nucleus::createAnd(lhs.value, rhs.value));
920 return RValue<Bool>(Nucleus::createOr(lhs.value, rhs.value));
925 return Type::getInt1Ty(*Nucleus::getContext());
935 Value *integer = Nucleus::createTrunc(cast.value, Byte::getType());
942 Value *integer = Nucleus::createTrunc(cast.value, Byte::getType());
949 Value *integer = Nucleus::createTrunc(cast.value, Byte::getType());
960 storeValue(Nucleus::createConstantByte((unsigned char)x));
965 storeValue(Nucleus::createConstantByte(x));
1010 return RValue<Byte>(Nucleus::createAdd(lhs.value, rhs.value));
1015 return RValue<Byte>(Nucleus::createSub(lhs.value, rhs.value));
1020 return RValue<Byte>(Nucleus::createMul(lhs.value, rhs.value));
1025 return RValue<Byte>(Nucleus::createUDiv(lhs.value, rhs.value));
1030 return RValue<Byte>(Nucleus::createURem(lhs.value, rhs.value));
1035 return RValue<Byte>(Nucleus::createAnd(lhs.value, rhs.value));
1040 return RValue<Byte>(Nucleus::createOr(lhs.value, rhs.value));
1045 return RValue<Byte>(Nucleus::createXor(lhs.value, rhs.value));
1050 return RValue<Byte>(Nucleus::createShl(lhs.value, rhs.value));
1055 return RValue<Byte>(Nucleus::createLShr(lhs.value, rhs.value));
1115 return RValue<Byte>(Nucleus::createNeg(val.value));
1120 return RValue<Byte>(Nucleus::createNot(val.value));
1127 Value *inc = Nucleus::createAdd(res.value, Nucleus::createConstantByte((unsigned char)1));
1135 Value *inc = Nucleus::createAdd(val.loadValue(), Nucleus::createConstantByte((unsigned char)1));
1145 Value *inc = Nucleus::createSub(res.value, Nucleus::createConstantByte((unsigned char)1));
1153 Value *inc = Nucleus::createSub(val.loadValue(), Nucleus::createConstantByte((unsigned char)1));
1161 return RValue<Bool>(Nucleus::createICmpULT(lhs.value, rhs.value));
1166 return RValue<Bool>(Nucleus::createICmpULE(lhs.value, rhs.value));
1171 return RValue<Bool>(Nucleus::createICmpUGT(lhs.value, rhs.value));
1176 return RValue<Bool>(Nucleus::createICmpUGE(lhs.value, rhs.value));
1181 return RValue<Bool>(Nucleus::createICmpNE(lhs.value, rhs.value));
1186 return RValue<Bool>(Nucleus::createICmpEQ(lhs.value, rhs.value));
1191 return Type::getInt8Ty(*Nucleus::getContext());
1201 Value *integer = Nucleus::createTrunc(cast.value, SByte::getType());
1208 Value *integer = Nucleus::createTrunc(cast.value, SByte::getType());
1219 storeValue(Nucleus::createConstantByte(x));
1264 return RValue<SByte>(Nucleus::createAdd(lhs.value, rhs.value));
1269 return RValue<SByte>(Nucleus::createSub(lhs.value, rhs.value));
1274 return RValue<SByte>(Nucleus::createMul(lhs.value, rhs.value));
1279 return RValue<SByte>(Nucleus::createSDiv(lhs.value, rhs.value));
1284 return RValue<SByte>(Nucleus::createSRem(lhs.value, rhs.value));
1289 return RValue<SByte>(Nucleus::createAnd(lhs.value, rhs.value));
1294 return RValue<SByte>(Nucleus::createOr(lhs.value, rhs.value));
1299 return RValue<SByte>(Nucleus::createXor(lhs.value, rhs.value));
1304 return RValue<SByte>(Nucleus::createShl(lhs.value, rhs.value));
1309 return RValue<SByte>(Nucleus::createAShr(lhs.value, rhs.value));
1369 return RValue<SByte>(Nucleus::createNeg(val.value));
1374 return RValue<SByte>(Nucleus::createNot(val.value));
1381 Value *inc = Nucleus::createAdd(res.value, Nucleus::createConstantByte((signed char)1));
1389 Value *inc = Nucleus::createAdd(val.loadValue(), Nucleus::createConstantByte((signed char)1));
1399 Value *inc = Nucleus::createSub(res.value, Nucleus::createConstantByte((signed char)1));
1407 Value *inc = Nucleus::createSub(val.loadValue(), Nucleus::createConstantByte((signed char)1));
1415 return RValue<Bool>(Nucleus::createICmpSLT(lhs.value, rhs.value));
1420 return RValue<Bool>(Nucleus::createICmpSLE(lhs.value, rhs.value));
1425 return RValue<Bool>(Nucleus::createICmpSGT(lhs.value, rhs.value));
1430 return RValue<Bool>(Nucleus::createICmpSGE(lhs.value, rhs.value));
1435 return RValue<Bool>(Nucleus::createICmpNE(lhs.value, rhs.value));
1440 return RValue<Bool>(Nucleus::createICmpEQ(lhs.value, rhs.value));
1445 return Type::getInt8Ty(*Nucleus::getContext());
1455 Value *integer = Nucleus::createTrunc(cast.value, Short::getType());
1466 storeValue(Nucleus::createConstantShort(x));
1511 return RValue<Short>(Nucleus::createAdd(lhs.value, rhs.value));
1516 return RValue<Short>(Nucleus::createSub(lhs.value, rhs.value));
1521 return RValue<Short>(Nucleus::createMul(lhs.value, rhs.value));
1526 return RValue<Short>(Nucleus::createSDiv(lhs.value, rhs.value));
1531 return RValue<Short>(Nucleus::createSRem(lhs.value, rhs.value));
1536 return RValue<Short>(Nucleus::createAnd(lhs.value, rhs.value));
1541 return RValue<Short>(Nucleus::createOr(lhs.value, rhs.value));
1546 return RValue<Short>(Nucleus::createXor(lhs.value, rhs.value));
1551 return RValue<Short>(Nucleus::createShl(lhs.value, rhs.value));
1556 return RValue<Short>(Nucleus::createAShr(lhs.value, rhs.value));
1616 return RValue<Short>(Nucleus::createNeg(val.value));
1621 return RValue<Short>(Nucleus::createNot(val.value));
1628 Value *inc = Nucleus::createAdd(res.value, Nucleus::createConstantShort((short)1));
1636 Value *inc = Nucleus::createAdd(val.loadValue(), Nucleus::createConstantShort((short)1));
1646 Value *inc = Nucleus::createSub(res.value, Nucleus::createConstantShort((short)1));
1654 Value *inc = Nucleus::createSub(val.loadValue(), Nucleus::createConstantShort((short)1));
1662 return RValue<Bool>(Nucleus::createICmpSLT(lhs.value, rhs.value));
1667 return RValue<Bool>(Nucleus::createICmpSLE(lhs.value, rhs.value));
1672 return RValue<Bool>(Nucleus::createICmpSGT(lhs.value, rhs.value));
1677 return RValue<Bool>(Nucleus::createICmpSGE(lhs.value, rhs.value));
1682 return RValue<Bool>(Nucleus::createICmpNE(lhs.value, rhs.value));
1687 return RValue<Bool>(Nucleus::createICmpEQ(lhs.value, rhs.value));
1692 return Type::getInt16Ty(*Nucleus::getContext());
1702 Value *integer = Nucleus::createTrunc(cast.value, UShort::getType());
1709 Value *integer = Nucleus::createTrunc(cast.value, UShort::getType());
1720 storeValue(Nucleus::createConstantShort(x));
1765 return RValue<UShort>(Nucleus::createAdd(lhs.value, rhs.value));
1770 return RValue<UShort>(Nucleus::createSub(lhs.value, rhs.value));
1775 return RValue<UShort>(Nucleus::createMul(lhs.value, rhs.value));
1780 return RValue<UShort>(Nucleus::createUDiv(lhs.value, rhs.value));
1785 return RValue<UShort>(Nucleus::createURem(lhs.value, rhs.value));
1790 return RValue<UShort>(Nucleus::createAnd(lhs.value, rhs.value));
1795 return RValue<UShort>(Nucleus::createOr(lhs.value, rhs.value));
1800 return RValue<UShort>(Nucleus::createXor(lhs.value, rhs.value));
1805 return RValue<UShort>(Nucleus::createShl(lhs.value, rhs.value));
1810 return RValue<UShort>(Nucleus::createLShr(lhs.value, rhs.value));
1870 return RValue<UShort>(Nucleus::createNeg(val.value));
1875 return RValue<UShort>(Nucleus::createNot(val.value));
1882 Value *inc = Nucleus::createAdd(res.value, Nucleus::createConstantShort((unsigned short)1));
1890 Value *inc = Nucleus::createAdd(val.loadValue(), Nucleus::createConstantShort((unsigned short)1));
1900 Value *inc = Nucleus::createSub(res.value, Nucleus::createConstantShort((unsigned short)1));
1908 Value *inc = Nucleus::createSub(val.loadValue(), Nucleus::createConstantShort((unsigned short)1));
1916 return RValue<Bool>(Nucleus::createICmpULT(lhs.value, rhs.value));
1921 return RValue<Bool>(Nucleus::createICmpULE(lhs.value, rhs.value));
1926 return RValue<Bool>(Nucleus::createICmpUGT(lhs.value, rhs.value));
1931 return RValue<Bool>(Nucleus::createICmpUGE(lhs.value, rhs.value));
1936 return RValue<Bool>(Nucleus::createICmpNE(lhs.value, rhs.value));
1941 return RValue<Bool>(Nucleus::createICmpEQ(lhs.value, rhs.value));
1946 return Type::getInt16Ty(*Nucleus::getContext());
1977 constantVector[0] = Nucleus::createConstantByte(x0);
1978 constantVector[1] = Nucleus::createConstantByte(x1);
1979 constantVector[2] = Nucleus::createConstantByte(x2);
1980 constantVector[3] = Nucleus::createConstantByte(x3);
1981 constantVector[4] = Nucleus::createConstantByte(x4);
1982 constantVector[5] = Nucleus::createConstantByte(x5);
1983 constantVector[6] = Nucleus::createConstantByte(x6);
1984 constantVector[7] = Nucleus::createConstantByte(x7);
1985 Value *vector = Nucleus::createConstantVector(constantVector, 8);
1987 storeValue(Nucleus::createBitCast(vector, getType()));
1995 constantVector[0] = Nucleus::createConstantByte((unsigned char)(x >> 0));
1996 constantVector[1] = Nucleus::createConstantByte((unsigned char)(x >> 8));
1997 constantVector[2] = Nucleus::createConstantByte((unsigned char)(x >> 16));
1998 constantVector[3] = Nucleus::createConstantByte((unsigned char)(x >> 24));
1999 constantVector[4] = Nucleus::createConstantByte((unsigned char)(x >> 32));
2000 constantVector[5] = Nucleus::createConstantByte((unsigned char)(x >> 40));
2001 constantVector[6] = Nucleus::createConstantByte((unsigned char)(x >> 48));
2002 constantVector[7] = Nucleus::createConstantByte((unsigned char)(x >> 56));
2003 Value *vector = Nucleus::createConstantVector(constantVector, 8);
2005 storeValue(Nucleus::createBitCast(vector, getType()));
2062 return RValue<Byte8>(Nucleus::createAdd(lhs.value, rhs.value));
2074 return RValue<Byte8>(Nucleus::createSub(lhs.value, rhs.value));
2080 // return RValue<Byte8>(Nucleus::createMul(lhs.value, rhs.value));
2085 // return RValue<Byte8>(Nucleus::createUDiv(lhs.value, rhs.value));
2090 // return RValue<Byte8>(Nucleus::createURem(lhs.value, rhs.value));
2101 return RValue<Byte8>(Nucleus::createAnd(lhs.value, rhs.value));
2113 return RValue<Byte8>(Nucleus::createOr(lhs.value, rhs.value));
2125 return RValue<Byte8>(Nucleus::createXor(lhs.value, rhs.value));
2131 // return RValue<Byte8>(Nucleus::createShl(lhs.value, rhs.value));
2136 // return RValue<Byte8>(Nucleus::createLShr(lhs.value, rhs.value));
2196 // return RValue<Byte8>(Nucleus::createNeg(val.value));
2207 return RValue<Byte8>(Nucleus::createNot(val.value));
2223 Value *int2 = Nucleus::createInsertElement(UndefValue::get(VectorType::get(Int::getType(), 2)), x.value, 0);
2224 Value *byte8 = Nucleus::createBitCast(int2, Byte8::getType());
2238 shuffle[0] = Nucleus::createConstantInt(0);
2239 shuffle[1] = Nucleus::createConstantInt(8);
2240 shuffle[2] = Nucleus::createConstantInt(1);
2241 shuffle[3] = Nucleus::createConstantInt(9);
2242 shuffle[4] = Nucleus::createConstantInt(2);
2243 shuffle[5] = Nucleus::createConstantInt(10);
2244 shuffle[6] = Nucleus::createConstantInt(3);
2245 shuffle[7] = Nucleus::createConstantInt(11);
2247 Value *packed = Nucleus::createShuffleVector(x.value, y.value, Nucleus::createConstantVector(shuffle, 8));
2249 return RValue<Short4>(Nucleus::createBitCast(packed, Short4::getType()));
2262 shuffle[0] = Nucleus::createConstantInt(4);
2263 shuffle[1] = Nucleus::createConstantInt(12);
2264 shuffle[2] = Nucleus::createConstantInt(5);
2265 shuffle[3] = Nucleus::createConstantInt(13);
2266 shuffle[4] = Nucleus::createConstantInt(6);
2267 shuffle[5] = Nucleus::createConstantInt(14);
2268 shuffle[6] = Nucleus::createConstantInt(7);
2269 shuffle[7] = Nucleus::createConstantInt(15);
2271 Value *packed = Nucleus::createShuffleVector(x.value, y.value, Nucleus::createConstantVector(shuffle, 8));
2273 return RValue<Short4>(Nucleus::createBitCast(packed, Short4::getType()));
2314 constantVector[0] = Nucleus::createConstantByte(x0);
2315 constantVector[1] = Nucleus::createConstantByte(x1);
2316 constantVector[2] = Nucleus::createConstantByte(x2);
2317 constantVector[3] = Nucleus::createConstantByte(x3);
2318 constantVector[4] = Nucleus::createConstantByte(x4);
2319 constantVector[5] = Nucleus::createConstantByte(x5);
2320 constantVector[6] = Nucleus::createConstantByte(x6);
2321 constantVector[7] = Nucleus::createConstantByte(x7);
2322 Value *vector = Nucleus::createConstantVector(constantVector, 8);
2324 storeValue(Nucleus::createBitCast(vector, getType()));
2332 constantVector[0] = Nucleus::createConstantByte((unsigned char)(x >> 0));
2333 constantVector[1] = Nucleus::createConstantByte((unsigned char)(x >> 8));
2334 constantVector[2] = Nucleus::createConstantByte((unsigned char)(x >> 16));
2335 constantVector[3] = Nucleus::createConstantByte((unsigned char)(x >> 24));
2336 constantVector[4] = Nucleus::createConstantByte((unsigned char)(x >> 32));
2337 constantVector[5] = Nucleus::createConstantByte((unsigned char)(x >> 40));
2338 constantVector[6] = Nucleus::createConstantByte((unsigned char)(x >> 48));
2339 constantVector[7] = Nucleus::createConstantByte((unsigned char)(x >> 56));
2340 Value *vector = Nucleus::createConstantVector(constantVector, 8);
2342 storeValue(Nucleus::createBitCast(vector, getType()));
2399 return RValue<SByte8>(Nucleus::createAdd(lhs.value, rhs.value));
2411 return RValue<SByte8>(Nucleus::createSub(lhs.value, rhs.value));
2417 // return RValue<SByte8>(Nucleus::createMul(lhs.value, rhs.value));
2422 // return RValue<SByte8>(Nucleus::createSDiv(lhs.value, rhs.value));
2427 // return RValue<SByte8>(Nucleus::createSRem(lhs.value, rhs.value));
2432 return RValue<SByte8>(Nucleus::createAnd(lhs.value, rhs.value));
2437 return RValue<SByte8>(Nucleus::createOr(lhs.value, rhs.value));
2442 return RValue<SByte8>(Nucleus::createXor(lhs.value, rhs.value));
2447 // return RValue<SByte8>(Nucleus::createShl(lhs.value, rhs.value));
2452 // return RValue<SByte8>(Nucleus::createAShr(lhs.value, rhs.value));
2512 // return RValue<SByte8>(Nucleus::createNeg(val.value));
2523 return RValue<SByte8>(Nucleus::createNot(val.value));
2546 shuffle[0] = Nucleus::createConstantInt(0);
2547 shuffle[1] = Nucleus::createConstantInt(8);
2548 shuffle[2] = Nucleus::createConstantInt(1);
2549 shuffle[3] = Nucleus::createConstantInt(9);
2550 shuffle[4] = Nucleus::createConstantInt(2);
2551 shuffle[5] = Nucleus::createConstantInt(10);
2552 shuffle[6] = Nucleus::createConstantInt(3);
2553 shuffle[7] = Nucleus::createConstantInt(11);
2555 Value *packed = Nucleus::createShuffleVector(x.value, y.value, Nucleus::createConstantVector(shuffle, 8));
2557 return RValue<Short4>(Nucleus::createBitCast(packed, Short4::getType()));
2570 shuffle[0] = Nucleus::createConstantInt(4);
2571 shuffle[1] = Nucleus::createConstantInt(12);
2572 shuffle[2] = Nucleus::createConstantInt(5);
2573 shuffle[3] = Nucleus::createConstantInt(13);
2574 shuffle[4] = Nucleus::createConstantInt(6);
2575 shuffle[5] = Nucleus::createConstantInt(14);
2576 shuffle[6] = Nucleus::createConstantInt(7);
2577 shuffle[7] = Nucleus::createConstantInt(15);
2579 Value *packed = Nucleus::createShuffleVector(x.value, y.value, Nucleus::createConstantVector(shuffle, 8));
2581 return RValue<Short4>(Nucleus::createBitCast(packed, Short4::getType()));
2670 Value *extend = Nucleus::createZExt(cast.value, Long::getType());
2678 Value *short8 = Nucleus::createBitCast(cast.value, Short8::getType());
2682 pack[0] = Nucleus::createConstantInt(0);
2683 pack[1] = Nucleus::createConstantInt(2);
2684 pack[2] = Nucleus::createConstantInt(4);
2685 pack[3] = Nucleus::createConstantInt(6);
2687 Value *short4 = Nucleus::createShuffleVector(short8, short8, Nucleus::createConstantVector(pack, 4));
2695 pshuflw[0] = Nucleus::createConstantInt(0);
2696 pshuflw[1] = Nucleus::createConstantInt(2);
2697 pshuflw[2] = Nucleus::createConstantInt(0);
2698 pshuflw[3] = Nucleus::createConstantInt(2);
2699 pshuflw[4] = Nucleus::createConstantInt(4);
2700 pshuflw[5] = Nucleus::createConstantInt(5);
2701 pshuflw[6] = Nucleus::createConstantInt(6);
2702 pshuflw[7] = Nucleus::createConstantInt(7);
2705 pshufhw[0] = Nucleus::createConstantInt(0);
2706 pshufhw[1] = Nucleus::createConstantInt(1);
2707 pshufhw[2] = Nucleus::createConstantInt(2);
2708 pshufhw[3] = Nucleus::createConstantInt(3);
2709 pshufhw[4] = Nucleus::createConstantInt(4);
2710 pshufhw[5] = Nucleus::createConstantInt(6);
2711 pshufhw[6] = Nucleus::createConstantInt(4);
2712 pshufhw[7] = Nucleus::createConstantInt(6);
2714 Value *shuffle1 = Nucleus::createShuffleVector(short8, UndefValue::get(Short8::getType()), Nucleus::createConstantVector(pshuflw, 8));
2715 Value *shuffle2 = Nucleus::createShuffleVector(shuffle1, UndefValue::get(Short8::getType()), Nucleus::createConstantVector(pshufhw, 8));
2716 Value *int4 = Nucleus::createBitCast(shuffle2, Int4::getType());
2717 packed = Nucleus::createSwizzle(int4, 0x88);
2722 pshufb[0] = Nucleus::createConstantInt(0);
2723 pshufb[1] = Nucleus::createConstantInt(1);
2724 pshufb[2] = Nucleus::createConstantInt(4);
2725 pshufb[3] = Nucleus::createConstantInt(5);
2726 pshufb[4] = Nucleus::createConstantInt(8);
2727 pshufb[5] = Nucleus::createConstantInt(9);
2728 pshufb[6] = Nucleus::createConstantInt(12);
2729 pshufb[7] = Nucleus::createConstantInt(13);
2730 pshufb[8] = Nucleus::createConstantInt(0);
2731 pshufb[9] = Nucleus::createConstantInt(1);
2732 pshufb[10] = Nucleus::createConstantInt(4);
2733 pshufb[11] = Nucleus::createConstantInt(5);
2734 pshufb[12] = Nucleus::createConstantInt(8);
2735 pshufb[13] = Nucleus::createConstantInt(9);
2736 pshufb[14] = Nucleus::createConstantInt(12);
2737 pshufb[15] = Nucleus::createConstantInt(13);
2739 Value *byte16 = Nucleus::createBitCast(cast.value, Byte16::getType());
2740 packed = Nucleus::createShuffleVector(byte16, UndefValue::get(Byte16::getType()), Nucleus::createConstantVector(pshufb, 16));
2744 Value *qword2 = Nucleus::createBitCast(packed, Long2::getType());
2745 Value *element = Nucleus::createExtractElement(qword2, 0);
2746 Value *short4 = Nucleus::createBitCast(element, Short4::getType());
2749 Value *short4 = Nucleus::createBitCast(int2, Short4::getType());
2778 constantVector[0] = Nucleus::createConstantShort(xyzw);
2779 constantVector[1] = Nucleus::createConstantShort(xyzw);
2780 constantVector[2] = Nucleus::createConstantShort(xyzw);
2781 constantVector[3] = Nucleus
2782 Value *vector = Nucleus::createConstantVector(constantVector, 4);
2784 storeValue(Nucleus::createBitCast(vector, getType()));
2792 constantVector[0] = Nucleus::createConstantShort(x);
2793 constantVector[1] = Nucleus::createConstantShort(y);
2794 constantVector[2] = Nucleus::createConstantShort(z);
2795 constantVector[3] = Nucleus::createConstantShort(w);
2796 Value *vector = Nucleus::createConstantVector(constantVector, 4);
2798 storeValue(Nucleus::createBitCast(vector, getType()));
2899 return RValue<Short4>(Nucleus::createAdd(lhs.value, rhs.value));
2911 return RValue<Short4>(Nucleus::createSub(lhs.value, rhs.value));
2923 return RValue<Short4>(Nucleus::createMul(lhs.value, rhs.value));
2929 // return RValue<Short4>(Nucleus::createSDiv(lhs.value, rhs.value));
2934 // return RValue<Short4>(Nucleus::createSRem(lhs.value, rhs.value));
2945 return RValue<Short4>(Nucleus::createAnd(lhs.value, rhs.value));
2957 return RValue<Short4>(Nucleus::createOr(lhs.value, rhs.value));
2969 return RValue<Short4>(Nucleus::createXor(lhs.value, rhs.value));
2975 // return RValue<Short4>(Nucleus::createShl(lhs.value, rhs.value));
2982 // return RValue<Short4>(Nucleus::createAShr(lhs.value, rhs.value));
2989 // return RValue<Short4>(Nucleus::createShl(lhs.value, rhs.value));
2996 // return RValue<Short4>(Nucleus::createAShr(lhs.value, rhs.value));
3074 return RValue<Short4>(Nucleus::createNeg(val.value));
3086 return RValue<Short4>(Nucleus::createNot(val.value));
3142 shuffle[0] = Nucleus::createConstantInt(0);
3143 shuffle[1] = Nucleus::createConstantInt(4);
3144 shuffle[2] = Nucleus::createConstantInt(1);
3145 shuffle[3] = Nucleus::createConstantInt(5);
3147 Value *packed = Nucleus::createShuffleVector(x.value, y.value, Nucleus::createConstantVector(shuffle, 4));
3149 return RValue<Int2>(Nucleus::createBitCast(packed, Int2::getType()));
3162 shuffle[0] = Nucleus::createConstantInt(2);
3163 shuffle[1] = Nucleus::createConstantInt(6);
3164 shuffle[2] = Nucleus::createConstantInt(3);
3165 shuffle[3] = Nucleus::createConstantInt(7);
3167 Value *packed = Nucleus::createShuffleVector(x.value, y.value, Nucleus::createConstantVector(shuffle, 4));
3169 return RValue<Int2>(Nucleus::createBitCast(packed, Int2::getType()));
3181 return RValue<Short4>(Nucleus::createSwizzle(x.value, select));
3193 return RValue<Short4>(Nucleus::createInsertElement(val.value, element.value, i));
3205 return RValue<Short>(Nucleus::createExtractElement(val.value, i));
3278 constantVector[0] = Nucleus::createConstantShort(x);
3279 constantVector[1] = Nucleus::createConstantShort(y);
3280 constantVector[2] = Nucleus::createConstantShort(z);
3281 constantVector[3] = Nucleus::createConstantShort(w);
3282 Value *vector = Nucleus::createConstantVector(constantVector, 4);
3284 storeValue(Nucleus::createBitCast(vector, getType()));
3387 return RValue<UShort4>(Nucleus::createAdd(lhs.value, rhs.value));
3399 return RValue<UShort4>(Nucleus::createSub(lhs.value, rhs.value));
3412 return RValue<UShort4>(Nucleus::createMul(lhs.value, rhs.value));
3418 // return RValue<Short4>(Nucleus::createShl(lhs.value, rhs.value));
3425 // return RValue<Short4>(Nucleus::createLShr(lhs.value, rhs.value));
3432 // return RValue<Short4>(Nucleus::createShl(lhs.value, rhs.value));
3439 // return RValue<Short4>(Nucleus::createLShr(lhs.value, rhs.value));
3472 return RValue<UShort4>(Nucleus::createNot(val.value));
3528 constantVector[0] = Nucleus::createConstantShort(c0);
3529 constantVector[1] = Nucleus::createConstantShort(c1);
3530 constantVector[2] = Nucleus::createConstantShort(c2);
3531 constantVector[3] = Nucleus::createConstantShort(c3);
3532 constantVector[4] = Nucleus::createConstantShort(c4);
3533 constantVector[5] = Nucleus::createConstantShort(c5);
3534 constantVector[6] = Nucleus::createConstantShort(c6);
3535 constantVector[7] = Nucleus::createConstantShort(c7);
3537 storeValue(Nucleus::createConstantVector(constantVector, 8));
3549 Value *loLong = Nucleus::createBitCast(lo.value, Long::getType());
3550 Value *hiLong = Nucleus::createBitCast(hi.value, Long::getType());
3553 long2 = Nucleus::createInsertElement(long2, loLong, 0);
3554 Nucleus::createInsertElement(long2, hiLong, 1);
3555 Value *short8 = Nucleus::createBitCast(long2, Short8::getType());
3562 return RValue<Short8>(Nucleus::createAdd(lhs.value, rhs.value));
3567 return RValue<Short8>(Nucleus::createAnd(lhs.value, rhs.value));
3613 constantVector[0] = Nucleus::createConstantShort(c0);
3614 constantVector[1] = Nucleus::createConstantShort(c1);
3615 constantVector[2] = Nucleus::createConstantShort(c2);
3616 constantVector[3] = Nucleus::createConstantShort(c3);
3617 constantVector[4] = Nucleus::createConstantShort(c4);
3618 constantVector[5] = Nucleus::createConstantShort(c5);
3619 constantVector[6] = Nucleus::createConstantShort(c6);
3620 constantVector[7] = Nucleus::createConstantShort(c7);
3622 storeValue(Nucleus::createConstantVector(constantVector, 8));
3634 Value *loLong = Nucleus::createBitCast(lo.value, Long::getType());
3635 Value *hiLong = Nucleus::createBitCast(hi.value, Long::getType());
3638 long2 = Nucleus::createInsertElement(long2, loLong, 0);
3639 long2 = Nucleus::createInsertElement(long2, hiLong, 1);
3640 Value *short8 = Nucleus::createBitCast(long2, Short8::getType());
3670 return RValue<UShort8>(Nucleus::createAnd(lhs.value, rhs.value));
3685 return RValue<UShort8>(Nucleus::createAdd(lhs.value, rhs.value));
3690 return RValue<UShort8>(Nucleus::createMul(lhs.value, rhs.value));
3700 return RValue<UShort8>(Nucleus::createNot(val.value));
3706 pshufb[0] = Nucleus::createConstantInt(select0 + 0);
3707 pshufb[1] = Nucleus::createConstantInt(select0 + 1);
3708 pshufb[2] = Nucleus::createConstantInt(select1 + 0);
3709 pshufb[3] = Nucleus::createConstantInt(select1 + 1);
3710 pshufb[4] = Nucleus::createConstantInt(select2 + 0);
3711 pshufb[5] = Nucleus::createConstantInt(select2 + 1);
3712 pshufb[6] = Nucleus::createConstantInt(select3 + 0);
3713 pshufb[7] = Nucleus::createConstantInt(select3 + 1);
3714 pshufb[8] = Nucleus::createConstantInt(select4 + 0);
3715 pshufb[9] = Nucleus::createConstantInt(select4 + 1);
3716 pshufb[10] = Nucleus::createConstantInt(select5 + 0);
3717 pshufb[11] = Nucleus::createConstantInt(select5 + 1);
3718 pshufb[12] = Nucleus::createConstantInt(select6 + 0);
3719 pshufb[13] = Nucleus::createConstantInt(select6 + 1);
3720 pshufb[14] = Nucleus::createConstantInt(select7 + 0);
3721 pshufb[15] = Nucleus::createConstantInt(select7 + 1);
3723 Value *byte16 = Nucleus::createBitCast(x.value, Byte16::getType());
3724 Value *shuffle = Nucleus::createShuffleVector(byte16, UndefValue::get(Byte16::getType()), Nucleus::createConstantVector(pshufb, 16));
3725 Value *short8 = Nucleus::createBitCast(shuffle, UShort8::getType());
3739 // pshufb[0] = Nucleus::createConstantInt(element + 0);
3740 // pshufb[1] = Nucleus::createConstantInt(element + 0);
3741 // pshufb[2] = Nucleus::createConstantInt(element + 4);
3742 // pshufb[3] = Nucleus::createConstantInt(element + 4);
3743 // pshufb[4] = Nucleus::createConstantInt(element + 8);
3744 // pshufb[5] = Nucleus::createConstantInt(element + 8);
3745 // pshufb[6] = Nucleus::createConstantInt(element + 12);
3746 // pshufb[7] = Nucleus::createConstantInt(element + 12);
3747 // pshufb[8] = Nucleus::createConstantInt(element + 16);
3748 // pshufb[9] = Nucleus::createConstantInt(element + 16);
3749 // pshufb[10] = Nucleus::createConstantInt(element + 20);
3750 // pshufb[11] = Nucleus::createConstantInt(element + 20);
3751 // pshufb[12] = Nucleus::createConstantInt(element + 24);
3752 // pshufb[13] = Nucleus::createConstantInt(element + 24);
3753 // pshufb[14] = Nucleus::createConstantInt(element + 28);
3754 // pshufb[15] = Nucleus::createConstantInt(element + 28);
3756 // Value *shuffle = Nucleus::createShuffleVector(x.value, y.value, Nucleus::createConstantVector(pshufb, 16));
3757 // Value *short8 = Nucleus::createBitCast(shuffle, UShort8::getType());
3774 Value *integer = Nucleus::createZExt(cast.value, Int::getType());
3781 Value *integer = Nucleus::createSExt(cast.value, Int::getType());
3788 Value *integer = Nucleus::createSExt(cast.value, Int::getType());
3795 Value *integer = Nucleus::createZExt(cast.value, Int::getType());
3807 Value *integer = Nucleus::createTrunc(cast.value, Int::getType());
3814 Value *integer = Nucleus::createFPToSI(cast.value, Int::getType());
3825 storeValue(Nucleus::createConstantInt(x));
3864 return RValue<Int>(storeValue(Nucleus::createConstantInt(rhs)));
3915 return RValue<Int>(Nucleus::createAdd(lhs.value, rhs.value));
3920 return RValue<Int>(Nucleus::createSub(lhs.value, rhs.value));
3925 return RValue<Int>(Nucleus::createMul(lhs.value, rhs.value));
3930 return RValue<Int>(Nucleus::createSDiv(lhs.value, rhs.value));
3935 return RValue<Int>(Nucleus::createSRem(lhs.value, rhs.value));
3940 return RValue<Int>(Nucleus::createAnd(lhs.value, rhs.value));
3945 return RValue<Int>(Nucleus::createOr(lhs.value, rhs.value));
3950 return RValue<Int>(Nucleus::createXor(lhs.value, rhs.value));
3955 return RValue<Int>(Nucleus::createShl(lhs.value, rhs.value));
3960 return RValue<Int>(Nucleus::createAShr(lhs.value, rhs.value));
4020 return RValue<Int>(Nucleus::createNeg(val.value));
4025 return RValue<Int>(Nucleus::createNot(val.value));
4032 Value *inc = Nucleus::createAdd(res.value, Nucleus::createConstantInt(1));
4040 Value *inc = Nucleus::createAdd(val.loadValue(), Nucleus::createConstantInt(1));
4050 Value *inc = Nucleus::createSub(res.value, Nucleus::createConstantInt(1));
4058 Value *inc = Nucleus::createSub(val.loadValue(), Nucleus::createConstantInt(1));
4066 return RValue<Bool>(Nucleus::createICmpSLT(lhs.value, rhs.value));
4071 return RValue<Bool>(Nucleus::createICmpSLE(lhs.value, rhs.value));
4076 return RValue<Bool>(Nucleus::createICmpSGT(lhs.value, rhs.value));
4081 return RValue<Bool>(Nucleus::createICmpSGE(lhs.value, rhs.value));
4086 return RValue<Bool>(Nucleus::createICmpNE(lhs.value, rhs.value));
4091 return RValue<Bool>(Nucleus::createICmpEQ(lhs.value, rhs.value));
4118 return Type::getInt32Ty(*Nucleus::getContext());
4125 Value *integer = Nucleus::createSExt(cast.value, Long::getType());
4132 Value *integer = Nucleus::createZExt(cast.value, Long::getType());
4148 return RValue<Long>(storeValue(Nucleus::createConstantInt(rhs)));
4176 return RValue<Long>(Nucleus::createAdd(lhs.value, rhs.value));
4181 return RValue<Long>(Nucleus::createSub(lhs.value, rhs.value));
4196 return RValue<Long>(Nucleus::createAtomicAdd(x.value, y.value));
4201 return Type::getInt64Ty(*Nucleus::getContext());
4206 Value *undefCast = Nucleus::createInsertElement(UndefValue::get(VectorType::get(Int::getType(), 2)), cast.value, 0);
4207 Value *zeroCast = Nucleus::createInsertElement(undefCast, Nucleus::createConstantInt(0), 1);
4209 storeValue(Nucleus::createBitCast(zeroCast, Long1::getType()));
4232 shuffle[0] = Nucleus::createConstantInt(1);
4233 shuffle[1] = Nucleus::createConstantInt(3);
4235 Value *packed = Nucleus::createShuffleVector(x.value, y.value, Nucleus::createConstantVector(shuffle, 2));
4252 Value *integer = Nucleus::createZExt(cast.value, UInt::getType());
4259 Value *integer = Nucleus::createTrunc(cast.value, UInt::getType());
4266 Value *integer = Nucleus::createFPToUI(cast.value, UInt::getType());
4277 storeValue(Nucleus::createConstantInt(x));
4282 storeValue(Nucleus::createConstantInt(x));
4321 return RValue<UInt>(storeValue(Nucleus::createConstantInt(rhs)));
4372 return RValue<UInt>(Nucleus::createAdd(lhs.value, rhs.value));
4377 return RValue<UInt>(Nucleus::createSub(lhs.value, rhs.value));
4382 return RValue<UInt>(Nucleus::createMul(lhs.value, rhs.value));
4387 return RValue<UInt>(Nucleus::createUDiv(lhs.value, rhs.value));
4392 return RValue<UInt>(Nucleus::createURem(lhs.value, rhs.value));
4397 return RValue<UInt>(Nucleus::createAnd(lhs.value, rhs.value));
4402 return RValue<UInt>(Nucleus::createOr(lhs.value, rhs.value));
4407 return RValue<UInt>(Nucleus::createXor(lhs.value, rhs.value));
4412 return RValue<UInt>(Nucleus::createShl(lhs.value, rhs.value));
4417 return RValue<UInt>(Nucleus::createLShr(lhs.value, rhs.value));
4477 return RValue<UInt>(Nucleus::createNeg(val.value));
4482 return RValue<UInt>(Nucleus::createNot(val.value));
4489 Value *inc = Nucleus::createAdd(res.value, Nucleus::createConstantInt(1));
4497 Value *inc = Nucleus::createAdd(val.loadValue(), Nucleus::createConstantInt(1));
4507 Value *inc = Nucleus::createSub(res.value, Nucleus::createConstantInt(1));
4515 Value *inc = Nucleus::createSub(val.loadValue(), Nucleus::createConstantInt(1));
4538 return RValue<Bool>(Nucleus::createICmpULT(lhs.value, rhs.value));
4543 return RValue<Bool>(Nucleus::createICmpULE(lhs.value, rhs.value));
4548 return RValue<Bool>(Nucleus::createICmpUGT(lhs.value, rhs.value));
4553 return RValue<Bool>(Nucleus::createICmpUGE(lhs.value, rhs.value));
4558 return RValue<Bool>(Nucleus::createICmpNE(lhs.value, rhs.value));
4563 return RValue<Bool>(Nucleus::createICmpEQ(lhs.value, rhs.value));
4575 return Type::getInt32Ty(*Nucleus::getContext());
4580 // Value *extend = Nucleus::createZExt(cast.value, Long::getType());
4581 // Value *vector = Nucleus::createBitCast(extend, Int2::getType());
4584 // shuffle[0] = Nucleus::createConstantInt(0);
4585 // shuffle[1] = Nucleus::createConstantInt(0);
4587 // Value *replicate = Nucleus::createShuffleVector(vector, UndefValue::get(Int2::getType()), Nucleus::createConstantVector(shuffle, 2));
4594 Value *long2 = Nucleus::createBitCast(cast.value, Long2::getType());
4595 Value *element = Nucleus::createExtractElement(long2, 0);
4596 Value *int2 = Nucleus::createBitCast(element, Int2::getType());
4611 constantVector[0] = Nucleus::createConstantInt(x);
4612 constantVector[1] = Nucleus::createConstantInt(y);
4613 Value *vector = Nucleus::createConstantVector(constantVector, 2);
4615 storeValue(Nucleus::createBitCast(vector, getType()));
4653 shuffle[0] = Nucleus::createConstantInt(0);
4654 shuffle[1] = Nucleus::createConstantInt(1);
4656 Value *packed = Nucleus::createShuffleVector(Nucleus::createBitCast(lo.value, VectorType::get(Int::getType(), 1)), Nucleus::createBitCast(hi.value, VectorType::get(Int::getType(), 1)), Nucleus::createConstantVector(shuffle, 2));
4658 storeValue(Nucleus::createBitCast(packed, Int2::getType()));
4693 return RValue<Int2>(Nucleus::createAdd(lhs.value, rhs.value));
4705 return RValue<Int2>(Nucleus::createSub(lhs.value, rhs.value));
4711 // return RValue<Int2>(Nucleus::createMul(lhs.value, rhs.value));
4716 // return RValue<Int2>(Nucleus::createSDiv(lhs.value, rhs.value));
4721 // return RValue<Int2>(Nucleus::createSRem(lhs.value, rhs.value));
4732 return RValue<Int2>(Nucleus::createAnd(lhs.value, rhs.value));
4744 return RValue<Int2>(Nucleus::createOr(lhs.value, rhs.value));
4756 return RValue<Int2>(Nucleus::createXor(lhs.value, rhs.value));
4762 // return RValue<Int2>(Nucleus::createShl(lhs.value, rhs.value));
4769 // return RValue<Int2>(Nucleus::createAShr(lhs.value, rhs.value));
4776 // return RValue<Int2>(Nucleus::createShl(lhs.value, rhs.value));
4783 // return RValue<Int2>(Nucleus::createAShr(lhs.value, rhs.value));
4855 // return RValue<Int2>(Nucleus::createNeg(val.value));
4866 return RValue<Int2>(Nucleus::createNot(val.value));
4879 shuffle[0] = Nucleus::createConstantInt(0);
4880 shuffle[1] = Nucleus::createConstantInt(2);
4882 Value *packed = Nucleus::createShuffleVector(x.value, y.value, Nucleus::createConstantVector(shuffle, 2));
4884 return RValue<Long1>(Nucleus::createBitCast(packed, Long1::getType()));
4897 shuffle[0] = Nucleus::createConstantInt(1);
4898 shuffle[1] = Nucleus::createConstantInt(3);
4900 Value *packed = Nucleus::createShuffleVector(x.value, y.value, Nucleus::createConstantVector(shuffle, 2));
4902 return RValue<Long1>(Nucleus::createBitCast(packed, Long1::getType()));
4910 return RValue<Int>(Nucleus::createExtractElement(val.value, i));
4916 return RValue<Int>(Nucleus::createExtractElement(Nucleus::createBitCast(val.value, VectorType::get(Int::getType(), 2)), 0));
4929 return RValue<Int2>(Nucleus::createBitCast(Nucleus::createInsertElement(Nucleus::createBitCast(val.value, VectorType::get(Int::getType(), 2)), element.value, i), Int2::getType()));
4954 constantVector[0] = Nucleus::createConstantInt(x);
4955 constantVector[1] = Nucleus::createConstantInt(y);
4956 Value *vector = Nucleus::createConstantVector(constantVector, 2);
4958 storeValue(Nucleus::createBitCast(vector, getType()));
5015 return RValue<UInt2>(Nucleus::createAdd(lhs.value, rhs.value));
5027 return RValue<UInt2>(Nucleus::createSub(lhs.value, rhs.value));
5033 // return RValue<UInt2>(Nucleus::createMul(lhs.value, rhs.value));
5038 // return RValue<UInt2>(Nucleus::createUDiv(lhs.value, rhs.value));
5043 // return RValue<UInt2>(Nucleus::createURem(lhs.value, rhs.value));
5054 return RValue<UInt2>(Nucleus::createAnd(lhs.value, rhs.value));
5066 return RValue<UInt2>(Nucleus::createOr(lhs.value, rhs.value));
5078 return RValue<UInt2>(Nucleus::createXor(lhs.value, rhs.value));
5084 // return RValue<UInt2>(Nucleus::createShl(lhs.value, rhs.value));
5091 // return RValue<UInt2>(Nucleus::createLShr(lhs.value, rhs.value));
5098 // return RValue<UInt2>(Nucleus::createShl(lhs.value, rhs.value));
5105 // return RValue<UInt2>(Nucleus::createLShr(lhs.value, rhs.value));
5177 // return RValue<UInt2>(Nucleus::createNeg(val.value));
5188 return RValue<UInt2>(Nucleus::createNot(val.value));
5208 Value *xyzw = Nucleus::createFPToSI(cast.value, Int4::getType());
5216 Value *element = Nucleus::createBitCast(cast.value, Long::getType());
5217 long2 = Nucleus::createInsertElement(long2, element, 0);
5218 RValue<Int4> vector = RValue<Int4>(Nucleus::createBitCast(long2, Int4::getType()));
5226 Value *b = Nucleus::createBitCast(vector.value, Short8::getType());
5229 swizzle[0] = Nucleus::createConstantInt(0);
5230 swizzle[1] = Nucleus::createConstantInt(0);
5231 swizzle[2] = Nucleus::createConstantInt(1);
5232 swizzle[3] = Nucleus::createConstantInt(1);
5233 swizzle[4] = Nucleus::createConstantInt(2);
5234 swizzle[5] = Nucleus::createConstantInt(2);
5235 swizzle[6] = Nucleus::createConstantInt(3);
5236 swizzle[7] = Nucleus::createConstantInt(3);
5238 Value *c = Nucleus::createShuffleVector(b, b, Nucleus::createConstantVector(swizzle, 8));
5239 Value *d = Nucleus::createBitCast(c, Int4::getType());
5253 Value *element = Nucleus::createBitCast(cast.value, Long::getType());
5254 long2 = Nucleus::createInsertElement(long2, element, 0);
5255 RValue<Int4> vector = RValue<Int4>(Nucleus::createBitCast(long2, Int4::getType()));
5263 Value *b = Nucleus::createBitCast(vector.value, Short8::getType());
5266 swizzle[0] = Nucleus::createConstantInt(0);
5267 swizzle[1] = Nucleus::createConstantInt(8);
5268 swizzle[2] = Nucleus::createConstantInt(1);
5269 swizzle[3] = Nucleus::createConstantInt(9);
5270 swizzle[4] = Nucleus::createConstantInt(2);
5271 swizzle[5] = Nucleus::createConstantInt(10);
5272 swizzle[6] = Nucleus::createConstantInt(3);
5273 swizzle[7] = Nucleus::createConstantInt(11);
5275 Value *c = Nucleus::createShuffleVector(b, Nucleus::createNullValue(Short8::getType()), Nucleus::createConstantVector(swizzle, 8));
5276 Value *d = Nucleus::createBitCast(c, Int4::getType());
5311 constantVector[0] = Nucleus::createConstantInt(x);
5312 constantVector[1] = Nucleus::createConstantInt(y);
5313 constantVector[2] = Nucleus::createConstantInt(z);
5314 constantVector[3] = Nucleus::createConstantInt(w);
5316 storeValue(Nucleus::createConstantVector(constantVector, 4));
5367 Value *loLong = Nucleus::createBitCast(lo.value, Long::getType());
5368 Value *hiLong = Nucleus::createBitCast(hi.value, Long::getType());
5371 long2 = Nucleus::createInsertElement(long2, loLong, 0);
5372 long2 = Nucleus::createInsertElement(long2, hiLong, 1);
5373 Value *int4 = Nucleus::createBitCast(long2, Int4::getType());
5403 return RValue<Int4>(Nucleus::createAdd(lhs.value, rhs.value));
5408 return RValue<Int4>(Nucleus::createSub(lhs.value, rhs.value));
5413 return RValue<Int4>(Nucleus::createMul(lhs.value, rhs.value));
5418 return RValue<Int4>(Nucleus::createSDiv(lhs.value, rhs.value));
5423 return RValue<Int4>(Nucleus::createSRem(lhs.value, rhs.value));
5428 return RValue<Int4>(Nucleus::createAnd(lhs.value, rhs.value));
5433 return RValue<Int4>(Nucleus::createOr(lhs.value, rhs.value));
5438 return RValue<Int4>(Nucleus::createXor(lhs.value, rhs.value));
5453 return RValue<Int4>(Nucleus::createShl(lhs.value, rhs.value));
5458 return RValue<Int4>(Nucleus::createAShr(lhs.value, rhs.value));
5518 return RValue<Int4>(Nucleus::createNeg(val.value));
5523 return RValue<Int4>(Nucleus::createNot(val.value));
5530 // return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpEQ(x.value, y.value), Int4::getType()));
5531 return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpNE(x.value, y.value), Int4::getType())) ^ Int4(0xFFFFFFFF);
5536 return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpSLT(x.value, y.value), Int4::getType()));
5543 // return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpSLE(x.value, y.value), Int4::getType()));
5544 return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpSGT(x.value, y.value), Int4::getType())) ^ Int4(0xFFFFFFFF);
5549 return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpNE(x.value, y.value), Int4::getType()));
5556 // return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpSGE(x.value, y.value), Int4::getType()));
5557 return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpSLT(x.value, y.value), Int4::getType())) ^ Int4(0xFFFFFFFF);
5562 return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpSGT(x.value, y.value), Int4::getType()));
5603 return RValue<Int>(Nucleus::createExtractElement(x.value, i));
5608 return RValue<Int4>(Nucleus::createInsertElement(x.value, element.value, i));
5618 return RValue<Int4>(Nucleus::createSwizzle(x.value, select));
5630 Value *xyzw = Nucleus::createFPToUI(cast.value, UInt4::getType());
5665 constantVector[0] = Nucleus::createConstantInt(x);
5666 constantVector[1] = Nucleus::createConstantInt(y);
5667 constantVector[2] = Nucleus::createConstantInt(z);
5668 constantVector[3] = Nucleus::createConstantInt(w);
5670 storeValue(Nucleus::createConstantVector(constantVector, 4));
5721 Value *loLong = Nucleus::createBitCast(lo.value, Long::getType());
5722 Value *hiLong = Nucleus::createBitCast(hi.value, Long::getType());
5725 long2 = Nucleus::createInsertElement(long2, loLong, 0);
5726 long2 = Nucleus::createInsertElement(long2, hiLong, 1);
5727 Value *uint4 = Nucleus::createBitCast(long2, Int4::getType());
5757 return RValue<UInt4>(Nucleus::createAdd(lhs.value, rhs.value));
5762 return RValue<UInt4>(Nucleus::createSub(lhs.value, rhs.value));
5767 return RValue<UInt4>(Nucleus::createMul(lhs.value, rhs.value));
5772 return RValue<UInt4>(Nucleus::createUDiv(lhs.value, rhs.value));
5777 return RValue<UInt4>(Nucleus::createURem(lhs.value, rhs.value));
5782 return RValue<UInt4>(Nucleus::createAnd(lhs.value, rhs.value));
5787 return RValue<UInt4>(Nucleus::createOr(lhs.value, rhs.value));
5792 return RValue<UInt4>(Nucleus::createXor(lhs.value, rhs.value));
5807 return RValue<UInt4>(Nucleus::createShl(lhs.value, rhs.value));
5812 return RValue<UInt4>(Nucleus::createLShr(lhs.value, rhs.value));
5872 return RValue<UInt4>(Nucleus::createNeg(val.value));
5877 return RValue<UInt4>(Nucleus::createNot(val.value));
5884 // return RValue<UInt4>(Nucleus::createSExt(Nucleus::createICmpEQ(x.value, y.value), Int4::getType()));
5885 return RValue<UInt4>(Nucleus::createSExt(Nucleus::createICmpNE(x.value, y.value), Int4::getType())) ^ UInt4(0xFFFFFFFF);
5890 return RValue<UInt4>(Nucleus::createSExt(Nucleus::createICmpULT(x.value, y.value), Int4::getType()));
5897 // return RValue<UInt4>(Nucleus::createSExt(Nucleus::createICmpULE(x.value, y.value), Int4::getType()));
5898 return RValue<UInt4>(Nucleus::createSExt(Nucleus::createICmpUGT(x.value, y.value), Int4::getType())) ^ UInt4(0xFFFFFFFF);
5903 return RValue<UInt4>(Nucleus::createSExt(Nucleus::createICmpNE(x.value, y.value), Int4::getType()));
5910 // return RValue<UInt4>(Nucleus::createSExt(Nucleus::createICmpUGE(x.value, y.value), Int4::getType()));
5911 return RValue<UInt4>(Nucleus::createSExt(Nucleus::createICmpULT(x.value, y.value), Int4::getType())) ^ UInt4(0xFFFFFFFF);
5916 return RValue<UInt4>(Nucleus::createSExt(Nucleus::createICmpUGT(x.value, y.value), Int4::getType()));
5957 Value *integer = Nucleus::createSIToFP(cast.value, Float::getType());
5969 storeValue(Nucleus::createConstantFloat(x));
6014 return RValue<Float>(Nucleus::createFAdd(lhs.value, rhs.value));
6019 return RValue<Float>(Nucleus::createFSub(lhs.value, rhs.value));
6024 return RValue<Float>(Nucleus::createFMul(lhs.value, rhs.value));
6029 return RValue<Float>(Nucleus::createFDiv(lhs.value, rhs.value));
6059 return RValue<Float>(Nucleus::createFNeg(val.value));
6064 return RValue<Bool>(Nucleus::createFCmpOLT(lhs.value, rhs.value));
6069 return RValue<Bool>(Nucleus::createFCmpOLE(lhs.value, rhs.value));
6074 return RValue<Bool>(Nucleus::createFCmpOGT(lhs.value, rhs.value));
6079 return RValue<Bool>(Nucleus::createFCmpOGE(lhs.value, rhs.value));
6084 return RValue<Bool>(Nucleus::createFCmpONE(lhs.value, rhs.value));
6089 return RValue<Bool>(Nucleus::createFCmpOEQ(lhs.value, rhs.value));
6193 return Type::getFloatTy(*Nucleus::getContext());
6200 Value *int64x2 = Nucleus::createBitCast(cast.value, Long2::getType());
6201 Value *int64 = Nucleus::createExtractElement(int64x2, 0);
6202 Value *float2 = Nucleus::createBitCast(int64, Float2::getType());
6217 Value *xyzw = Nucleus::createUIToFP(cast.value, Float4::getType()); // FIXME: Crashes
6221 Value *i8x = Nucleus::createExtractElement(cast.value, 0);
6222 Value *f32x = Nucleus::createUIToFP(i8x, Float::getType());
6223 Value *x = Nucleus::createInsertElement(vector, f32x, 0);
6225 Value *i8y = Nucleus::createExtractElement(cast.value, Nucleus::createConstantInt(1));
6226 Value *f32y = Nucleus::createUIToFP(i8y, Float::getType());
6227 Value *xy = Nucleus::createInsertElement(x, f32y, Nucleus::createConstantInt(1));
6229 Value *i8z = Nucleus::createExtractElement(cast.value, Nucleus::createConstantInt(2));
6230 Value *f32z = Nucleus::createUIToFP(i8z, Float::getType());
6231 Value *xyz = Nucleus::createInsertElement(xy, f32z, Nucleus::createConstantInt(2));
6233 Value *i8w = Nucleus::createExtractElement(cast.value, Nucleus::createConstantInt(3));
6234 Value *f32w = Nucleus::createUIToFP(i8w, Float::getType());
6235 Value *xyzw = Nucleus::createInsertElement(xyz, f32w, Nucleus::createConstantInt(3));
6237 Value *x = Nucleus::createBitCast(cast.value, Int::getType());
6238 Value *a = Nucleus::createInsertElement(UndefValue::get(Int4::getType()), x, 0);
6249 swizzle[0] = Nucleus::createConstantInt(0);
6250 swizzle[1] = Nucleus::createConstantInt(16);
6251 swizzle[2] = Nucleus::createConstantInt(1);
6252 swizzle[3] = Nucleus::createConstantInt(17);
6253 swizzle[4] = Nucleus::createConstantInt(2);
6254 swizzle[5] = Nucleus::createConstantInt(18);
6255 swizzle[6] = Nucleus::createConstantInt(3);
6256 swizzle[7] = Nucleus::createConstantInt(19);
6257 swizzle[8] = Nucleus::createConstantInt(4);
6258 swizzle[9] = Nucleus::createConstantInt(20);
6259 swizzle[10] = Nucleus::createConstantInt(5);
6260 swizzle[11] = Nucleus::createConstantInt(21);
6261 swizzle[12] = Nucleus::createConstantInt(6);
6262 swizzle[13] = Nucleus::createConstantInt(22);
6263 swizzle[14] = Nucleus::createConstantInt(7);
6264 swizzle[15] = Nucleus::createConstantInt(23);
6266 Value *b = Nucleus::createBitCast(a, Byte16::getType());
6267 Value *c = Nucleus::createShuffleVector(b, Nucleus::createNullValue(Byte16::getType()), Nucleus::createConstantVector(swizzle, 16));
6270 swizzle2[0] = Nucleus::createConstantInt(0);
6271 swizzle2[1] = Nucleus::createConstantInt(8);
6272 swizzle2[2] = Nucleus::createConstantInt(1);
6273 swizzle2[3] = Nucleus::createConstantInt(9);
6274 swizzle2[4] = Nucleus::createConstantInt(2);
6275 swizzle2[5] = Nucleus::createConstantInt(10);
6276 swizzle2[6] = Nucleus::createConstantInt(3);
6277 swizzle2[7] = Nucleus::createConstantInt(11);
6279 Value *d = Nucleus::createBitCast(c, Short8::getType());
6280 e = Nucleus::createShuffleVector(d, Nucleus::createNullValue(Short8::getType()), Nucleus::createConstantVector(swizzle2, 8));
6283 Value *f = Nucleus::createBitCast(e, Int4::getType());
6284 Value *g = Nucleus::createSIToFP(f, Float4::getType());
6296 Value *xyzw = Nucleus::createSIToFP(cast.value, Float4::getType()); // FIXME: Crashes
6300 Value *i8x = Nucleus::createExtractElement(cast.value, 0);
6301 Value *f32x = Nucleus::createSIToFP(i8x, Float::getType());
6302 Value *x = Nucleus::createInsertElement(vector, f32x, 0);
6304 Value *i8y = Nucleus::createExtractElement(cast.value, Nucleus::createConstantInt(1));
6305 Value *f32y = Nucleus::createSIToFP(i8y, Float::getType());
6306 Value *xy = Nucleus::createInsertElement(x, f32y, Nucleus::createConstantInt(1));
6308 Value *i8z = Nucleus::createExtractElement(cast.value, Nucleus::createConstantInt(2));
6309 Value *f32z = Nucleus::createSIToFP(i8z, Float::getType());
6310 Value *xyz = Nucleus::createInsertElement(xy, f32z, Nucleus::createConstantInt(2));
6312 Value *i8w = Nucleus::createExtractElement(cast.value, Nucleus::createConstantInt(3));
6313 Value *f32w = Nucleus::createSIToFP(i8w, Float::getType());
6314 Value *xyzw = Nucleus::createInsertElement(xyz, f32w, Nucleus::createConstantInt(3));
6316 Value *x = Nucleus::createBitCast(cast.value, Int::getType());
6317 Value *a = Nucleus::createInsertElement(UndefValue::get(Int4::getType()), x, 0);
6328 swizzle[0] = Nucleus::createConstantInt(0);
6329 swizzle[1] = Nucleus::createConstantInt(0);
6330 swizzle[2] = Nucleus::createConstantInt(1);
6331 swizzle[3] = Nucleus::createConstantInt(1);
6332 swizzle[4] = Nucleus::createConstantInt(2);
6333 swizzle[5] = Nucleus::createConstantInt(2);
6334 swizzle[6] = Nucleus::createConstantInt(3);
6335 swizzle[7] = Nucleus::createConstantInt(3);
6336 swizzle[8] = Nucleus::createConstantInt(4);
6337 swizzle[9] = Nucleus::createConstantInt(4);
6338 swizzle[10] = Nucleus::createConstantInt(5);
6339 swizzle[11] = Nucleus::createConstantInt(5);
6340 swizzle[12] = Nucleus::createConstantInt(6);
6341 swizzle[13] = Nucleus::createConstantInt(6);
6342 swizzle[14] = Nucleus::createConstantInt(7);
6343 swizzle[15] = Nucleus::createConstantInt(7);
6345 Value *b = Nucleus::createBitCast(a, Byte16::getType());
6346 Value *c = Nucleus::createShuffleVector(b, b, Nucleus::createConstantVector(swizzle, 16));
6349 swizzle2[0] = Nucleus::createConstantInt(0);
6350 swizzle2[1] = Nucleus::createConstantInt(0);
6351 Nucleus::createConstantInt(1);
6352 swizzle2[3] = Nucleus::createConstantInt(1);
6353 swizzle2[4] = Nucleus::createConstantInt(2);
6354 swizzle2[5] = Nucleus::createConstantInt(2);
6355 swizzle2[6] = Nucleus::createConstantInt(3);
6356 swizzle2[7] = Nucleus::createConstantInt(3);
6358 Value *d = Nucleus::createBitCast(c, Short8::getType());
6359 Value *e = Nucleus::createShuffleVector(d, d, Nucleus::createConstantVector(swizzle2, 8));
6361 Value *f = Nucleus::createBitCast(e, Int4::getType());
6362 // g = Nucleus::createAShr(f, Nucleus::createConstantInt(24));
6366 Value *xyzw = Nucleus::createSIToFP(g, Float4::getType());
6377 storeValue(Nucleus::createSIToFP(RValue<Int4>(c).value, Float4::getType()));
6385 storeValue(Nucleus::createSIToFP(RValue<Int4>(c).value, Float4::getType()));
6392 Value *xyzw = Nucleus::createSIToFP(cast.value, Float4::getType());
6401 Value *xyzw = Nucleus::createUIToFP(cast.value, Float4::getType());
6436 constantVector[0] = Nucleus::createConstantFloat(x);
6437 constantVector[1] = Nucleus::createConstantFloat(y);
6438 constantVector[2] = Nucleus::createConstantFloat(z);
6439 constantVector[3] = Nucleus::createConstantFloat(w);
6441 storeValue(Nucleus::createConstantVector(constantVector, 4));
6472 Value *insert = Nucleus::createInsertElement(vector, rhs.value, 0);
6475 swizzle[0] = Nucleus::createConstantInt(0);
6476 swizzle[1] = Nucleus::createConstantInt(0);
6477 swizzle[2] = Nucleus::createConstantInt(0);
6478 swizzle[3] = Nucleus::createConstantInt(0);
6480 Value *replicate = Nucleus::createShuffleVector(insert, UndefValue::get(Float4::getType()), Nucleus::createConstantVector(swizzle, 4));
6544 return RValue<Float4>(Nucleus::createFAdd(lhs.value, rhs.value));
6549 return RValue<Float4>(Nucleus::createFSub(lhs.value, rhs.value));
6554 return RValue<Float4>(Nucleus::createFMul(lhs.value, rhs.value));
6559 return RValue<Float4>(Nucleus::createFDiv(lhs.value, rhs.value));
6564 return RValue<Float4>(Nucleus::createFRem(lhs.value, rhs.value));
6599 return RValue<Float4>(Nucleus::createFNeg(val.value));
6604 Value *vector = Nucleus::createBitCast(x.value, Int4::getType());
6607 constantVector[0] = Nucleus::createConstantInt(0x7FFFFFFF);
6608 constantVector[1] = Nucleus::createConstantInt(0x7FFFFFFF);
6609 constantVector[2] = Nucleus::createConstantInt(0x7FFFFFFF);
6610 constantVector[3] = Nucleus::createConstantInt(0x7FFFFFFF);
6612 Value *result = Nucleus::createAnd(vector, Nucleus::createConstantVector(constantVector, 4));
6614 return RValue<Float4>(Nucleus::createBitCast(result, Float4::getType()));
6654 llvm::Value *insert = Nucleus::createInsertElement(value, element.value, i);
6663 return RValue<Float>(Nucleus::createExtractElement(x.value, i));
6668 return RValue<Float4>(Nucleus::createSwizzle(x.value, select));
6674 shuffle[0] = Nucleus::createConstantInt(((imm >> 0) & 0x03) + 0);
6675 shuffle[1] = Nucleus::createConstantInt(((imm >> 2) & 0x03) + 0);
6676 shuffle[2] = Nucleus::createConstantInt(((imm >> 4) & 0x03) + 4);
6677 shuffle[3] = Nucleus::createConstantInt(((imm >> 6) & 0x03) + 4);
6679 return RValue<Float4>(Nucleus::createShuffleVector(x.value, y.value, Nucleus::createConstantVector(shuffle, 4)));
6685 shuffle[0] = Nucleus::createConstantInt(0);
6686 shuffle[1] = Nucleus::createConstantInt(4);
6687 shuffle[2] = Nucleus::createConstantInt(1);
6688 shuffle[3] = Nucleus::createConstantInt(5);
6690 return RValue<Float4>(Nucleus::createShuffleVector(x.value, y.value, Nucleus::createConstantVector(shuffle, 4)));
6696 shuffle[0] = Nucleus::createConstantInt(2);
6697 shuffle[1] = Nucleus::createConstantInt(6);
6698 shuffle[2] = Nucleus::createConstantInt(3);
6699 shuffle[3] = Nucleus::createConstantInt(7);
6701 return RValue<Float4>(Nucleus::createShuffleVector(x.value, y.value, Nucleus::createConstantVector(shuffle, 4)));
6707 Value *shuffle = Nucleus::createMask(vector, rhs.value, select);
6721 return RValue<Int4>(Nucleus::createSExt(Nucleus::createFCmpOEQ(x.value, y.value), Int4::getType()));
6727 return RValue<Int4>(Nucleus::createSExt(Nucleus::createFCmpOLT(x.value, y.value), Int4::getType()));
6733 return RValue<Int4>(Nucleus::createSExt(Nucleus::createFCmpOLE(x.value, y.value), Int4::getType()));
6739 return RValue<Int4>(Nucleus::createSExt(Nucleus::createFCmpONE(x.value, y.value), Int4::getType()));
6745 return RValue<Int4>(Nucleus::createSExt(Nucleus::createFCmpOGE(x.value, y.value), Int4::getType()));
6751 return RValue<Int4>(Nucleus::createSExt(Nucleus::createFCmpOGT(x.value, y.value), Int4::getType()));
6823 return RValue<Pointer<Byte>>(Nucleus::createGEP(lhs.value, Nucleus::createConstantInt(offset)));
6828 return RValue<Pointer<Byte>>(Nucleus::createGEP(lhs.value, offset.value));
6833 return RValue<Pointer<Byte>>(Nucleus::createGEP(lhs.value, offset.value));
6883 Nucleus::createRetVoid();
6884 Nucleus::setInsertBlock(Nucleus::createBasicBlock());
6885 Nucleus::createUnreachable();
6890 Nucleus::createRet(Nucleus::createConstantBool(ret));
6891 Nucleus::setInsertBlock(Nucleus::createBasicBlock());
6892 Nucleus::createUnreachable();
6897 Nucleus::createRet(ret.loadValue());
6898 Nucleus::setInsertBlock(Nucleus::createBasicBlock());
6899 Nucleus::createUnreachable();
6904 BasicBlock *loopBB = Nucleus::createBasicBlock();
6906 Nucleus::createBr(loopBB);
6907 Nucleus::setInsertBlock(loopBB);
6914 Nucleus::createCondBr(cmp.value, bodyBB, endBB);
6915 Nucleus::setInsertBlock(bodyBB);
6923 Nucleus::setInsertBlock(falseBB);
6930 Module *module = Nucleus::getModule();
6933 return RValue<Long>(Nucleus::createCall(rdtsc));
6943 Module *module = Nucleus::getModule();
6949 return RValue<Int>(Nucleus::createCall(cvtss2si, RValue<Float4>(vector).value));
6954 Module *module = Nucleus::getModule();
6957 return RValue<Int2>(Nucleus::createCall(cvtps2pi, val.value));
6962 Module *module = Nucleus::getModule();
6965 return RValue<Int2>(Nucleus::createCall(cvttps2pi, val.value));
6972 Module *module = Nucleus::getModule();
6975 return RValue<Int4>(Nucleus::createCall(cvtps2dq, val.value));
6988 Module *module = Nucleus::getModule();
6991 Value *vector = Nucleus::createInsertElement(UndefValue::get(Float4::getType()), val.value, 0);
6993 return RValue<Float>(Nucleus::createExtractElement(Nucleus::createCall(rcpss, vector), 0));
6998 Module *module = Nucleus::getModule();
7001 Value *vector = Nucleus::createInsertElement(UndefValue::get(Float4::getType()), val.value, 0);
7003 return RValue<Float>(Nucleus::createExtractElement(Nucleus::createCall(sqrtss, vector), 0));
7008 Module *module = Nucleus::getModule();
7011 Value *vector = Nucleus::createInsertElement(UndefValue::get(Float4::getType()), val.value, 0);
7013 return RValue<Float>(Nucleus::createExtractElement(Nucleus::createCall(rsqrtss, vector), 0));
7018 Module *module = Nucleus::getModule();
7021 Nucleus::createCall(rcpps, val.value));
7026 Module *module = Nucleus::getModule();
7029 return RValue<Float4>(Nucleus::createCall(sqrtps, val.value));
7034 Module *module = Nucleus::getModule();
7037 return RValue<Float4>(Nucleus::createCall(rsqrtps, val.value));
7042 Module *module = Nucleus::getModule();
7045 return RValue<Float4>(Nucleus::createCall(maxps, x.value, y.value));
7050 Module *module = Nucleus::getModule();
7053 return RValue<Float4>(Nucleus::createCall(minps, x.value, y.value));
7058 Module *module = Nucleus::getModule();
7062 Value *vector = Nucleus::createInsertElement(undef, val.value, 0);
7064 return RValue<Float>(Nucleus::createExtractElement(Nucleus::createCall(roundss, undef, vector, Nucleus::createConstantInt(imm)), 0));
7079 Module *module = Nucleus::getModule();
7082 return RValue<Float4>(Nucleus::createCall(roundps, val.value, Nucleus::createConstantInt(imm)));
7097 Module *module = Nucleus::getModule();
7100 return RValue<Float4>(Nucleus::createCall(cmpps, x.value, y.value, Nucleus::createConstantByte(imm)));
7145 Module *module = Nucleus::getModule();
7148 Value *vector1 = Nucleus::createInsertElement(UndefValue::get(Float4::getType()), x.value, 0);
7149 Value *vector2 = Nucleus::createInsertElement(UndefValue::get(Float4::getType()), y.value, 0);
7151 return RValue<Float>(Nucleus::createExtractElement(Nucleus::createCall(cmpss, vector1, vector2, Nucleus::createConstantByte(imm)), 0));
7196 Module *module = Nucleus::getModule();
7199 return RValue<Int4>(Nucleus::createCall(pabsd, x.value));
7204 Module *module = Nucleus::getModule();
7207 return As<Short4>(RValue<MMX>(Nucleus::createCall(paddsw, As<MMX>(x).value, As<MMX>(y).value)));
7212 Module *module = Nucleus::getModule();
7215 return As<Short4>(RValue<MMX>(Nucleus::createCall(psubsw, As<MMX>(x).value, As<MMX>(y).value)));
7220 Module *module = Nucleus::getModule();
7223 return As<UShort4>(RValue<MMX>(Nucleus::createCall(paddusw, As<MMX>(x).value, As<MMX>(y).value)));
7228 Module *module = Nucleus::getModule();
7231 return As<UShort4>(RValue<MMX>(Nucleus::createCall(psubusw, As<MMX>(x).value, As<MMX>(y).value)));
7236 Module *module = Nucleus::getModule();
7239 return As<SByte8>(RValue<MMX>(Nucleus::createCall(paddsb, As<MMX>(x).value, As<MMX>(y).value)));
7244 Module *module = Nucleus::getModule();
7247 return As<SByte8>(RValue<MMX>(Nucleus::createCall(psubsb, As<MMX>(x).value, As<MMX>(y).value)));
7252 Module *module = Nucleus::getModule();
7255 return As<Byte8>(RValue<MMX>(Nucleus::createCall(paddusb, As<MMX>(x).value, As<MMX>(y).value)));
7260 Module *module = Nucleus::getModule();
7263 return As<Byte8>(RValue<MMX>(Nucleus::createCall(psubusb, As<MMX>(x).value, As<MMX>(y).value)));
7268 Module *module = Nucleus::getModule();
7271 return As<Short4>(RValue<MMX>(Nucleus::createCall(paddw, As<MMX>(x).value, As<MMX>(y).value)));
7276 Module *module = Nucleus::getModule();
7279 return As<Short4>(RValue<MMX>(Nucleus::createCall(psubw, As<MMX>(x).value, As<MMX>(y).value)));
7284 Module *module = Nucleus::getModule();
7287 return As<Short4>(RValue<MMX>(Nucleus::createCall(pmullw, As<MMX>(x).value, As<MMX>(y).value)));
7292 Module *module = Nucleus::getModule();
7295 return As<Short4>(RValue<MMX>(Nucleus::createCall(pand, As<MMX>(x).value, As<MMX>(y).value)));
7300 Module *module = Nucleus::getModule();
7303 return As<Short4>(RValue<MMX>(Nucleus::createCall(por, As<MMX>(x).value, As<MMX>(y).value)));
7308 Module *module = Nucleus::getModule();
7311 return As<Short4>(RValue<MMX>(Nucleus::createCall(pxor, As<MMX>(x).value, As<MMX>(y).value)));
7316 Module *module = Nucleus::getModule();
7319 return As<Short4>(RValue<MMX>(Nucleus::createCall(pshufw, As<MMX>(x).value, Nucleus::createConstantByte(y))));
7324 Module *module = Nucleus::getModule();
7327 return As<Int2>(RValue<MMX>(Nucleus::createCall(punpcklwd, As<MMX>(x).value, As<MMX>(y).value)));
7332 Module *module = Nucleus::getModule();
7335 return As<Int2>(RValue<MMX>(Nucleus::createCall(punpckhwd, As<MMX>(x).value, As<MMX>(y).value)));
7340 Module *module = Nucleus::getModule();
7343 return As<Short4>(RValue<MMX>(Nucleus::createCall(pinsrw, As<MMX>(x).value, y.value, Nucleus::createConstantInt(i))));
7348 Module *module = Nucleus::getModule();
7351 return RValue<Int>(Nucleus::createCall(pextrw, As<MMX>(x).value, Nucleus::createConstantInt(i)));
7356 Module *module = Nucleus::getModule();
7359 return As<Long1>(RValue<MMX>(Nucleus::createCall(punpckldq, As<MMX>(x).value, As<MMX>(y).value)));
7364 Module *module = Nucleus::getModule();
7367 return As<Long1>(RValue<MMX>(Nucleus::createCall(punpckhdq, As<MMX>(x).value, As<MMX>(y).value)));
7372 Module *module = Nucleus::getModule();
7375 return As<Short4>(RValue<MMX>(Nucleus::createCall(punpcklbw, As<MMX>(x).value, As<MMX>(y).value)));
7380 Module *module = Nucleus::getModule();
7383 return As<Short4>(RValue<MMX>(Nucleus::createCall(punpckhbw, As<MMX>(x).value, As<MMX>(y).value)));
7388 Module *module = Nucleus::getModule();
7391 return As<Byte8>(RValue<MMX>(Nucleus::createCall(paddb, As<MMX>(x).value, As<MMX>(y).value)));
7396 Module *module = Nucleus::getModule();
7399 return As<Byte8>(RValue<MMX>(Nucleus::createCall(psubb, As<MMX>(x).value, As<MMX>(y).value)));
7404 Module *module = Nucleus::getModule();
7407 return As<Int2>(RValue<MMX>(Nucleus::createCall(paddd, As<MMX>(x).value, As<MMX>(y).value)));
7412 Module *module = Nucleus::getModule();
7415 return As<Int2>(RValue<MMX>(Nucleus::createCall(psubd, As<MMX>(x).value, As<MMX>(y).value)));
7420 Module *module = Nucleus::getModule();
7423 return As<UShort4>(RValue<MMX>(Nucleus::createCall(pavgw, As<MMX>(x).value, As<MMX>(y).value)));
7428 Module *module = Nucleus::getModule();
7431 return As<Short4>(RValue<MMX>(Nucleus::createCall(pmaxsw, As<MMX>(x).value, As<MMX>(y).value)));
7436 Module *module = Nucleus::getModule();
7439 return As<Short4>(RValue<MMX>(Nucleus::createCall(pminsw, As<MMX>(x).value, As<MMX>(y).value)));
7444 Module *module = Nucleus::getModule();
7447 return As<Short4>(RValue<MMX>(Nucleus::createCall(pcmpgtw, As<MMX>(x).value, As<MMX>(y).value)));
7452 Module *module = Nucleus::getModule();
7455 return As<Short4>(RValue<MMX>(Nucleus::createCall(pcmpeqw, As<MMX>(x).value, As<MMX>(y).value)));
7460 Module *module = Nucleus::getModule();
7463 return As<Byte8>(RValue<MMX>(Nucleus::createCall(pcmpgtb, As<MMX>(x).value, As<MMX>(y).value)));
7468 Module *module = Nucleus::getModule();
7471 return As<Byte8>(RValue<MMX>(Nucleus::createCall(pcmpeqb, As<MMX>(x).value, As<MMX>(y).value)));
7476 Module *module = Nucleus::getModule();
7479 return As<Short4>(RValue<MMX>(Nucleus::createCall(packssdw, As<MMX>(x).value, As<MMX>(y).value)));
7486 Module *module = Nucleus::getModule();
7489 return RValue<Short8>(Nucleus::createCall(packssdw, x.value, y.value));
7508 Module *module = Nucleus::getModule();
7511 return As<SByte8>(RValue<MMX>(Nucleus
7516 Module *module = Nucleus::getModule();
7519 return As<Byte8>(RValue<MMX>(Nucleus::createCall(packuswb, As<MMX>(x).value, As<MMX>(y).value)));
7526 Module *module = Nucleus::getModule();
7529 return RValue<UShort8>(Nucleus::createCall(packusdw, x.value, y.value));
7540 Module *module = Nucleus::getModule();
7543 return As<UShort4>(RValue<MMX>(Nucleus::createCall(psrlw, As<MMX>(x).value, Nucleus::createConstantInt(y))));
7548 Module *module = Nucleus::getModule();
7551 return RValue<UShort8>(Nucleus::createCall(psrlw, x.value, Nucleus::createConstantInt(y)));
7556 Module *module = Nucleus::getModule();
7559 return As<Short4>(RValue<MMX>(Nucleus::createCall(psraw, As<MMX>(x).value, Nucleus::createConstantInt(y))));
7564 Module *module = Nucleus::getModule();
7567 return RValue<Short8>(Nucleus::createCall(psraw, x.value, Nucleus::createConstantInt(y)));
7572 Module *module = Nucleus::getModule();
7575 return As<Short4>(RValue<MMX>(Nucleus::createCall(psllw, As<MMX>(x).value, Nucleus::createConstantInt(y))));
7580 Module *module = Nucleus::getModule();
7583 return RValue<Short8>(Nucleus::createCall(psllw, x.value, Nucleus::createConstantInt(y)));
7588 Module *module = Nucleus::getModule();
7591 return As<Int2>(RValue<MMX>(Nucleus::createCall(pslld, As<MMX>(x).value, Nucleus::createConstantInt(y))));
7598 Module *module = Nucleus::getModule();
7601 return RValue<Int4>(Nucleus::createCall(pslld, x.value, Nucleus::createConstantInt(y)));
7617 Module *module = Nucleus::getModule();
7620 return As<Int2>(RValue<MMX>(Nucleus::createCall(psrad, As<MMX>(x).value, Nucleus::createConstantInt(y))));
7627 Module *module = Nucleus::getModule();
7630 return RValue<Int4>(Nucleus::createCall(psrad, x.value, Nucleus::createConstantInt(y)));
7646 Module *module = Nucleus::getModule();
7649 return As<UInt2>(RValue<MMX>(Nucleus::createCall(psrld, As<MMX>(x).value, Nucleus::createConstantInt(y))));
7656 Module *module = Nucleus::getModule();
7659 return RValue<UInt4>(Nucleus::createCall(psrld, x.value, Nucleus::createConstantInt(y)));
7675 Module *module = Nucleus::getModule();
7678 return As<UShort4>(RValue<MMX>(Nucleus::createCall(psrlw, As<MMX>(x).value, As<MMX>(y).value)));
7683 Module *module = Nucleus::getModule();
7686 return As<Short4>(RValue<MMX>(Nucleus::createCall(psraw, As<MMX>(x).value, As<MMX>(y).value)));
7691 Module *module = Nucleus::getModule();
7694 return As<Short4>(RValue<MMX>(Nucleus::createCall(psllw, As<MMX>(x).value, As<MMX>(y).value)));
7699 Module *module = Nucleus::getModule();
7702 return As<Int2>(RValue<MMX>(Nucleus::createCall(pslld, As<MMX>(x).value, As<MMX>(y).value)));
7707 Module *module = Nucleus::getModule();
7710 return As<UInt2>(RValue<MMX>(Nucleus::createCall(psrld, As<MMX>(x).value, As<MMX>(y).value)));
7715 Module *module = Nucleus::getModule();
7718 return As<Int2>(RValue<MMX>(Nucleus::createCall(psrld, As<MMX>(x).value, As<MMX>(y).value)));
7723 Module *module = Nucleus::getModule();
7726 return RValue<Int4>(Nucleus::createCall(pmaxsd, x.value, y.value));
7731 Module *module = Nucleus::getModule();
7734 return RValue<Int4>(Nucleus::createCall(pminsd, x.value, y.value));
7739 Module *module = Nucleus::getModule();
7742 return RValue<UInt4>(Nucleus::createCall(pmaxud, x.value, y.value));
7747 Module *module = Nucleus::getModule();
7750 return RValue<UInt4>(Nucleus::createCall(pminud, x.value, y.value));
7755 Module *module = Nucleus::getModule();
7758 return As<Short4>(RValue<MMX>(Nucleus::createCall(pmulhw, As<MMX>(x).value, As<MMX>(y).value)));
7763 Module *module = Nucleus::getModule();
7766 return As<UShort4>(RValue<MMX>(Nucleus::createCall(pmulhuw, As<MMX>(x).value, As<MMX>(y).value)));
7771 Module *module = Nucleus::getModule();
7774 return As<Int2>(RValue<MMX>(Nucleus::createCall(pmaddwd, As<MMX>(x).value, As<MMX>(y).value)));
7779 Module *module = Nucleus::getModule();
7782 return RValue<Short8>(Nucleus::createCall(pmulhw, x.value, y.value));
7787 Module *module = Nucleus::getModule();
7790 return RValue<UShort8>(Nucleus::createCall(pmulhuw, x.value, y.value));
7795 Module *module = Nucleus::getModule();
7798 return RValue<Int4>(Nucleus::createCall(pmaddwd, x.value, y.value));
7803 Module *module = Nucleus::getModule();
7806 return RValue<Int>(Nucleus::createCall(movmskps, x.value));
7811 Module *module = Nucleus::getModule();
7814 return RValue<Int>(Nucleus::createCall(pmovmskb, As<MMX>(x).value));
7819 // Value *element = Nucleus::createLoad(x.value);
7822 //// int2 = Nucleus::createInsertElement(int2, element, ConstantInt::get(Int::getType(), 0));
7824 // Value *int2 = Nucleus::createBitCast(Nucleus::createZExt(element, Long::getType()), Int2::getType());
7831 // Value *long2 = Nucleus::createBitCast(x.value, Long2::getType());
7832 // Value *element = Nucleus::createExtractElement(long2, ConstantInt::get(Int::getType(), 0));
7834 // return RValue<Int2>(Nucleus::createBitCast(element, Int2::getType()));
7839 Module *module = Nucleus::getModule();
7842 return RValue<Int4>(Nucleus::createCall(pmovzxbd, Nucleus::createBitCast(x.value, Byte16::getType())));
7847 Module *module = Nucleus::getModule();
7850 return RValue<Int4>(Nucleus::createCall(pmovsxbd, Nucleus::createBitCast(x.value, SByte16::getType())));
7855 Module *module = Nucleus::getModule();
7858 return RValue<Int4>(Nucleus::createCall(pmovzxwd, Nucleus::createBitCast(x.value, UShort8::getType())));
7863 Module *module = Nucleus::getModule();
7866 return RValue<Int4>(Nucleus::createCall(pmovsxwd, Nucleus::createBitCast(x.value, Short8::getType())));
7871 Module *module = Nucleus::getModule();
7874 Nucleus::createCall(emms);