From: Tim Rowley Date: Wed, 9 Aug 2017 23:48:58 +0000 (-0500) Subject: swr/rast: SIMD16 FE remove templated immediates workaround X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9df5691fffafdc31b82eb18f3cd5ce7d45eb83a2;p=mesa.git swr/rast: SIMD16 FE remove templated immediates workaround Fixed properly in gcc-compatible fashion. Reviewed-by: Bruce Cherniak --- diff --git a/src/gallium/drivers/swr/rasterizer/core/binner.cpp b/src/gallium/drivers/swr/rasterizer/core/binner.cpp index e09ff7a3995..832c47d6e4b 100644 --- a/src/gallium/drivers/swr/rasterizer/core/binner.cpp +++ b/src/gallium/drivers/swr/rasterizer/core/binner.cpp @@ -404,35 +404,6 @@ void ProcessUserClipDist(PA_STATE& pa, uint32_t primIndex, uint8_t clipDistMask, } } -// WA linux compiler issue with SIMDLIB and shift immediates -#define SIMD_WA_SXXI_EPI32 1 - -#if SIMD_WA_SXXI_EPI32 -template -simdscalari simd_wa_slli_epi32(simdscalari a) -{ - return SIMD256::slli_epi32(a); -} - -template -simd16scalari simd_wa_slli_epi32(simd16scalari a) -{ - return SIMD512::slli_epi32(a); -} - -template -simdscalari simd_wa_srai_epi32(simdscalari a) -{ - return SIMD256::srai_epi32(a); -} - -template -simd16scalari simd_wa_srai_epi32(simd16scalari a) -{ - return SIMD512::srai_epi32(a); -} - -#endif INLINE void TransposeVertices(simd4scalar(&dst)[8], const simdscalar &src0, const simdscalar &src1, const simdscalar &src2) { @@ -804,17 +775,10 @@ endBinTriangles: } // Convert triangle bbox to macrotile units. -#if SIMD_WA_SXXI_EPI32 - bbox.xmin = simd_wa_srai_epi32(bbox.xmin); - bbox.ymin = simd_wa_srai_epi32(bbox.ymin); - bbox.xmax = simd_wa_srai_epi32(bbox.xmax); - bbox.ymax = simd_wa_srai_epi32(bbox.ymax); -#else - bbox.xmin = SIMD_T::srai_epi32(bbox.xmin); - bbox.ymin = SIMD_T::srai_epi32(bbox.ymin); - bbox.xmax = SIMD_T::srai_epi32(bbox.xmax); - bbox.ymax = SIMD_T::srai_epi32(bbox.ymax); -#endif + bbox.xmin = SIMD_T::template srai_epi32(bbox.xmin); + bbox.ymin = SIMD_T::template srai_epi32(bbox.ymin); + bbox.xmax = SIMD_T::template srai_epi32(bbox.xmax); + bbox.ymax = SIMD_T::template srai_epi32(bbox.ymax); OSALIGNSIMD16(uint32_t) aMTLeft[SIMD_WIDTH], aMTRight[SIMD_WIDTH], aMTTop[SIMD_WIDTH], aMTBottom[SIMD_WIDTH]; @@ -1034,13 +998,8 @@ void BinPostSetupPointsImpl( primMask &= ~SIMD_T::movemask_ps(SIMD_T::castsi_ps(vYi)); // compute macro tile coordinates -#if SIMD_WA_SXXI_EPI32 - typename SIMD_T::Integer macroX = simd_wa_srai_epi32(vXi); - typename SIMD_T::Integer macroY = simd_wa_srai_epi32(vYi); -#else - typename SIMD_T::Integer macroX = SIMD_T::srai_epi32(vXi); - typename SIMD_T::Integer macroY = SIMD_T::srai_epi32(vYi); -#endif + typename SIMD_T::Integer macroX = SIMD_T::template srai_epi32(vXi); + typename SIMD_T::Integer macroY = SIMD_T::template srai_epi32(vYi); OSALIGNSIMD16(uint32_t) aMacroX[SIMD_WIDTH], aMacroY[SIMD_WIDTH]; @@ -1048,30 +1007,15 @@ void BinPostSetupPointsImpl( SIMD_T::store_si(reinterpret_cast(aMacroY), macroY); // compute raster tile coordinates -#if SIMD_WA_SXXI_EPI32 - typename SIMD_T::Integer rasterX = simd_wa_srai_epi32(vXi); - typename SIMD_T::Integer rasterY = simd_wa_srai_epi32(vYi); -#else - typename SIMD_T::Integer rasterX = SIMD_T::srai_epi32(vXi); - typename SIMD_T::Integer rasterY = SIMD_T::srai_epi32(vYi); -#endif + typename SIMD_T::Integer rasterX = SIMD_T::template srai_epi32(vXi); + typename SIMD_T::Integer rasterY = SIMD_T::template srai_epi32(vYi); // compute raster tile relative x,y for coverage mask -#if SIMD_WA_SXXI_EPI32 - typename SIMD_T::Integer tileAlignedX = simd_wa_slli_epi32(rasterX); - typename SIMD_T::Integer tileAlignedY = simd_wa_slli_epi32(rasterY); -#else - typename SIMD_T::Integer tileAlignedX = SIMD_T::slli_epi32(rasterX); - typename SIMD_T::Integer tileAlignedY = SIMD_T::slli_epi32(rasterY); -#endif + typename SIMD_T::Integer tileAlignedX = SIMD_T::template slli_epi32(rasterX); + typename SIMD_T::Integer tileAlignedY = SIMD_T::template slli_epi32(rasterY); -#if SIMD_WA_SXXI_EPI32 - typename SIMD_T::Integer tileRelativeX = SIMD_T::sub_epi32(simd_wa_srai_epi32(vXi), tileAlignedX); - typename SIMD_T::Integer tileRelativeY = SIMD_T::sub_epi32(simd_wa_srai_epi32(vYi), tileAlignedY); -#else - typename SIMD_T::Integer tileRelativeX = SIMD_T::sub_epi32(SIMD_T::srai_epi32(vXi), tileAlignedX); - typename SIMD_T::Integer tileRelativeY = SIMD_T::sub_epi32(SIMD_T::srai_epi32(vYi), tileAlignedY); -#endif + typename SIMD_T::Integer tileRelativeX = SIMD_T::sub_epi32(SIMD_T::template srai_epi32(vXi), tileAlignedX); + typename SIMD_T::Integer tileRelativeY = SIMD_T::sub_epi32(SIMD_T::template srai_epi32(vYi), tileAlignedY); OSALIGNSIMD16(uint32_t) aTileRelativeX[SIMD_WIDTH]; OSALIGNSIMD16(uint32_t) aTileRelativeY[SIMD_WIDTH]; @@ -1223,17 +1167,10 @@ void BinPostSetupPointsImpl( primMask = primMask & ~maskOutsideScissor; // Convert bbox to macrotile units. -#if SIMD_WA_SXXI_EPI32 - bbox.xmin = simd_wa_srai_epi32(bbox.xmin); - bbox.ymin = simd_wa_srai_epi32(bbox.ymin); - bbox.xmax = simd_wa_srai_epi32(bbox.xmax); - bbox.ymax = simd_wa_srai_epi32(bbox.ymax); -#else - bbox.xmin = SIMD_T::srai_epi32(bbox.xmin); - bbox.ymin = SIMD_T::srai_epi32(bbox.ymin); - bbox.xmax = SIMD_T::srai_epi32(bbox.xmax); - bbox.ymax = SIMD_T::srai_epi32(bbox.ymax); -#endif + bbox.xmin = SIMD_T::template srai_epi32(bbox.xmin); + bbox.ymin = SIMD_T::template srai_epi32(bbox.ymin); + bbox.xmax = SIMD_T::template srai_epi32(bbox.xmax); + bbox.ymax = SIMD_T::template srai_epi32(bbox.ymax); OSALIGNSIMD16(uint32_t) aMTLeft[SIMD_WIDTH], aMTRight[SIMD_WIDTH], aMTTop[SIMD_WIDTH], aMTBottom[SIMD_WIDTH]; @@ -1569,17 +1506,10 @@ void BinPostSetupLinesImpl( } // Convert triangle bbox to macrotile units. -#if SIMD_WA_SXXI_EPI32 - bbox.xmin = simd_wa_srai_epi32(bbox.xmin); - bbox.ymin = simd_wa_srai_epi32(bbox.ymin); - bbox.xmax = simd_wa_srai_epi32(bbox.xmax); - bbox.ymax = simd_wa_srai_epi32(bbox.ymax); -#else - bbox.xmin = SIMD_T::srai_epi32(bbox.xmin); - bbox.ymin = SIMD_T::srai_epi32(bbox.ymin); - bbox.xmax = SIMD_T::srai_epi32(bbox.xmax); - bbox.ymax = SIMD_T::srai_epi32(bbox.ymax); -#endif + bbox.xmin = SIMD_T::template srai_epi32(bbox.xmin); + bbox.ymin = SIMD_T::template srai_epi32(bbox.ymin); + bbox.xmax = SIMD_T::template srai_epi32(bbox.xmax); + bbox.ymax = SIMD_T::template srai_epi32(bbox.ymax); OSALIGNSIMD16(uint32_t) aMTLeft[SIMD_WIDTH], aMTRight[SIMD_WIDTH], aMTTop[SIMD_WIDTH], aMTBottom[SIMD_WIDTH];