[Mesa-dev] [PATCH v2 22/45] swr/rast: Cleanup of JitManager convenience types

George Kyriazis george.kyriazis at intel.com
Wed Apr 18 01:32:02 UTC 2018


Small cleanup. Remove convenience types from JitManager and standardize
on the Builder's convenience types.
---
 .../drivers/swr/rasterizer/jitter/JitManager.cpp     | 19 -------------------
 .../drivers/swr/rasterizer/jitter/JitManager.h       | 20 --------------------
 .../drivers/swr/rasterizer/jitter/builder.cpp        |  7 +++----
 src/gallium/drivers/swr/rasterizer/jitter/builder.h  |  3 ++-
 4 files changed, 5 insertions(+), 44 deletions(-)

diff --git a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
index bfb1d2e..9080964 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
@@ -110,11 +110,6 @@ JitManager::JitManager(uint32_t simdWidth, const char *arch, const char* core)
     mpExec->RegisterJITEventListener(vTune);
 #endif
 
-    mFP32Ty = Type::getFloatTy(mContext);   // float type
-    mInt8Ty = Type::getInt8Ty(mContext);
-    mInt32Ty = Type::getInt32Ty(mContext);   // int type
-    mInt64Ty = Type::getInt64Ty(mContext);   // int type
-
     // fetch function signature
 #if USE_SIMD16_SHADERS
     // typedef void(__cdecl *PFN_FETCH_FUNC)(SWR_FETCH_CONTEXT& fetchInfo, simd16vertex& out);
@@ -135,20 +130,6 @@ JitManager::JitManager(uint32_t simdWidth, const char *arch, const char* core)
 
     mFetchShaderTy = FunctionType::get(Type::getVoidTy(mContext), fsArgs, false);
 
-    mSimtFP32Ty = VectorType::get(mFP32Ty, mVWidth);
-    mSimtInt32Ty = VectorType::get(mInt32Ty, mVWidth);
-
-    mSimdVectorTy = ArrayType::get(mSimtFP32Ty, 4);
-    mSimdVectorInt32Ty = ArrayType::get(mSimtInt32Ty, 4);
-
-#if USE_SIMD16_SHADERS
-    mSimd16FP32Ty = ArrayType::get(mSimtFP32Ty, 2);
-    mSimd16Int32Ty = ArrayType::get(mSimtInt32Ty, 2);
-
-    mSimd16VectorFP32Ty = ArrayType::get(mSimd16FP32Ty, 4);
-    mSimd16VectorInt32Ty = ArrayType::get(mSimd16Int32Ty, 4);
-
-#endif
 #if defined(_WIN32)
     // explicitly instantiate used symbols from potentially staticly linked libs
     sys::DynamicLibrary::AddSymbol("exp2f", &exp2f);
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h
index 3660249..86e6758 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h
+++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h
@@ -143,26 +143,6 @@ struct JitManager
     uint32_t                mVWidth;
 
 
-    // Built in types.
-    llvm::Type*             mInt8Ty;
-    llvm::Type*             mInt32Ty;
-    llvm::Type*             mInt64Ty;
-    llvm::Type*             mFP32Ty;
-
-    llvm::Type*             mSimtFP32Ty;
-    llvm::Type*             mSimtInt32Ty;
-
-    llvm::Type*             mSimdVectorInt32Ty;
-    llvm::Type*             mSimdVectorTy;
-
-#if USE_SIMD16_SHADERS
-    llvm::Type*             mSimd16FP32Ty;
-    llvm::Type*             mSimd16Int32Ty;
-
-    llvm::Type*             mSimd16VectorFP32Ty;
-    llvm::Type*             mSimd16VectorInt32Ty;
-
-#endif
     // fetch shader types
     llvm::FunctionType*     mFetchShaderTy;
 
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder.cpp b/src/gallium/drivers/swr/rasterizer/jitter/builder.cpp
index 260daab..625f132 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder.cpp
@@ -42,10 +42,8 @@ namespace SwrJit
         : mpJitMgr(pJitMgr),
           mpPrivateContext(nullptr)
     {
-        SWR_ASSERT(pJitMgr->mVWidth == 8);
-
         mVWidth = pJitMgr->mVWidth;
-        mVWidth16 = pJitMgr->mVWidth * 2;
+        mVWidth16 = 16;
 
         mpIRBuilder = &pJitMgr->mBuilder;
 
@@ -67,7 +65,7 @@ namespace SwrJit
 
         mSimd4FP64Ty = VectorType::get(mDoubleTy, 4);
 
-        // Built in types: simd8
+        // Built in types: target simd
 
         mSimdInt1Ty     = VectorType::get(mInt1Ty,  mVWidth);
         mSimdInt16Ty    = VectorType::get(mInt16Ty, mVWidth);
@@ -76,6 +74,7 @@ namespace SwrJit
         mSimdFP16Ty     = VectorType::get(mFP16Ty,  mVWidth);
         mSimdFP32Ty     = VectorType::get(mFP32Ty,  mVWidth);
         mSimdVectorTy   = ArrayType::get(mSimdFP32Ty, 4);
+        mSimdVectorIntTy= ArrayType::get(mSimdInt32Ty, 4);
         mSimdVectorTRTy = ArrayType::get(mSimdFP32Ty, 5);
 
         // Built in types: simd16
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder.h b/src/gallium/drivers/swr/rasterizer/jitter/builder.h
index 0b57fbf..6b2c9f0 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder.h
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder.h
@@ -68,7 +68,7 @@ namespace SwrJit
 
         Type*                mSimd4FP64Ty;
 
-        // Built in types: simd8
+        // Built in types: target SIMD
 
         Type*                mSimdFP16Ty;
         Type*                mSimdFP32Ty;
@@ -79,6 +79,7 @@ namespace SwrJit
         Type*                mSimdIntPtrTy;
         Type*                mSimdVectorTy;
         Type*                mSimdVectorTRTy;
+        Type*                mSimdVectorIntTy;
 
         // Built in types: simd16
 
-- 
2.7.4



More information about the mesa-dev mailing list