[clang] [clang][HLSL] Add sign intrinsic part 3 (PR #101989)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 10 19:54:31 PDT 2024


================
@@ -1108,6 +1117,14 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
       return true;
     break;
   }
+  case Builtin::BI__builtin_hlsl_elementwise_sign: {
+    if (CheckFloatingOrSignedIntRepresentation(&SemaRef, TheCall))
+      return true;
+    if (SemaRef.PrepareBuiltinElementwiseMathOneArgCall(TheCall))
+      return true;
+    SetElementTypeAsReturnType(&SemaRef, TheCall, getASTContext().IntTy);
----------------
farzonl wrote:

I'm not sure if this is correct. Will IntTy return type only assume scalar?

https://github.com/llvm/llvm-project/pull/101989


More information about the cfe-commits mailing list