Mesa (master): swr: [rasterizer jitter] add core string to JitManager

Tim Rowley torowley at kemper.freedesktop.org
Wed Aug 10 18:17:13 UTC 2016


Module: Mesa
Branch: master
Commit: 9aa75e5d46b9c2cf4eba2c182874a86ea9f5464a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9aa75e5d46b9c2cf4eba2c182874a86ea9f5464a

Author: Tim Rowley <timothy.o.rowley at intel.com>
Date:   Tue Aug  9 15:29:06 2016 -0600

swr: [rasterizer jitter] add core string to JitManager

Signed-off-by: Tim Rowley <timothy.o.rowley at intel.com>

---

 src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp | 9 ++++++---
 src/gallium/drivers/swr/rasterizer/jitter/JitManager.h   | 3 ++-
 src/gallium/drivers/swr/rasterizer/jitter/jit_api.h      | 2 +-
 src/gallium/drivers/swr/swr_screen.cpp                   | 2 +-
 4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
index 6637cdd..4540105 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
@@ -76,7 +76,7 @@ using namespace llvm;
 //////////////////////////////////////////////////////////////////////////
 /// @brief Contructor for JitManager.
 /// @param simdWidth - SIMD width to be used in generated program.
-JitManager::JitManager(uint32_t simdWidth, const char *arch)
+JitManager::JitManager(uint32_t simdWidth, const char *arch, const char* core)
     : mContext(), mBuilder(mContext), mIsModuleFinalized(true), mJitNumber(0), mVWidth(simdWidth), mArch(arch)
 {
     InitializeNativeTarget();
@@ -96,6 +96,9 @@ JitManager::JitManager(uint32_t simdWidth, const char *arch)
 
     //tOpts.PrintMachineCode    = true;
 
+    mCore = std::string(core);
+    std::transform(mCore.begin(), mCore.end(), mCore.begin(), ::tolower);
+
     std::stringstream fnName("JitModule", std::ios_base::in | std::ios_base::out | std::ios_base::ate);
     fnName << mJitNumber++;
     std::unique_ptr<Module> newModule(new Module(fnName.str(), mContext));
@@ -357,9 +360,9 @@ extern "C"
     //////////////////////////////////////////////////////////////////////////
     /// @brief Create JIT context.
     /// @param simdWidth - SIMD width to be used in generated program.
-    HANDLE JITCALL JitCreateContext(uint32_t targetSimdWidth, const char* arch)
+    HANDLE JITCALL JitCreateContext(uint32_t targetSimdWidth, const char* arch, const char* core)
     {
-        return new JitManager(targetSimdWidth, arch);
+        return new JitManager(targetSimdWidth, arch, core);
     }
 
     //////////////////////////////////////////////////////////////////////////
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h
index 354bfe8..f474143 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h
+++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h
@@ -146,7 +146,7 @@ struct JitLLVMContext : LLVMContext
 //////////////////////////////////////////////////////////////////////////
 struct JitManager
 {
-    JitManager(uint32_t w, const char *arch);
+    JitManager(uint32_t w, const char* arch, const char* core);
     ~JitManager(){};
 
     JitLLVMContext          mContext;   ///< LLVM compiler
@@ -178,6 +178,7 @@ struct JitManager
     FunctionType*        mFetchShaderTy;
 
     JitInstructionSet mArch;
+    std::string mCore;
 
     void SetupNewModule();
     bool SetupModuleFromIR(const uint8_t *pIR);
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/jit_api.h b/src/gallium/drivers/swr/rasterizer/jitter/jit_api.h
index 05af540..8a08031 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/jit_api.h
+++ b/src/gallium/drivers/swr/rasterizer/jitter/jit_api.h
@@ -68,7 +68,7 @@ extern "C"
 
 //////////////////////////////////////////////////////////////////////////
 /// @brief Create JIT context.
-HANDLE JITCALL JitCreateContext(uint32_t targetSimdWidth, const char* arch);
+HANDLE JITCALL JitCreateContext(uint32_t targetSimdWidth, const char* arch, const char* core);
 
 //////////////////////////////////////////////////////////////////////////
 /// @brief Destroy JIT context.
diff --git a/src/gallium/drivers/swr/swr_screen.cpp b/src/gallium/drivers/swr/swr_screen.cpp
index df44967..3790fea 100644
--- a/src/gallium/drivers/swr/swr_screen.cpp
+++ b/src/gallium/drivers/swr/swr_screen.cpp
@@ -753,7 +753,7 @@ swr_create_screen(struct sw_winsys *winsys)
 
    screen->base.flush_frontbuffer = swr_flush_frontbuffer;
 
-   screen->hJitMgr = JitCreateContext(KNOB_SIMD_WIDTH, KNOB_ARCH_STR);
+   screen->hJitMgr = JitCreateContext(KNOB_SIMD_WIDTH, KNOB_ARCH_STR, "swr");
 
    swr_fence_init(&screen->base);
 




More information about the mesa-commit mailing list