[Mesa-dev] [PATCH 01/45] swr/rast: Add some instructions to jitter

George Kyriazis george.kyriazis at intel.com
Fri Apr 13 19:01:41 UTC 2018


VPHADDD, PMAXUD, PMINUD
---
 .../drivers/swr/rasterizer/codegen/gen_llvm_ir_macros.py     |  1 +
 src/gallium/drivers/swr/rasterizer/jitter/builder_misc.cpp   | 12 ++++++++++++
 src/gallium/drivers/swr/rasterizer/jitter/builder_misc.h     |  2 ++
 3 files changed, 15 insertions(+)

diff --git a/src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_ir_macros.py b/src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_ir_macros.py
index aab499b..113c616 100644
--- a/src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_ir_macros.py
+++ b/src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_ir_macros.py
@@ -71,6 +71,7 @@ intrinsics = [
         ['VFMADDPS', 'x86_fma_vfmadd_ps_256', ['a', 'b', 'c']],
         ['VMOVMSKPS', 'x86_avx_movmsk_ps_256', ['a']],
         ['INTERRUPT', 'x86_int', ['a']],
+        ['VPHADDD', 'x86_avx2_phadd_d', ['a', 'b']],
     ]
 
 this_dir = os.path.dirname(os.path.abspath(__file__))
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.cpp b/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.cpp
index 0148d8e..704b0f2 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.cpp
@@ -756,6 +756,18 @@ namespace SwrJit
         return SELECT(cmp, a, b);
     }
 
+    Value *Builder::PMAXUD(Value* a, Value* b)
+    {
+        Value* cmp = ICMP_UGT(a, b);
+        return SELECT(cmp, a, b);
+    }
+
+    Value *Builder::PMINUD(Value* a, Value* b)
+    {
+        Value* cmp = ICMP_ULT(a, b);
+        return SELECT(cmp, a, b);
+    }
+
     // Helper function to create alloca in entry block of function
     Value* Builder::CreateEntryAlloca(Function* pFunc, Type* pType)
     {
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.h b/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.h
index 5195678..9660bc6 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.h
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.h
@@ -128,6 +128,8 @@ Value *CVTPH2PS(Value* a, const llvm::Twine& name = "");
 Value *CVTPS2PH(Value* a, Value* rounding);
 Value *PMAXSD(Value* a, Value* b);
 Value *PMINSD(Value* a, Value* b);
+Value *PMAXUD(Value* a, Value* b);
+Value *PMINUD(Value* a, Value* b);
 Value *VABSPS(Value* a);
 Value *FMADDPS(Value* a, Value* b, Value* c);
 
-- 
2.7.4



More information about the mesa-dev mailing list