summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/rasterizer/common/simd16intrin.h
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2017-06-28 16:32:19 -0500
committerTim Rowley <[email protected]>2017-07-13 08:47:10 -0500
commitbbc3b5c0dc38e303d97379a935f8417b81cdfbb6 (patch)
tree4e945e186f6430548f0c3d99558034012fa654d9 /src/gallium/drivers/swr/rasterizer/common/simd16intrin.h
parent640ea4d9a196c183ea4d6130b5ce371280a89c3f (diff)
swr/rast: SIMD16 Frontend - Fix USE_SIMD16_FRONTEND build
Previous check-ins without testing with USE_SIMD16_FRONTEND have introduced regressions. This fixes the build, not the regressions. Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/rasterizer/common/simd16intrin.h')
-rw-r--r--src/gallium/drivers/swr/rasterizer/common/simd16intrin.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/common/simd16intrin.h b/src/gallium/drivers/swr/rasterizer/common/simd16intrin.h
index 29151682e07..a160ca2c5ed 100644
--- a/src/gallium/drivers/swr/rasterizer/common/simd16intrin.h
+++ b/src/gallium/drivers/swr/rasterizer/common/simd16intrin.h
@@ -126,7 +126,7 @@ typedef SIMD512 SIMD16;
#define _simd16_add_epi8 SIMD16::add_epi8
#define _simd16_shuffle_epi8 SIMD16::shuffle_epi8
-#define _simd16_i32gather_ps(m, index, scale) SIMD16::i32gather_ps<SIMD16::ScaleFactor(scale)>(index, m)
+#define _simd16_i32gather_ps(m, index, scale) SIMD16::i32gather_ps<SIMD16::ScaleFactor(scale)>(m, index)
#define _simd16_mask_i32gather_ps(a, m, index, mask, scale) SIMD16::mask_i32gather_ps<SIMD16::ScaleFactor(scale)>(a, m, index, mask)
#define _simd16_abs_epi32 SIMD16::abs_epi32
@@ -162,6 +162,18 @@ typedef SIMD512 SIMD16;
#define _simd16_int2mask(mask) simd16mask(mask)
#define _simd16_mask2int(mask) int(mask)
+// convert bitmask to vector mask
+SIMDINLINE simd16scalar vMask16(int32_t mask)
+{
+ simd16scalari temp = _simd16_set1_epi32(mask);
+
+ simd16scalari bits = _simd16_set_epi32(0x8000, 0x4000, 0x2000, 0x1000, 0x0800, 0x0400, 0x0200, 0x0100, 0x0080, 0x0040, 0x0020, 0x0010, 0x0008, 0x0004, 0x0002, 0x0001);
+
+ simd16scalari result = _simd16_cmplt_epi32(_simd16_setzero_si(), _simd16_and_si(temp, bits));
+
+ return _simd16_castsi_ps(result);
+}
+
#endif//ENABLE_AVX512_SIMD16
#endif//__SWR_SIMD16INTRIN_H_