Commit 3bbc5e16 by Nicolas Capens

Reduce header dependencies.

This removes all Common headers from Reactor headers, making it easier to use Reactor outside of SwiftShader. Bug swiftshader:10 Change-Id: I35c5d138e781d4e911d206954d38e392714d4659 Reviewed-on: https://swiftshader-review.googlesource.com/7330Tested-by: 's avatarNicolas Capens <capn@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 5763d17e
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "CPUID.hpp" #include "CPUID.hpp"
#include "Thread.hpp" #include "Thread.hpp"
#include "Memory.hpp" #include "Memory.hpp"
#include "MutexLock.hpp"
#include <xmmintrin.h> #include <xmmintrin.h>
#include <fstream> #include <fstream>
...@@ -66,12 +67,13 @@ namespace ...@@ -66,12 +67,13 @@ namespace
llvm::LLVMContext *context = nullptr; llvm::LLVMContext *context = nullptr;
llvm::Module *module = nullptr; llvm::Module *module = nullptr;
llvm::Function *function = nullptr; llvm::Function *function = nullptr;
sw::BackoffLock codegenMutex;
} }
namespace sw namespace sw
{ {
using namespace llvm; using namespace llvm;
BackoffLock Nucleus::codegenMutex;
Optimization optimization[10] = {InstructionCombining, Disabled}; Optimization optimization[10] = {InstructionCombining, Disabled};
...@@ -107,7 +109,7 @@ namespace sw ...@@ -107,7 +109,7 @@ namespace sw
Nucleus::Nucleus() Nucleus::Nucleus()
{ {
codegenMutex.lock(); // Reactor and LLVM are currently not thread safe ::codegenMutex.lock(); // Reactor and LLVM are currently not thread safe
InitializeNativeTarget(); InitializeNativeTarget();
JITEmitDebugInfo = false; JITEmitDebugInfo = false;
...@@ -166,7 +168,7 @@ namespace sw ...@@ -166,7 +168,7 @@ namespace sw
::function = nullptr; ::function = nullptr;
::module = nullptr; ::module = nullptr;
codegenMutex.unlock(); ::codegenMutex.unlock();
} }
Routine *Nucleus::acquireRoutine(const wchar_t *name, bool runOptimizations) Routine *Nucleus::acquireRoutine(const wchar_t *name, bool runOptimizations)
...@@ -1961,7 +1963,7 @@ namespace sw ...@@ -1961,7 +1963,7 @@ namespace sw
// xyzw.parent = this; // xyzw.parent = this;
} }
Byte8::Byte8(byte x0, byte x1, byte x2, byte x3, byte x4, byte x5, byte x6, byte x7) Byte8::Byte8(uint8_t x0, uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, uint8_t x5, uint8_t x6, uint8_t x7)
{ {
// xyzw.parent = this; // xyzw.parent = this;
...@@ -2298,7 +2300,7 @@ namespace sw ...@@ -2298,7 +2300,7 @@ namespace sw
// xyzw.parent = this; // xyzw.parent = this;
} }
SByte8::SByte8(byte x0, byte x1, byte x2, byte x3, byte x4, byte x5, byte x6, byte x7) SByte8::SByte8(uint8_t x0, uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, uint8_t x5, uint8_t x6, uint8_t x7)
{ {
// xyzw.parent = this; // xyzw.parent = this;
......
...@@ -15,18 +15,9 @@ ...@@ -15,18 +15,9 @@
#ifndef sw_Nucleus_hpp #ifndef sw_Nucleus_hpp
#define sw_Nucleus_hpp #define sw_Nucleus_hpp
#include "Common/Types.hpp" #include <cstdarg>
#include "Common/MutexLock.hpp" #include <cstdint>
#include <stdarg.h>
#include <vector> #include <vector>
#include <stdio.h>
#include <wchar.h>
#undef abs
#undef max
#undef min
#undef Bool
namespace sw namespace sw
{ {
...@@ -184,8 +175,6 @@ namespace sw ...@@ -184,8 +175,6 @@ namespace sw
private: private:
void optimize(); void optimize();
static BackoffLock codegenMutex;
}; };
} }
......
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
#include "Nucleus.hpp" #include "Nucleus.hpp"
#include "Routine.hpp" #include "Routine.hpp"
#include <cstddef>
#include <cwchar>
#undef Bool
namespace sw namespace sw
{ {
class Byte; class Byte;
...@@ -514,7 +518,7 @@ namespace sw ...@@ -514,7 +518,7 @@ namespace sw
{ {
public: public:
Byte8(); Byte8();
Byte8(byte x0, byte x1, byte x2, byte x3, byte x4, byte x5, byte x6, byte x7); Byte8(uint8_t x0, uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, uint8_t x5, uint8_t x6, uint8_t x7);
Byte8(int64_t x); Byte8(int64_t x);
Byte8(RValue<Byte8> rhs); Byte8(RValue<Byte8> rhs);
Byte8(const Byte8 &rhs); Byte8(const Byte8 &rhs);
...@@ -568,7 +572,7 @@ namespace sw ...@@ -568,7 +572,7 @@ namespace sw
{ {
public: public:
SByte8(); SByte8();
SByte8(byte x0, byte x1, byte x2, byte x3, byte x4, byte x5, byte x6, byte x7); SByte8(uint8_t x0, uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, uint8_t x5, uint8_t x6, uint8_t x7);
SByte8(int64_t x); SByte8(int64_t x);
SByte8(RValue<SByte8> rhs); SByte8(RValue<SByte8> rhs);
SByte8(const SByte8 &rhs); SByte8(const SByte8 &rhs);
......
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