Commit cfe6df40 by Alexis Hetu

LLVM 7.0 dEQP fixes

dEQP using SwiftShader with LLVM 7.0 has a number of failures. Most of them were cause either by using unsafe floating point math or by a "__chkstk not found" error. Change-Id: I16f14b3aee6f24717ec90ce2ea5bae8b4439620a
parent fcedef47
...@@ -255,6 +255,7 @@ endif() ...@@ -255,6 +255,7 @@ endif()
if(WIN32) if(WIN32)
add_definitions(-DWINVER=0x501 -DNOMINMAX -DSTRICT) add_definitions(-DWINVER=0x501 -DNOMINMAX -DSTRICT)
set_cpp_flag("-DDEBUGGER_WAIT_DIALOG" DEBUG)
set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "" "lib") set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "" "lib")
endif() endif()
......
...@@ -550,10 +550,7 @@ namespace sw ...@@ -550,10 +550,7 @@ namespace sw
llvm::JITSymbol symbol = compileLayer.findSymbolIn(moduleKey, name, false); llvm::JITSymbol symbol = compileLayer.findSymbolIn(moduleKey, name, false);
llvm::Expected<llvm::JITTargetAddress> expectAddr = symbol.getAddress(); llvm::Expected<llvm::JITTargetAddress> expectAddr = symbol.getAddress();
if (!expectAddr) assert(expectAddr);
{
return nullptr;
}
void *addr = reinterpret_cast<void *>(static_cast<intptr_t>(expectAddr.get())); void *addr = reinterpret_cast<void *>(static_cast<intptr_t>(expectAddr.get()));
return new LLVMRoutine(addr, releaseRoutineCallback, this, moduleKey); return new LLVMRoutine(addr, releaseRoutineCallback, this, moduleKey);
...@@ -767,7 +764,7 @@ namespace sw ...@@ -767,7 +764,7 @@ namespace sw
// llvm::NoNaNsFPMath = true; // llvm::NoNaNsFPMath = true;
#else #else
llvm::TargetOptions targetOpts; llvm::TargetOptions targetOpts;
targetOpts.UnsafeFPMath = true; targetOpts.UnsafeFPMath = false;
// targetOpts.NoInfsFPMath = true; // targetOpts.NoInfsFPMath = true;
// targetOpts.NoNaNsFPMath = true; // targetOpts.NoNaNsFPMath = true;
#endif #endif
...@@ -920,6 +917,11 @@ namespace sw ...@@ -920,6 +917,11 @@ namespace sw
::function->setCallingConv(llvm::CallingConv::C); ::function->setCallingConv(llvm::CallingConv::C);
::builder->SetInsertPoint(llvm::BasicBlock::Create(*::context, "", ::function)); ::builder->SetInsertPoint(llvm::BasicBlock::Create(*::context, "", ::function));
#if SWIFTSHADER_LLVM_VERSION >= 7
// This fixes the "__chkstk not found" error
::function->addFnAttr("stack-probe-size", "1048576");
#endif
} }
Value *Nucleus::getArgument(unsigned int index) Value *Nucleus::getArgument(unsigned int index)
......
...@@ -14,25 +14,22 @@ ...@@ -14,25 +14,22 @@
#include "Routine.hpp" #include "Routine.hpp"
#include "../Common/Thread.hpp"
#include <cassert> #include <cassert>
namespace sw namespace sw
{ {
Routine::Routine() Routine::Routine() : bindCount(0)
{ {
bindCount = 0;
} }
void Routine::bind() void Routine::bind()
{ {
atomicIncrement(&bindCount); ++bindCount;
} }
void Routine::unbind() void Routine::unbind()
{ {
long count = atomicDecrement(&bindCount); int count = bindCount--;
if(count == 0) if(count == 0)
{ {
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#ifndef sw_Routine_hpp #ifndef sw_Routine_hpp
#define sw_Routine_hpp #define sw_Routine_hpp
#include "../Common/Thread.hpp"
namespace sw namespace sw
{ {
class Routine class Routine
...@@ -31,7 +33,7 @@ namespace sw ...@@ -31,7 +33,7 @@ namespace sw
void unbind(); void unbind();
private: private:
volatile int bindCount; AtomicInt bindCount;
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment