swr: [rasterizer jitter] add core string to JitManager
authorTim Rowley <timothy.o.rowley@intel.com>
Tue, 9 Aug 2016 21:29:06 +0000 (15:29 -0600)
committerTim Rowley <timothy.o.rowley@intel.com>
Wed, 10 Aug 2016 16:09:42 +0000 (11:09 -0500)
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
src/gallium/drivers/swr/rasterizer/jitter/JitManager.h
src/gallium/drivers/swr/rasterizer/jitter/jit_api.h
src/gallium/drivers/swr/swr_screen.cpp

index 6637cdd7619a951483a1cc0225ffd6a8ed796aae..4540105ed9affb886a8cdfdc35ccebe697c8d61f 100644 (file)
@@ -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);
     }
 
     //////////////////////////////////////////////////////////////////////////
index 354bfe869baf0698ee18e12cde5b6c73d0f7b5cd..f474143842a927a896a88471315778b8878de835 100644 (file)
@@ -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);
index 05af54008c425eaadb99b876b038dd80f7d824f5..8a08031f25364aeae5a8fb86184fa9d4174dddde 100644 (file)
@@ -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.
index df44967feee69ae2e0f842353e6e614d40652466..3790fea8359ab4d2272e06849c15f6e838c933de 100644 (file)
@@ -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);