summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/drivers/swr/rasterizer/jitter/builder_misc.cpp8
-rw-r--r--src/gallium/drivers/swr/rasterizer/jitter/builder_misc.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.cpp b/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.cpp
index 0738d023321..0148d8eb8ac 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.cpp
@@ -836,6 +836,14 @@ namespace SwrJit
}
//////////////////////////////////////////////////////////////////////////
+ /// @brief pop count on vector mask (e.g. <8 x i1>)
+ Value* Builder::VPOPCNT(Value* a)
+ {
+ Value* b = BITCAST(VMASK(a), mSimdFP32Ty);
+ return POPCNT(VMOVMSKPS(b));
+ }
+
+ //////////////////////////////////////////////////////////////////////////
/// @brief C functions called by LLVM IR
//////////////////////////////////////////////////////////////////////////
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.h b/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.h
index 50d7a1e71fa..5195678b4c4 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.h
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.h
@@ -148,6 +148,7 @@ CallInst *PRINT(const std::string &printStr);
CallInst *PRINT(const std::string &printStr,const std::initializer_list<Value*> &printArgs);
Value* POPCNT(Value* a);
+Value* VPOPCNT(Value* a);
Value* DEBUGTRAP();
Value* INT3() { return DEBUGTRAP(); }