swr/rast: SIMD16 FE - add SIMD16 types to jitter
authorTim Rowley <timothy.o.rowley@intel.com>
Mon, 15 May 2017 17:33:21 +0000 (12:33 -0500)
committerTim Rowley <timothy.o.rowley@intel.com>
Tue, 30 May 2017 22:21:18 +0000 (17:21 -0500)
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_types.py
src/gallium/drivers/swr/rasterizer/core/frontend.h
src/gallium/drivers/swr/rasterizer/core/state.h

index 4cabde3394fa018730b0b76fade54de40be5277c..c1533687c9d40c232509ca71741d0fcf6ff0883b 100644 (file)
@@ -71,7 +71,9 @@ def gen_llvm_type(type, name, is_pointer, is_pointer_pointer, is_array, is_array
         elif type == 'SIMD16::vectori_t':
             llvm_type = 'VectorType::get(Type::getInt32Ty(ctx), 16)'
         elif type == 'simdvector':
-            llvm_type = 'ArrayType::get(VectorType::get(Type::getFloatTy(ctx), pJitMgr->mVWidth), 4)'
+            llvm_type = 'ArrayType::get(VectorType::get(Type::getFloatTy(ctx), 8), 4)'
+        elif type == 'simd16vector':
+            llvm_type = 'ArrayType::get(VectorType::get(Type::getFloatTy(ctx), 16), 4)'
         elif type == 'SIMD8::attrib_t':
             llvm_type = 'ArrayType::get(VectorType::get(Type::getFloatTy(ctx), 8), 4)'
         elif type == 'SIMD16::attrib_t':
index 1ce51bbd5df0860a8891b6650b5ababae0fcff21..eedbcfcf7b6430a0947f8a8cc4a6a9ab632ae5ec 100644 (file)
 #include "context.h"
 #include <type_traits>
 
-#if ENABLE_AVX512_SIMD16
-// TODO: this belongs in state.h alongside the simdvector definition, but there is a llvm codegen issue
-struct simd16vertex
-{
-    simd16vector    attrib[SWR_VTX_NUM_SLOTS];
-};
-
-#endif
 // Calculates the A and B coefficients for the 3 edges of the triangle
 // 
 // maths for edge equations:
index bf735e03f242b235237ebd0ae1d8161c56d260f5..8812fbaab5f4fc98d7b426adb9d663f47fa0ecc1 100644 (file)
@@ -197,9 +197,16 @@ enum SWR_VTX_SLOTS
 // SoAoSoA
 struct simdvertex
 {
-    simdvector    attrib[SWR_VTX_NUM_SLOTS];
+    simdvector      attrib[SWR_VTX_NUM_SLOTS];
 };
 
+#if ENABLE_AVX512_SIMD16
+struct simd16vertex
+{
+    simd16vector    attrib[SWR_VTX_NUM_SLOTS];
+};
+
+#endif
 //////////////////////////////////////////////////////////////////////////
 /// SWR_VS_CONTEXT
 /// @brief Input to vertex shader