[clang] [llvm] [HLSL] Implement the `smoothstep` intrinsic (PR #132288)
    Kaitlin Peng via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Mar 21 14:43:15 PDT 2025
    
    
  
================
@@ -101,6 +101,44 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned BuiltinID,
     TheCall->setType(RetTy);
     break;
   }
+  case SPIRV::BI__builtin_spirv_smoothstep: {
+    if (SemaRef.checkArgCount(TheCall, 3))
+      return true;
+
+    ExprResult A = TheCall->getArg(0);
+    QualType ArgTyA = A.get()->getType();
+    auto *VTyA = ArgTyA->getAs<VectorType>();
+    if (!(ArgTyA->isScalarType() || VTyA)) {
----------------
kmpeng wrote:
Code updated with suggested changes.
https://github.com/llvm/llvm-project/pull/132288
    
    
More information about the llvm-commits
mailing list