summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Pagani2016-10-07 14:12:27 +0200
committerBruno Pagani2016-10-07 14:12:27 +0200
commit9ea64d4ad98e7eb2d61c722ff43630ebfd518988 (patch)
tree590b8179a48d82d7a5dc2c52284d5f92f602ca4b
parent1bca88e83b4a8bcc16e25ec61b6ec22d49c137d8 (diff)
downloadaur-9ea64d4ad98e7eb2d61c722ff43630ebfd518988.tar.gz
beignet: Remove old patches
-rw-r--r--clangfix.patch682
-rw-r--r--gcc6.patch51
-rw-r--r--isnan.patch237
3 files changed, 0 insertions, 970 deletions
diff --git a/clangfix.patch b/clangfix.patch
deleted file mode 100644
index 0c8656fca4b7..000000000000
--- a/clangfix.patch
+++ /dev/null
@@ -1,682 +0,0 @@
-From e529586d062450007acf942fc7c73269db5a0fbe Mon Sep 17 00:00:00 2001
-From: Pan Xiuli <xiuli.pan@intel.com>
-Date: Wed, 27 Jan 2016 14:14:59 +0800
-Subject: Backend: Add support for LLVM release 3.8
-
-This is support for llvm releae 3.8
-
-V2:add specific comment about bitcode library link about change in
-LLVM3.8 of materialized check.
-
-Signed-off-by: Pan Xiuli <xiuli.pan@intel.com>
-Reviewed-by: Ruiling Song <ruiling.song@intel.com>
-
-diff --git a/backend/src/backend/gen_program.cpp b/backend/src/backend/gen_program.cpp
-index e3c2895..099116c 100644
---- a/backend/src/backend/gen_program.cpp
-+++ b/backend/src/backend/gen_program.cpp
-@@ -450,7 +450,11 @@ namespace gbe {
- using namespace gbe;
- char* errMsg;
- if(((GenProgram*)dst_program)->module == NULL){
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ ((GenProgram*)dst_program)->module = llvm::CloneModule((llvm::Module*)((GenProgram*)src_program)->module).release();
-+#else
- ((GenProgram*)dst_program)->module = llvm::CloneModule((llvm::Module*)((GenProgram*)src_program)->module);
-+#endif
- errSize = 0;
- }else{
- llvm::Module* src = (llvm::Module*)((GenProgram*)src_program)->module;
-diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp
-index 7d12f73..2b44025 100644
---- a/backend/src/backend/program.cpp
-+++ b/backend/src/backend/program.cpp
-@@ -124,7 +124,11 @@ namespace gbe {
- llvm::Module * cloned_module = NULL;
- bool ret = true;
- if(module){
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ cloned_module = llvm::CloneModule((llvm::Module*)module).release();
-+#else
- cloned_module = llvm::CloneModule((llvm::Module*)module);
-+#endif
- }
- bool strictMath = true;
- if (fast_relaxed_math || !OCL_STRICT_CONFORMANCE)
-diff --git a/backend/src/llvm/ExpandConstantExpr.cpp b/backend/src/llvm/ExpandConstantExpr.cpp
-index c6f57b8..e9ec3ab 100644
---- a/backend/src/llvm/ExpandConstantExpr.cpp
-+++ b/backend/src/llvm/ExpandConstantExpr.cpp
-@@ -115,7 +115,7 @@ static Value *expandConstantVector(Instruction *InsertPt, ConstantVector *CV) {
- Type *IntTy = IntegerType::get(CV->getContext(), 32);
-
- BasicBlock::iterator InsertPos(InsertPt);
-- IRBuilder<> IRB(InsertPos);
-+ IRBuilder<> IRB(&*InsertPos);
- Value *vec = UndefValue::get(CV->getType());
- for (int i = 0; i < elemNum; i++) {
- Value *idx = ConstantInt::get(IntTy, i);
-@@ -177,7 +177,7 @@ bool ExpandConstantExpr::runOnFunction(Function &Func) {
- for (BasicBlock::InstListType::iterator Inst = BB->begin(), E = BB->end();
- Inst != E;
- ++Inst) {
-- Modified |= expandInstruction(Inst);
-+ Modified |= expandInstruction(&*Inst);
- }
- }
- return Modified;
-diff --git a/backend/src/llvm/ExpandLargeIntegers.cpp b/backend/src/llvm/ExpandLargeIntegers.cpp
-index 20fdda9..00987cb 100644
---- a/backend/src/llvm/ExpandLargeIntegers.cpp
-+++ b/backend/src/llvm/ExpandLargeIntegers.cpp
-@@ -388,7 +388,7 @@ static void convertInstruction(Instruction *Inst, ConversionState &State,
- // Set the insert point *after* Inst, so that any instructions inserted here
- // will be visited again. That allows iterative expansion of types > i128.
- BasicBlock::iterator InsertPos(Inst);
-- IRBuilder<> IRB(++InsertPos);
-+ IRBuilder<> IRB(&*++InsertPos);
- StringRef Name = Inst->getName();
-
- if (PHINode *Phi = dyn_cast<PHINode>(Inst)) {
-diff --git a/backend/src/llvm/ExpandUtils.cpp b/backend/src/llvm/ExpandUtils.cpp
-index 801f969..a09d990 100644
---- a/backend/src/llvm/ExpandUtils.cpp
-+++ b/backend/src/llvm/ExpandUtils.cpp
-@@ -101,7 +101,7 @@ namespace llvm {
- Function *RecreateFunction(Function *Func, FunctionType *NewType) {
- Function *NewFunc = Function::Create(NewType, Func->getLinkage());
- NewFunc->copyAttributesFrom(Func);
-- Func->getParent()->getFunctionList().insert(Func, NewFunc);
-+ Func->getParent()->getFunctionList().insert(ilist_iterator<Function>(Func), NewFunc);
- NewFunc->takeName(Func);
- NewFunc->getBasicBlockList().splice(NewFunc->begin(),
- Func->getBasicBlockList());
-diff --git a/backend/src/llvm/PromoteIntegers.cpp b/backend/src/llvm/PromoteIntegers.cpp
-index b65440f..8759287 100644
---- a/backend/src/llvm/PromoteIntegers.cpp
-+++ b/backend/src/llvm/PromoteIntegers.cpp
-@@ -615,7 +615,7 @@ bool PromoteIntegers::runOnFunction(Function &F) {
- // Don't support changing the function arguments. This should not be
- // generated by clang.
- for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I) {
-- Value *Arg = I;
-+ Value *Arg = &*I;
- if (shouldConvert(Arg)) {
- errs() << "Function " << F.getName() << ": " << *Arg << "\n";
- llvm_unreachable("Function has illegal integer/pointer argument");
-@@ -626,7 +626,7 @@ bool PromoteIntegers::runOnFunction(Function &F) {
- bool Modified = false;
- for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI) {
- for (BasicBlock::iterator BBI = FI->begin(), BBE = FI->end(); BBI != BBE;) {
-- Instruction *Inst = BBI++;
-+ Instruction *Inst = &*BBI++;
- // Only attempt to convert an instruction if its result or any of its
- // operands are illegal.
- bool ShouldConvert = shouldConvert(Inst);
-diff --git a/backend/src/llvm/StripAttributes.cpp b/backend/src/llvm/StripAttributes.cpp
-index e6df312..3bf3853 100644
---- a/backend/src/llvm/StripAttributes.cpp
-+++ b/backend/src/llvm/StripAttributes.cpp
-@@ -98,7 +98,7 @@ bool StripAttributes::runOnFunction(Function &Func) {
- BB != E; ++BB) {
- for (BasicBlock::iterator Inst = BB->begin(), E = BB->end();
- Inst != E; ++Inst) {
-- CallSite Call(Inst);
-+ CallSite Call(&*Inst);
- if (Call)
- Call.setCallingConv(CallingConv::C);
- }
-diff --git a/backend/src/llvm/llvm_bitcode_link.cpp b/backend/src/llvm/llvm_bitcode_link.cpp
-index 56205bb..10fccf6 100644
---- a/backend/src/llvm/llvm_bitcode_link.cpp
-+++ b/backend/src/llvm/llvm_bitcode_link.cpp
-@@ -68,8 +68,9 @@ namespace gbe
- return oclLib;
- }
-
-- static bool materializedFuncCall(Module& src, Module& lib, llvm::Function &KF, std::set<std::string>& MFS)
-- {
-+ static bool materializedFuncCall(Module& src, Module& lib, llvm::Function& KF,
-+ std::set<std::string>& MFS,
-+ std::vector<GlobalValue *>&Gvs) {
- bool fromSrc = false;
- for (llvm::Function::iterator B = KF.begin(), BE = KF.end(); B != BE; B++) {
- for (BasicBlock::iterator instI = B->begin(),
-@@ -112,9 +113,10 @@ namespace gbe
- printf("Can not materialize the function: %s, because %s\n", fnName.c_str(), EC.message().c_str());
- return false;
- }
-+ Gvs.push_back((GlobalValue *)newMF);
- #endif
- }
-- if (!materializedFuncCall(src, lib, *newMF, MFS))
-+ if (!materializedFuncCall(src, lib, *newMF, MFS, Gvs))
- return false;
-
- }
-@@ -128,6 +130,7 @@ namespace gbe
- {
- LLVMContext& ctx = mod->getContext();
- std::set<std::string> materializedFuncs;
-+ std::vector<GlobalValue *> Gvs;
- Module* clonedLib = createOclBitCodeModule(ctx, strictMath);
- assert(clonedLib && "Can not create the beignet bitcode\n");
-
-@@ -173,10 +176,11 @@ namespace gbe
- if (!isKernelFunction(*SF)) continue;
- kernels.push_back(SF->getName().data());
-
-- if (!materializedFuncCall(*mod, *clonedLib, *SF, materializedFuncs)) {
-+ if (!materializedFuncCall(*mod, *clonedLib, *SF, materializedFuncs, Gvs)) {
- delete clonedLib;
- return NULL;
- }
-+ Gvs.push_back((GlobalValue *)&*SF);
- }
-
- if (kernels.empty()) {
-@@ -215,14 +219,43 @@ namespace gbe
- }
- #endif
-
-- if (!materializedFuncCall(*mod, *clonedLib, *newMF, materializedFuncs)) {
-+ if (!materializedFuncCall(*mod, *clonedLib, *newMF, materializedFuncs, Gvs)) {
- delete clonedLib;
- return NULL;
- }
-
-+ Gvs.push_back((GlobalValue *)newMF);
- kernels.push_back(f);
- }
-
-+ /* The llvm 3.8 now has a strict materialized check for all value by checking
-+ * module is materialized. If we want to use library as old style that just
-+ * materialize what we need, we need to remove what we did not need before
-+ * materialize all of the module. To do this, we need all of the builtin
-+ * funcitons and what are needed from the kernel functions, these functions
-+ * are materalized and are recorded in Gvs, the GlobalValue like PI are also
-+ * needed and are added. Now we could not use use_empty to check if the GVs
-+ * are needed before the module is marked as all materialized, so we just
-+ * materialize all of them as there are only 7 GVs. Then we use GVExtraction
-+ * pass to extract the functions and values in Gvs from the library module.
-+ * After extract what we need and remove what we do not need, we use
-+ * materializeAll to mark the module as materialized. */
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >=8
-+ /* Get all GlobalValue from module. */
-+ Module::GlobalListType &GVlist = clonedLib->getGlobalList();
-+ for(Module::global_iterator GVitr = GVlist.begin();GVitr != GVlist.end();++GVitr) {
-+ GlobalValue * GV = &*GVitr;
-+ clonedLib->materialize(GV);
-+ Gvs.push_back(GV);
-+ }
-+ llvm::legacy::PassManager Extract;
-+ /* Extract all values we need using GVExtractionPass. */
-+ Extract.add(createGVExtractionPass(Gvs, false));
-+ Extract.run(*clonedLib);
-+ /* Mark the library module as materialized for later use. */
-+ clonedLib->materializeAll();
-+#endif
-+
- /* the SPIR binary datalayout maybe different with beignet's bitcode */
- if(clonedLib->getDataLayout() != mod->getDataLayout())
- mod->setDataLayout(clonedLib->getDataLayout());
-diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp
-index 886b6f3..1a2bbcd 100644
---- a/backend/src/llvm/llvm_gen_backend.cpp
-+++ b/backend/src/llvm/llvm_gen_backend.cpp
-@@ -1226,7 +1226,7 @@ namespace gbe
- }
- bool isImage = llvmInfo.isImageType();
- if (I->getType()->isPointerTy() || isImage) {
-- BtiMap.insert(std::make_pair(I, getNewBti(I, isImage)));
-+ BtiMap.insert(std::make_pair(&*I, getNewBti(&*I, isImage)));
- }
- }
-
-@@ -1340,7 +1340,7 @@ namespace gbe
- // function argument
- for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I) {
- if (I->getType()->isPointerTy()) {
-- findPointerEscape(I, mixedPtr, true, revisit);
-+ findPointerEscape(&*I, mixedPtr, true, revisit);
- }
- }
- // alloca
-@@ -1389,7 +1389,7 @@ namespace gbe
- while (isa<AllocaInst>(bbIter)) ++bbIter;
-
- IRBuilder<> Builder(&entry);
-- Builder.SetInsertPoint(bbIter);
-+ Builder.SetInsertPoint(&*bbIter);
-
- PointerType * AITy = cast<AllocaInst>(base)->getType();
- Value * btiArray = Builder.CreateAlloca(AITy->getElementType(), ArraySize, base->getName() + ".bti");
-@@ -1814,7 +1814,7 @@ namespace gbe
- }
-
- void GenWriter::simplifyTerminator(BasicBlock *bb) {
-- Value *value = --bb->end();
-+ Value *value = bb->getTerminator();
- BranchInst *I = NULL;
- if ((I = dyn_cast<BranchInst>(value)) != NULL) {
- if (I->isConditional() == false)
-@@ -2097,12 +2097,12 @@ namespace gbe
- }
-
- // function arguments are uniform values.
-- this->newRegister(I, NULL, true);
-+ this->newRegister(&*I, NULL, true);
-
- // add support for vector argument.
- if(type->isVectorTy()) {
- VectorType *vectorType = cast<VectorType>(type);
-- ir::Register reg = getRegister(I, 0);
-+ ir::Register reg = getRegister(&*I, 0);
- Type *elemType = vectorType->getElementType();
- const uint32_t elemSize = getTypeByteSize(unit, elemType);
- const uint32_t elemNum = vectorType->getNumElements();
-@@ -2112,7 +2112,7 @@ namespace gbe
- ir::Function& fn = ctx.getFunction();
- for(uint32_t i=1; i < elemNum; i++) {
- ir::PushLocation argLocation(fn, argID, elemSize*i);
-- reg = getRegister(I, i);
-+ reg = getRegister(&*I, i);
- ctx.appendPushedConstant(reg, argLocation); //add to push map for reg alloc
- }
- continue;
-@@ -2120,10 +2120,10 @@ namespace gbe
-
- GBE_ASSERTM(isScalarType(type) == true,
- "vector type in the function argument is not supported yet");
-- const ir::Register reg = getRegister(I);
-+ const ir::Register reg = getRegister(&*I);
- if (llvmInfo.isImageType()) {
- ctx.input(argName, ir::FunctionArgument::IMAGE, reg, llvmInfo, 4, 4, 0);
-- ctx.getFunction().getImageSet()->append(reg, &ctx, BtiMap.find(I)->second);
-+ ctx.getFunction().getImageSet()->append(reg, &ctx, BtiMap.find(&*I)->second);
- collectImageArgs(llvmInfo.accessQual, imageArgsInfo);
- continue;
- }
-@@ -2156,7 +2156,7 @@ namespace gbe
- const uint32_t align = getAlignmentByte(unit, pointed);
- switch (addrSpace) {
- case ir::MEM_GLOBAL:
-- ctx.input(argName, ir::FunctionArgument::GLOBAL_POINTER, reg, llvmInfo, ptrSize, align, BtiMap.find(I)->second);
-+ ctx.input(argName, ir::FunctionArgument::GLOBAL_POINTER, reg, llvmInfo, ptrSize, align, BtiMap.find(&*I)->second);
- break;
- case ir::MEM_LOCAL:
- ctx.input(argName, ir::FunctionArgument::LOCAL_POINTER, reg, llvmInfo, ptrSize, align, BTI_LOCAL);
-@@ -2934,12 +2934,12 @@ namespace gbe
-
- // First create all the labels (one per block) ...
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
-- this->newLabelIndex(BB);
-+ this->newLabelIndex(&*BB);
-
- // Then, for all branch instructions that have conditions, see if we can
- // simplify the code by inverting condition code
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
-- this->simplifyTerminator(BB);
-+ this->simplifyTerminator(&*BB);
-
- // gather loop info, which is useful for liveness analysis
- gatherLoopInfo(fn);
-@@ -2947,7 +2947,7 @@ namespace gbe
- // ... then, emit the instructions for all basic blocks
- pass = PASS_EMIT_INSTRUCTIONS;
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
-- emitBasicBlock(BB);
-+ emitBasicBlock(&*BB);
- ctx.endFunction();
-
- // Liveness can be shared when we optimized the immediates and the MOVs
-@@ -3477,7 +3477,7 @@ namespace gbe
- Value *Callee = I.getCalledValue();
- GBE_ASSERT(ctx.getFunction().getProfile() == ir::PROFILE_OCL);
- GBE_ASSERT(isa<InlineAsm>(I.getCalledValue()) == false);
-- GBE_ASSERT(I.hasStructRetAttr() == false);
-+ if(I.getNumArgOperands()) GBE_ASSERT(I.hasStructRetAttr() == false);
-
- // We only support a small number of intrinsics right now
- if (Function *F = I.getCalledFunction()) {
-diff --git a/backend/src/llvm/llvm_includes.hpp b/backend/src/llvm/llvm_includes.hpp
-index fed3a18..d2deb90 100644
---- a/backend/src/llvm/llvm_includes.hpp
-+++ b/backend/src/llvm/llvm_includes.hpp
-@@ -122,4 +122,9 @@
-
- #include <clang/CodeGen/CodeGenAction.h>
-
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >=8
-+#include "llvm/Analysis/BasicAliasAnalysis.h"
-+#include "llvm/Analysis/TypeBasedAliasAnalysis.h"
-+#endif
-+
- #endif /* __GBE_IR_LLVM_INCLUDES_HPP__ */
-diff --git a/backend/src/llvm/llvm_intrinsic_lowering.cpp b/backend/src/llvm/llvm_intrinsic_lowering.cpp
-index b35d1e6..c26e96a 100644
---- a/backend/src/llvm/llvm_intrinsic_lowering.cpp
-+++ b/backend/src/llvm/llvm_intrinsic_lowering.cpp
-@@ -73,7 +73,7 @@ namespace gbe {
- Constant* FCache = M->getOrInsertFunction(NewFn,
- FunctionType::get(RetTy, ParamTys, false));
-
-- IRBuilder<> Builder(CI->getParent(), CI);
-+ IRBuilder<> Builder(CI->getParent(), BasicBlock::iterator(CI));
- SmallVector<Value *, 8> Args(ArgBegin, ArgEnd);
- CallInst *NewCI = Builder.CreateCall(FCache, Args);
- NewCI->setName(CI->getName());
-@@ -90,12 +90,12 @@ namespace gbe {
- DataLayout TD(M);
- LLVMContext &Context = BB.getContext();
- for (BasicBlock::iterator DI = BB.begin(); DI != BB.end(); ) {
-- Instruction *Inst = DI++;
-+ Instruction *Inst = &*DI++;
- CallInst* CI = dyn_cast<CallInst>(Inst);
- if(CI == NULL)
- continue;
-
-- IRBuilder<> Builder(&BB, CI);
-+ IRBuilder<> Builder(&BB, BasicBlock::iterator(CI));
- // only support memcpy and memset
- if (Function *F = CI->getCalledFunction()) {
- const Intrinsic::ID intrinsicID = (Intrinsic::ID) F->getIntrinsicID();
-diff --git a/backend/src/llvm/llvm_loadstore_optimization.cpp b/backend/src/llvm/llvm_loadstore_optimization.cpp
-index 698fdc2..121f53d 100644
---- a/backend/src/llvm/llvm_loadstore_optimization.cpp
-+++ b/backend/src/llvm/llvm_loadstore_optimization.cpp
-@@ -35,13 +35,22 @@ namespace gbe {
- GenLoadStoreOptimization() : BasicBlockPass(ID) {}
-
- void getAnalysisUsage(AnalysisUsage &AU) const {
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ AU.addRequired<ScalarEvolutionWrapperPass>();
-+ AU.addPreserved<ScalarEvolutionWrapperPass>();
-+#else
- AU.addRequired<ScalarEvolution>();
- AU.addPreserved<ScalarEvolution>();
-+#endif
- AU.setPreservesCFG();
- }
-
- virtual bool runOnBasicBlock(BasicBlock &BB) {
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE();
-+#else
- SE = &getAnalysis<ScalarEvolution>();
-+#endif
- #if LLVM_VERSION_MINOR >= 7
- TD = &BB.getModule()->getDataLayout();
- #elif LLVM_VERSION_MINOR >= 5
-@@ -159,9 +168,9 @@ namespace gbe {
- bool isLoad) {
-
- BasicBlock::iterator stepForward = start;
-- if(!isSimpleLoadStore(start)) return stepForward;
-+ if(!isSimpleLoadStore(&*start)) return stepForward;
-
-- merged.push_back(start);
-+ merged.push_back(&*start);
-
- BasicBlock::iterator E = BB.end();
- BasicBlock::iterator J = ++start;
-@@ -170,8 +179,8 @@ namespace gbe {
-
- for(unsigned ss = 0; J != E && ss <= maxLimit; ++ss, ++J) {
- if((isLoad && isa<LoadInst>(*J)) || (!isLoad && isa<StoreInst>(*J))) {
-- if(isLoadStoreCompatible(merged[merged.size()-1], J)) {
-- merged.push_back(J);
-+ if(isLoadStoreCompatible(merged[merged.size()-1], &*J)) {
-+ merged.push_back(&*J);
- stepForward = ++J;
- }
- } else if((isLoad && isa<StoreInst>(*J)) || (!isLoad && isa<LoadInst>(*J))) {
-@@ -217,7 +226,7 @@ namespace gbe {
- for (BasicBlock::iterator BBI = BB.begin(), E = BB.end(); BBI != E;++BBI) {
- if(isa<LoadInst>(*BBI) || isa<StoreInst>(*BBI)) {
- bool isLoad = isa<LoadInst>(*BBI) ? true: false;
-- Type *ty = getValueType(BBI);
-+ Type *ty = getValueType(&*BBI);
- if(ty->isVectorTy()) continue;
- // TODO Support DWORD/WORD/BYTE LOAD for store support DWORD only now.
- if (!(ty->isFloatTy() || ty->isIntegerTy(32) ||
-diff --git a/backend/src/llvm/llvm_printf_parser.cpp b/backend/src/llvm/llvm_printf_parser.cpp
-index 422f16b..2bf3d04 100644
---- a/backend/src/llvm/llvm_printf_parser.cpp
-+++ b/backend/src/llvm/llvm_printf_parser.cpp
-@@ -618,7 +618,7 @@ error:
- Value* op0 = NULL;
- Value* val = NULL;
-
-- builder->SetInsertPoint(F.begin()->begin());// Insert the common var in the begin.
-+ builder->SetInsertPoint(&*(F.begin()->begin()));// Insert the common var in the begin.
-
- /* FIXME: Because the OpenCL language do not support va macro, and we do not want
- to introduce the va_list, va_start and va_end into our code, we just simulate
-diff --git a/backend/src/llvm/llvm_scalarize.cpp b/backend/src/llvm/llvm_scalarize.cpp
-index 899a696..9efb897 100644
---- a/backend/src/llvm/llvm_scalarize.cpp
-+++ b/backend/src/llvm/llvm_scalarize.cpp
-@@ -197,7 +197,7 @@ namespace gbe {
- /* set to insert new instructions after the specified instruction.*/
- void setAppendPoint(Instruction *insn) {
- BasicBlock::iterator next(insn);
-- builder->SetInsertPoint(++next);
-+ builder->SetInsertPoint(&*++next);
- }
-
- DenseMap<Value*, VectorValues> vectorVals;
-@@ -801,7 +801,7 @@ namespace gbe {
- return;
- ReversePostOrderTraversal<Function*> rpot(&F);
- BasicBlock::iterator instI = (*rpot.begin())->begin();
-- builder->SetInsertPoint(instI);
-+ builder->SetInsertPoint(&*instI);
-
- Function::arg_iterator I = F.arg_begin(), E = F.arg_end();
-
-@@ -809,7 +809,7 @@ namespace gbe {
- Type *type = I->getType();
-
- if(type->isVectorTy())
-- extractFromVector(I);
-+ extractFromVector(&*I);
- }
- return;
- }
-@@ -846,11 +846,11 @@ namespace gbe {
- RPOTType rpot(&F);
- for (RPOTType::rpo_iterator bbI = rpot.begin(), bbE = rpot.end(); bbI != bbE; ++bbI) {
- for (BasicBlock::iterator instI = (*bbI)->begin(), instE = (*bbI)->end(); instI != instE; ++instI) {
-- bool scalarized = scalarize(instI);
-+ bool scalarized = scalarize(&*instI);
- if (scalarized) {
- changed = true;
- // TODO: uncomment when done
-- deadList.push_back(instI);
-+ deadList.push_back(&*instI);
- }
- }
- }
-diff --git a/backend/src/llvm/llvm_to_gen.cpp b/backend/src/llvm/llvm_to_gen.cpp
-index b8ab1dd..653fc09 100644
---- a/backend/src/llvm/llvm_to_gen.cpp
-+++ b/backend/src/llvm/llvm_to_gen.cpp
-@@ -45,7 +45,6 @@ namespace gbe
- using namespace llvm;
-
- #if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7
-- using namespace llvm::legacy;
- #define TARGETLIBRARY TargetLibraryInfoImpl
- #else
- #define TARGETLIBRARY TargetLibraryInfo
-@@ -53,7 +52,11 @@ namespace gbe
-
- void runFuntionPass(Module &mod, TARGETLIBRARY *libraryInfo, const DataLayout &DL)
- {
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7
-+ legacy::FunctionPassManager FPM(&mod);
-+#else
- FunctionPassManager FPM(&mod);
-+#endif
-
- #if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7
- #elif LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 6
-@@ -74,8 +77,13 @@ namespace gbe
- #else
- FPM.add(new TargetLibraryInfo(*libraryInfo));
- #endif
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ FPM.add(createTypeBasedAAWrapperPass());
-+ FPM.add(createBasicAAWrapperPass());
-+#else
- FPM.add(createTypeBasedAliasAnalysisPass());
- FPM.add(createBasicAliasAnalysisPass());
-+#endif
- FPM.add(createCFGSimplificationPass());
- FPM.add(createSROAPass());
- FPM.add(createEarlyCSEPass());
-@@ -91,7 +99,11 @@ namespace gbe
-
- void runModulePass(Module &mod, TARGETLIBRARY *libraryInfo, const DataLayout &DL, int optLevel, bool strictMath)
- {
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7
-+ legacy::PassManager MPM;
-+#else
- PassManager MPM;
-+#endif
-
- #if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7
- #elif LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 6
-@@ -107,8 +119,13 @@ namespace gbe
- #else
- MPM.add(new TargetLibraryInfo(*libraryInfo));
- #endif
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ MPM.add(createTypeBasedAAWrapperPass());
-+ MPM.add(createBasicAAWrapperPass());
-+#else
- MPM.add(createTypeBasedAliasAnalysisPass());
- MPM.add(createBasicAliasAnalysisPass());
-+#endif
- MPM.add(createIntrinsicLoweringPass());
- MPM.add(createStripAttributesPass()); // Strip unsupported attributes and calling conventions.
- MPM.add(createSamplerFixPass());
-@@ -123,11 +140,19 @@ namespace gbe
- MPM.add(createBarrierNodupPass(false)); // remove noduplicate fnAttr before inlining.
- MPM.add(createFunctionInliningPass(20000));
- MPM.add(createBarrierNodupPass(true)); // restore noduplicate fnAttr after inlining.
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ MPM.add(createPostOrderFunctionAttrsPass()); // Set readonly/readnone attrs
-+#else
- MPM.add(createFunctionAttrsPass()); // Set readonly/readnone attrs
-+#endif
-
- //MPM.add(createScalarReplAggregatesPass(64, true, -1, -1, 64))
- if(optLevel > 0)
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ MPM.add(createSROAPass());
-+#else
- MPM.add(createSROAPass(/*RequiresDomTree*/ false));
-+#endif
- MPM.add(createEarlyCSEPass()); // Catch trivial redundancies
- MPM.add(createJumpThreadingPass()); // Thread jumps.
- MPM.add(createCorrelatedValuePropagationPass()); // Propagate conditionals
-@@ -146,7 +171,11 @@ namespace gbe
- MPM.add(createLoopDeletionPass()); // Delete dead loops
- MPM.add(createLoopUnrollPass(640)); //1024, 32, 1024, 512)); //Unroll loops
- if(optLevel > 0) {
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ MPM.add(createSROAPass());
-+#else
- MPM.add(createSROAPass(/*RequiresDomTree*/ false));
-+#endif
- MPM.add(createGVNPass()); // Remove redundancies
- }
- #if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5
-@@ -157,7 +186,11 @@ namespace gbe
- MPM.add(createCustomLoopUnrollPass()); //1024, 32, 1024, 512)); //Unroll loops
- MPM.add(createLoopUnrollPass()); //1024, 32, 1024, 512)); //Unroll loops
- if(optLevel > 0) {
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ MPM.add(createSROAPass());
-+#else
- MPM.add(createSROAPass(/*RequiresDomTree*/ false));
-+#endif
- MPM.add(createGVNPass()); // Remove redundancies
- }
- }
-@@ -184,7 +217,15 @@ namespace gbe
- }
-
-
--#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7
-+#define OUTPUT_BITCODE(STAGE, MOD) do { \
-+ legacy::PassManager passes__; \
-+ if (OCL_OUTPUT_LLVM_##STAGE) { \
-+ passes__.add(createPrintModulePass(*o)); \
-+ passes__.run(MOD); \
-+ } \
-+ }while(0)
-+#elif LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5
- #define OUTPUT_BITCODE(STAGE, MOD) do { \
- PassManager passes__; \
- if (OCL_OUTPUT_LLVM_##STAGE) { \
-@@ -256,7 +297,11 @@ namespace gbe
-
- runFuntionPass(mod, libraryInfo, DL);
- runModulePass(mod, libraryInfo, DL, optLevel, strictMath);
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7
-+ legacy::PassManager passes;
-+#else
- PassManager passes;
-+#endif
- #if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7
- #elif LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 6
- passes.add(new DataLayoutPass());
-diff --git a/backend/src/llvm/llvm_unroll.cpp b/backend/src/llvm/llvm_unroll.cpp
-index 6990e39..0f62bdc 100644
---- a/backend/src/llvm/llvm_unroll.cpp
-+++ b/backend/src/llvm/llvm_unroll.cpp
-@@ -47,8 +47,13 @@ namespace gbe {
- AU.addPreservedID(LoopSimplifyID);
- AU.addRequiredID(LCSSAID);
- AU.addPreservedID(LCSSAID);
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ AU.addRequired<ScalarEvolutionWrapperPass>();
-+ AU.addPreserved<ScalarEvolutionWrapperPass>();
-+#else
- AU.addRequired<ScalarEvolution>();
- AU.addPreserved<ScalarEvolution>();
-+#endif
- // FIXME: Loop unroll requires LCSSA. And LCSSA requires dom info.
- // If loop unroll does not preserve dom info then LCSSA pass on next
- // loop will receive invalid dom info.
-@@ -156,7 +161,12 @@ namespace gbe {
- // be unrolled.
- bool handleParentLoops(Loop *L, LPPassManager &LPM) {
- Loop *currL = L;
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ ScalarEvolution *SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE();
-+ LoopInfo &loopInfo = getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
-+#else
- ScalarEvolution *SE = &getAnalysis<ScalarEvolution>();
-+#endif
- BasicBlock *ExitBlock = currL->getLoopLatch();
- if (!ExitBlock || !L->isLoopExiting(ExitBlock))
- ExitBlock = currL->getExitingBlock();
-@@ -183,7 +193,11 @@ namespace gbe {
- shouldUnroll = false;
- setUnrollID(currL, false);
- if (currL != L)
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ loopInfo.markAsRemoved(currL);
-+#else
- LPM.deleteLoopFromQueue(currL);
-+#endif
- }
- currL = parentL;
- currTripCount = parentTripCount;
---
-cgit v0.10.2
diff --git a/gcc6.patch b/gcc6.patch
deleted file mode 100644
index 3d54f49245c4..000000000000
--- a/gcc6.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 356c856479207e2514d44d28456a70766691fccc Mon Sep 17 00:00:00 2001
-From: Pan Xiuli <xiuli.pan@intel.com>
-Date: Tue, 3 May 2016 10:58:10 +0800
-Subject: Add support for gcc 6
-
-Signed-off-by: Pan Xiuli <xiuli.pan@intel.com>
-Reviewed-by: Yang Rong <rong.r.yang@intel.com>
-
-diff --git a/backend/src/ir/immediate.hpp b/backend/src/ir/immediate.hpp
-index 3141643..6bc60d5 100644
---- a/backend/src/ir/immediate.hpp
-+++ b/backend/src/ir/immediate.hpp
-@@ -343,7 +343,7 @@ namespace ir {
- float *f32;
- double *f64;
- half *f16;
-- const Immediate *immVec[];
-+ const Immediate **immVec;
- void *p;
- } data; //!< Value to store
- Immediate operator+ (const Immediate &) const;
-diff --git a/utests/builtin_exp.cpp b/utests/builtin_exp.cpp
-index 406d223..1eaa187 100644
---- a/utests/builtin_exp.cpp
-+++ b/utests/builtin_exp.cpp
-@@ -5,7 +5,7 @@
- #define udebug 0
-
- #define FLT_MAX 0x1.fffffep127f
--#define FLT_MIN 0x1.0p-126f
-+#define FLT_MIN ldexp(1.0,-126)
- #define FLT_ULP (1.0e-6f)
-
- #define printf_c(...) \
-diff --git a/utests/utest_generator.py b/utests/utest_generator.py
-index 84029da..38d9ea0 100644
---- a/utests/utest_generator.py
-+++ b/utests/utest_generator.py
-@@ -4,8 +4,8 @@ import os,sys,re
-
- FLT_MAX_POSI='0x1.fffffep127f'
- FLT_MIN_NEGA='-0x1.fffffep127f'
--FLT_MIN_POSI='0x1.0p-126f'
--FLT_MAX_NEGA='-0x1.0p-126f'
-+FLT_MIN_POSI='ldexp(1.0, -126)'
-+FLT_MAX_NEGA='ldexp(-1.0, -126)'
-
- paraTypeList={'float':'%e','int':'%d','double':'%lf','uint':'%d','string':'%s'}
-
---
-cgit v0.10.2
diff --git a/isnan.patch b/isnan.patch
deleted file mode 100644
index 5dfb7d69483a..000000000000
--- a/isnan.patch
+++ /dev/null
@@ -1,237 +0,0 @@
-diff -aur Beignet-1.1.1-Source/utests/builtin_acos_asin.cpp Beignet-1.1.1-Source.new/utests/builtin_acos_asin.cpp
---- Beignet-1.1.1-Source/utests/builtin_acos_asin.cpp 2015-09-18 00:01:08.000000000 -0700
-+++ Beignet-1.1.1-Source.new/utests/builtin_acos_asin.cpp 2016-03-08 22:48:14.862878670 -0800
-@@ -59,10 +59,10 @@
- {
- index_cur = k * max_function + i;
- #if udebug
-- if (isinf(cpu_data[index_cur]) && !isinf(gpu_data[index_cur])){
-+ if (std::isinf(cpu_data[index_cur]) && !std::isinf(gpu_data[index_cur])){
- printf_c("%d/%d: %f -> gpu:%f cpu:%f\n", k, i, input_data[k], gpu_data[index_cur], cpu_data[index_cur]);
- }
-- else if (isnan(cpu_data[index_cur]) && !isnan(gpu_data[index_cur])){
-+ else if (std::isnan(cpu_data[index_cur]) && !std::isnan(gpu_data[index_cur])){
- printf_c("%d/%d: %f -> gpu:%f cpu:%f\n", k, i, input_data[k], gpu_data[index_cur], cpu_data[index_cur]);
- }
- else if(fabs(gpu_data[index_cur] - cpu_data[index_cur]) > 1e-3f){
-@@ -71,10 +71,10 @@
- else
- printf("%d/%d: %f -> gpu:%f cpu:%f\n", k, i, input_data[k], gpu_data[index_cur], cpu_data[index_cur]);
- #else
-- if (isinf(cpu_data[index_cur]))
-- OCL_ASSERT(isinf(gpu_data[index_cur]));
-- else if (isnan(cpu_data[index_cur]))
-- OCL_ASSERT(isnan(gpu_data[index_cur]));
-+ if (std::isinf(cpu_data[index_cur]))
-+ OCL_ASSERT(std::isinf(gpu_data[index_cur]));
-+ else if (std::isnan(cpu_data[index_cur]))
-+ OCL_ASSERT(std::isnan(gpu_data[index_cur]));
- else
- {
- OCL_ASSERT(fabs(gpu_data[index_cur] - cpu_data[index_cur]) < 1e-3f);
-diff -aur Beignet-1.1.1-Source/utests/builtin_exp.cpp Beignet-1.1.1-Source.new/utests/builtin_exp.cpp
---- Beignet-1.1.1-Source/utests/builtin_exp.cpp 2015-09-18 00:01:08.000000000 -0700
-+++ Beignet-1.1.1-Source.new/utests/builtin_exp.cpp 2016-03-08 22:48:14.862878670 -0800
-@@ -71,10 +71,10 @@
- diff/gpu_data[index_cur], 3 * FLT_ULP);
-
- #if udebug
-- if (isinf(cpu_data[index_cur]) && isinf(gpu_data[index_cur])){
-+ if (std::isinf(cpu_data[index_cur]) && std::isinf(gpu_data[index_cur])){
- printf(log);
- }
-- else if (isnan(cpu_data[index_cur]) && isnan(gpu_data[index_cur])){
-+ else if (std::isnan(cpu_data[index_cur]) && std::isnan(gpu_data[index_cur])){
- printf(log);
- }
- else if( diff / cpu_data[index_cur] < 3 * FLT_ULP \
-@@ -86,10 +86,10 @@
- else
- printf_c(log);
- #else
-- if (isinf(cpu_data[index_cur]))
-- OCL_ASSERTM(isinf(gpu_data[index_cur]), log);
-- else if (isnan(cpu_data[index_cur]))
-- OCL_ASSERTM(isnan(gpu_data[index_cur]), log);
-+ if (std::isinf(cpu_data[index_cur]))
-+ OCL_ASSERTM(std::isinf(gpu_data[index_cur]), log);
-+ else if (std::isnan(cpu_data[index_cur]))
-+ OCL_ASSERTM(std::isnan(gpu_data[index_cur]), log);
- else if ( gpu_data[index_cur] > FLT_ULP || cpu_data[index_cur] > FLT_ULP)
- OCL_ASSERTM(fabs( diff / cpu_data[index_cur]) < 3 * FLT_ULP, log);
- else
-Only in Beignet-1.1.1-Source.new/utests: builtin_frexp.cpp~
-Only in Beignet-1.1.1-Source.new/utests: builtin_modf.cpp~
-Only in Beignet-1.1.1-Source.new/utests: builtin_nextafter.cpp~
-diff -aur Beignet-1.1.1-Source/utests/builtin_pow.cpp Beignet-1.1.1-Source.new/utests/builtin_pow.cpp
---- Beignet-1.1.1-Source/utests/builtin_pow.cpp 2015-09-18 00:01:08.000000000 -0700
-+++ Beignet-1.1.1-Source.new/utests/builtin_pow.cpp 2016-03-08 22:48:14.866212006 -0800
-@@ -74,8 +74,8 @@
- {
- index_cur = k * max_function + i;
- #if udebug
-- if ( (isinf(cpu_data[index_cur]) && !isinf(gpu_data[index_cur])) ||
-- (isnan(cpu_data[index_cur]) && !isnan(gpu_data[index_cur])) ||
-+ if ( (std::isinf(cpu_data[index_cur]) && !std::isinf(gpu_data[index_cur])) ||
-+ (std::isnan(cpu_data[index_cur]) && !std::isnan(gpu_data[index_cur])) ||
- (fabs(gpu_data[index_cur] - cpu_data[index_cur]) > cl_FLT_ULP(cpu_data[index_cur]) * ULPSIZE_FACTOR
- && (denormals_supported || gpu_data[index_cur]!=0 || std::fpclassify(cpu_data[index_cur])!=FP_SUBNORMAL) ) )
-
-@@ -85,10 +85,10 @@
- else
- printf("%d/%d: x:%f, y:%f -> gpu:%f cpu:%f\n", k, i, input_data1[k], input_data2[k], gpu_data[index_cur], cpu_data[index_cur]);
- #else
-- if (isinf(cpu_data[index_cur]))
-- OCL_ASSERT(isinf(gpu_data[index_cur]));
-- else if (isnan(cpu_data[index_cur]))
-- OCL_ASSERT(isnan(gpu_data[index_cur]));
-+ if (std::isinf(cpu_data[index_cur]))
-+ OCL_ASSERT(std::isinf(gpu_data[index_cur]));
-+ else if (std::isnan(cpu_data[index_cur]))
-+ OCL_ASSERT(std::isnan(gpu_data[index_cur]));
- else
- {
- OCL_ASSERT((fabs(gpu_data[index_cur] - cpu_data[index_cur]) < cl_FLT_ULP(cpu_data[index_cur]) * ULPSIZE_FACTOR) ||
-Only in Beignet-1.1.1-Source.new/utests: builtin_remquo.cpp~
-diff -aur Beignet-1.1.1-Source/utests/builtin_tgamma.cpp Beignet-1.1.1-Source.new/utests/builtin_tgamma.cpp
---- Beignet-1.1.1-Source/utests/builtin_tgamma.cpp 2015-09-18 00:01:08.000000000 -0700
-+++ Beignet-1.1.1-Source.new/utests/builtin_tgamma.cpp 2016-03-08 22:48:14.866212006 -0800
-@@ -43,8 +43,8 @@
- max_ulp = fabsf(cpu - dst[i]) / cl_FLT_ULP(cpu);
- max_ulp_at = src[i];
- }
-- if (isinf(cpu)) {
-- OCL_ASSERT(isinf(dst[i]));
-+ if (std::isinf(cpu)) {
-+ OCL_ASSERT(std::isinf(dst[i]));
- } else if (fabsf(cpu - dst[i]) >= cl_FLT_ULP(cpu) * ULPSIZE_FACTOR) {
- printf("%f %f %f\n", src[i], cpu, dst[i]);
- OCL_ASSERT(0);
-diff -aur Beignet-1.1.1-Source/utests/compiler_half.cpp Beignet-1.1.1-Source.new/utests/compiler_half.cpp
---- Beignet-1.1.1-Source/utests/compiler_half.cpp 2015-09-18 00:01:08.000000000 -0700
-+++ Beignet-1.1.1-Source.new/utests/compiler_half.cpp 2016-03-08 22:48:14.866212006 -0800
-@@ -229,7 +229,7 @@
- OCL_ASSERT(((fabs(fdst[i]) < 6e-8f) && (fabs(f) < 6e-8f)) || \
- (fabs(f - fdst[i]) <= 0.03 * fabs(fdst[i])) || \
- (isInf && ((infSign && fdst[i] > 65504.0f) || (!infSign && fdst[i] < -65504.0f))) || \
-- (isnan(f) && isnan(fdst[i]))); \
-+ (std::isnan(f) && std::isnan(fdst[i]))); \
- } \
- OCL_UNMAP_BUFFER(1); \
- } \
-@@ -303,7 +303,7 @@
- OCL_ASSERT(((fabs(fdst[i]) < 6e-8f) && (fabs(f) < 6e-8f)) || \
- (fabs(f - fdst[i]) <= 0.03 * fabs(fdst[i])) || \
- (isInf && ((infSign && fdst[i] > 65504.0f) || (!infSign && fdst[i] < -65504.0f))) || \
-- (isnan(f) && isnan(fdst[i]))); \
-+ (std::isnan(f) && std::isnan(fdst[i]))); \
- } \
- OCL_UNMAP_BUFFER(2); \
- } \
-diff -aur Beignet-1.1.1-Source/utests/compiler_math_2op.cpp Beignet-1.1.1-Source.new/utests/compiler_math_2op.cpp
---- Beignet-1.1.1-Source/utests/compiler_math_2op.cpp 2015-09-18 00:01:08.000000000 -0700
-+++ Beignet-1.1.1-Source.new/utests/compiler_math_2op.cpp 2016-03-08 22:48:14.869545342 -0800
-@@ -65,10 +65,10 @@
- for (int i = 0; i < 16; ++i) {
- const float cpu = cpu_dst[i];
- const float gpu = ((float*)buf_data[0])[i];
-- if (isinf(cpu))
-- OCL_ASSERT(isinf(gpu));
-- else if (isnan(cpu))
-- OCL_ASSERT(isnan(gpu));
-+ if (std::isinf(cpu))
-+ OCL_ASSERT(std::isinf(gpu));
-+ else if (std::isnan(cpu))
-+ OCL_ASSERT(std::isnan(gpu));
- else {
- OCL_ASSERT(fabs(gpu-cpu) < 1e-3f);
- }
-diff -aur Beignet-1.1.1-Source/utests/compiler_math_3op.cpp Beignet-1.1.1-Source.new/utests/compiler_math_3op.cpp
---- Beignet-1.1.1-Source/utests/compiler_math_3op.cpp 2015-09-18 00:01:08.000000000 -0700
-+++ Beignet-1.1.1-Source.new/utests/compiler_math_3op.cpp 2016-03-08 22:48:14.869545342 -0800
-@@ -50,10 +50,10 @@
- for (int i = 0; i < 16; ++i) {
- const float cpu = cpu_dst[i];
- const float gpu = ((float*)buf_data[0])[i];
-- if (isinf(cpu))
-- OCL_ASSERT(isinf(gpu));
-- else if (isnan(cpu))
-- OCL_ASSERT(isnan(gpu));
-+ if (std::isinf(cpu))
-+ OCL_ASSERT(std::isinf(gpu));
-+ else if (std::isnan(cpu))
-+ OCL_ASSERT(std::isnan(gpu));
- else
- OCL_ASSERT(fabs(gpu-cpu) < 1e-3f);
- }
-diff -aur Beignet-1.1.1-Source/utests/compiler_math.cpp Beignet-1.1.1-Source.new/utests/compiler_math.cpp
---- Beignet-1.1.1-Source/utests/compiler_math.cpp 2015-09-18 00:01:08.000000000 -0700
-+++ Beignet-1.1.1-Source.new/utests/compiler_math.cpp 2016-03-08 22:48:14.869545342 -0800
-@@ -72,10 +72,10 @@
- for (int i = 0; i < 16; ++i) {
- const float cpu = cpu_dst[i];
- const float gpu = ((float*)buf_data[0])[i];
-- if (isinf(cpu))
-- OCL_ASSERT(isinf(gpu));
-- else if (isnan(cpu))
-- OCL_ASSERT(isnan(gpu));
-+ if (std::isinf(cpu))
-+ OCL_ASSERT(std::isinf(gpu));
-+ else if (std::isnan(cpu))
-+ OCL_ASSERT(std::isnan(gpu));
- else
- OCL_ASSERT(fabs(gpu-cpu) < 1e-3f);
- }
-diff -aur Beignet-1.1.1-Source/utests/utest_generator.py Beignet-1.1.1-Source.new/utests/utest_generator.py
---- Beignet-1.1.1-Source/utests/utest_generator.py 2015-09-18 00:22:49.000000000 -0700
-+++ Beignet-1.1.1-Source.new/utests/utest_generator.py 2016-03-08 22:48:14.869545342 -0800
-@@ -112,10 +112,10 @@
- ULPSIZE_FACTOR = select_ulpsize(ULPSIZE_FAST_MATH,ULPSIZE_NO_FAST_MATH);
- bool fast_math = ULPSIZE_FACTOR == ULPSIZE_FAST_MATH;
-
-- if (isinf(cpu_data[index])){
-+ if (std::isinf(cpu_data[index])){
- INFORNAN="INF";
- }
-- else if (isnan(cpu_data[index])){
-+ else if (std::isnan(cpu_data[index])){
- INFORNAN="NAN";
- }
- else{
-@@ -124,14 +124,14 @@
- }
-
- #if udebug
-- if (isinf(cpu_data[index])){
-- if (isinf(gpu_data[index]))
-+ if (std::isinf(cpu_data[index])){
-+ if (std::isinf(gpu_data[index]))
- printf("%s expect:%s\\n", log, INFORNAN);
- else
- printf_c("%s expect:%s\\n", log, INFORNAN);
- }
-- else if (isnan(cpu_data[index])){
-- if (isnan(gpu_data[index]))
-+ else if (std::isnan(cpu_data[index])){
-+ if (std::isnan(gpu_data[index]))
- printf("%s expect:%s\\n", log, INFORNAN);
- else
- printf_c("%s expect:%s\\n", log, INFORNAN);
-@@ -142,13 +142,13 @@
- else
- printf_c("%s expect:%s\\n", log, ULPSIZE);
- #else
-- if (isinf(cpu_data[index])){
-+ if (std::isinf(cpu_data[index])){
- sprintf(log, "%s expect:%s\\n", log, INFORNAN);
-- OCL_ASSERTM(isinf(gpu_data[index]) || fast_math,log);
-+ OCL_ASSERTM(std::isinf(gpu_data[index]) || fast_math,log);
- }
-- else if (isnan(cpu_data[index])){
-+ else if (std::isnan(cpu_data[index])){
- sprintf(log, "%s expect:%s\\n", log, INFORNAN);
-- OCL_ASSERTM(isnan(gpu_data[index]) || fast_math,log);
-+ OCL_ASSERTM(std::isnan(gpu_data[index]) || fast_math,log);
- }
- else{
- sprintf(log, "%s expect:%s\\n", log, ULPSIZE);