[clang] [clang] Improve diagnostics for vector builtins (PR #125673)

Fraser Cormack via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 10 09:05:04 PST 2025


https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/125673

>From c6e5201586737fec829ce544d6ed1abf22e09c95 Mon Sep 17 00:00:00 2001
From: Fraser Cormack <fraser at codeplay.com>
Date: Tue, 4 Feb 2025 11:19:24 +0000
Subject: [PATCH 1/2] [clang] Improve diagnostics for vector builtins

Thie commit improves the diagnostics for vector (elementwise) builtins
in a couple of ways.

It primarily provides more precise type-checking diagnostics for
builtins with specific type requirements. Previously many builtins were
receiving a catch-all diagnostic suggesting types which aren't valid.

It also makes consistent the type-checking behaviour between various
binary and ternary builtins. The binary builtins would check for
mismatched argument types before specific type requirements, whereas
ternary builtins would perform the checks in the reverse order. The
binary builtins now behave as the ternary ones do.
---
 .../clang/Basic/DiagnosticSemaKinds.td        |   3 +-
 clang/include/clang/Sema/Sema.h               |  27 ++-
 clang/lib/Sema/SemaChecking.cpp               | 185 +++++++-----------
 clang/lib/Sema/SemaHLSL.cpp                   |  12 +-
 clang/test/Sema/aarch64-sve-vector-exp-ops.c  |   4 +-
 clang/test/Sema/aarch64-sve-vector-log-ops.c  |   6 +-
 clang/test/Sema/aarch64-sve-vector-trig-ops.c |  18 +-
 clang/test/Sema/builtins-elementwise-math.c   |  67 ++++---
 clang/test/Sema/riscv-rvv-vector-exp-ops.c    |   4 +-
 clang/test/Sema/riscv-rvv-vector-log-ops.c    |   6 +-
 clang/test/Sema/riscv-rvv-vector-trig-ops.c   |  18 +-
 clang/test/SemaHLSL/BuiltIns/exp-errors.hlsl  |   2 +-
 .../SemaHLSL/BuiltIns/reversebits-errors.hlsl |   2 +-
 .../test/SemaHLSL/BuiltIns/round-errors.hlsl  |   2 +-
 14 files changed, 169 insertions(+), 187 deletions(-)

diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index bcae9e9f3009387..38badfd81f5088c 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -12414,7 +12414,8 @@ def err_builtin_invalid_arg_type: Error <
   "a vector of integers|"
   "an unsigned integer|"
   "an 'int'|"
-  "a vector of floating points}1 (was %2)">;
+  "a vector of floating points|"
+  "an integer or vector of integers}1 (was %2)">;
 
 def err_builtin_matrix_disabled: Error<
   "matrix types extension is disabled. Pass -fenable-matrix to enable it">;
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 1870d1271c556cb..fb18abf82797d5e 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -2331,9 +2331,18 @@ class Sema final : public SemaBase {
   bool CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall,
                          const FunctionProtoType *Proto);
 
+  enum class EltwiseBuiltinArgTyRestriction {
+    None,
+    FloatTy,
+    IntegerTy,
+    SignedIntOrFloatTy,
+  };
+
   /// \param FPOnly restricts the arguments to floating-point types.
-  std::optional<QualType> BuiltinVectorMath(CallExpr *TheCall,
-                                            bool FPOnly = false);
+  std::optional<QualType>
+  BuiltinVectorMath(CallExpr *TheCall,
+                    EltwiseBuiltinArgTyRestriction ArgTyRestr =
+                        EltwiseBuiltinArgTyRestriction::None);
   bool BuiltinVectorToScalarMath(CallExpr *TheCall);
 
   void checkLifetimeCaptureBy(FunctionDecl *FDecl, bool IsMemberFunction,
@@ -2418,9 +2427,13 @@ class Sema final : public SemaBase {
                                bool *ICContext = nullptr,
                                bool IsListInit = false);
 
-  bool BuiltinElementwiseTernaryMath(CallExpr *TheCall,
-                                     bool CheckForFloatArgs = true);
-  bool PrepareBuiltinElementwiseMathOneArgCall(CallExpr *TheCall);
+  bool
+  BuiltinElementwiseTernaryMath(CallExpr *TheCall,
+                                EltwiseBuiltinArgTyRestriction ArgTyRestr =
+                                    EltwiseBuiltinArgTyRestriction::FloatTy);
+  bool PrepareBuiltinElementwiseMathOneArgCall(
+      CallExpr *TheCall, EltwiseBuiltinArgTyRestriction ArgTyRestr =
+                             EltwiseBuiltinArgTyRestriction::None);
 
 private:
   void CheckArrayAccess(const Expr *BaseExpr, const Expr *IndexExpr,
@@ -2529,7 +2542,9 @@ class Sema final : public SemaBase {
                                  AtomicExpr::AtomicOp Op);
 
   /// \param FPOnly restricts the arguments to floating-point types.
-  bool BuiltinElementwiseMath(CallExpr *TheCall, bool FPOnly = false);
+  bool BuiltinElementwiseMath(CallExpr *TheCall,
+                              EltwiseBuiltinArgTyRestriction ArgTyRestr =
+                                  EltwiseBuiltinArgTyRestriction::None);
   bool PrepareBuiltinReduceMathOneArgCall(CallExpr *TheCall);
 
   bool BuiltinNonDeterministicValue(CallExpr *TheCall);
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 66c233de4ef30b0..7e9d5b48d835ff1 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -1970,26 +1970,40 @@ bool Sema::CheckTSBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
 // Check if \p Ty is a valid type for the elementwise math builtins. If it is
 // not a valid type, emit an error message and return true. Otherwise return
 // false.
-static bool checkMathBuiltinElementType(Sema &S, SourceLocation Loc,
-                                        QualType ArgTy, int ArgIndex) {
-  if (!ArgTy->getAs<VectorType>() &&
-      !ConstantMatrixType::isValidElementType(ArgTy)) {
-    return S.Diag(Loc, diag::err_builtin_invalid_arg_type)
-           << ArgIndex << /* vector, integer or float ty*/ 0 << ArgTy;
-  }
-
-  return false;
-}
-
-static bool checkFPMathBuiltinElementType(Sema &S, SourceLocation Loc,
-                                          QualType ArgTy, int ArgIndex) {
+static bool
+checkMathBuiltinElementType(Sema &S, SourceLocation Loc, QualType ArgTy,
+                            Sema::EltwiseBuiltinArgTyRestriction ArgTyRestr,
+                            int ArgOrdinal) {
   QualType EltTy = ArgTy;
   if (auto *VecTy = EltTy->getAs<VectorType>())
     EltTy = VecTy->getElementType();
 
-  if (!EltTy->isRealFloatingType()) {
-    return S.Diag(Loc, diag::err_builtin_invalid_arg_type)
-           << ArgIndex << /* vector or float ty*/ 5 << ArgTy;
+  switch (ArgTyRestr) {
+  case Sema::EltwiseBuiltinArgTyRestriction::None:
+    if (!ArgTy->getAs<VectorType>() &&
+        !ConstantMatrixType::isValidElementType(ArgTy)) {
+      return S.Diag(Loc, diag::err_builtin_invalid_arg_type)
+             << ArgOrdinal << /* vector, integer or float ty*/ 0 << ArgTy;
+    }
+    break;
+  case Sema::EltwiseBuiltinArgTyRestriction::FloatTy:
+    if (!EltTy->isRealFloatingType()) {
+      return S.Diag(Loc, diag::err_builtin_invalid_arg_type)
+             << ArgOrdinal << /* vector or float ty*/ 5 << ArgTy;
+    }
+    break;
+  case Sema::EltwiseBuiltinArgTyRestriction::IntegerTy:
+    if (!EltTy->isIntegerType()) {
+      return S.Diag(Loc, diag::err_builtin_invalid_arg_type)
+             << ArgOrdinal << /* vector or int ty*/ 10 << ArgTy;
+    }
+    break;
+  case Sema::EltwiseBuiltinArgTyRestriction::SignedIntOrFloatTy:
+    if (EltTy->isUnsignedIntegerType()) {
+      return S.Diag(Loc, diag::err_builtin_invalid_arg_type)
+             << 1 << /* signed integer or float ty*/ 3 << ArgTy;
+    }
+    break;
   }
 
   return false;
@@ -2695,23 +2709,11 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
 
   // __builtin_elementwise_abs restricts the element type to signed integers or
   // floating point types only.
-  case Builtin::BI__builtin_elementwise_abs: {
-    if (PrepareBuiltinElementwiseMathOneArgCall(TheCall))
+  case Builtin::BI__builtin_elementwise_abs:
+    if (PrepareBuiltinElementwiseMathOneArgCall(
+            TheCall, EltwiseBuiltinArgTyRestriction::SignedIntOrFloatTy))
       return ExprError();
-
-    QualType ArgTy = TheCall->getArg(0)->getType();
-    QualType EltTy = ArgTy;
-
-    if (auto *VecTy = EltTy->getAs<VectorType>())
-      EltTy = VecTy->getElementType();
-    if (EltTy->isUnsignedIntegerType()) {
-      Diag(TheCall->getArg(0)->getBeginLoc(),
-           diag::err_builtin_invalid_arg_type)
-          << 1 << /* signed integer or float ty*/ 3 << ArgTy;
-      return ExprError();
-    }
     break;
-  }
 
   // These builtins restrict the element type to floating point
   // types only.
@@ -2737,21 +2739,15 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
   case Builtin::BI__builtin_elementwise_tan:
   case Builtin::BI__builtin_elementwise_tanh:
   case Builtin::BI__builtin_elementwise_trunc:
-  case Builtin::BI__builtin_elementwise_canonicalize: {
-    if (PrepareBuiltinElementwiseMathOneArgCall(TheCall))
-      return ExprError();
-
-    QualType ArgTy = TheCall->getArg(0)->getType();
-    if (checkFPMathBuiltinElementType(*this, TheCall->getArg(0)->getBeginLoc(),
-                                      ArgTy, 1))
+  case Builtin::BI__builtin_elementwise_canonicalize:
+    if (PrepareBuiltinElementwiseMathOneArgCall(
+            TheCall, EltwiseBuiltinArgTyRestriction::FloatTy))
       return ExprError();
     break;
-  }
-  case Builtin::BI__builtin_elementwise_fma: {
+  case Builtin::BI__builtin_elementwise_fma:
     if (BuiltinElementwiseTernaryMath(TheCall))
       return ExprError();
     break;
-  }
 
   // These builtins restrict the element type to floating point
   // types only, and take in two arguments.
@@ -2759,59 +2755,30 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
   case Builtin::BI__builtin_elementwise_maximum:
   case Builtin::BI__builtin_elementwise_atan2:
   case Builtin::BI__builtin_elementwise_fmod:
-  case Builtin::BI__builtin_elementwise_pow: {
-    if (BuiltinElementwiseMath(TheCall, /*FPOnly=*/true))
+  case Builtin::BI__builtin_elementwise_pow:
+    if (BuiltinElementwiseMath(TheCall,
+                               EltwiseBuiltinArgTyRestriction::FloatTy))
       return ExprError();
     break;
-  }
-
   // These builtins restrict the element type to integer
   // types only.
   case Builtin::BI__builtin_elementwise_add_sat:
-  case Builtin::BI__builtin_elementwise_sub_sat: {
-    if (BuiltinElementwiseMath(TheCall))
-      return ExprError();
-
-    const Expr *Arg = TheCall->getArg(0);
-    QualType ArgTy = Arg->getType();
-    QualType EltTy = ArgTy;
-
-    if (auto *VecTy = EltTy->getAs<VectorType>())
-      EltTy = VecTy->getElementType();
-
-    if (!EltTy->isIntegerType()) {
-      Diag(Arg->getBeginLoc(), diag::err_builtin_invalid_arg_type)
-          << 1 << /* integer ty */ 6 << ArgTy;
+  case Builtin::BI__builtin_elementwise_sub_sat:
+    if (BuiltinElementwiseMath(TheCall,
+                               EltwiseBuiltinArgTyRestriction::IntegerTy))
       return ExprError();
-    }
     break;
-  }
-
   case Builtin::BI__builtin_elementwise_min:
   case Builtin::BI__builtin_elementwise_max:
     if (BuiltinElementwiseMath(TheCall))
       return ExprError();
     break;
   case Builtin::BI__builtin_elementwise_popcount:
-  case Builtin::BI__builtin_elementwise_bitreverse: {
-    if (PrepareBuiltinElementwiseMathOneArgCall(TheCall))
-      return ExprError();
-
-    const Expr *Arg = TheCall->getArg(0);
-    QualType ArgTy = Arg->getType();
-    QualType EltTy = ArgTy;
-
-    if (auto *VecTy = EltTy->getAs<VectorType>())
-      EltTy = VecTy->getElementType();
-
-    if (!EltTy->isIntegerType()) {
-      Diag(Arg->getBeginLoc(), diag::err_builtin_invalid_arg_type)
-          << 1 << /* integer ty */ 6 << ArgTy;
+  case Builtin::BI__builtin_elementwise_bitreverse:
+    if (PrepareBuiltinElementwiseMathOneArgCall(
+            TheCall, EltwiseBuiltinArgTyRestriction::IntegerTy))
       return ExprError();
-    }
     break;
-  }
-
   case Builtin::BI__builtin_elementwise_copysign: {
     if (checkArgCount(TheCall, 2))
       return ExprError();
@@ -2823,10 +2790,12 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
 
     QualType MagnitudeTy = Magnitude.get()->getType();
     QualType SignTy = Sign.get()->getType();
-    if (checkFPMathBuiltinElementType(*this, TheCall->getArg(0)->getBeginLoc(),
-                                      MagnitudeTy, 1) ||
-        checkFPMathBuiltinElementType(*this, TheCall->getArg(1)->getBeginLoc(),
-                                      SignTy, 2)) {
+    if (checkMathBuiltinElementType(
+            *this, TheCall->getArg(0)->getBeginLoc(), MagnitudeTy,
+            EltwiseBuiltinArgTyRestriction::FloatTy, 1) ||
+        checkMathBuiltinElementType(
+            *this, TheCall->getArg(1)->getBeginLoc(), SignTy,
+            EltwiseBuiltinArgTyRestriction::FloatTy, 2)) {
       return ExprError();
     }
 
@@ -14662,7 +14631,8 @@ static ExprResult BuiltinVectorMathConversions(Sema &S, Expr *E) {
   return S.UsualUnaryFPConversions(Res.get());
 }
 
-bool Sema::PrepareBuiltinElementwiseMathOneArgCall(CallExpr *TheCall) {
+bool Sema::PrepareBuiltinElementwiseMathOneArgCall(
+    CallExpr *TheCall, EltwiseBuiltinArgTyRestriction ArgTyRestr) {
   if (checkArgCount(TheCall, 1))
     return true;
 
@@ -14673,15 +14643,17 @@ bool Sema::PrepareBuiltinElementwiseMathOneArgCall(CallExpr *TheCall) {
   TheCall->setArg(0, A.get());
   QualType TyA = A.get()->getType();
 
-  if (checkMathBuiltinElementType(*this, A.get()->getBeginLoc(), TyA, 1))
+  if (checkMathBuiltinElementType(*this, A.get()->getBeginLoc(), TyA,
+                                  ArgTyRestr, 1))
     return true;
 
   TheCall->setType(TyA);
   return false;
 }
 
-bool Sema::BuiltinElementwiseMath(CallExpr *TheCall, bool FPOnly) {
-  if (auto Res = BuiltinVectorMath(TheCall, FPOnly); Res.has_value()) {
+bool Sema::BuiltinElementwiseMath(CallExpr *TheCall,
+                                  EltwiseBuiltinArgTyRestriction ArgTyRestr) {
+  if (auto Res = BuiltinVectorMath(TheCall, ArgTyRestr); Res.has_value()) {
     TheCall->setType(*Res);
     return false;
   }
@@ -14714,8 +14686,9 @@ static bool checkBuiltinVectorMathMixedEnums(Sema &S, Expr *LHS, Expr *RHS,
   return false;
 }
 
-std::optional<QualType> Sema::BuiltinVectorMath(CallExpr *TheCall,
-                                                bool FPOnly) {
+std::optional<QualType>
+Sema::BuiltinVectorMath(CallExpr *TheCall,
+                        EltwiseBuiltinArgTyRestriction ArgTyRestr) {
   if (checkArgCount(TheCall, 2))
     return std::nullopt;
 
@@ -14736,26 +14709,21 @@ std::optional<QualType> Sema::BuiltinVectorMath(CallExpr *TheCall,
   QualType TyA = Args[0]->getType();
   QualType TyB = Args[1]->getType();
 
+  if (checkMathBuiltinElementType(*this, LocA, TyA, ArgTyRestr, 1))
+    return std::nullopt;
+
   if (TyA.getCanonicalType() != TyB.getCanonicalType()) {
     Diag(LocA, diag::err_typecheck_call_different_arg_types) << TyA << TyB;
     return std::nullopt;
   }
 
-  if (FPOnly) {
-    if (checkFPMathBuiltinElementType(*this, LocA, TyA, 1))
-      return std::nullopt;
-  } else {
-    if (checkMathBuiltinElementType(*this, LocA, TyA, 1))
-      return std::nullopt;
-  }
-
   TheCall->setArg(0, Args[0]);
   TheCall->setArg(1, Args[1]);
   return TyA;
 }
 
-bool Sema::BuiltinElementwiseTernaryMath(CallExpr *TheCall,
-                                         bool CheckForFloatArgs) {
+bool Sema::BuiltinElementwiseTernaryMath(
+    CallExpr *TheCall, EltwiseBuiltinArgTyRestriction ArgTyRestr) {
   if (checkArgCount(TheCall, 3))
     return true;
 
@@ -14775,20 +14743,11 @@ bool Sema::BuiltinElementwiseTernaryMath(CallExpr *TheCall,
     Args[I] = Converted.get();
   }
 
-  if (CheckForFloatArgs) {
-    int ArgOrdinal = 1;
-    for (Expr *Arg : Args) {
-      if (checkFPMathBuiltinElementType(*this, Arg->getBeginLoc(),
-                                        Arg->getType(), ArgOrdinal++))
-        return true;
-    }
-  } else {
-    int ArgOrdinal = 1;
-    for (Expr *Arg : Args) {
-      if (checkMathBuiltinElementType(*this, Arg->getBeginLoc(), Arg->getType(),
-                                      ArgOrdinal++))
-        return true;
-    }
+  int ArgOrdinal = 1;
+  for (Expr *Arg : Args) {
+    if (checkMathBuiltinElementType(*this, Arg->getBeginLoc(), Arg->getType(),
+                                    ArgTyRestr, ArgOrdinal++))
+      return true;
   }
 
   for (int I = 1; I < 3; ++I) {
diff --git a/clang/lib/Sema/SemaHLSL.cpp b/clang/lib/Sema/SemaHLSL.cpp
index ec6b5b45de42bfa..9ce21dfd20b68e7 100644
--- a/clang/lib/Sema/SemaHLSL.cpp
+++ b/clang/lib/Sema/SemaHLSL.cpp
@@ -2259,8 +2259,10 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
     if (CheckVectorElementCallArgs(&SemaRef, TheCall))
       return true;
     if (SemaRef.BuiltinElementwiseTernaryMath(
-            TheCall, /*CheckForFloatArgs*/
-            TheCall->getArg(0)->getType()->hasFloatingRepresentation()))
+            TheCall, /*ArgTyRestr*/
+            TheCall->getArg(0)->getType()->hasFloatingRepresentation()
+                ? Sema::EltwiseBuiltinArgTyRestriction::FloatTy
+                : Sema::EltwiseBuiltinArgTyRestriction::None))
       return true;
     break;
   }
@@ -2393,8 +2395,10 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
     if (CheckVectorElementCallArgs(&SemaRef, TheCall))
       return true;
     if (SemaRef.BuiltinElementwiseTernaryMath(
-            TheCall, /*CheckForFloatArgs*/
-            TheCall->getArg(0)->getType()->hasFloatingRepresentation()))
+            TheCall, /*ArgTyRestr*/
+            TheCall->getArg(0)->getType()->hasFloatingRepresentation()
+                ? Sema::EltwiseBuiltinArgTyRestriction::FloatTy
+                : Sema::EltwiseBuiltinArgTyRestriction::None))
       return true;
     break;
   }
diff --git a/clang/test/Sema/aarch64-sve-vector-exp-ops.c b/clang/test/Sema/aarch64-sve-vector-exp-ops.c
index f2bba8c7eeb196d..4b411babbc3471e 100644
--- a/clang/test/Sema/aarch64-sve-vector-exp-ops.c
+++ b/clang/test/Sema/aarch64-sve-vector-exp-ops.c
@@ -7,11 +7,11 @@
 svfloat32_t test_exp_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_exp(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
 
 svfloat32_t test_exp2_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_exp2(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
diff --git a/clang/test/Sema/aarch64-sve-vector-log-ops.c b/clang/test/Sema/aarch64-sve-vector-log-ops.c
index ef16e8581844d7f..bc81323b560c9c4 100644
--- a/clang/test/Sema/aarch64-sve-vector-log-ops.c
+++ b/clang/test/Sema/aarch64-sve-vector-log-ops.c
@@ -7,17 +7,17 @@
 svfloat32_t test_log_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_log(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
 
 svfloat32_t test_log10_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_log10(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
 
 svfloat32_t test_log2_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_log2(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
diff --git a/clang/test/Sema/aarch64-sve-vector-trig-ops.c b/clang/test/Sema/aarch64-sve-vector-trig-ops.c
index 3fe6834be2e0b7f..46df63cbba42bf7 100644
--- a/clang/test/Sema/aarch64-sve-vector-trig-ops.c
+++ b/clang/test/Sema/aarch64-sve-vector-trig-ops.c
@@ -7,19 +7,19 @@
 svfloat32_t test_asin_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_asin(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
 
 svfloat32_t test_acos_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_acos(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
 
 svfloat32_t test_atan_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_atan(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
 
 svfloat32_t test_atan2_vv_i8mf8(svfloat32_t v) {
@@ -31,35 +31,35 @@ svfloat32_t test_atan2_vv_i8mf8(svfloat32_t v) {
 svfloat32_t test_sin_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_sin(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
 
 svfloat32_t test_cos_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_cos(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
 
 svfloat32_t test_tan_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_tan(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
 
 svfloat32_t test_sinh_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_sinh(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
 
 svfloat32_t test_cosh_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_cosh(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
 
 svfloat32_t test_tanh_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_tanh(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
diff --git a/clang/test/Sema/builtins-elementwise-math.c b/clang/test/Sema/builtins-elementwise-math.c
index d6785f78340caf5..cfa96657ae468be 100644
--- a/clang/test/Sema/builtins-elementwise-math.c
+++ b/clang/test/Sema/builtins-elementwise-math.c
@@ -45,7 +45,7 @@ void test_builtin_elementwise_abs(int i, double d, float4 v, int3 iv, unsigned u
 
 void test_builtin_elementwise_add_sat(int i, short s, double d, float4 v, int3 iv, unsigned3 uv, int *p) {
   i = __builtin_elementwise_add_sat(p, d);
-  // expected-error at -1 {{arguments are of different types ('int *' vs 'double')}}
+  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'int *')}}
 
   struct Foo foo = __builtin_elementwise_add_sat(i, i);
   // expected-error at -1 {{initializing 'struct Foo' with an expression of incompatible type 'int'}}
@@ -60,13 +60,16 @@ void test_builtin_elementwise_add_sat(int i, short s, double d, float4 v, int3 i
   // expected-error at -1 {{too many arguments to function call, expected 2, have 3}}
 
   i = __builtin_elementwise_add_sat(v, iv);
-  // expected-error at -1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'int3' (vector of 3 'int' values))}}
+  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'float4' (vector of 4 'float' values))}}
+
+  i = __builtin_elementwise_add_sat(iv, v);
+  // expected-error at -1 {{arguments are of different types ('int3' (vector of 3 'int' values) vs 'float4' (vector of 4 'float' values))}}
 
   i = __builtin_elementwise_add_sat(uv, iv);
   // expected-error at -1 {{arguments are of different types ('unsigned3' (vector of 3 'unsigned int' values) vs 'int3' (vector of 3 'int' values))}}
 
   v = __builtin_elementwise_add_sat(v, v);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'float4' (vector of 4 'float' values))}}
+  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'float4' (vector of 4 'float' values))}}
 
   s = __builtin_elementwise_add_sat(i, s);
   // expected-error at -1 {{arguments are of different types ('int' vs 'short')}}
@@ -95,7 +98,7 @@ void test_builtin_elementwise_add_sat(int i, short s, double d, float4 v, int3 i
 
   int A[10];
   A = __builtin_elementwise_add_sat(A, A);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was 'int *')}}
+  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'int *')}}
 
   int(ii);
   int j;
@@ -103,12 +106,12 @@ void test_builtin_elementwise_add_sat(int i, short s, double d, float4 v, int3 i
 
   _Complex float c1, c2;
   c1 = __builtin_elementwise_add_sat(c1, c2);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was '_Complex float')}}
+  // expected-error at -1 {{1st argument must be an integer or vector of integers (was '_Complex float')}}
 }
 
 void test_builtin_elementwise_sub_sat(int i, short s, double d, float4 v, int3 iv, unsigned3 uv, int *p) {
   i = __builtin_elementwise_sub_sat(p, d);
-  // expected-error at -1 {{arguments are of different types ('int *' vs 'double')}}
+  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'int *')}}
 
   struct Foo foo = __builtin_elementwise_sub_sat(i, i);
   // expected-error at -1 {{initializing 'struct Foo' with an expression of incompatible type 'int'}}
@@ -123,13 +126,16 @@ void test_builtin_elementwise_sub_sat(int i, short s, double d, float4 v, int3 i
   // expected-error at -1 {{too many arguments to function call, expected 2, have 3}}
 
   i = __builtin_elementwise_sub_sat(v, iv);
-  // expected-error at -1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'int3' (vector of 3 'int' values))}}
+  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'float4' (vector of 4 'float' values))}}
+
+  i = __builtin_elementwise_sub_sat(iv, v);
+  // expected-error at -1 {{arguments are of different types ('int3' (vector of 3 'int' values) vs 'float4' (vector of 4 'float' values))}}
 
   i = __builtin_elementwise_sub_sat(uv, iv);
   // expected-error at -1 {{arguments are of different types ('unsigned3' (vector of 3 'unsigned int' values) vs 'int3' (vector of 3 'int' values))}}
 
   v = __builtin_elementwise_sub_sat(v, v);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'float4' (vector of 4 'float' values))}}
+  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'float4' (vector of 4 'float' values))}}
 
   s = __builtin_elementwise_sub_sat(i, s);
   // expected-error at -1 {{arguments are of different types ('int' vs 'short')}}
@@ -158,7 +164,7 @@ void test_builtin_elementwise_sub_sat(int i, short s, double d, float4 v, int3 i
 
   int A[10];
   A = __builtin_elementwise_sub_sat(A, A);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was 'int *')}}
+  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'int *')}}
 
   int(ii);
   int j;
@@ -166,12 +172,12 @@ void test_builtin_elementwise_sub_sat(int i, short s, double d, float4 v, int3 i
 
   _Complex float c1, c2;
   c1 = __builtin_elementwise_sub_sat(c1, c2);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was '_Complex float')}}
+  // expected-error at -1 {{1st argument must be an integer or vector of integers (was '_Complex float')}}
 }
 
 void test_builtin_elementwise_max(int i, short s, double d, float4 v, int3 iv, unsigned3 uv, int *p) {
   i = __builtin_elementwise_max(p, d);
-  // expected-error at -1 {{arguments are of different types ('int *' vs 'double')}}
+  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was 'int *')}}
 
   struct Foo foo = __builtin_elementwise_max(i, i);
   // expected-error at -1 {{initializing 'struct Foo' with an expression of incompatible type 'int'}}
@@ -231,7 +237,7 @@ void test_builtin_elementwise_max(int i, short s, double d, float4 v, int3 iv, u
 
 void test_builtin_elementwise_min(int i, short s, double d, float4 v, int3 iv, unsigned3 uv, int *p) {
   i = __builtin_elementwise_min(p, d);
-  // expected-error at -1 {{arguments are of different types ('int *' vs 'double')}}
+  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was 'int *')}}
 
   struct Foo foo = __builtin_elementwise_min(i, i);
   // expected-error at -1 {{initializing 'struct Foo' with an expression of incompatible type 'int'}}
@@ -291,7 +297,7 @@ void test_builtin_elementwise_min(int i, short s, double d, float4 v, int3 iv, u
 
 void test_builtin_elementwise_maximum(int i, short s, float f, double d, float4 fv, double4 dv, int3 iv, unsigned3 uv, int *p) {
   i = __builtin_elementwise_maximum(p, d);
-  // expected-error at -1 {{arguments are of different types ('int *' vs 'double')}}
+  // expected-error at -1 {{1st argument must be a floating point type (was 'int *')}}
 
   struct Foo foo = __builtin_elementwise_maximum(d, d);
   // expected-error at -1 {{initializing 'struct Foo' with an expression of incompatible type 'double'}}
@@ -309,7 +315,7 @@ void test_builtin_elementwise_maximum(int i, short s, float f, double d, float4
   // expected-error at -1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'int3' (vector of 3 'int' values))}}
 
   i = __builtin_elementwise_maximum(uv, iv);
-  // expected-error at -1 {{arguments are of different types ('unsigned3' (vector of 3 'unsigned int' values) vs 'int3' (vector of 3 'int' values))}}
+  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned3' (vector of 3 'unsigned int' values))}}
 
   dv = __builtin_elementwise_maximum(fv, dv);
   // expected-error at -1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'double4' (vector of 4 'double' values))}}
@@ -336,7 +342,7 @@ void test_builtin_elementwise_maximum(int i, short s, float f, double d, float4
 
 void test_builtin_elementwise_minimum(int i, short s, float f, double d, float4 fv, double4 dv, int3 iv, unsigned3 uv, int *p) {
   i = __builtin_elementwise_minimum(p, d);
-  // expected-error at -1 {{arguments are of different types ('int *' vs 'double')}}
+  // expected-error at -1 {{1st argument must be a floating point type (was 'int *')}}
 
   struct Foo foo = __builtin_elementwise_minimum(d, d);
   // expected-error at -1 {{initializing 'struct Foo' with an expression of incompatible type 'double'}}
@@ -354,7 +360,7 @@ void test_builtin_elementwise_minimum(int i, short s, float f, double d, float4
   // expected-error at -1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'int3' (vector of 3 'int' values))}}
 
   i = __builtin_elementwise_minimum(uv, iv);
-  // expected-error at -1 {{arguments are of different types ('unsigned3' (vector of 3 'unsigned int' values) vs 'int3' (vector of 3 'int' values))}}
+  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned3' (vector of 3 'unsigned int' values))}}
 
   dv = __builtin_elementwise_minimum(fv, dv);
   // expected-error at -1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'double4' (vector of 4 'double' values))}}
@@ -388,16 +394,16 @@ void test_builtin_elementwise_bitreverse(int i, float f, double d, float4 v, int
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_bitreverse(f);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'float')}}
+  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'float')}}
   
   i = __builtin_elementwise_bitreverse(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_bitreverse(d);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'double')}}
+  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'double')}}
 
   v = __builtin_elementwise_bitreverse(v);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'float4' (vector of 4 'float' values))}}
+  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'float4' (vector of 4 'float' values))}}
 }
 
 void test_builtin_elementwise_ceil(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -620,16 +626,16 @@ void test_builtin_elementwise_popcount(int i, float f, double d, float4 v, int3
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_popcount(f);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'float')}}
+  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'float')}}
 
   i = __builtin_elementwise_popcount(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_popcount(d);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'double')}}
+  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'double')}}
 
   v = __builtin_elementwise_popcount(v);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'float4' (vector of 4 'float' values))}}
+  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'float4' (vector of 4 'float' values))}}
 
   int2 i2 = __builtin_elementwise_popcount(iv);
   // expected-error at -1 {{initializing 'int2' (vector of 2 'int' values) with an expression of incompatible type 'int3' (vector of 3 'int' values)}}
@@ -646,7 +652,7 @@ void test_builtin_elementwise_popcount(int i, float f, double d, float4 v, int3
 
 void test_builtin_elementwise_fmod(int i, short s, double d, float4 v, int3 iv, unsigned3 uv, int *p) {
   i = __builtin_elementwise_fmod(p, d);
-  // expected-error at -1 {{arguments are of different types ('int *' vs 'double')}}
+  // expected-error at -1 {{1st argument must be a floating point type (was 'int *')}}
 
   struct Foo foo = __builtin_elementwise_fmod(i, i);
   // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
@@ -664,7 +670,7 @@ void test_builtin_elementwise_fmod(int i, short s, double d, float4 v, int3 iv,
   // expected-error at -1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'int3' (vector of 3 'int' values))}}
 
   i = __builtin_elementwise_fmod(uv, iv);
-  // expected-error at -1 {{arguments are of different types ('unsigned3' (vector of 3 'unsigned int' values) vs 'int3' (vector of 3 'int' values))}}
+  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned3' (vector of 3 'unsigned int' values))}}
 
   i = __builtin_elementwise_fmod(d, v);
   // expected-error at -1 {{arguments are of different types ('double' vs 'float4' (vector of 4 'float' values))}}
@@ -672,7 +678,7 @@ void test_builtin_elementwise_fmod(int i, short s, double d, float4 v, int3 iv,
 
 void test_builtin_elementwise_pow(int i, short s, double d, float4 v, int3 iv, unsigned3 uv, int *p) {
   i = __builtin_elementwise_pow(p, d);
-  // expected-error at -1 {{arguments are of different types ('int *' vs 'double')}}
+  // expected-error at -1 {{1st argument must be a floating point type (was 'int *')}}
 
   struct Foo foo = __builtin_elementwise_pow(i, i);
   // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
@@ -690,7 +696,7 @@ void test_builtin_elementwise_pow(int i, short s, double d, float4 v, int3 iv, u
   // expected-error at -1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'int3' (vector of 3 'int' values))}}
 
   i = __builtin_elementwise_pow(uv, iv);
-  // expected-error at -1 {{arguments are of different types ('unsigned3' (vector of 3 'unsigned int' values) vs 'int3' (vector of 3 'int' values))}}
+  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned3' (vector of 3 'unsigned int' values))}}
   
 }
 
@@ -734,10 +740,9 @@ void test_builtin_elementwise_round(int i, float f, double d, float4 v, int3 iv,
   uv = __builtin_elementwise_round(uv);
   // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 
-  // FIXME: Error should not mention integer
   _Complex float c1, c2;
   c1 = __builtin_elementwise_round(c1);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was '_Complex float')}}
+  // expected-error at -1 {{1st argument must be a floating point type (was '_Complex float')}}
 }
 
 void test_builtin_elementwise_rint(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -759,10 +764,9 @@ void test_builtin_elementwise_rint(int i, float f, double d, float4 v, int3 iv,
   uv = __builtin_elementwise_rint(uv);
   // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 
-  // FIXME: Error should not mention integer
   _Complex float c1, c2;
   c1 = __builtin_elementwise_rint(c1);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was '_Complex float')}}
+  // expected-error at -1 {{1st argument must be a floating point type (was '_Complex float')}}
 }
 
 void test_builtin_elementwise_nearbyint(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -784,10 +788,9 @@ void test_builtin_elementwise_nearbyint(int i, float f, double d, float4 v, int3
   uv = __builtin_elementwise_nearbyint(uv);
   // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 
-  // FIXME: Error should not mention integer
   _Complex float c1, c2;
   c1 = __builtin_elementwise_nearbyint(c1);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was '_Complex float')}}
+  // expected-error at -1 {{1st argument must be a floating point type (was '_Complex float')}}
 }
 
 void test_builtin_elementwise_asin(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
diff --git a/clang/test/Sema/riscv-rvv-vector-exp-ops.c b/clang/test/Sema/riscv-rvv-vector-exp-ops.c
index a0ac46f760a309d..7f8f59ab5cfebbb 100644
--- a/clang/test/Sema/riscv-rvv-vector-exp-ops.c
+++ b/clang/test/Sema/riscv-rvv-vector-exp-ops.c
@@ -9,11 +9,11 @@
 vfloat32mf2_t test_exp_vv_i8mf8(vfloat32mf2_t v) {
 
   return __builtin_elementwise_exp(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
 
 vfloat32mf2_t test_exp2_vv_i8mf8(vfloat32mf2_t v) {
 
   return __builtin_elementwise_exp2(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
diff --git a/clang/test/Sema/riscv-rvv-vector-log-ops.c b/clang/test/Sema/riscv-rvv-vector-log-ops.c
index 970cfe3fd68bfb1..5028803efd861df 100644
--- a/clang/test/Sema/riscv-rvv-vector-log-ops.c
+++ b/clang/test/Sema/riscv-rvv-vector-log-ops.c
@@ -9,17 +9,17 @@
 vfloat32mf2_t test_log_vv_i8mf8(vfloat32mf2_t v) {
 
   return __builtin_elementwise_log(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
 
 vfloat32mf2_t test_log10_vv_i8mf8(vfloat32mf2_t v) {
 
   return __builtin_elementwise_log10(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
 
 vfloat32mf2_t test_log2_vv_i8mf8(vfloat32mf2_t v) {
 
   return __builtin_elementwise_log2(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
diff --git a/clang/test/Sema/riscv-rvv-vector-trig-ops.c b/clang/test/Sema/riscv-rvv-vector-trig-ops.c
index 0aed1b2a0998655..077d1ba61c6e248 100644
--- a/clang/test/Sema/riscv-rvv-vector-trig-ops.c
+++ b/clang/test/Sema/riscv-rvv-vector-trig-ops.c
@@ -8,19 +8,19 @@
 vfloat32mf2_t test_asin_vv_i8mf8(vfloat32mf2_t v) {
 
     return __builtin_elementwise_asin(v);
-    // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+    // expected-error at -1 {{1st argument must be a floating point type}}
   }
   
   vfloat32mf2_t test_acos_vv_i8mf8(vfloat32mf2_t v) {
   
     return __builtin_elementwise_acos(v);
-    // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+    // expected-error at -1 {{1st argument must be a floating point type}}
   }
   
   vfloat32mf2_t test_atan_vv_i8mf8(vfloat32mf2_t v) {
   
     return __builtin_elementwise_atan(v);
-    // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+    // expected-error at -1 {{1st argument must be a floating point type}}
   }
 
 vfloat32mf2_t test_atan2_vv_i8mf8(vfloat32mf2_t v) {
@@ -32,36 +32,36 @@ vfloat32mf2_t test_atan2_vv_i8mf8(vfloat32mf2_t v) {
 vfloat32mf2_t test_sin_vv_i8mf8(vfloat32mf2_t v) {
 
   return __builtin_elementwise_sin(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
 
 vfloat32mf2_t test_cos_vv_i8mf8(vfloat32mf2_t v) {
 
   return __builtin_elementwise_cos(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
 
 vfloat32mf2_t test_tan_vv_i8mf8(vfloat32mf2_t v) {
 
   return __builtin_elementwise_tan(v);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+  // expected-error at -1 {{1st argument must be a floating point type}}
 }
 
 vfloat32mf2_t test_sinh_vv_i8mf8(vfloat32mf2_t v) {
 
     return __builtin_elementwise_sinh(v);
-    // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+    // expected-error at -1 {{1st argument must be a floating point type}}
   }
   
   vfloat32mf2_t test_cosh_vv_i8mf8(vfloat32mf2_t v) {
   
     return __builtin_elementwise_cosh(v);
-    // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+    // expected-error at -1 {{1st argument must be a floating point type}}
   }
   
   vfloat32mf2_t test_tanh_vv_i8mf8(vfloat32mf2_t v) {
   
     return __builtin_elementwise_tanh(v);
-    // expected-error at -1 {{1st argument must be a vector, integer or floating point type}}
+    // expected-error at -1 {{1st argument must be a floating point type}}
   }
   
diff --git a/clang/test/SemaHLSL/BuiltIns/exp-errors.hlsl b/clang/test/SemaHLSL/BuiltIns/exp-errors.hlsl
index 321fc915ec01fcb..bb93e652582cf5c 100644
--- a/clang/test/SemaHLSL/BuiltIns/exp-errors.hlsl
+++ b/clang/test/SemaHLSL/BuiltIns/exp-errors.hlsl
@@ -13,7 +13,7 @@ float2 test_too_many_arg(float2 p0) {
 
 float builtin_bool_to_float_type_promotion(bool p1) {
   return TEST_FUNC(p1);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was 'bool')}}
+  // expected-error at -1 {{1st argument must be a floating point type (was 'bool')}}
 }
 
 float builtin_exp_int_to_float_promotion(int p1) {
diff --git a/clang/test/SemaHLSL/BuiltIns/reversebits-errors.hlsl b/clang/test/SemaHLSL/BuiltIns/reversebits-errors.hlsl
index 49cd895d98c52d2..e01fb9151de1592 100644
--- a/clang/test/SemaHLSL/BuiltIns/reversebits-errors.hlsl
+++ b/clang/test/SemaHLSL/BuiltIns/reversebits-errors.hlsl
@@ -3,7 +3,7 @@
 
 double2 test_int_builtin(double2 p0) {
     return __builtin_elementwise_bitreverse(p0);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'double2' (aka 'vector<double, 2>'))}}
+  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'double2' (aka 'vector<double, 2>'))}}
 }
 
 int2 test_int_builtin(int2 p0) {
diff --git a/clang/test/SemaHLSL/BuiltIns/round-errors.hlsl b/clang/test/SemaHLSL/BuiltIns/round-errors.hlsl
index bede89015298b68..52eff2204b901ff 100644
--- a/clang/test/SemaHLSL/BuiltIns/round-errors.hlsl
+++ b/clang/test/SemaHLSL/BuiltIns/round-errors.hlsl
@@ -13,7 +13,7 @@ float2 test_too_many_arg(float2 p0) {
 
 float builtin_bool_to_float_type_promotion(bool p1) {
   return __builtin_elementwise_round(p1);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was 'bool')}}
+  // expected-error at -1 {{1st argument must be a floating point type (was 'bool')}}
 }
 
 float builtin_round_int_to_float_promotion(int p1) {

>From 266b00776d45874841456928f39fb890708efe82 Mon Sep 17 00:00:00 2001
From: Fraser Cormack <fraser at codeplay.com>
Date: Mon, 10 Feb 2025 16:23:56 +0000
Subject: [PATCH 2/2] [clang] Unify and refactor error formatting

---
 .../clang/Basic/DiagnosticSemaKinds.td        |  18 +-
 clang/lib/Sema/SemaChecking.cpp               |  48 +--
 clang/lib/Sema/SemaHLSL.cpp                   |   3 +-
 clang/test/Sema/aarch64-sve-vector-exp-ops.c  |   4 +-
 clang/test/Sema/aarch64-sve-vector-log-ops.c  |   6 +-
 clang/test/Sema/aarch64-sve-vector-pow-ops.c  |   2 +-
 clang/test/Sema/aarch64-sve-vector-trig-ops.c |  20 +-
 clang/test/Sema/builtins-elementwise-math.c   | 274 +++++++++---------
 clang/test/Sema/builtins-reduction-math.c     |  24 +-
 clang/test/Sema/count-builtins.c              |  60 ++--
 clang/test/Sema/riscv-rvv-vector-exp-ops.c    |   4 +-
 clang/test/Sema/riscv-rvv-vector-log-ops.c    |   6 +-
 clang/test/Sema/riscv-rvv-vector-trig-ops.c   |  20 +-
 clang/test/Sema/riscv-sve-vector-pow-ops.c    |   2 +-
 .../test/SemaHLSL/BuiltIns/clamp-errors.hlsl  |   8 +-
 clang/test/SemaHLSL/BuiltIns/dot-errors.hlsl  |   2 +-
 clang/test/SemaHLSL/BuiltIns/exp-errors.hlsl  |   6 +-
 .../BuiltIns/firstbithigh-errors.hlsl         |   4 +-
 .../SemaHLSL/BuiltIns/firstbitlow-errors.hlsl |   4 +-
 clang/test/SemaHLSL/BuiltIns/lerp-errors.hlsl |  10 +-
 clang/test/SemaHLSL/BuiltIns/mad-errors.hlsl  |   6 +-
 .../SemaHLSL/BuiltIns/reversebits-errors.hlsl |   2 +-
 .../test/SemaHLSL/BuiltIns/round-errors.hlsl  |   6 +-
 23 files changed, 274 insertions(+), 265 deletions(-)

diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 38badfd81f5088c..93ef23834a4ab95 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -12405,17 +12405,13 @@ def err_builtin_is_within_lifetime_invalid_arg : Error<
   "%select{non-|function }0pointer argument to '__builtin_is_within_lifetime' "
   "is not allowed">;
 
-def err_builtin_invalid_arg_type: Error <
-  "%ordinal0 argument must be "
-  "%select{a vector, integer or floating point type|a matrix|"
-  "a pointer to a valid matrix element type|"
-  "a signed integer or floating point type|a vector type|"
-  "a floating point type|"
-  "a vector of integers|"
-  "an unsigned integer|"
-  "an 'int'|"
-  "a vector of floating points|"
-  "an integer or vector of integers}1 (was %2)">;
+def err_builtin_invalid_arg_type: Error<
+  "%ordinal0 argument must be a"
+  "%select{| scalar| vector| vector,| vector of| scalar or vector of}1"
+  "%select{| integer| signed integer| unsigned integer| 'int'|"
+  " matrix| pointer to a valid matrix element}2"
+  "%plural{0:|:%plural{0:|: or}2}3"
+  "%select{| floating-point}3 %plural{[0,3]:type|:types}1 (was %4)">;
 
 def err_builtin_matrix_disabled: Error<
   "matrix types extension is disabled. Pass -fenable-matrix to enable it">;
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 7e9d5b48d835ff1..08572012fd25117 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -1983,25 +1983,29 @@ checkMathBuiltinElementType(Sema &S, SourceLocation Loc, QualType ArgTy,
     if (!ArgTy->getAs<VectorType>() &&
         !ConstantMatrixType::isValidElementType(ArgTy)) {
       return S.Diag(Loc, diag::err_builtin_invalid_arg_type)
-             << ArgOrdinal << /* vector, integer or float ty*/ 0 << ArgTy;
+             << ArgOrdinal << /* vector, */ 3 << /* integer */ 1 << /* fp */ 1
+             << ArgTy;
     }
     break;
   case Sema::EltwiseBuiltinArgTyRestriction::FloatTy:
     if (!EltTy->isRealFloatingType()) {
       return S.Diag(Loc, diag::err_builtin_invalid_arg_type)
-             << ArgOrdinal << /* vector or float ty*/ 5 << ArgTy;
+             << ArgOrdinal << /* scalar or vector */ 5 << /* no int */ 0
+             << /* floating-point */ 1 << ArgTy;
     }
     break;
   case Sema::EltwiseBuiltinArgTyRestriction::IntegerTy:
     if (!EltTy->isIntegerType()) {
       return S.Diag(Loc, diag::err_builtin_invalid_arg_type)
-             << ArgOrdinal << /* vector or int ty*/ 10 << ArgTy;
+             << ArgOrdinal << /* scalar or vector */ 5 << /* integer */ 1
+             << /* no fp */ 0 << ArgTy;
     }
     break;
   case Sema::EltwiseBuiltinArgTyRestriction::SignedIntOrFloatTy:
     if (EltTy->isUnsignedIntegerType()) {
       return S.Diag(Loc, diag::err_builtin_invalid_arg_type)
-             << 1 << /* signed integer or float ty*/ 3 << ArgTy;
+             << 1 << /* scalar or vector */ 5 << /* signed int */ 2
+             << /* or fp */ 1 << ArgTy;
     }
     break;
   }
@@ -2071,7 +2075,8 @@ static bool BuiltinPopcountg(Sema &S, CallExpr *TheCall) {
 
   if (!ArgTy->isUnsignedIntegerType()) {
     S.Diag(Arg->getBeginLoc(), diag::err_builtin_invalid_arg_type)
-        << 1 << /*unsigned integer ty*/ 7 << ArgTy;
+        << 1 << /* scalar */ 1 << /* unsigned integer ty */ 3 << /* no fp */ 0
+        << ArgTy;
     return true;
   }
   return false;
@@ -2095,7 +2100,8 @@ static bool BuiltinCountZeroBitsGeneric(Sema &S, CallExpr *TheCall) {
 
   if (!Arg0Ty->isUnsignedIntegerType()) {
     S.Diag(Arg0->getBeginLoc(), diag::err_builtin_invalid_arg_type)
-        << 1 << /*unsigned integer ty*/ 7 << Arg0Ty;
+        << 1 << /* scalar */ 1 << /* unsigned integer ty */ 3 << /* no fp */ 0
+        << Arg0Ty;
     return true;
   }
 
@@ -2111,7 +2117,7 @@ static bool BuiltinCountZeroBitsGeneric(Sema &S, CallExpr *TheCall) {
 
     if (!Arg1Ty->isSpecificBuiltinType(BuiltinType::Int)) {
       S.Diag(Arg1->getBeginLoc(), diag::err_builtin_invalid_arg_type)
-          << 2 << /*'int' ty*/ 8 << Arg1Ty;
+          << 2 << /* scalar */ 1 << /* 'int' ty */ 4 << /* no fp */ 0 << Arg1Ty;
       return true;
     }
   }
@@ -2826,7 +2832,8 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
 
     if (ElTy.isNull()) {
       Diag(Arg->getBeginLoc(), diag::err_builtin_invalid_arg_type)
-          << 1 << /* vector ty*/ 4 << Arg->getType();
+          << 1 << /* vector ty */ 2 << /* no int */ 0 << /* no fp */ 0
+          << Arg->getType();
       return ExprError();
     }
 
@@ -2849,7 +2856,8 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
 
     if (ElTy.isNull() || !ElTy->isFloatingType()) {
       Diag(Arg->getBeginLoc(), diag::err_builtin_invalid_arg_type)
-          << 1 << /* vector of floating points */ 9 << Arg->getType();
+          << 1 << /* vector of */ 4 << /* no int */ 0 << /* fp */ 1
+          << Arg->getType();
       return ExprError();
     }
 
@@ -2878,7 +2886,8 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
 
     if (ElTy.isNull() || !ElTy->isIntegerType()) {
       Diag(Arg->getBeginLoc(), diag::err_builtin_invalid_arg_type)
-          << 1  << /* vector of integers */ 6 << Arg->getType();
+          << 1 << /* vector of */ 4 << /* int */ 1 << /* no fp */ 0
+          << Arg->getType();
       return ExprError();
     }
 
@@ -14785,8 +14794,9 @@ bool Sema::BuiltinNonDeterministicValue(CallExpr *TheCall) {
   QualType TyArg = Arg.get()->getType();
 
   if (!TyArg->isBuiltinType() && !TyArg->isVectorType())
-    return Diag(TheCall->getArg(0)->getBeginLoc(), diag::err_builtin_invalid_arg_type)
-           << 1 << /*vector, integer or floating point ty*/ 0 << TyArg;
+    return Diag(TheCall->getArg(0)->getBeginLoc(),
+                diag::err_builtin_invalid_arg_type)
+           << 1 << /* vector, */ 3 << /* integer */ 1 << /* fp */ 1 << TyArg;
 
   TheCall->setType(TyArg);
   return false;
@@ -14805,7 +14815,7 @@ ExprResult Sema::BuiltinMatrixTranspose(CallExpr *TheCall,
   auto *MType = Matrix->getType()->getAs<ConstantMatrixType>();
   if (!MType) {
     Diag(Matrix->getBeginLoc(), diag::err_builtin_invalid_arg_type)
-        << 1 << /* matrix ty*/ 1 << Matrix->getType();
+        << 1 << 0 << /* matrix ty */ 5 << /* no fp */ 0 << Matrix->getType();
     return ExprError();
   }
 
@@ -14877,15 +14887,16 @@ ExprResult Sema::BuiltinMatrixColumnMajorLoad(CallExpr *TheCall,
   QualType ElementTy;
   if (!PtrTy) {
     Diag(PtrExpr->getBeginLoc(), diag::err_builtin_invalid_arg_type)
-        << PtrArgIdx + 1 << /*pointer to element ty*/ 2 << PtrExpr->getType();
+        << PtrArgIdx + 1 << 0 << /* pointer to element ty */ 6 << /* no fp */ 0
+        << PtrExpr->getType();
     ArgError = true;
   } else {
     ElementTy = PtrTy->getPointeeType().getUnqualifiedType();
 
     if (!ConstantMatrixType::isValidElementType(ElementTy)) {
       Diag(PtrExpr->getBeginLoc(), diag::err_builtin_invalid_arg_type)
-          << PtrArgIdx + 1 << /* pointer to element ty*/ 2
-          << PtrExpr->getType();
+          << PtrArgIdx + 1 << 0 << /* pointer to element ty */ 6
+          << /* no fp */ 0 << PtrExpr->getType();
       ArgError = true;
     }
   }
@@ -14985,7 +14996,7 @@ ExprResult Sema::BuiltinMatrixColumnMajorStore(CallExpr *TheCall,
   auto *MatrixTy = MatrixExpr->getType()->getAs<ConstantMatrixType>();
   if (!MatrixTy) {
     Diag(MatrixExpr->getBeginLoc(), diag::err_builtin_invalid_arg_type)
-        << 1 << /*matrix ty */ 1 << MatrixExpr->getType();
+        << 1 << 0 << /* matrix ty */ 5 << 0 << MatrixExpr->getType();
     ArgError = true;
   }
 
@@ -15005,7 +15016,8 @@ ExprResult Sema::BuiltinMatrixColumnMajorStore(CallExpr *TheCall,
   auto *PtrTy = PtrExpr->getType()->getAs<PointerType>();
   if (!PtrTy) {
     Diag(PtrExpr->getBeginLoc(), diag::err_builtin_invalid_arg_type)
-        << PtrArgIdx + 1 << /*pointer to element ty*/ 2 << PtrExpr->getType();
+        << PtrArgIdx + 1 << 0 << /* pointer to element ty */ 6 << 0
+        << PtrExpr->getType();
     ArgError = true;
   } else {
     QualType ElementTy = PtrTy->getPointeeType();
diff --git a/clang/lib/Sema/SemaHLSL.cpp b/clang/lib/Sema/SemaHLSL.cpp
index 9ce21dfd20b68e7..af4db990ccbc222 100644
--- a/clang/lib/Sema/SemaHLSL.cpp
+++ b/clang/lib/Sema/SemaHLSL.cpp
@@ -2331,7 +2331,8 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
 
     if (!EltTy->isIntegerType()) {
       Diag(Arg->getBeginLoc(), diag::err_builtin_invalid_arg_type)
-          << 1 << /* integer ty */ 6 << ArgTy;
+          << 1 << /* scalar or vector of */ 5 << /* integer ty */ 1
+          << /* no fp */ 0 << ArgTy;
       return true;
     }
 
diff --git a/clang/test/Sema/aarch64-sve-vector-exp-ops.c b/clang/test/Sema/aarch64-sve-vector-exp-ops.c
index 4b411babbc3471e..c0bcfe131867900 100644
--- a/clang/test/Sema/aarch64-sve-vector-exp-ops.c
+++ b/clang/test/Sema/aarch64-sve-vector-exp-ops.c
@@ -7,11 +7,11 @@
 svfloat32_t test_exp_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_exp(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 svfloat32_t test_exp2_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_exp2(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
diff --git a/clang/test/Sema/aarch64-sve-vector-log-ops.c b/clang/test/Sema/aarch64-sve-vector-log-ops.c
index bc81323b560c9c4..cd0b5607d1e2a78 100644
--- a/clang/test/Sema/aarch64-sve-vector-log-ops.c
+++ b/clang/test/Sema/aarch64-sve-vector-log-ops.c
@@ -7,17 +7,17 @@
 svfloat32_t test_log_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_log(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 svfloat32_t test_log10_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_log10(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 svfloat32_t test_log2_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_log2(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
diff --git a/clang/test/Sema/aarch64-sve-vector-pow-ops.c b/clang/test/Sema/aarch64-sve-vector-pow-ops.c
index 16dbe33c1afe7ed..e4977615e98d25b 100644
--- a/clang/test/Sema/aarch64-sve-vector-pow-ops.c
+++ b/clang/test/Sema/aarch64-sve-vector-pow-ops.c
@@ -7,5 +7,5 @@
 svfloat32_t test_pow_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_pow(v, v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
diff --git a/clang/test/Sema/aarch64-sve-vector-trig-ops.c b/clang/test/Sema/aarch64-sve-vector-trig-ops.c
index 46df63cbba42bf7..04e496031fff4a2 100644
--- a/clang/test/Sema/aarch64-sve-vector-trig-ops.c
+++ b/clang/test/Sema/aarch64-sve-vector-trig-ops.c
@@ -7,59 +7,59 @@
 svfloat32_t test_asin_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_asin(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 svfloat32_t test_acos_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_acos(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 svfloat32_t test_atan_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_atan(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 svfloat32_t test_atan2_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_atan2(v, v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 svfloat32_t test_sin_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_sin(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 svfloat32_t test_cos_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_cos(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 svfloat32_t test_tan_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_tan(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 svfloat32_t test_sinh_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_sinh(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 svfloat32_t test_cosh_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_cosh(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 svfloat32_t test_tanh_vv_i8mf8(svfloat32_t v) {
 
   return __builtin_elementwise_tanh(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
diff --git a/clang/test/Sema/builtins-elementwise-math.c b/clang/test/Sema/builtins-elementwise-math.c
index cfa96657ae468be..a1b1d40bee628aa 100644
--- a/clang/test/Sema/builtins-elementwise-math.c
+++ b/clang/test/Sema/builtins-elementwise-math.c
@@ -37,15 +37,15 @@ void test_builtin_elementwise_abs(int i, double d, float4 v, int3 iv, unsigned u
   // expected-error at -1 {{assigning to 'int' from incompatible type 'float4' (vector of 4 'float' values)}}
 
   u = __builtin_elementwise_abs(u);
-  // expected-error at -1 {{1st argument must be a signed integer or floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of signed integer or floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_abs(uv);
-  // expected-error at -1 {{1st argument must be a signed integer or floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of signed integer or floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_add_sat(int i, short s, double d, float4 v, int3 iv, unsigned3 uv, int *p) {
   i = __builtin_elementwise_add_sat(p, d);
-  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'int *')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'int *')}}
 
   struct Foo foo = __builtin_elementwise_add_sat(i, i);
   // expected-error at -1 {{initializing 'struct Foo' with an expression of incompatible type 'int'}}
@@ -60,7 +60,7 @@ void test_builtin_elementwise_add_sat(int i, short s, double d, float4 v, int3 i
   // expected-error at -1 {{too many arguments to function call, expected 2, have 3}}
 
   i = __builtin_elementwise_add_sat(v, iv);
-  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'float4' (vector of 4 'float' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'float4' (vector of 4 'float' values))}}
 
   i = __builtin_elementwise_add_sat(iv, v);
   // expected-error at -1 {{arguments are of different types ('int3' (vector of 3 'int' values) vs 'float4' (vector of 4 'float' values))}}
@@ -69,7 +69,7 @@ void test_builtin_elementwise_add_sat(int i, short s, double d, float4 v, int3 i
   // expected-error at -1 {{arguments are of different types ('unsigned3' (vector of 3 'unsigned int' values) vs 'int3' (vector of 3 'int' values))}}
 
   v = __builtin_elementwise_add_sat(v, v);
-  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'float4' (vector of 4 'float' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'float4' (vector of 4 'float' values))}}
 
   s = __builtin_elementwise_add_sat(i, s);
   // expected-error at -1 {{arguments are of different types ('int' vs 'short')}}
@@ -98,7 +98,7 @@ void test_builtin_elementwise_add_sat(int i, short s, double d, float4 v, int3 i
 
   int A[10];
   A = __builtin_elementwise_add_sat(A, A);
-  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'int *')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'int *')}}
 
   int(ii);
   int j;
@@ -106,12 +106,12 @@ void test_builtin_elementwise_add_sat(int i, short s, double d, float4 v, int3 i
 
   _Complex float c1, c2;
   c1 = __builtin_elementwise_add_sat(c1, c2);
-  // expected-error at -1 {{1st argument must be an integer or vector of integers (was '_Complex float')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was '_Complex float')}}
 }
 
 void test_builtin_elementwise_sub_sat(int i, short s, double d, float4 v, int3 iv, unsigned3 uv, int *p) {
   i = __builtin_elementwise_sub_sat(p, d);
-  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'int *')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'int *')}}
 
   struct Foo foo = __builtin_elementwise_sub_sat(i, i);
   // expected-error at -1 {{initializing 'struct Foo' with an expression of incompatible type 'int'}}
@@ -126,7 +126,7 @@ void test_builtin_elementwise_sub_sat(int i, short s, double d, float4 v, int3 i
   // expected-error at -1 {{too many arguments to function call, expected 2, have 3}}
 
   i = __builtin_elementwise_sub_sat(v, iv);
-  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'float4' (vector of 4 'float' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'float4' (vector of 4 'float' values))}}
 
   i = __builtin_elementwise_sub_sat(iv, v);
   // expected-error at -1 {{arguments are of different types ('int3' (vector of 3 'int' values) vs 'float4' (vector of 4 'float' values))}}
@@ -135,7 +135,7 @@ void test_builtin_elementwise_sub_sat(int i, short s, double d, float4 v, int3 i
   // expected-error at -1 {{arguments are of different types ('unsigned3' (vector of 3 'unsigned int' values) vs 'int3' (vector of 3 'int' values))}}
 
   v = __builtin_elementwise_sub_sat(v, v);
-  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'float4' (vector of 4 'float' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'float4' (vector of 4 'float' values))}}
 
   s = __builtin_elementwise_sub_sat(i, s);
   // expected-error at -1 {{arguments are of different types ('int' vs 'short')}}
@@ -164,7 +164,7 @@ void test_builtin_elementwise_sub_sat(int i, short s, double d, float4 v, int3 i
 
   int A[10];
   A = __builtin_elementwise_sub_sat(A, A);
-  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'int *')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'int *')}}
 
   int(ii);
   int j;
@@ -172,12 +172,12 @@ void test_builtin_elementwise_sub_sat(int i, short s, double d, float4 v, int3 i
 
   _Complex float c1, c2;
   c1 = __builtin_elementwise_sub_sat(c1, c2);
-  // expected-error at -1 {{1st argument must be an integer or vector of integers (was '_Complex float')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was '_Complex float')}}
 }
 
 void test_builtin_elementwise_max(int i, short s, double d, float4 v, int3 iv, unsigned3 uv, int *p) {
   i = __builtin_elementwise_max(p, d);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was 'int *')}}
+  // expected-error at -1 {{1st argument must be a vector, integer or floating-point type (was 'int *')}}
 
   struct Foo foo = __builtin_elementwise_max(i, i);
   // expected-error at -1 {{initializing 'struct Foo' with an expression of incompatible type 'int'}}
@@ -224,7 +224,7 @@ void test_builtin_elementwise_max(int i, short s, double d, float4 v, int3 iv, u
 
   int A[10];
   A = __builtin_elementwise_max(A, A);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was 'int *')}}
+  // expected-error at -1 {{1st argument must be a vector, integer or floating-point type (was 'int *')}}
 
   int(ii);
   int j;
@@ -232,12 +232,12 @@ void test_builtin_elementwise_max(int i, short s, double d, float4 v, int3 iv, u
 
   _Complex float c1, c2;
   c1 = __builtin_elementwise_max(c1, c2);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was '_Complex float')}}
+  // expected-error at -1 {{1st argument must be a vector, integer or floating-point type (was '_Complex float')}}
 }
 
 void test_builtin_elementwise_min(int i, short s, double d, float4 v, int3 iv, unsigned3 uv, int *p) {
   i = __builtin_elementwise_min(p, d);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was 'int *')}}
+  // expected-error at -1 {{1st argument must be a vector, integer or floating-point type (was 'int *')}}
 
   struct Foo foo = __builtin_elementwise_min(i, i);
   // expected-error at -1 {{initializing 'struct Foo' with an expression of incompatible type 'int'}}
@@ -284,7 +284,7 @@ void test_builtin_elementwise_min(int i, short s, double d, float4 v, int3 iv, u
 
   int A[10];
   A = __builtin_elementwise_min(A, A);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was 'int *')}}
+  // expected-error at -1 {{1st argument must be a vector, integer or floating-point type (was 'int *')}}
 
   int(ii);
   int j;
@@ -292,12 +292,12 @@ void test_builtin_elementwise_min(int i, short s, double d, float4 v, int3 iv, u
 
   _Complex float c1, c2;
   c1 = __builtin_elementwise_min(c1, c2);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was '_Complex float')}}
+  // expected-error at -1 {{1st argument must be a vector, integer or floating-point type (was '_Complex float')}}
 }
 
 void test_builtin_elementwise_maximum(int i, short s, float f, double d, float4 fv, double4 dv, int3 iv, unsigned3 uv, int *p) {
   i = __builtin_elementwise_maximum(p, d);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int *')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int *')}}
 
   struct Foo foo = __builtin_elementwise_maximum(d, d);
   // expected-error at -1 {{initializing 'struct Foo' with an expression of incompatible type 'double'}}
@@ -315,7 +315,7 @@ void test_builtin_elementwise_maximum(int i, short s, float f, double d, float4
   // expected-error at -1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'int3' (vector of 3 'int' values))}}
 
   i = __builtin_elementwise_maximum(uv, iv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned3' (vector of 3 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned3' (vector of 3 'unsigned int' values))}}
 
   dv = __builtin_elementwise_maximum(fv, dv);
   // expected-error at -1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'double4' (vector of 4 'double' values))}}
@@ -326,23 +326,23 @@ void test_builtin_elementwise_maximum(int i, short s, float f, double d, float4
   fv = __builtin_elementwise_maximum(fv, fv);
 
   i = __builtin_elementwise_maximum(iv, iv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int3' (vector of 3 'int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int3' (vector of 3 'int' values))}}
 
   i = __builtin_elementwise_maximum(i, i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   int A[10];
   A = __builtin_elementwise_maximum(A, A);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int *')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int *')}}
 
   _Complex float c1, c2;
   c1 = __builtin_elementwise_maximum(c1, c2);
-  // expected-error at -1 {{1st argument must be a floating point type (was '_Complex float')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was '_Complex float')}}
 }
 
 void test_builtin_elementwise_minimum(int i, short s, float f, double d, float4 fv, double4 dv, int3 iv, unsigned3 uv, int *p) {
   i = __builtin_elementwise_minimum(p, d);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int *')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int *')}}
 
   struct Foo foo = __builtin_elementwise_minimum(d, d);
   // expected-error at -1 {{initializing 'struct Foo' with an expression of incompatible type 'double'}}
@@ -360,7 +360,7 @@ void test_builtin_elementwise_minimum(int i, short s, float f, double d, float4
   // expected-error at -1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'int3' (vector of 3 'int' values))}}
 
   i = __builtin_elementwise_minimum(uv, iv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned3' (vector of 3 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned3' (vector of 3 'unsigned int' values))}}
 
   dv = __builtin_elementwise_minimum(fv, dv);
   // expected-error at -1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'double4' (vector of 4 'double' values))}}
@@ -371,18 +371,18 @@ void test_builtin_elementwise_minimum(int i, short s, float f, double d, float4
   fv = __builtin_elementwise_minimum(fv, fv);
 
   i = __builtin_elementwise_minimum(iv, iv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int3' (vector of 3 'int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int3' (vector of 3 'int' values))}}
 
   i = __builtin_elementwise_minimum(i, i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   int A[10];
   A = __builtin_elementwise_minimum(A, A);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int *')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int *')}}
 
   _Complex float c1, c2;
   c1 = __builtin_elementwise_minimum(c1, c2);
-  // expected-error at -1 {{1st argument must be a floating point type (was '_Complex float')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was '_Complex float')}}
 }
 
 void test_builtin_elementwise_bitreverse(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -394,16 +394,16 @@ void test_builtin_elementwise_bitreverse(int i, float f, double d, float4 v, int
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_bitreverse(f);
-  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'float')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'float')}}
   
   i = __builtin_elementwise_bitreverse(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_bitreverse(d);
-  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'double')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'double')}}
 
   v = __builtin_elementwise_bitreverse(v);
-  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'float4' (vector of 4 'float' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'float4' (vector of 4 'float' values))}}
 }
 
 void test_builtin_elementwise_ceil(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -415,16 +415,16 @@ void test_builtin_elementwise_ceil(int i, float f, double d, float4 v, int3 iv,
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_ceil(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_ceil(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_ceil(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_ceil(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_acos(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -436,16 +436,16 @@ void test_builtin_elementwise_acos(int i, float f, double d, float4 v, int3 iv,
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_acos(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_acos(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_acos(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_acos(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_cos(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -457,16 +457,16 @@ void test_builtin_elementwise_cos(int i, float f, double d, float4 v, int3 iv, u
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_cos(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_cos(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_cos(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_cos(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_cosh(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -478,16 +478,16 @@ void test_builtin_elementwise_cosh(int i, float f, double d, float4 v, int3 iv,
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_cosh(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_cosh(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_cosh(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_cosh(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_exp(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -499,16 +499,16 @@ void test_builtin_elementwise_exp(int i, float f, double d, float4 v, int3 iv, u
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_exp(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_exp(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_exp(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_exp(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_exp2(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -520,16 +520,16 @@ void test_builtin_elementwise_exp2(int i, float f, double d, float4 v, int3 iv,
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_exp2(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_exp2(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_exp2(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_exp2(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 
@@ -542,16 +542,16 @@ void test_builtin_elementwise_floor(int i, float f, double d, float4 v, int3 iv,
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_floor(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_floor(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_floor(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_floor(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_log(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -563,16 +563,16 @@ void test_builtin_elementwise_log(int i, float f, double d, float4 v, int3 iv, u
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_log(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_log(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_log(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_log(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_log10(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -584,16 +584,16 @@ void test_builtin_elementwise_log10(int i, float f, double d, float4 v, int3 iv,
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_log10(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_log10(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_log10(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_log10(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_log2(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -605,16 +605,16 @@ void test_builtin_elementwise_log2(int i, float f, double d, float4 v, int3 iv,
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_log2(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_log2(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_log2(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_log2(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_popcount(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -626,16 +626,16 @@ void test_builtin_elementwise_popcount(int i, float f, double d, float4 v, int3
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_popcount(f);
-  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'float')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'float')}}
 
   i = __builtin_elementwise_popcount(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_popcount(d);
-  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'double')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'double')}}
 
   v = __builtin_elementwise_popcount(v);
-  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'float4' (vector of 4 'float' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'float4' (vector of 4 'float' values))}}
 
   int2 i2 = __builtin_elementwise_popcount(iv);
   // expected-error at -1 {{initializing 'int2' (vector of 2 'int' values) with an expression of incompatible type 'int3' (vector of 3 'int' values)}}
@@ -652,10 +652,10 @@ void test_builtin_elementwise_popcount(int i, float f, double d, float4 v, int3
 
 void test_builtin_elementwise_fmod(int i, short s, double d, float4 v, int3 iv, unsigned3 uv, int *p) {
   i = __builtin_elementwise_fmod(p, d);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int *')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int *')}}
 
   struct Foo foo = __builtin_elementwise_fmod(i, i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_fmod(i);
   // expected-error at -1 {{too few arguments to function call, expected 2, have 1}}
@@ -670,7 +670,7 @@ void test_builtin_elementwise_fmod(int i, short s, double d, float4 v, int3 iv,
   // expected-error at -1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'int3' (vector of 3 'int' values))}}
 
   i = __builtin_elementwise_fmod(uv, iv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned3' (vector of 3 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned3' (vector of 3 'unsigned int' values))}}
 
   i = __builtin_elementwise_fmod(d, v);
   // expected-error at -1 {{arguments are of different types ('double' vs 'float4' (vector of 4 'float' values))}}
@@ -678,10 +678,10 @@ void test_builtin_elementwise_fmod(int i, short s, double d, float4 v, int3 iv,
 
 void test_builtin_elementwise_pow(int i, short s, double d, float4 v, int3 iv, unsigned3 uv, int *p) {
   i = __builtin_elementwise_pow(p, d);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int *')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int *')}}
 
   struct Foo foo = __builtin_elementwise_pow(i, i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_pow(i);
   // expected-error at -1 {{too few arguments to function call, expected 2, have 1}}
@@ -696,7 +696,7 @@ void test_builtin_elementwise_pow(int i, short s, double d, float4 v, int3 iv, u
   // expected-error at -1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'int3' (vector of 3 'int' values))}}
 
   i = __builtin_elementwise_pow(uv, iv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned3' (vector of 3 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned3' (vector of 3 'unsigned int' values))}}
   
 }
 
@@ -709,16 +709,16 @@ void test_builtin_elementwise_roundeven(int i, float f, double d, float4 v, int3
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_roundeven(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_roundeven(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_roundeven(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_roundeven(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_round(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -729,20 +729,20 @@ void test_builtin_elementwise_round(int i, float f, double d, float4 v, int3 iv,
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_round(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_round(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_round(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_round(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 
   _Complex float c1, c2;
   c1 = __builtin_elementwise_round(c1);
-  // expected-error at -1 {{1st argument must be a floating point type (was '_Complex float')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was '_Complex float')}}
 }
 
 void test_builtin_elementwise_rint(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -753,20 +753,20 @@ void test_builtin_elementwise_rint(int i, float f, double d, float4 v, int3 iv,
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_rint(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_rint(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_rint(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_rint(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 
   _Complex float c1, c2;
   c1 = __builtin_elementwise_rint(c1);
-  // expected-error at -1 {{1st argument must be a floating point type (was '_Complex float')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was '_Complex float')}}
 }
 
 void test_builtin_elementwise_nearbyint(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -777,20 +777,20 @@ void test_builtin_elementwise_nearbyint(int i, float f, double d, float4 v, int3
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_nearbyint(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_nearbyint(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_nearbyint(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_nearbyint(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 
   _Complex float c1, c2;
   c1 = __builtin_elementwise_nearbyint(c1);
-  // expected-error at -1 {{1st argument must be a floating point type (was '_Complex float')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was '_Complex float')}}
 }
 
 void test_builtin_elementwise_asin(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -802,16 +802,16 @@ void test_builtin_elementwise_asin(int i, float f, double d, float4 v, int3 iv,
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_asin(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_asin(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_asin(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_asin(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_sin(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -823,16 +823,16 @@ void test_builtin_elementwise_sin(int i, float f, double d, float4 v, int3 iv, u
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_sin(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_sin(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_sin(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_sin(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_sinh(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -844,16 +844,16 @@ void test_builtin_elementwise_sinh(int i, float f, double d, float4 v, int3 iv,
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_sinh(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_sinh(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_sinh(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_sinh(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_sqrt(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -865,16 +865,16 @@ void test_builtin_elementwise_sqrt(int i, float f, double d, float4 v, int3 iv,
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_sqrt(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_sqrt(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_sqrt(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_sqrt(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_atan(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -886,16 +886,16 @@ void test_builtin_elementwise_atan(int i, float f, double d, float4 v, int3 iv,
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_atan(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_atan(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_atan(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_atan(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_atan2(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -910,16 +910,16 @@ void test_builtin_elementwise_atan2(int i, float f, double d, float4 v, int3 iv,
   // expected-error at -1 {{too few arguments to function call, expected 2, have 1}}
 
   i = __builtin_elementwise_atan2(i, i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_atan2(f, f, f);
   // expected-error at -1 {{too many arguments to function call, expected 2, have 3}}
 
   u = __builtin_elementwise_atan2(u, u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_atan2(uv, uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_tan(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -931,16 +931,16 @@ void test_builtin_elementwise_tan(int i, float f, double d, float4 v, int3 iv, u
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_tan(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_tan(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_tan(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_tan(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_tanh(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -952,16 +952,16 @@ void test_builtin_elementwise_tanh(int i, float f, double d, float4 v, int3 iv,
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_tanh(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_tanh(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_tanh(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_tanh(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_trunc(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -973,16 +973,16 @@ void test_builtin_elementwise_trunc(int i, float f, double d, float4 v, int3 iv,
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_trunc(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_trunc(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_trunc(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_trunc(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_canonicalize(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
@@ -994,24 +994,24 @@ void test_builtin_elementwise_canonicalize(int i, float f, double d, float4 v, i
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_elementwise_canonicalize(i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_canonicalize(f, f);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   u = __builtin_elementwise_canonicalize(u);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned int')}}
 
   uv = __builtin_elementwise_canonicalize(uv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned4' (vector of 4 'unsigned int' values))}}
 }
 
 void test_builtin_elementwise_copysign(int i, short s, double d, float f, float4 v, int3 iv, unsigned3 uv, int *p) {
   i = __builtin_elementwise_copysign(p, d);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int *')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int *')}}
 
   i = __builtin_elementwise_copysign(i, i);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   i = __builtin_elementwise_copysign(i);
   // expected-error at -1 {{too few arguments to function call, expected 2, have 1}}
@@ -1023,32 +1023,32 @@ void test_builtin_elementwise_copysign(int i, short s, double d, float f, float4
   // expected-error at -1 {{too many arguments to function call, expected 2, have 3}}
 
   i = __builtin_elementwise_copysign(v, iv);
-  // expected-error at -1 {{2nd argument must be a floating point type (was 'int3' (vector of 3 'int' values))}}
+  // expected-error at -1 {{2nd argument must be a scalar or vector of floating-point types (was 'int3' (vector of 3 'int' values))}}
 
   i = __builtin_elementwise_copysign(uv, iv);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'unsigned3' (vector of 3 'unsigned int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'unsigned3' (vector of 3 'unsigned int' values))}}
 
   s = __builtin_elementwise_copysign(i, s);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   f = __builtin_elementwise_copysign(f, i);
-  // expected-error at -1 {{2nd argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{2nd argument must be a scalar or vector of floating-point types (was 'int')}}
 
   f = __builtin_elementwise_copysign(i, f);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   enum e { one,
            two };
   i = __builtin_elementwise_copysign(one, two);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   enum f { three };
   enum f x = __builtin_elementwise_copysign(one, three);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   _BitInt(32) ext; // expected-warning {{'_BitInt' in C17 and earlier is a Clang extension}}
   ext = __builtin_elementwise_copysign(ext, ext);
-  // expected-error at -1 {{1st argument must be a floating point type (was '_BitInt(32)')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was '_BitInt(32)')}}
 
   const float cf32;
   f = __builtin_elementwise_copysign(cf32, f);
@@ -1060,7 +1060,7 @@ void test_builtin_elementwise_copysign(int i, short s, double d, float f, float4
 
   float A[10];
   A = __builtin_elementwise_copysign(A, A);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'float *')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'float *')}}
 
   float(ii);
   float j;
@@ -1068,7 +1068,7 @@ void test_builtin_elementwise_copysign(int i, short s, double d, float f, float4
 
   _Complex float c1, c2;
   c1 = __builtin_elementwise_copysign(c1, c2);
-  // expected-error at -1 {{1st argument must be a floating point type (was '_Complex float')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was '_Complex float')}}
 
   double f64 = 0.0;
   double tmp0 = __builtin_elementwise_copysign(f64, f);
@@ -1157,28 +1157,28 @@ void test_builtin_elementwise_fma(int i32, int2 v2i32, short i16,
   // expected-error at -1 {{arguments are of different types ('double' vs 'double2' (vector of 2 'double' values)}}
 
   i32 = __builtin_elementwise_fma(i32, i32, i32);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 
   v2i32 = __builtin_elementwise_fma(v2i32, v2i32, v2i32);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int2' (vector of 2 'int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int2' (vector of 2 'int' values))}}
 
   f32 = __builtin_elementwise_fma(f32, f32, i32);
-  // expected-error at -1 {{3rd argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{3rd argument must be a scalar or vector of floating-point types (was 'int')}}
 
   f32 = __builtin_elementwise_fma(f32, i32, f32);
-  // expected-error at -1 {{2nd argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{2nd argument must be a scalar or vector of floating-point types (was 'int')}}
 
   f32 = __builtin_elementwise_fma(f32, f32, i32);
-  // expected-error at -1 {{3rd argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{3rd argument must be a scalar or vector of floating-point types (was 'int')}}
 
 
   _Complex float c1, c2, c3;
   c1 = __builtin_elementwise_fma(c1, f32, f32);
-  // expected-error at -1 {{1st argument must be a floating point type (was '_Complex float')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was '_Complex float')}}
 
   c2 = __builtin_elementwise_fma(f32, c2, f32);
-  // expected-error at -1 {{2nd argument must be a floating point type (was '_Complex float')}}
+  // expected-error at -1 {{2nd argument must be a scalar or vector of floating-point types (was '_Complex float')}}
 
   c3 = __builtin_elementwise_fma(f32, f32, c3);
-  // expected-error at -1 {{3rd argument must be a floating point type (was '_Complex float')}}
+  // expected-error at -1 {{3rd argument must be a scalar or vector of floating-point types (was '_Complex float')}}
 }
diff --git a/clang/test/Sema/builtins-reduction-math.c b/clang/test/Sema/builtins-reduction-math.c
index 9b0d91bfd6e3d26..74f09d501198b66 100644
--- a/clang/test/Sema/builtins-reduction-math.c
+++ b/clang/test/Sema/builtins-reduction-math.c
@@ -47,10 +47,10 @@ void test_builtin_reduce_add(int i, float4 v, int3 iv) {
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   i = __builtin_reduce_add(i);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'int')}}
+  // expected-error at -1 {{1st argument must be a vector of integer types (was 'int')}}
 
   i = __builtin_reduce_add(v);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'float4' (vector of 4 'float' values))}}
+  // expected-error at -1 {{1st argument must be a vector of integer types (was 'float4' (vector of 4 'float' values))}}
 }
 
 void test_builtin_reduce_mul(int i, float4 v, int3 iv) {
@@ -64,10 +64,10 @@ void test_builtin_reduce_mul(int i, float4 v, int3 iv) {
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   i = __builtin_reduce_mul(i);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'int')}}
+  // expected-error at -1 {{1st argument must be a vector of integer types (was 'int')}}
 
   i = __builtin_reduce_mul(v);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'float4' (vector of 4 'float' values))}}
+  // expected-error at -1 {{1st argument must be a vector of integer types (was 'float4' (vector of 4 'float' values))}}
 }
 
 void test_builtin_reduce_xor(int i, float4 v, int3 iv) {
@@ -81,10 +81,10 @@ void test_builtin_reduce_xor(int i, float4 v, int3 iv) {
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   i = __builtin_reduce_xor(i);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'int')}}
+  // expected-error at -1 {{1st argument must be a vector of integer types (was 'int')}}
 
   i = __builtin_reduce_xor(v);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'float4' (vector of 4 'float' values))}}
+  // expected-error at -1 {{1st argument must be a vector of integer types (was 'float4' (vector of 4 'float' values))}}
 }
 
 void test_builtin_reduce_or(int i, float4 v, int3 iv) {
@@ -98,10 +98,10 @@ void test_builtin_reduce_or(int i, float4 v, int3 iv) {
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   i = __builtin_reduce_or(i);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'int')}}
+  // expected-error at -1 {{1st argument must be a vector of integer types (was 'int')}}
 
   i = __builtin_reduce_or(v);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'float4' (vector of 4 'float' values))}}
+  // expected-error at -1 {{1st argument must be a vector of integer types (was 'float4' (vector of 4 'float' values))}}
 }
 
 void test_builtin_reduce_and(int i, float4 v, int3 iv) {
@@ -115,10 +115,10 @@ void test_builtin_reduce_and(int i, float4 v, int3 iv) {
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
 
   i = __builtin_reduce_and(i);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'int')}}
+  // expected-error at -1 {{1st argument must be a vector of integer types (was 'int')}}
 
   i = __builtin_reduce_and(v);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'float4' (vector of 4 'float' values))}}
+  // expected-error at -1 {{1st argument must be a vector of integer types (was 'float4' (vector of 4 'float' values))}}
 }
 
 void test_builtin_reduce_maximum(int i, float4 v, int3 iv) {
@@ -132,7 +132,7 @@ void test_builtin_reduce_maximum(int i, float4 v, int3 iv) {
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_reduce_maximum(i);
-  // expected-error at -1 {{1st argument must be a vector of floating points (was 'int')}}
+  // expected-error at -1 {{1st argument must be a vector of floating-point types (was 'int')}}
 }
 
 void test_builtin_reduce_minimum(int i, float4 v, int3 iv) {
@@ -146,5 +146,5 @@ void test_builtin_reduce_minimum(int i, float4 v, int3 iv) {
   // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
 
   i = __builtin_reduce_minimum(i);
-  // expected-error at -1 {{1st argument must be a vector of floating points (was 'int')}}
+  // expected-error at -1 {{1st argument must be a vector of floating-point types (was 'int')}}
 }
diff --git a/clang/test/Sema/count-builtins.c b/clang/test/Sema/count-builtins.c
index 79fa812f3f206bb..ea309f0a6826f1c 100644
--- a/clang/test/Sema/count-builtins.c
+++ b/clang/test/Sema/count-builtins.c
@@ -9,17 +9,17 @@ void test_builtin_popcountg(short s, int i, __int128 i128, _BitInt(128) bi128,
   __builtin_popcountg(i, i);
   // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
   __builtin_popcountg(s);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was 'short')}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was 'short')}}
   __builtin_popcountg(i);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was 'int')}}
   __builtin_popcountg(i128);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was '__int128')}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was '__int128')}}
   __builtin_popcountg(bi128);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was '_BitInt(128)')}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was '_BitInt(128)')}}
   __builtin_popcountg(d);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was 'double')}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was 'double')}}
   __builtin_popcountg(i2);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was 'int2' (vector of 2 'int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was 'int2' (vector of 2 'int' values))}}
 }
 
 void test_builtin_clzg(short s, int i, unsigned int ui, __int128 i128,
@@ -29,29 +29,29 @@ void test_builtin_clzg(short s, int i, unsigned int ui, __int128 i128,
   __builtin_clzg(i, i, i);
   // expected-error at -1 {{too many arguments to function call, expected at most 2, have 3}}
   __builtin_clzg(s);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was 'short')}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was 'short')}}
   __builtin_clzg(i);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was 'int')}}
   __builtin_clzg(i128);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was '__int128')}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was '__int128')}}
   __builtin_clzg(bi128);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was '_BitInt(128)')}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was '_BitInt(128)')}}
   __builtin_clzg(d);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was 'double')}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was 'double')}}
   __builtin_clzg(i2);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was 'int2' (vector of 2 'int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was 'int2' (vector of 2 'int' values))}}
   __builtin_clzg(i2);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was 'int2' (vector of 2 'int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was 'int2' (vector of 2 'int' values))}}
   __builtin_clzg(ui, ui);
-  // expected-error at -1 {{2nd argument must be an 'int' (was 'unsigned int')}}
+  // expected-error at -1 {{2nd argument must be a scalar 'int' type (was 'unsigned int')}}
   __builtin_clzg(ui, i128);
-  // expected-error at -1 {{2nd argument must be an 'int' (was '__int128')}}
+  // expected-error at -1 {{2nd argument must be a scalar 'int' type (was '__int128')}}
   __builtin_clzg(ui, bi128);
-  // expected-error at -1 {{2nd argument must be an 'int' (was '_BitInt(128)')}}
+  // expected-error at -1 {{2nd argument must be a scalar 'int' type (was '_BitInt(128)')}}
   __builtin_clzg(ui, d);
-  // expected-error at -1 {{2nd argument must be an 'int' (was 'double')}}
+  // expected-error at -1 {{2nd argument must be a scalar 'int' type (was 'double')}}
   __builtin_clzg(ui, i2);
-  // expected-error at -1 {{2nd argument must be an 'int' (was 'int2' (vector of 2 'int' values))}}
+  // expected-error at -1 {{2nd argument must be a scalar 'int' type (was 'int2' (vector of 2 'int' values))}}
 }
 
 void test_builtin_ctzg(short s, int i, unsigned int ui, __int128 i128,
@@ -61,27 +61,27 @@ void test_builtin_ctzg(short s, int i, unsigned int ui, __int128 i128,
   __builtin_ctzg(i, i, i);
   // expected-error at -1 {{too many arguments to function call, expected at most 2, have 3}}
   __builtin_ctzg(s);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was 'short')}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was 'short')}}
   __builtin_ctzg(i);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was 'int')}}
   __builtin_ctzg(i128);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was '__int128')}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was '__int128')}}
   __builtin_ctzg(bi128);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was '_BitInt(128)')}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was '_BitInt(128)')}}
   __builtin_ctzg(d);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was 'double')}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was 'double')}}
   __builtin_ctzg(i2);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was 'int2' (vector of 2 'int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was 'int2' (vector of 2 'int' values))}}
   __builtin_ctzg(i2);
-  // expected-error at -1 {{1st argument must be an unsigned integer (was 'int2' (vector of 2 'int' values))}}
+  // expected-error at -1 {{1st argument must be a scalar unsigned integer type (was 'int2' (vector of 2 'int' values))}}
   __builtin_ctzg(ui, ui);
-  // expected-error at -1 {{2nd argument must be an 'int' (was 'unsigned int')}}
+  // expected-error at -1 {{2nd argument must be a scalar 'int' type (was 'unsigned int')}}
   __builtin_ctzg(ui, i128);
-  // expected-error at -1 {{2nd argument must be an 'int' (was '__int128')}}
+  // expected-error at -1 {{2nd argument must be a scalar 'int' type (was '__int128')}}
   __builtin_ctzg(ui, bi128);
-  // expected-error at -1 {{2nd argument must be an 'int' (was '_BitInt(128)')}}
+  // expected-error at -1 {{2nd argument must be a scalar 'int' type (was '_BitInt(128)')}}
   __builtin_ctzg(ui, d);
-  // expected-error at -1 {{2nd argument must be an 'int' (was 'double')}}
+  // expected-error at -1 {{2nd argument must be a scalar 'int' type (was 'double')}}
   __builtin_ctzg(ui, i2);
-  // expected-error at -1 {{2nd argument must be an 'int' (was 'int2' (vector of 2 'int' values))}}
+  // expected-error at -1 {{2nd argument must be a scalar 'int' type (was 'int2' (vector of 2 'int' values))}}
 }
diff --git a/clang/test/Sema/riscv-rvv-vector-exp-ops.c b/clang/test/Sema/riscv-rvv-vector-exp-ops.c
index 7f8f59ab5cfebbb..f6b544123fa1c61 100644
--- a/clang/test/Sema/riscv-rvv-vector-exp-ops.c
+++ b/clang/test/Sema/riscv-rvv-vector-exp-ops.c
@@ -9,11 +9,11 @@
 vfloat32mf2_t test_exp_vv_i8mf8(vfloat32mf2_t v) {
 
   return __builtin_elementwise_exp(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 vfloat32mf2_t test_exp2_vv_i8mf8(vfloat32mf2_t v) {
 
   return __builtin_elementwise_exp2(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
diff --git a/clang/test/Sema/riscv-rvv-vector-log-ops.c b/clang/test/Sema/riscv-rvv-vector-log-ops.c
index 5028803efd861df..2674bed95a108df 100644
--- a/clang/test/Sema/riscv-rvv-vector-log-ops.c
+++ b/clang/test/Sema/riscv-rvv-vector-log-ops.c
@@ -9,17 +9,17 @@
 vfloat32mf2_t test_log_vv_i8mf8(vfloat32mf2_t v) {
 
   return __builtin_elementwise_log(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 vfloat32mf2_t test_log10_vv_i8mf8(vfloat32mf2_t v) {
 
   return __builtin_elementwise_log10(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 vfloat32mf2_t test_log2_vv_i8mf8(vfloat32mf2_t v) {
 
   return __builtin_elementwise_log2(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
diff --git a/clang/test/Sema/riscv-rvv-vector-trig-ops.c b/clang/test/Sema/riscv-rvv-vector-trig-ops.c
index 077d1ba61c6e248..7825816d820b62f 100644
--- a/clang/test/Sema/riscv-rvv-vector-trig-ops.c
+++ b/clang/test/Sema/riscv-rvv-vector-trig-ops.c
@@ -8,60 +8,60 @@
 vfloat32mf2_t test_asin_vv_i8mf8(vfloat32mf2_t v) {
 
     return __builtin_elementwise_asin(v);
-    // expected-error at -1 {{1st argument must be a floating point type}}
+    // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
   }
   
   vfloat32mf2_t test_acos_vv_i8mf8(vfloat32mf2_t v) {
   
     return __builtin_elementwise_acos(v);
-    // expected-error at -1 {{1st argument must be a floating point type}}
+    // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
   }
   
   vfloat32mf2_t test_atan_vv_i8mf8(vfloat32mf2_t v) {
   
     return __builtin_elementwise_atan(v);
-    // expected-error at -1 {{1st argument must be a floating point type}}
+    // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
   }
 
 vfloat32mf2_t test_atan2_vv_i8mf8(vfloat32mf2_t v) {
 
   return __builtin_elementwise_atan2(v, v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 vfloat32mf2_t test_sin_vv_i8mf8(vfloat32mf2_t v) {
 
   return __builtin_elementwise_sin(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 vfloat32mf2_t test_cos_vv_i8mf8(vfloat32mf2_t v) {
 
   return __builtin_elementwise_cos(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 vfloat32mf2_t test_tan_vv_i8mf8(vfloat32mf2_t v) {
 
   return __builtin_elementwise_tan(v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
 }
 
 vfloat32mf2_t test_sinh_vv_i8mf8(vfloat32mf2_t v) {
 
     return __builtin_elementwise_sinh(v);
-    // expected-error at -1 {{1st argument must be a floating point type}}
+    // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
   }
   
   vfloat32mf2_t test_cosh_vv_i8mf8(vfloat32mf2_t v) {
   
     return __builtin_elementwise_cosh(v);
-    // expected-error at -1 {{1st argument must be a floating point type}}
+    // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
   }
   
   vfloat32mf2_t test_tanh_vv_i8mf8(vfloat32mf2_t v) {
   
     return __builtin_elementwise_tanh(v);
-    // expected-error at -1 {{1st argument must be a floating point type}}
+    // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types}}
   }
   
diff --git a/clang/test/Sema/riscv-sve-vector-pow-ops.c b/clang/test/Sema/riscv-sve-vector-pow-ops.c
index 524e4534417808c..7edaf4099c31485 100644
--- a/clang/test/Sema/riscv-sve-vector-pow-ops.c
+++ b/clang/test/Sema/riscv-sve-vector-pow-ops.c
@@ -9,5 +9,5 @@
 vfloat32mf2_t test_pow_vv_i8mf8(vfloat32mf2_t v) {
 
   return __builtin_elementwise_pow(v, v);
-  // expected-error at -1 {{1st argument must be a floating point type}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point type}}
 }
diff --git a/clang/test/SemaHLSL/BuiltIns/clamp-errors.hlsl b/clang/test/SemaHLSL/BuiltIns/clamp-errors.hlsl
index 036f04cdac0b51c..97c8b59710d7f74 100644
--- a/clang/test/SemaHLSL/BuiltIns/clamp-errors.hlsl
+++ b/clang/test/SemaHLSL/BuiltIns/clamp-errors.hlsl
@@ -72,20 +72,20 @@ float2 test_builtin_clamp_int_vect_to_float_vec_promotion(int2 p0, float p1) {
 
 float test_builtin_clamp_bool_type_promotion(bool p0) {
   return __builtin_hlsl_elementwise_clamp(p0, p0, p0);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was 'bool')}}
+  // expected-error at -1 {{1st argument must be a vector, integer or floating-point type (was 'bool')}}
 }
 
 float builtin_bool_to_float_type_promotion(float p0, bool p1) {
   return __builtin_hlsl_elementwise_clamp(p0, p0, p1);
-  // expected-error at -1 {{3rd argument must be a floating point type (was 'bool')}}
+  // expected-error at -1 {{3rd argument must be a scalar or vector of floating-point types (was 'bool')}}
 }
 
 float builtin_bool_to_float_type_promotion2(bool p0, float p1) {
   return __builtin_hlsl_elementwise_clamp(p1, p0, p1);
-  // expected-error at -1 {{2nd argument must be a floating point type (was 'bool')}}
+  // expected-error at -1 {{2nd argument must be a scalar or vector of floating-point types (was 'bool')}}
 }
 
 float builtin_clamp_int_to_float_promotion(float p0, int p1) {
   return __builtin_hlsl_elementwise_clamp(p0, p0, p1);
-  // expected-error at -1 {{3rd argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{3rd argument must be a scalar or vector of floating-point types (was 'int')}}
 }
diff --git a/clang/test/SemaHLSL/BuiltIns/dot-errors.hlsl b/clang/test/SemaHLSL/BuiltIns/dot-errors.hlsl
index cc42f0cb0a572df..157f5e2575b0327 100644
--- a/clang/test/SemaHLSL/BuiltIns/dot-errors.hlsl
+++ b/clang/test/SemaHLSL/BuiltIns/dot-errors.hlsl
@@ -106,7 +106,7 @@ float test_builtin_dot_int_vect_to_float_vec_promotion(int2 p0, float p1) {
 
 int test_builtin_dot_bool_type_promotion(bool p0, bool p1) {
   return __builtin_hlsl_dot(p0, p1);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating point type (was 'bool')}}
+  // expected-error at -1 {{1st argument must be a vector, integer or floating-point type (was 'bool')}}
 }
 
 double test_dot_double(double2 p0, double2 p1) {
diff --git a/clang/test/SemaHLSL/BuiltIns/exp-errors.hlsl b/clang/test/SemaHLSL/BuiltIns/exp-errors.hlsl
index bb93e652582cf5c..b8c6bf3c91daea9 100644
--- a/clang/test/SemaHLSL/BuiltIns/exp-errors.hlsl
+++ b/clang/test/SemaHLSL/BuiltIns/exp-errors.hlsl
@@ -13,15 +13,15 @@ float2 test_too_many_arg(float2 p0) {
 
 float builtin_bool_to_float_type_promotion(bool p1) {
   return TEST_FUNC(p1);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'bool')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'bool')}}
 }
 
 float builtin_exp_int_to_float_promotion(int p1) {
   return TEST_FUNC(p1);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 }
 
 float2 builtin_exp_int2_to_float2_promotion(int2 p1) {
   return TEST_FUNC(p1);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int2' (aka 'vector<int, 2>'))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int2' (aka 'vector<int, 2>'))}}
 }
diff --git a/clang/test/SemaHLSL/BuiltIns/firstbithigh-errors.hlsl b/clang/test/SemaHLSL/BuiltIns/firstbithigh-errors.hlsl
index b4024418dbba4f6..8badaf0b99a20cc 100644
--- a/clang/test/SemaHLSL/BuiltIns/firstbithigh-errors.hlsl
+++ b/clang/test/SemaHLSL/BuiltIns/firstbithigh-errors.hlsl
@@ -17,10 +17,10 @@ double test_int_builtin(double p0) {
 
 double2 test_int_builtin_2(double2 p0) {
   return __builtin_hlsl_elementwise_firstbithigh(p0);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'double2' (aka 'vector<double, 2>'))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'double2' (aka 'vector<double, 2>'))}}
 }
 
 float test_int_builtin_3(float p0) {
   return __builtin_hlsl_elementwise_firstbithigh(p0);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'double')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'double')}}
 }
diff --git a/clang/test/SemaHLSL/BuiltIns/firstbitlow-errors.hlsl b/clang/test/SemaHLSL/BuiltIns/firstbitlow-errors.hlsl
index 95c25e9e2fb60d1..b12afe65a863ec7 100644
--- a/clang/test/SemaHLSL/BuiltIns/firstbitlow-errors.hlsl
+++ b/clang/test/SemaHLSL/BuiltIns/firstbitlow-errors.hlsl
@@ -17,10 +17,10 @@ double test_int_builtin(double p0) {
 
 double2 test_int_builtin_2(double2 p0) {
   return __builtin_hlsl_elementwise_firstbitlow(p0);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'double2' (aka 'vector<double, 2>'))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'double2' (aka 'vector<double, 2>'))}}
 }
 
 float test_int_builtin_3(float p0) {
   return __builtin_hlsl_elementwise_firstbitlow(p0);
-  // expected-error at -1 {{1st argument must be a vector of integers (was 'double')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'double')}}
 }
diff --git a/clang/test/SemaHLSL/BuiltIns/lerp-errors.hlsl b/clang/test/SemaHLSL/BuiltIns/lerp-errors.hlsl
index c77a07602b390ef..46a39c62d126c48 100644
--- a/clang/test/SemaHLSL/BuiltIns/lerp-errors.hlsl
+++ b/clang/test/SemaHLSL/BuiltIns/lerp-errors.hlsl
@@ -104,27 +104,27 @@ float2 test_builtin_lerp_int_vect_to_float_vec_promotion(int2 p0, float p1) {
 
 float test_builtin_lerp_bool_type_promotion(bool p0) {
   return __builtin_hlsl_lerp(p0, p0, p0);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'bool')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'bool')}}
 }
 
 float builtin_bool_to_float_type_promotion(float p0, bool p1) {
   return __builtin_hlsl_lerp(p0, p0, p1);
-  // expected-error at -1 {{3rd argument must be a floating point type (was 'bool')}}
+  // expected-error at -1 {{3rd argument must be a scalar or vector of floating-point types (was 'bool')}}
 }
 
 float builtin_bool_to_float_type_promotion2(bool p0, float p1) {
   return __builtin_hlsl_lerp(p1, p0, p1);
-  // expected-error at -1 {{2nd argument must be a floating point type (was 'bool')}}
+  // expected-error at -1 {{2nd argument must be a scalar or vector of floating-point types (was 'bool')}}
 }
 
 float builtin_lerp_int_to_float_promotion(float p0, int p1) {
   return __builtin_hlsl_lerp(p0, p0, p1);
-  // expected-error at -1 {{3rd argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{3rd argument must be a scalar or vector of floating-point types (was 'int')}}
 }
 
 float4 test_lerp_int4(int4 p0, int4 p1, int4 p2) {
   return __builtin_hlsl_lerp(p0, p1, p2);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int4' (aka 'vector<int, 4>'))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int4' (aka 'vector<int, 4>'))}}
 }
 
 // note: DefaultVariadicArgumentPromotion --> DefaultArgumentPromotion has already promoted to double
diff --git a/clang/test/SemaHLSL/BuiltIns/mad-errors.hlsl b/clang/test/SemaHLSL/BuiltIns/mad-errors.hlsl
index b96761fb76cc0c3..5feb147d1d63269 100644
--- a/clang/test/SemaHLSL/BuiltIns/mad-errors.hlsl
+++ b/clang/test/SemaHLSL/BuiltIns/mad-errors.hlsl
@@ -72,17 +72,17 @@ float2 test_builtin_mad_int_vect_to_float_vec_promotion(int2 p0, float p1) {
 
 float builtin_bool_to_float_type_promotion(float p0, bool p1) {
   return __builtin_hlsl_mad(p0, p0, p1);
-  // expected-error at -1 {{3rd argument must be a floating point type (was 'bool')}}
+  // expected-error at -1 {{3rd argument must be a scalar or vector of floating-point types (was 'bool')}}
 }
 
 float builtin_bool_to_float_type_promotion2(bool p0, float p1) {
   return __builtin_hlsl_mad(p1, p0, p1);
-  // expected-error at -1 {{2nd argument must be a floating point type (was 'bool')}}
+  // expected-error at -1 {{2nd argument must be a scalar or vector of floating-point types (was 'bool')}}
 }
 
 float builtin_mad_int_to_float_promotion(float p0, int p1) {
   return __builtin_hlsl_mad(p0, p0, p1);
-  // expected-error at -1 {{3rd argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{3rd argument must be a scalar or vector of floating-point types (was 'int')}}
 }
 
 int builtin_mad_mixed_enums() {
diff --git a/clang/test/SemaHLSL/BuiltIns/reversebits-errors.hlsl b/clang/test/SemaHLSL/BuiltIns/reversebits-errors.hlsl
index e01fb9151de1592..76ebe66d0d11956 100644
--- a/clang/test/SemaHLSL/BuiltIns/reversebits-errors.hlsl
+++ b/clang/test/SemaHLSL/BuiltIns/reversebits-errors.hlsl
@@ -3,7 +3,7 @@
 
 double2 test_int_builtin(double2 p0) {
     return __builtin_elementwise_bitreverse(p0);
-  // expected-error at -1 {{1st argument must be an integer or vector of integers (was 'double2' (aka 'vector<double, 2>'))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of integer types (was 'double2' (aka 'vector<double, 2>'))}}
 }
 
 int2 test_int_builtin(int2 p0) {
diff --git a/clang/test/SemaHLSL/BuiltIns/round-errors.hlsl b/clang/test/SemaHLSL/BuiltIns/round-errors.hlsl
index 52eff2204b901ff..45f86450b37c22a 100644
--- a/clang/test/SemaHLSL/BuiltIns/round-errors.hlsl
+++ b/clang/test/SemaHLSL/BuiltIns/round-errors.hlsl
@@ -13,15 +13,15 @@ float2 test_too_many_arg(float2 p0) {
 
 float builtin_bool_to_float_type_promotion(bool p1) {
   return __builtin_elementwise_round(p1);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'bool')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'bool')}}
 }
 
 float builtin_round_int_to_float_promotion(int p1) {
   return __builtin_elementwise_round(p1);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int')}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}}
 }
 
 float2 builtin_round_int2_to_float2_promotion(int2 p1) {
   return __builtin_elementwise_round(p1);
-  // expected-error at -1 {{1st argument must be a floating point type (was 'int2' (aka 'vector<int, 2>'))}}
+  // expected-error at -1 {{1st argument must be a scalar or vector of floating-point types (was 'int2' (aka 'vector<int, 2>'))}}
 }



More information about the cfe-commits mailing list