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()
if(WIN32)
add_definitions(-DWINVER=0x501 -DNOMINMAX -DSTRICT)
set_cpp_flag("-DDEBUGGER_WAIT_DIALOG" DEBUG)
set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "" "lib")
endif()
......
......@@ -550,10 +550,7 @@ namespace sw
llvm::JITSymbol symbol = compileLayer.findSymbolIn(moduleKey, name, false);
llvm::Expected<llvm::JITTargetAddress> expectAddr = symbol.getAddress();
if (!expectAddr)
{
return nullptr;
}
assert(expectAddr);
void *addr = reinterpret_cast<void *>(static_cast<intptr_t>(expectAddr.get()));
return new LLVMRoutine(addr, releaseRoutineCallback, this, moduleKey);
......@@ -767,7 +764,7 @@ namespace sw
// llvm::NoNaNsFPMath = true;
#else
llvm::TargetOptions targetOpts;
targetOpts.UnsafeFPMath = true;
targetOpts.UnsafeFPMath = false;
// targetOpts.NoInfsFPMath = true;
// targetOpts.NoNaNsFPMath = true;
#endif
......@@ -920,6 +917,11 @@ namespace sw
::function->setCallingConv(llvm::CallingConv::C);
::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)
......
......@@ -14,25 +14,22 @@
#include "Routine.hpp"
#include "../Common/Thread.hpp"
#include <cassert>
namespace sw
{
Routine::Routine()
Routine::Routine() : bindCount(0)
{
bindCount = 0;
}
void Routine::bind()
{
atomicIncrement(&bindCount);
++bindCount;
}
void Routine::unbind()
{
long count = atomicDecrement(&bindCount);
int count = bindCount--;
if(count == 0)
{
......
......@@ -15,6 +15,8 @@
#ifndef sw_Routine_hpp
#define sw_Routine_hpp
#include "../Common/Thread.hpp"
namespace sw
{
class Routine
......@@ -31,7 +33,7 @@ namespace sw
void unbind();
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