[clang] 3aca0ff - [clang][SVE] Add support for arithmetic operators on SVE types

David Truby via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 11 07:39:57 PST 2022


Author: David Truby
Date: 2022-03-11T15:39:44Z
New Revision: 3aca0ffd5092e37590bbee7e0fcd2b1b5780024c

URL: https://github.com/llvm/llvm-project/commit/3aca0ffd5092e37590bbee7e0fcd2b1b5780024c
DIFF: https://github.com/llvm/llvm-project/commit/3aca0ffd5092e37590bbee7e0fcd2b1b5780024c.diff

LOG: [clang][SVE] Add support for arithmetic operators on SVE types

This patch implements support for the +, -, *, / and % operators on sizeless SVE
types. Support for these operators on svbool_t is excluded.

Differential Revision: https://reviews.llvm.org/D120323

Added: 
    clang/test/CodeGen/aarch64-sve-vector-ops.c
    clang/test/Sema/aarch64-sve-vector-ops.c

Modified: 
    clang/include/clang/AST/Type.h
    clang/include/clang/Sema/Sema.h
    clang/lib/AST/Type.cpp
    clang/lib/Sema/SemaExpr.cpp
    clang/test/Sema/sizeless-1.c
    clang/test/SemaCXX/sizeless-1.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h
index 3c71cbbb9c8f3..76e4474b1b303 100644
--- a/clang/include/clang/AST/Type.h
+++ b/clang/include/clang/AST/Type.h
@@ -2557,6 +2557,8 @@ class BuiltinType : public Type {
     return getKind() >= Half && getKind() <= Ibm128;
   }
 
+  bool isSVEBool() const { return getKind() == Kind::SveBool; }
+
   /// Determines whether the given kind corresponds to a placeholder type.
   static bool isPlaceholderTypeKind(Kind K) {
     return K >= Overload;

diff  --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index d072cf9223f7d..4c5666f290141 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -11940,6 +11940,10 @@ class Sema final {
   QualType CheckVectorLogicalOperands(ExprResult &LHS, ExprResult &RHS,
                                       SourceLocation Loc);
 
+  // type checking for sizeless vector binary operators.
+  QualType CheckSizelessVectorOperands(ExprResult &LHS, ExprResult &RHS,
+                                       SourceLocation Loc);
+
   /// Type checking for matrix binary operators.
   QualType CheckMatrixElementwiseOperands(ExprResult &LHS, ExprResult &RHS,
                                           SourceLocation Loc,

diff  --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index 1c7499c3c237e..8579d697868fd 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -2105,6 +2105,11 @@ bool Type::hasUnsignedIntegerRepresentation() const {
     return VT->getElementType()->isUnsignedIntegerOrEnumerationType();
   if (const auto *VT = dyn_cast<MatrixType>(CanonicalType))
     return VT->getElementType()->isUnsignedIntegerOrEnumerationType();
+  if (CanonicalType->isVLSTBuiltinType()) {
+    const auto *VT = cast<BuiltinType>(CanonicalType);
+    return VT->getKind() >= BuiltinType::SveUint8 &&
+           VT->getKind() <= BuiltinType::SveUint64;
+  }
   return isUnsignedIntegerOrEnumerationType();
 }
 

diff  --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index ca5e206f8933d..96471f6c5fb1f 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -10403,6 +10403,29 @@ QualType Sema::CheckVectorOperands(ExprResult &LHS, ExprResult &RHS,
   return QualType();
 }
 
+QualType Sema::CheckSizelessVectorOperands(ExprResult &LHS, ExprResult &RHS,
+                                           SourceLocation Loc) {
+  QualType LHSType = LHS.get()->getType().getUnqualifiedType();
+  QualType RHSType = RHS.get()->getType().getUnqualifiedType();
+
+  const BuiltinType *LHSVecType = LHSType->getAs<BuiltinType>();
+  const BuiltinType *RHSVecType = RHSType->getAs<BuiltinType>();
+
+  unsigned DiagID = diag::err_typecheck_invalid_operands;
+  if (LHSVecType->isSVEBool() || RHSVecType->isSVEBool()) {
+    Diag(Loc, DiagID) << LHSType << RHSType << LHS.get()->getSourceRange()
+                      << RHS.get()->getSourceRange();
+    return QualType();
+  }
+
+  if (Context.hasSameType(LHSType, RHSType))
+    return LHSType;
+
+  Diag(Loc, DiagID) << LHSType << RHSType << LHS.get()->getSourceRange()
+                    << RHS.get()->getSourceRange();
+  return QualType();
+}
+
 // checkArithmeticNull - Detect when a NULL constant is used improperly in an
 // expression.  These are mainly cases where the null pointer is used as an
 // integer instead of a pointer.
@@ -10512,8 +10535,10 @@ QualType Sema::CheckMultiplyDivideOperands(ExprResult &LHS, ExprResult &RHS,
   QualType RHSTy = RHS.get()->getType();
   if (LHSTy->isVectorType() || RHSTy->isVectorType())
     return CheckVectorOperands(LHS, RHS, Loc, IsCompAssign,
-                               /*AllowBothBool*/getLangOpts().AltiVec,
-                               /*AllowBoolConversions*/false);
+                               /*AllowBothBool*/ getLangOpts().AltiVec,
+                               /*AllowBoolConversions*/ false);
+  if (LHSTy->isVLSTBuiltinType() || RHSTy->isVLSTBuiltinType())
+    return CheckSizelessVectorOperands(LHS, RHS, Loc);
   if (!IsDiv &&
       (LHSTy->isConstantMatrixType() || RHSTy->isConstantMatrixType()))
     return CheckMatrixMultiplyOperands(LHS, RHS, Loc, IsCompAssign);
@@ -10551,6 +10576,21 @@ QualType Sema::CheckRemainderOperands(
     return InvalidOperands(Loc, LHS, RHS);
   }
 
+  if (LHS.get()->getType()->isVLSTBuiltinType() &&
+      RHS.get()->getType()->isVLSTBuiltinType()) {
+    if (LHS.get()
+            ->getType()
+            ->getSveEltType(Context)
+            ->hasIntegerRepresentation() &&
+        RHS.get()
+            ->getType()
+            ->getSveEltType(Context)
+            ->hasIntegerRepresentation())
+      return CheckSizelessVectorOperands(LHS, RHS, Loc);
+
+    return InvalidOperands(Loc, LHS, RHS);
+  }
+
   QualType compType = UsualArithmeticConversions(
       LHS, RHS, Loc, IsCompAssign ? ACK_CompAssign : ACK_Arithmetic);
   if (LHS.isInvalid() || RHS.isInvalid())
@@ -10856,6 +10896,14 @@ QualType Sema::CheckAdditionOperands(ExprResult &LHS, ExprResult &RHS,
     return compType;
   }
 
+  if (LHS.get()->getType()->isVLSTBuiltinType() ||
+      RHS.get()->getType()->isVLSTBuiltinType()) {
+    QualType compType = CheckSizelessVectorOperands(LHS, RHS, Loc);
+    if (CompLHSTy)
+      *CompLHSTy = compType;
+    return compType;
+  }
+
   if (LHS.get()->getType()->isConstantMatrixType() ||
       RHS.get()->getType()->isConstantMatrixType()) {
     QualType compType =
@@ -10960,6 +11008,14 @@ QualType Sema::CheckSubtractionOperands(ExprResult &LHS, ExprResult &RHS,
     return compType;
   }
 
+  if (LHS.get()->getType()->isVLSTBuiltinType() ||
+      RHS.get()->getType()->isVLSTBuiltinType()) {
+    QualType compType = CheckSizelessVectorOperands(LHS, RHS, Loc);
+    if (CompLHSTy)
+      *CompLHSTy = compType;
+    return compType;
+  }
+
   if (LHS.get()->getType()->isConstantMatrixType() ||
       RHS.get()->getType()->isConstantMatrixType()) {
     QualType compType =

diff  --git a/clang/test/CodeGen/aarch64-sve-vector-ops.c b/clang/test/CodeGen/aarch64-sve-vector-ops.c
new file mode 100644
index 0000000000000..15a05e940d981
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve-vector-ops.c
@@ -0,0 +1,743 @@
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve \
+// RUN: -fallow-half-arguments-and-returns \
+// RUN:  -O1 -emit-llvm -o - %s 2>&1 | FileCheck %s
+
+#include <arm_sve.h>
+
+// ADDITION
+
+svint8_t add_i8(svint8_t a, svint8_t b) {
+  // CHECK-LABEL: add_i8
+  // CHECK: %add = add <vscale x 16 x i8> %b, %a
+  // CHECK-NEXT: ret <vscale x 16 x i8> %add
+  return a + b;
+}
+
+svint16_t add_i16(svint16_t a, svint16_t b) {
+  // CHECK-LABEL: add_i16
+  // CHECK: %add = add <vscale x 8 x i16> %b, %a
+  // CHECK-NEXT: ret <vscale x 8 x i16> %add
+  return a + b;
+}
+
+svint32_t add_i32(svint32_t a, svint32_t b) {
+  // CHECK-LABEL: add_i32
+  // CHECK: %add = add <vscale x 4 x i32> %b, %a
+  // CHECK-NEXT: ret <vscale x 4 x i32> %add
+  return a + b;
+}
+
+svint64_t add_i64(svint64_t a, svint64_t b) {
+  // CHECK-LABEL: add_i64
+  // CHECK: %add = add <vscale x 2 x i64> %b, %a
+  // CHECK-NEXT: ret <vscale x 2 x i64> %add
+  return a + b;
+}
+
+svuint8_t add_u8(svuint8_t a, svuint8_t b) {
+  // CHECK-LABEL: add_u8
+  // CHECK: %add = add <vscale x 16 x i8> %b, %a
+  // CHECK-NEXT: ret <vscale x 16 x i8> %add
+  return a + b;
+}
+
+svuint16_t add_u16(svuint16_t a, svuint16_t b) {
+  // CHECK-LABEL: add_u16
+  // CHECK: %add = add <vscale x 8 x i16> %b, %a
+  // CHECK-NEXT: ret <vscale x 8 x i16> %add
+  return a + b;
+}
+
+svuint32_t add_u32(svuint32_t a, svuint32_t b) {
+  // CHECK-LABEL: add_u32
+  // CHECK: %add = add <vscale x 4 x i32> %b, %a
+  // CHECK-NEXT: ret <vscale x 4 x i32> %add
+  return a + b;
+}
+
+svuint64_t add_u64(svuint64_t a, svuint64_t b) {
+  // CHECK-LABEL: add_u64
+  // CHECK: %add = add <vscale x 2 x i64> %b, %a
+  // CHECK-NEXT: ret <vscale x 2 x i64> %add
+  return a + b;
+}
+
+svfloat16_t add_f16(svfloat16_t a, svfloat16_t b) {
+  // CHECK-LABEL: add_f16
+  // CHECK: %add = fadd <vscale x 8 x half> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x half> %add
+  return a + b;
+}
+
+svfloat32_t add_f32(svfloat32_t a, svfloat32_t b) {
+  // CHECK-LABEL: add_f32
+  // CHECK: %add = fadd <vscale x 4 x float> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x float> %add
+  return a + b;
+}
+
+svfloat64_t add_f64(svfloat64_t a, svfloat64_t b) {
+  // CHECK-LABEL: add_f64
+  // CHECK: %add = fadd <vscale x 2 x double> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x double> %add
+  return a + b;
+}
+
+svint8_t add_inplace_i8(svint8_t a, svint8_t b) {
+  // CHECK-LABEL: add_inplace_i8
+  // CHECK: %add = add <vscale x 16 x i8> %b, %a
+  // CHECK-NEXT: ret <vscale x 16 x i8> %add
+  return a += b;
+}
+
+svint16_t add_inplace_i16(svint16_t a, svint16_t b) {
+  // CHECK-LABEL: add_inplace_i16
+  // CHECK: %add = add <vscale x 8 x i16> %b, %a
+  // CHECK-NEXT: ret <vscale x 8 x i16> %add
+  return a += b;
+}
+
+svint32_t add_inplace_i32(svint32_t a, svint32_t b) {
+  // CHECK-LABEL: add_inplace_i32
+  // CHECK: %add = add <vscale x 4 x i32> %b, %a
+  // CHECK-NEXT: ret <vscale x 4 x i32> %add
+  return a += b;
+}
+
+svint64_t add_inplace_i64(svint64_t a, svint64_t b) {
+  // CHECK-LABEL: add_inplace_i64
+  // CHECK: %add = add <vscale x 2 x i64> %b, %a
+  // CHECK-NEXT: ret <vscale x 2 x i64> %add
+  return a += b;
+}
+
+svuint8_t add_inplace_u8(svuint8_t a, svuint8_t b) {
+  // CHECK-LABEL: add_inplace_u8
+  // CHECK: %add = add <vscale x 16 x i8> %b, %a
+  // CHECK-NEXT: ret <vscale x 16 x i8> %add
+  return a += b;
+}
+
+svuint16_t add_inplace_u16(svuint16_t a, svuint16_t b) {
+  // CHECK-LABEL: add_inplace_u16
+  // CHECK: %add = add <vscale x 8 x i16> %b, %a
+  // CHECK-NEXT: ret <vscale x 8 x i16> %add
+  return a += b;
+}
+
+svuint32_t add_inplace_u32(svuint32_t a, svuint32_t b) {
+  // CHECK-LABEL: add_inplace_u32
+  // CHECK: %add = add <vscale x 4 x i32> %b, %a
+  // CHECK-NEXT: ret <vscale x 4 x i32> %add
+  return a += b;
+}
+
+svuint64_t add_inplace_u64(svuint64_t a, svuint64_t b) {
+  // CHECK-LABEL: add_inplace_u64
+  // CHECK: %add = add <vscale x 2 x i64> %b, %a
+  // CHECK-NEXT: ret <vscale x 2 x i64> %add
+  return a += b;
+}
+
+svfloat16_t add_inplace_f16(svfloat16_t a, svfloat16_t b) {
+  // CHECK-LABEL: add_inplace_f16
+  // CHECK: %add = fadd <vscale x 8 x half> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x half> %add
+  return a += b;
+}
+
+svfloat32_t add_inplace_f32(svfloat32_t a, svfloat32_t b) {
+  // CHECK-LABEL: add_inplace_f32
+  // CHECK: %add = fadd <vscale x 4 x float> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x float> %add
+  return a += b;
+}
+
+svfloat64_t add_inplace_f64(svfloat64_t a, svfloat64_t b) {
+  // CHECK-LABEL: add_inplace_f64
+  // CHECK: %add = fadd <vscale x 2 x double> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x double> %add
+  return a += b;
+}
+
+// SUBTRACTION
+
+svint8_t sub_i8(svint8_t a, svint8_t b) {
+  // CHECK-LABEL: sub_i8
+  // CHECK: %sub = sub <vscale x 16 x i8> %a, %b
+  // CHECK-NEXT: ret <vscale x 16 x i8> %sub
+  return a - b;
+}
+
+svint16_t sub_i16(svint16_t a, svint16_t b) {
+  // CHECK-LABEL: sub_i16
+  // CHECK: %sub = sub <vscale x 8 x i16> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x i16> %sub
+  return a - b;
+}
+
+svint32_t sub_i32(svint32_t a, svint32_t b) {
+  // CHECK-LABEL: sub_i32
+  // CHECK: %sub = sub <vscale x 4 x i32> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x i32> %sub
+  return a - b;
+}
+
+svint64_t sub_i64(svint64_t a, svint64_t b) {
+  // CHECK-LABEL: sub_i64
+  // CHECK: %sub = sub <vscale x 2 x i64> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x i64> %sub
+  return a - b;
+}
+
+svuint8_t sub_u8(svuint8_t a, svuint8_t b) {
+  // CHECK-LABEL: sub_u8
+  // CHECK: %sub = sub <vscale x 16 x i8> %a, %b
+  // CHECK-NEXT: ret <vscale x 16 x i8> %sub
+  return a - b;
+}
+
+svuint16_t sub_u16(svuint16_t a, svuint16_t b) {
+  // CHECK-LABEL: sub_u16
+  // CHECK: %sub = sub <vscale x 8 x i16> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x i16> %sub
+  return a - b;
+}
+
+svuint32_t sub_u32(svuint32_t a, svuint32_t b) {
+  // CHECK-LABEL: sub_u32
+  // CHECK: %sub = sub <vscale x 4 x i32> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x i32> %sub
+  return a - b;
+}
+
+svuint64_t sub_u64(svuint64_t a, svuint64_t b) {
+  // CHECK-LABEL: sub_u64
+  // CHECK: %sub = sub <vscale x 2 x i64> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x i64> %sub
+  return a - b;
+}
+
+svfloat16_t sub_f16(svfloat16_t a, svfloat16_t b) {
+  // CHECK-LABEL: sub_f16
+  // CHECK: %sub = fsub <vscale x 8 x half> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x half> %sub
+  return a - b;
+}
+
+svfloat32_t sub_f32(svfloat32_t a, svfloat32_t b) {
+  // CHECK-LABEL: sub_f32
+  // CHECK: %sub = fsub <vscale x 4 x float> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x float> %sub
+  return a - b;
+}
+
+svfloat64_t sub_f64(svfloat64_t a, svfloat64_t b) {
+  // CHECK-LABEL: sub_f64
+  // CHECK: %sub = fsub <vscale x 2 x double> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x double> %sub
+  return a - b;
+}
+
+svint8_t sub_inplace_i8(svint8_t a, svint8_t b) {
+  // CHECK-LABEL: sub_inplace_i8
+  // CHECK: %sub = sub <vscale x 16 x i8> %a, %b
+  // CHECK-NEXT: ret <vscale x 16 x i8> %sub
+  return a - b;
+}
+
+svint16_t sub_inplace_i16(svint16_t a, svint16_t b) {
+  // CHECK-LABEL: sub_inplace_i16
+  // CHECK: %sub = sub <vscale x 8 x i16> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x i16> %sub
+  return a - b;
+}
+
+svint32_t sub_inplace_i32(svint32_t a, svint32_t b) {
+  // CHECK-LABEL: sub_inplace_i32
+  // CHECK: %sub = sub <vscale x 4 x i32> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x i32> %sub
+  return a - b;
+}
+
+svint64_t sub_inplace_i64(svint64_t a, svint64_t b) {
+  // CHECK-LABEL: sub_inplace_i64
+  // CHECK: %sub = sub <vscale x 2 x i64> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x i64> %sub
+  return a - b;
+}
+
+svuint8_t sub_inplace_u8(svuint8_t a, svuint8_t b) {
+  // CHECK-LABEL: sub_inplace_u8
+  // CHECK: %sub = sub <vscale x 16 x i8> %a, %b
+  // CHECK-NEXT: ret <vscale x 16 x i8> %sub
+  return a - b;
+}
+
+svuint16_t sub_inplace_u16(svuint16_t a, svuint16_t b) {
+  // CHECK-LABEL: sub_inplace_u16
+  // CHECK: %sub = sub <vscale x 8 x i16> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x i16> %sub
+  return a - b;
+}
+
+svuint32_t sub_inplace_u32(svuint32_t a, svuint32_t b) {
+  // CHECK-LABEL: sub_inplace_u32
+  // CHECK: %sub = sub <vscale x 4 x i32> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x i32> %sub
+  return a - b;
+}
+
+svuint64_t sub_inplace_u64(svuint64_t a, svuint64_t b) {
+  // CHECK-LABEL: sub_inplace_u64
+  // CHECK: %sub = sub <vscale x 2 x i64> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x i64> %sub
+  return a - b;
+}
+
+svfloat16_t sub_inplace_f16(svfloat16_t a, svfloat16_t b) {
+  // CHECK-LABEL: sub_inplace_f16
+  // CHECK: %sub = fsub <vscale x 8 x half> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x half> %sub
+  return a - b;
+}
+
+svfloat32_t sub_inplace_f32(svfloat32_t a, svfloat32_t b) {
+  // CHECK-LABEL: sub_inplace_f32
+  // CHECK: %sub = fsub <vscale x 4 x float> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x float> %sub
+  return a - b;
+}
+
+svfloat64_t sub_inplace_f64(svfloat64_t a, svfloat64_t b) {
+  // CHECK-LABEL: sub_inplace_f64
+  // CHECK: %sub = fsub <vscale x 2 x double> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x double> %sub
+  return a - b;
+}
+
+// MULTIPLICATION
+
+svint8_t mul_i8(svint8_t a, svint8_t b) {
+  // CHECK-LABEL: mul_i8
+  // CHECK: %mul = mul <vscale x 16 x i8> %b, %a
+  // CHECK-NEXT: ret <vscale x 16 x i8> %mul
+  return a * b;
+}
+
+svint16_t mul_i16(svint16_t a, svint16_t b) {
+  // CHECK-LABEL: mul_i16
+  // CHECK: %mul = mul <vscale x 8 x i16> %b, %a
+  // CHECK-NEXT: ret <vscale x 8 x i16> %mul
+  return a * b;
+}
+
+svint32_t mul_i32(svint32_t a, svint32_t b) {
+  // CHECK-LABEL: mul_i32
+  // CHECK: %mul = mul <vscale x 4 x i32> %b, %a
+  // CHECK-NEXT: ret <vscale x 4 x i32> %mul
+  return a * b;
+}
+
+svint64_t mul_i64(svint64_t a, svint64_t b) {
+  // CHECK-LABEL: mul_i64
+  // CHECK: %mul = mul <vscale x 2 x i64> %b, %a
+  // CHECK-NEXT: ret <vscale x 2 x i64> %mul
+  return a * b;
+}
+
+svuint8_t mul_u8(svuint8_t a, svuint8_t b) {
+  // CHECK-LABEL: mul_u8
+  // CHECK: %mul = mul <vscale x 16 x i8> %b, %a
+  // CHECK-NEXT: ret <vscale x 16 x i8> %mul
+  return a * b;
+}
+
+svuint16_t mul_u16(svuint16_t a, svuint16_t b) {
+  // CHECK-LABEL: mul_u16
+  // CHECK: %mul = mul <vscale x 8 x i16> %b, %a
+  // CHECK-NEXT: ret <vscale x 8 x i16> %mul
+  return a * b;
+}
+
+svuint32_t mul_u32(svuint32_t a, svuint32_t b) {
+  // CHECK-LABEL: mul_u32
+  // CHECK: %mul = mul <vscale x 4 x i32> %b, %a
+  // CHECK-NEXT: ret <vscale x 4 x i32> %mul
+  return a * b;
+}
+
+svuint64_t mul_u64(svuint64_t a, svuint64_t b) {
+  // CHECK-LABEL: mul_u64
+  // CHECK: %mul = mul <vscale x 2 x i64> %b, %a
+  // CHECK-NEXT: ret <vscale x 2 x i64> %mul
+  return a * b;
+}
+
+svfloat16_t mul_f16(svfloat16_t a, svfloat16_t b) {
+  // CHECK-LABEL: mul_f16
+  // CHECK: %mul = fmul <vscale x 8 x half> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x half> %mul
+  return a * b;
+}
+
+svfloat32_t mul_f32(svfloat32_t a, svfloat32_t b) {
+  // CHECK-LABEL: mul_f32
+  // CHECK: %mul = fmul <vscale x 4 x float> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x float> %mul
+  return a * b;
+}
+
+svfloat64_t mul_f64(svfloat64_t a, svfloat64_t b) {
+  // CHECK-LABEL: mul_f64
+  // CHECK: %mul = fmul <vscale x 2 x double> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x double> %mul
+  return a * b;
+}
+
+svint8_t mul_inplace_i8(svint8_t a, svint8_t b) {
+  // CHECK-LABEL: mul_inplace_i8
+  // CHECK: %mul = mul <vscale x 16 x i8> %b, %a
+  // CHECK-NEXT: ret <vscale x 16 x i8> %mul
+  return a * b;
+}
+
+svint16_t mul_inplace_i16(svint16_t a, svint16_t b) {
+  // CHECK-LABEL: mul_inplace_i16
+  // CHECK: %mul = mul <vscale x 8 x i16> %b, %a
+  // CHECK-NEXT: ret <vscale x 8 x i16> %mul
+  return a * b;
+}
+
+svint32_t mul_inplace_i32(svint32_t a, svint32_t b) {
+  // CHECK-LABEL: mul_inplace_i32
+  // CHECK: %mul = mul <vscale x 4 x i32> %b, %a
+  // CHECK-NEXT: ret <vscale x 4 x i32> %mul
+  return a * b;
+}
+
+svint64_t mul_inplace_i64(svint64_t a, svint64_t b) {
+  // CHECK-LABEL: mul_inplace_i64
+  // CHECK: %mul = mul <vscale x 2 x i64> %b, %a
+  // CHECK-NEXT: ret <vscale x 2 x i64> %mul
+  return a * b;
+}
+
+svuint8_t mul_inplace_u8(svuint8_t a, svuint8_t b) {
+  // CHECK-LABEL: mul_inplace_u8
+  // CHECK: %mul = mul <vscale x 16 x i8> %b, %a
+  // CHECK-NEXT: ret <vscale x 16 x i8> %mul
+  return a * b;
+}
+
+svuint16_t mul_inplace_u16(svuint16_t a, svuint16_t b) {
+  // CHECK-LABEL: mul_inplace_u16
+  // CHECK: %mul = mul <vscale x 8 x i16> %b, %a
+  // CHECK-NEXT: ret <vscale x 8 x i16> %mul
+  return a * b;
+}
+
+svuint32_t mul_inplace_u32(svuint32_t a, svuint32_t b) {
+  // CHECK-LABEL: mul_inplace_u32
+  // CHECK: %mul = mul <vscale x 4 x i32> %b, %a
+  // CHECK-NEXT: ret <vscale x 4 x i32> %mul
+  return a * b;
+}
+
+svuint64_t mul_inplace_u64(svuint64_t a, svuint64_t b) {
+  // CHECK-LABEL: mul_inplace_u64
+  // CHECK: %mul = mul <vscale x 2 x i64> %b, %a
+  // CHECK-NEXT: ret <vscale x 2 x i64> %mul
+  return a * b;
+}
+
+svfloat16_t mul_inplace_f16(svfloat16_t a, svfloat16_t b) {
+  // CHECK-LABEL: mul_inplace_f16
+  // CHECK: %mul = fmul <vscale x 8 x half> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x half> %mul
+  return a * b;
+}
+
+svfloat32_t mul_inplace_f32(svfloat32_t a, svfloat32_t b) {
+  // CHECK-LABEL: mul_inplace_f32
+  // CHECK: %mul = fmul <vscale x 4 x float> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x float> %mul
+  return a * b;
+}
+
+svfloat64_t mul_inplace_f64(svfloat64_t a, svfloat64_t b) {
+  // CHECK-LABEL: mul_inplace_f64
+  // CHECK: %mul = fmul <vscale x 2 x double> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x double> %mul
+  return a * b;
+}
+
+// DIVISION
+
+svint8_t div_i8(svint8_t a, svint8_t b) {
+  // CHECK-LABEL: div_i8
+  // CHECK: %div = sdiv <vscale x 16 x i8> %a, %b
+  // CHECK-NEXT: ret <vscale x 16 x i8> %div
+  return a / b;
+}
+
+svint16_t div_i16(svint16_t a, svint16_t b) {
+  // CHECK-LABEL: div_i16
+  // CHECK: %div = sdiv <vscale x 8 x i16> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x i16> %div
+  return a / b;
+}
+
+svint32_t div_i32(svint32_t a, svint32_t b) {
+  // CHECK-LABEL: div_i32
+  // CHECK: %div = sdiv <vscale x 4 x i32> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x i32> %div
+  return a / b;
+}
+
+svint64_t div_i64(svint64_t a, svint64_t b) {
+  // CHECK-LABEL: div_i64
+  // CHECK: %div = sdiv <vscale x 2 x i64> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x i64> %div
+  return a / b;
+}
+
+svuint8_t div_u8(svuint8_t a, svuint8_t b) {
+  // CHECK-LABEL: div_u8
+  // CHECK: %div = udiv <vscale x 16 x i8> %a, %b
+  // CHECK-NEXT: ret <vscale x 16 x i8> %div
+  return a / b;
+}
+
+svuint16_t div_u16(svuint16_t a, svuint16_t b) {
+  // CHECK-LABEL: div_u16
+  // CHECK: %div = udiv <vscale x 8 x i16> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x i16> %div
+  return a / b;
+}
+
+svuint32_t div_u32(svuint32_t a, svuint32_t b) {
+  // CHECK-LABEL: div_u32
+  // CHECK: %div = udiv <vscale x 4 x i32> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x i32> %div
+  return a / b;
+}
+
+svuint64_t div_u64(svuint64_t a, svuint64_t b) {
+  // CHECK-LABEL: div_u64
+  // CHECK: %div = udiv <vscale x 2 x i64> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x i64> %div
+  return a / b;
+}
+
+svfloat16_t div_f16(svfloat16_t a, svfloat16_t b) {
+  // CHECK-LABEL: div_f16
+  // CHECK: %div = fdiv <vscale x 8 x half> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x half> %div
+  return a / b;
+}
+
+svfloat32_t div_f32(svfloat32_t a, svfloat32_t b) {
+  // CHECK-LABEL: div_f32
+  // CHECK: %div = fdiv <vscale x 4 x float> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x float> %div
+  return a / b;
+}
+
+svfloat64_t div_f64(svfloat64_t a, svfloat64_t b) {
+  // CHECK-LABEL: div_f64
+  // CHECK: %div = fdiv <vscale x 2 x double> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x double> %div
+  return a / b;
+}
+
+svint8_t div_inplace_i8(svint8_t a, svint8_t b) {
+  // CHECK-LABEL: div_inplace_i8
+  // CHECK: %div = sdiv <vscale x 16 x i8> %a, %b
+  // CHECK-NEXT: ret <vscale x 16 x i8> %div
+  return a / b;
+}
+
+svint16_t div_inplace_i16(svint16_t a, svint16_t b) {
+  // CHECK-LABEL: div_inplace_i16
+  // CHECK: %div = sdiv <vscale x 8 x i16> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x i16> %div
+  return a / b;
+}
+
+svint32_t div_inplace_i32(svint32_t a, svint32_t b) {
+  // CHECK-LABEL: div_inplace_i32
+  // CHECK: %div = sdiv <vscale x 4 x i32> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x i32> %div
+  return a / b;
+}
+
+svint64_t div_inplace_i64(svint64_t a, svint64_t b) {
+  // CHECK-LABEL: div_inplace_i64
+  // CHECK: %div = sdiv <vscale x 2 x i64> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x i64> %div
+  return a / b;
+}
+
+svuint8_t div_inplace_u8(svuint8_t a, svuint8_t b) {
+  // CHECK-LABEL: div_inplace_u8
+  // CHECK: %div = udiv <vscale x 16 x i8> %a, %b
+  // CHECK-NEXT: ret <vscale x 16 x i8> %div
+  return a / b;
+}
+
+svuint16_t div_inplace_u16(svuint16_t a, svuint16_t b) {
+  // CHECK-LABEL: div_inplace_u16
+  // CHECK: %div = udiv <vscale x 8 x i16> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x i16> %div
+  return a / b;
+}
+
+svuint32_t div_inplace_u32(svuint32_t a, svuint32_t b) {
+  // CHECK-LABEL: div_inplace_u32
+  // CHECK: %div = udiv <vscale x 4 x i32> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x i32> %div
+  return a / b;
+}
+
+svuint64_t div_inplace_u64(svuint64_t a, svuint64_t b) {
+  // CHECK-LABEL: div_inplace_u64
+  // CHECK: %div = udiv <vscale x 2 x i64> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x i64> %div
+  return a / b;
+}
+
+svfloat16_t div_inplace_f16(svfloat16_t a, svfloat16_t b) {
+  // CHECK-LABEL: div_inplace_f16
+  // CHECK: %div = fdiv <vscale x 8 x half> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x half> %div
+  return a / b;
+}
+
+svfloat32_t div_inplace_f32(svfloat32_t a, svfloat32_t b) {
+  // CHECK-LABEL: div_inplace_f32
+  // CHECK: %div = fdiv <vscale x 4 x float> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x float> %div
+  return a / b;
+}
+
+svfloat64_t div_inplace_f64(svfloat64_t a, svfloat64_t b) {
+  // CHECK-LABEL: div_inplace_f64
+  // CHECK: %div = fdiv <vscale x 2 x double> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x double> %div
+  return a / b;
+}
+
+// REMAINDER
+
+svint8_t rem_i8(svint8_t a, svint8_t b) {
+  // CHECK-LABEL: rem_i8
+  // CHECK: %rem = srem <vscale x 16 x i8> %a, %b
+  // CHECK-NEXT: ret <vscale x 16 x i8> %rem
+  return a % b;
+}
+
+svint16_t rem_i16(svint16_t a, svint16_t b) {
+  // CHECK-LABEL: rem_i16
+  // CHECK: %rem = srem <vscale x 8 x i16> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x i16> %rem
+  return a % b;
+}
+
+svint32_t rem_i32(svint32_t a, svint32_t b) {
+  // CHECK-LABEL: rem_i32
+  // CHECK: %rem = srem <vscale x 4 x i32> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x i32> %rem
+  return a % b;
+}
+
+svint64_t rem_i64(svint64_t a, svint64_t b) {
+  // CHECK-LABEL: rem_i64
+  // CHECK: %rem = srem <vscale x 2 x i64> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x i64> %rem
+  return a % b;
+}
+
+svuint8_t rem_u8(svuint8_t a, svuint8_t b) {
+  // CHECK-LABEL: rem_u8
+  // CHECK: %rem = urem <vscale x 16 x i8> %a, %b
+  // CHECK-NEXT: ret <vscale x 16 x i8> %rem
+  return a % b;
+}
+
+svuint16_t rem_u16(svuint16_t a, svuint16_t b) {
+  // CHECK-LABEL: rem_u16
+  // CHECK: %rem = urem <vscale x 8 x i16> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x i16> %rem
+  return a % b;
+}
+
+svuint32_t rem_u32(svuint32_t a, svuint32_t b) {
+  // CHECK-LABEL: rem_u32
+  // CHECK: %rem = urem <vscale x 4 x i32> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x i32> %rem
+  return a % b;
+}
+
+svuint64_t rem_u64(svuint64_t a, svuint64_t b) {
+  // CHECK-LABEL: rem_u64
+  // CHECK: %rem = urem <vscale x 2 x i64> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x i64> %rem
+  return a % b;
+}
+
+svint8_t rem_inplace_i8(svint8_t a, svint8_t b) {
+  // CHECK-LABEL: rem_inplace_i8
+  // CHECK: %rem = srem <vscale x 16 x i8> %a, %b
+  // CHECK-NEXT: ret <vscale x 16 x i8> %rem
+  return a % b;
+}
+
+svint16_t rem_inplace_i16(svint16_t a, svint16_t b) {
+  // CHECK-LABEL: rem_inplace_i16
+  // CHECK: %rem = srem <vscale x 8 x i16> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x i16> %rem
+  return a % b;
+}
+
+svint32_t rem_inplace_i32(svint32_t a, svint32_t b) {
+  // CHECK-LABEL: rem_inplace_i32
+  // CHECK: %rem = srem <vscale x 4 x i32> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x i32> %rem
+  return a % b;
+}
+
+svint64_t rem_inplace_i64(svint64_t a, svint64_t b) {
+  // CHECK-LABEL: rem_inplace_i64
+  // CHECK: %rem = srem <vscale x 2 x i64> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x i64> %rem
+  return a % b;
+}
+
+svuint8_t rem_inplace_u8(svuint8_t a, svuint8_t b) {
+  // CHECK-LABEL: rem_inplace_u8
+  // CHECK: %rem = urem <vscale x 16 x i8> %a, %b
+  // CHECK-NEXT: ret <vscale x 16 x i8> %rem
+  return a % b;
+}
+
+svuint16_t rem_inplace_u16(svuint16_t a, svuint16_t b) {
+  // CHECK-LABEL: rem_inplace_u16
+  // CHECK: %rem = urem <vscale x 8 x i16> %a, %b
+  // CHECK-NEXT: ret <vscale x 8 x i16> %rem
+  return a % b;
+}
+
+svuint32_t rem_inplace_u32(svuint32_t a, svuint32_t b) {
+  // CHECK-LABEL: rem_inplace_u32
+  // CHECK: %rem = urem <vscale x 4 x i32> %a, %b
+  // CHECK-NEXT: ret <vscale x 4 x i32> %rem
+  return a % b;
+}
+
+svuint64_t rem_inplace_u64(svuint64_t a, svuint64_t b) {
+  // CHECK-LABEL: rem_inplace_u64
+  // CHECK: %rem = urem <vscale x 2 x i64> %a, %b
+  // CHECK-NEXT: ret <vscale x 2 x i64> %rem
+  return a % b;
+}

diff  --git a/clang/test/Sema/aarch64-sve-vector-ops.c b/clang/test/Sema/aarch64-sve-vector-ops.c
new file mode 100644
index 0000000000000..e18f19464d828
--- /dev/null
+++ b/clang/test/Sema/aarch64-sve-vector-ops.c
@@ -0,0 +1,645 @@
+// RUN: %clang_cc1 -verify -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only %s
+
+// REQUIRES: aarch64-registered-target
+
+#include <arm_sve.h>
+
+void add(svint8_t i8, svint16_t i16, svint32_t i32, svint64_t i64,
+         svuint8_t u8, svuint16_t u16, svuint32_t u32, svuint64_t u64,
+         svfloat16_t f16, svfloat32_t f32, svfloat64_t f64,
+         svbool_t b) {
+  (void)(b + b); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i8 + b); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 + i16); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 + i32); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 + i64); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 + u16); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 + u32); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 + u64); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 + f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 + f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 + f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u8 + b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u8 + i16); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 + i32); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 + i64); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 + u16); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 + u32); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 + u64); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 + f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 + f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 + f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i16 + b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i16 + i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i16 + i32); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 + i64); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 + u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i16 + u32); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 + u64); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 + f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 + f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 + f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u16 + b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u16 + i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u16 + i32); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 + i64); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 + u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u16 + u32); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 + u64); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 + f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 + f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 + f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i32 + b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i32 + i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i32 + i16); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 + i64); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 + u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i32 + u16); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 + u64); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 + f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 + f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 + f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u32 + b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u32 + i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u32 + i16); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 + i64); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 + u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u32 + u16); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 + u64); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 + f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 + f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 + f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i64 + b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i64 + i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i64 + i16); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 + i32); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 + u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i64 + u16); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 + u32); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 + f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 + f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 + f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u64 + b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u64 + i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u64 + i16); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 + i32); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 + u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u64 + u16); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 + u32); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 + f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 + f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 + f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(f16 + b);   // expected-error{{invalid operands to binary expression}}
+  (void)(f16 + i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f16 + i16); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 + i32); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 + i64); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 + u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f16 + u32); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 + u64); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 + f32); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 + f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(f32 + b);   // expected-error{{invalid operands to binary expression}}
+  (void)(f32 + i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f32 + i16); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 + i32); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 + i64); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 + u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f32 + u16); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 + u64); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 + f16); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 + f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(f64 + b);   // expected-error{{invalid operands to binary expression}}
+  (void)(f64 + i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f64 + i16); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 + i32); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 + i64); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 + u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f64 + u16); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 + u32); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 + f16); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 + f32); // expected-error{{invalid operands to binary expression}}
+}
+
+void sub(svint8_t i8, svint16_t i16, svint32_t i32, svint64_t i64,
+         svuint8_t u8, svuint16_t u16, svuint32_t u32, svuint64_t u64,
+         svfloat16_t f16, svfloat32_t f32, svfloat64_t f64,
+         svbool_t b) {
+  (void)(b - b); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i8 - b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i8 - i16); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 - i32); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 - i64); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 - u16); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 - u32); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 - u64); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 - f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 - f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 - f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u8 - b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u8 - i16); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 - i32); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 - i64); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 - u16); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 - u32); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 - u64); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 - f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 - f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 - f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i16 - b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i16 - i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i16 - i32); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 - i64); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 - u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i16 - u32); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 - u64); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 - f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 - f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 - f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u16 - b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u16 - i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u16 - i32); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 - i64); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 - u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u16 - u32); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 - u64); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 - f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 - f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 - f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i32 - b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i32 - i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i32 - i16); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 - i64); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 - u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i32 - u16); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 - u64); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 - f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 - f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 - f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u32 - b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u32 - i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u32 - i16); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 - i64); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 - u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u32 - u16); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 - u64); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 - f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 - f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 - f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i64 - b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i64 - i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i64 - i16); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 - i32); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 - u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i64 - u16); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 - u32); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 - f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 - f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 - f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u64 - b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u64 - i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u64 - i16); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 - i32); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 - u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u64 - u16); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 - u32); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 - f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 - f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 - f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(f16 - b);   // expected-error{{invalid operands to binary expression}}
+  (void)(f16 - i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f16 - i16); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 - i32); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 - i64); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 - u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f16 - u32); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 - u64); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 - f32); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 - f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(f32 - b);   // expected-error{{invalid operands to binary expression}}
+  (void)(f32 - i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f32 - i16); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 - i32); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 - i64); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 - u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f32 - u16); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 - u64); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 - f16); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 - f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(f64 - b);   // expected-error{{invalid operands to binary expression}}
+  (void)(f64 - i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f64 - i16); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 - i32); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 - i64); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 - u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f64 - u16); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 - u32); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 - f16); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 - f32); // expected-error{{invalid operands to binary expression}}
+}
+
+void mul(svint8_t i8, svint16_t i16, svint32_t i32, svint64_t i64,
+         svuint8_t u8, svuint16_t u16, svuint32_t u32, svuint64_t u64,
+         svfloat16_t f16, svfloat32_t f32, svfloat64_t f64,
+         svbool_t b) {
+  (void)(b * b); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i8 * b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i8 * i16); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 * i32); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 * i64); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 * u16); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 * u32); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 * u64); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 * f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 * f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 * f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u8 * b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u8 * i16); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 * i32); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 * i64); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 * u16); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 * u32); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 * u64); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 * f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 * f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 * f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i16 * b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i16 * i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i16 * i32); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 * i64); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 * u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i16 * u32); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 * u64); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 * f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 * f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 * f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u16 * b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u16 * i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u16 * i32); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 * i64); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 * u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u16 * u32); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 * u64); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 * f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 * f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 * f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i32 * b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i32 * i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i32 * i16); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 * i64); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 * u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i32 * u16); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 * u64); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 * f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 * f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 * f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u32 * b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u32 * i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u32 * i16); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 * i64); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 * u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u32 * u16); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 * u64); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 * f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 * f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 * f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i64 * b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i64 * i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i64 * i16); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 * i32); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 * u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i64 * u16); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 * u32); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 * f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 * f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 * f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u64 * b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u64 * i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u64 * i16); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 * i32); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 * u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u64 * u16); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 * u32); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 * f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 * f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 * f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(f16 * b);   // expected-error{{invalid operands to binary expression}}
+  (void)(f16 * i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f16 * i16); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 * i32); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 * i64); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 * u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f16 * u32); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 * u64); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 * f32); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 * f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(f32 * b);   // expected-error{{invalid operands to binary expression}}
+  (void)(f32 * i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f32 * i16); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 * i32); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 * i64); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 * u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f32 * u16); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 * u64); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 * f16); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 * f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(f64 * b);   // expected-error{{invalid operands to binary expression}}
+  (void)(f64 * i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f64 * i16); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 * i32); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 * i64); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 * u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f64 * u16); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 * u32); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 * f16); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 * f32); // expected-error{{invalid operands to binary expression}}
+}
+
+void div(svint8_t i8, svint16_t i16, svint32_t i32, svint64_t i64,
+         svuint8_t u8, svuint16_t u16, svuint32_t u32, svuint64_t u64,
+         svfloat16_t f16, svfloat32_t f32, svfloat64_t f64,
+         svbool_t b) {
+  (void)(b / b); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i8 / b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i8 / i16); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 / i32); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 / i64); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 / u16); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 / u32); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 / u64); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 / f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 / f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 / f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u8 / b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u8 / i16); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 / i32); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 / i64); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 / u16); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 / u32); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 / u64); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 / f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 / f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 / f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i16 / b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i16 / i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i16 / i32); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 / i64); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 / u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i16 / u32); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 / u64); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 / f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 / f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 / f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u16 / b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u16 / i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u16 / i32); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 / i64); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 / u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u16 / u32); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 / u64); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 / f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 / f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 / f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i32 / b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i32 / i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i32 / i16); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 / i64); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 / u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i32 / u16); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 / u64); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 / f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 / f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 / f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u32 / b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u32 / i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u32 / i16); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 / i64); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 / u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u32 / u16); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 / u64); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 / f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 / f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 / f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i64 / b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i64 / i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i64 / i16); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 / i32); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 / u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i64 / u16); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 / u32); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 / f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 / f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 / f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u64 / b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u64 / i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u64 / i16); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 / i32); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 / u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u64 / u16); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 / u32); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 / f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 / f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 / f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(f16 / b);   // expected-error{{invalid operands to binary expression}}
+  (void)(f16 / i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f16 / i16); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 / i32); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 / i64); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 / u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f16 / u32); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 / u64); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 / f32); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 / f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(f32 / b);   // expected-error{{invalid operands to binary expression}}
+  (void)(f32 / i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f32 / i16); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 / i32); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 / i64); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 / u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f32 / u16); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 / u64); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 / f16); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 / f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(f64 / b);   // expected-error{{invalid operands to binary expression}}
+  (void)(f64 / i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f64 / i16); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 / i32); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 / i64); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 / u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f64 / u16); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 / u32); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 / f16); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 / f32); // expected-error{{invalid operands to binary expression}}
+}
+
+void mod(svint8_t i8, svint16_t i16, svint32_t i32, svint64_t i64,
+         svuint8_t u8, svuint16_t u16, svuint32_t u32, svuint64_t u64,
+         svfloat16_t f16, svfloat32_t f32, svfloat64_t f64,
+         svbool_t b) {
+  (void)(b % b); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i8 % b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i8 % i16); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 % i32); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 % i64); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 % u16); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 % u32); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 % u64); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 % f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 % f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i8 % f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u8 % b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u8 % i16); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 % i32); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 % i64); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 % u16); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 % u32); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 % u64); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 % f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 % f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u8 % f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i16 % b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i16 % i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i16 % i32); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 % i64); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 % u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i16 % u32); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 % u64); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 % f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 % f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i16 % f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u16 % b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u16 % i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u16 % i32); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 % i64); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 % u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u16 % u32); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 % u64); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 % f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 % f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u16 % f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i32 % b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i32 % i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i32 % i16); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 % i64); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 % u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i32 % u16); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 % u64); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 % f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 % f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i32 % f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u32 % b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u32 % i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u32 % i16); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 % i64); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 % u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u32 % u16); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 % u64); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 % f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 % f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u32 % f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(i64 % b);   // expected-error{{invalid operands to binary expression}}
+  (void)(i64 % i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i64 % i16); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 % i32); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 % u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(i64 % u16); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 % u32); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 % f16); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 % f32); // expected-error{{invalid operands to binary expression}}
+  (void)(i64 % f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(u64 % b);   // expected-error{{invalid operands to binary expression}}
+  (void)(u64 % i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u64 % i16); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 % i32); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 % u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(u64 % u16); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 % u32); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 % f16); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 % f32); // expected-error{{invalid operands to binary expression}}
+  (void)(u64 % f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(f16 % b);   // expected-error{{invalid operands to binary expression}}
+  (void)(f16 % i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f16 % i16); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 % i32); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 % i64); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 % u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f16 % u32); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 % u64); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 % f32); // expected-error{{invalid operands to binary expression}}
+  (void)(f16 % f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(f32 % b);   // expected-error{{invalid operands to binary expression}}
+  (void)(f32 % i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f32 % i16); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 % i32); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 % i64); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 % u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f32 % u16); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 % u64); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 % f16); // expected-error{{invalid operands to binary expression}}
+  (void)(f32 % f64); // expected-error{{invalid operands to binary expression}}
+
+  (void)(f64 % b);   // expected-error{{invalid operands to binary expression}}
+  (void)(f64 % i8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f64 % i16); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 % i32); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 % i64); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 % u8);  // expected-error{{invalid operands to binary expression}}
+  (void)(f64 % u16); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 % u32); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 % f16); // expected-error{{invalid operands to binary expression}}
+  (void)(f64 % f32); // expected-error{{invalid operands to binary expression}}
+}

diff  --git a/clang/test/Sema/sizeless-1.c b/clang/test/Sema/sizeless-1.c
index 8018a0753b3bc..e7e374d099b47 100644
--- a/clang/test/Sema/sizeless-1.c
+++ b/clang/test/Sema/sizeless-1.c
@@ -199,11 +199,6 @@ void func(int sel) {
   __real init_int8; // expected-error {{invalid type 'svint8_t'}}
   __imag init_int8; // expected-error {{invalid type 'svint8_t'}}
 
-  local_int8 + init_int8;  // expected-error {{invalid operands to binary expression}}
-  local_int8 - init_int8;  // expected-error {{invalid operands to binary expression}}
-  local_int8 *init_int8;   // expected-error {{invalid operands to binary expression}}
-  local_int8 / init_int8;  // expected-error {{invalid operands to binary expression}}
-  local_int8 % init_int8;  // expected-error {{invalid operands to binary expression}}
   local_int8 &init_int8;   // expected-error {{invalid operands to binary expression}}
   local_int8 | init_int8;  // expected-error {{invalid operands to binary expression}}
   local_int8 ^ init_int8;  // expected-error {{invalid operands to binary expression}}
@@ -218,11 +213,6 @@ void func(int sel) {
   local_int8 &&init_int8;  // expected-error {{invalid operands to binary expression}}
   local_int8 || init_int8; // expected-error {{invalid operands to binary expression}}
 
-  local_int8 += init_int8;  // expected-error {{invalid operands to binary expression}}
-  local_int8 -= init_int8;  // expected-error {{invalid operands to binary expression}}
-  local_int8 *= init_int8;  // expected-error {{invalid operands to binary expression}}
-  local_int8 /= init_int8;  // expected-error {{invalid operands to binary expression}}
-  local_int8 %= init_int8;  // expected-error {{invalid operands to binary expression}}
   local_int8 &= init_int8;  // expected-error {{invalid operands to binary expression}}
   local_int8 |= init_int8;  // expected-error {{invalid operands to binary expression}}
   local_int8 ^= init_int8;  // expected-error {{invalid operands to binary expression}}

diff  --git a/clang/test/SemaCXX/sizeless-1.cpp b/clang/test/SemaCXX/sizeless-1.cpp
index 026c610a60e17..f4d020b9ab515 100644
--- a/clang/test/SemaCXX/sizeless-1.cpp
+++ b/clang/test/SemaCXX/sizeless-1.cpp
@@ -211,11 +211,6 @@ void func(int sel) {
   __real init_int8; // expected-error {{invalid type 'svint8_t'}}
   __imag init_int8; // expected-error {{invalid type 'svint8_t'}}
 
-  local_int8 + init_int8;  // expected-error {{invalid operands to binary expression}}
-  local_int8 - init_int8;  // expected-error {{invalid operands to binary expression}}
-  local_int8 *init_int8;   // expected-error {{invalid operands to binary expression}}
-  local_int8 / init_int8;  // expected-error {{invalid operands to binary expression}}
-  local_int8 % init_int8;  // expected-error {{invalid operands to binary expression}}
   local_int8 &init_int8;   // expected-error {{invalid operands to binary expression}}
   local_int8 | init_int8;  // expected-error {{invalid operands to binary expression}}
   local_int8 ^ init_int8;  // expected-error {{invalid operands to binary expression}}
@@ -230,11 +225,6 @@ void func(int sel) {
   local_int8 &&init_int8;  // expected-error {{invalid operands to binary expression}} expected-error {{not contextually convertible}}
   local_int8 || init_int8; // expected-error {{invalid operands to binary expression}} expected-error {{not contextually convertible}}
 
-  local_int8 += init_int8;  // expected-error {{invalid operands to binary expression}}
-  local_int8 -= init_int8;  // expected-error {{invalid operands to binary expression}}
-  local_int8 *= init_int8;  // expected-error {{invalid operands to binary expression}}
-  local_int8 /= init_int8;  // expected-error {{invalid operands to binary expression}}
-  local_int8 %= init_int8;  // expected-error {{invalid operands to binary expression}}
   local_int8 &= init_int8;  // expected-error {{invalid operands to binary expression}}
   local_int8 |= init_int8;  // expected-error {{invalid operands to binary expression}}
   local_int8 ^= init_int8;  // expected-error {{invalid operands to binary expression}}


        


More information about the cfe-commits mailing list