swr/rast: Add some instructions to jitter
authorGeorge Kyriazis <george.kyriazis@intel.com>
Wed, 7 Mar 2018 18:00:52 +0000 (12:00 -0600)
committerGeorge Kyriazis <george.kyriazis@intel.com>
Wed, 18 Apr 2018 15:51:38 +0000 (10:51 -0500)
VPHADDD, PMAXUD, PMINUD

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_ir_macros.py
src/gallium/drivers/swr/rasterizer/jitter/builder_misc.cpp
src/gallium/drivers/swr/rasterizer/jitter/builder_misc.h

index aab499b54ad8ea7b68e4c80e5f887284a5a4f3f0..113c616f6ae87899602809c6780761179aca19ef 100644 (file)
@@ -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__))
index 0148d8eb8aceb4153cff5fc40b9a4e110989d2ca..704b0f259c9eca2f6177d30fb087a9229b185177 100644 (file)
@@ -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)
     {
index 5195678b4c409848a6a00071edc22130ee5466fb..9660bc65f02d783e79731eb9b562a31c0327b1a9 100644 (file)
@@ -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);