swr/rast: Added ICLAMP builder function
authorGeorge Kyriazis <george.kyriazis@intel.com>
Fri, 19 Jan 2018 21:47:10 +0000 (15:47 -0600)
committerGeorge Kyriazis <george.kyriazis@intel.com>
Fri, 19 Jan 2018 22:52:41 +0000 (16:52 -0600)
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/jitter/builder_misc.cpp
src/gallium/drivers/swr/rasterizer/jitter/builder_misc.h

index f70c8dbad90717a69da2698ea67f68d4ef7cb889..142007eb3412afcdcf57c91da49fec3d28540b55 100644 (file)
@@ -1545,13 +1545,13 @@ namespace SwrJit
         return result;
     }
 
-    Value *Builder::ICLAMP(Value* src, Value* low, Value* high)
+    Value *Builder::ICLAMP(Value* src, Value* low, Value* high, const llvm::Twine& name)
     {
         Value *lowCmp = ICMP_SLT(src, low);
         Value *ret = SELECT(lowCmp, low, src);
 
         Value *highCmp = ICMP_SGT(ret, high);
-        ret = SELECT(highCmp, high, ret);
+        ret = SELECT(highCmp, high, ret, name);
 
         return ret;
     }
index 609e0b2b5618c794be5a2f2cf737a4bce1582ef2..c7f7f1aea93067f93203cd48419263ef96cdca2f 100644 (file)
@@ -174,7 +174,7 @@ Value *VPCMPGTD(Value* a, Value* b)
     return S_EXT(vIndexMask,VectorType::get(mInt32Ty,JM()->mVWidth));
 }
 
-Value *ICLAMP(Value* src, Value* low, Value* high);
+Value *ICLAMP(Value* src, Value* low, Value* high, const llvm::Twine& name = "");
 Value *FCLAMP(Value* src, Value* low, Value* high);
 Value *FCLAMP(Value* src, float low, float high);