[clang] f47e7e4 - [clang][SVE] Add support for bitwise operators on SVE types
David Truby via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 18 07:07:00 PDT 2022
Author: David Truby
Date: 2022-03-18T14:06:47Z
New Revision: f47e7e4a3480707f124db9622001d3a05a777d5d
URL: https://github.com/llvm/llvm-project/commit/f47e7e4a3480707f124db9622001d3a05a777d5d
DIFF: https://github.com/llvm/llvm-project/commit/f47e7e4a3480707f124db9622001d3a05a777d5d.diff
LOG: [clang][SVE] Add support for bitwise operators on SVE types
This patch implements support for the &, |, ^, and ~ operators on sizeless SVE
types.
Differential Revision: https://reviews.llvm.org/D121119
Added:
clang/test/CodeGen/aarch64-sve-vector-arith-ops.c
clang/test/CodeGen/aarch64-sve-vector-bitwise-ops.c
clang/test/Sema/aarch64-sve-vector-arith-ops.c
clang/test/Sema/aarch64-sve-vector-bitwise-ops.c
Modified:
clang/include/clang/Sema/Sema.h
clang/lib/AST/Type.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/Sema/attr-arm-sve-vector-bits.c
clang/test/Sema/sizeless-1.c
clang/test/SemaCXX/sizeless-1.cpp
Removed:
clang/test/CodeGen/aarch64-sve-vector-ops.c
clang/test/Sema/aarch64-sve-vector-ops.c
################################################################################
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index fe8a1f371fe74..32a8ffdc8df92 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -11948,7 +11948,8 @@ class Sema final {
// type checking for sizeless vector binary operators.
QualType CheckSizelessVectorOperands(ExprResult &LHS, ExprResult &RHS,
- SourceLocation Loc);
+ SourceLocation Loc,
+ ArithConvKind OperationKind);
/// Type checking for matrix binary operators.
QualType CheckMatrixElementwiseOperands(ExprResult &LHS, ExprResult &RHS,
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index 08a95669ac9fd..1803fe12d69c8 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -1899,8 +1899,14 @@ bool Type::hasAutoForTrailingReturnType() const {
bool Type::hasIntegerRepresentation() const {
if (const auto *VT = dyn_cast<VectorType>(CanonicalType))
return VT->getElementType()->isIntegerType();
- else
- return isIntegerType();
+ if (CanonicalType->isVLSTBuiltinType()) {
+ const auto *VT = cast<BuiltinType>(CanonicalType);
+ return VT->getKind() == BuiltinType::SveBool ||
+ (VT->getKind() >= BuiltinType::SveInt8 &&
+ VT->getKind() <= BuiltinType::SveUint64);
+ }
+
+ return isIntegerType();
}
/// Determine whether this type is an integral type.
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 635721b4cc3b3..be90c58e066d8 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -10464,7 +10464,8 @@ QualType Sema::CheckVectorOperands(ExprResult &LHS, ExprResult &RHS,
}
QualType Sema::CheckSizelessVectorOperands(ExprResult &LHS, ExprResult &RHS,
- SourceLocation Loc) {
+ SourceLocation Loc,
+ ArithConvKind OperationKind) {
QualType LHSType = LHS.get()->getType().getUnqualifiedType();
QualType RHSType = RHS.get()->getType().getUnqualifiedType();
@@ -10472,7 +10473,8 @@ QualType Sema::CheckSizelessVectorOperands(ExprResult &LHS, ExprResult &RHS,
const BuiltinType *RHSVecType = RHSType->getAs<BuiltinType>();
unsigned DiagID = diag::err_typecheck_invalid_operands;
- if (LHSVecType->isSVEBool() || RHSVecType->isSVEBool()) {
+ if ((OperationKind == ACK_Arithmetic) &&
+ (LHSVecType->isSVEBool() || RHSVecType->isSVEBool())) {
Diag(Loc, DiagID) << LHSType << RHSType << LHS.get()->getSourceRange()
<< RHS.get()->getSourceRange();
return QualType();
@@ -10600,7 +10602,7 @@ QualType Sema::CheckMultiplyDivideOperands(ExprResult &LHS, ExprResult &RHS,
/*AllowBooleanOperation*/ false,
/*ReportInvalid*/ true);
if (LHSTy->isVLSTBuiltinType() || RHSTy->isVLSTBuiltinType())
- return CheckSizelessVectorOperands(LHS, RHS, Loc);
+ return CheckSizelessVectorOperands(LHS, RHS, Loc, ACK_Arithmetic);
if (!IsDiv &&
(LHSTy->isConstantMatrixType() || RHSTy->isConstantMatrixType()))
return CheckMatrixMultiplyOperands(LHS, RHS, Loc, IsCompAssign);
@@ -10650,7 +10652,7 @@ QualType Sema::CheckRemainderOperands(
->getType()
->getSveEltType(Context)
->hasIntegerRepresentation())
- return CheckSizelessVectorOperands(LHS, RHS, Loc);
+ return CheckSizelessVectorOperands(LHS, RHS, Loc, ACK_Arithmetic);
return InvalidOperands(Loc, LHS, RHS);
}
@@ -10964,7 +10966,8 @@ QualType Sema::CheckAdditionOperands(ExprResult &LHS, ExprResult &RHS,
if (LHS.get()->getType()->isVLSTBuiltinType() ||
RHS.get()->getType()->isVLSTBuiltinType()) {
- QualType compType = CheckSizelessVectorOperands(LHS, RHS, Loc);
+ QualType compType =
+ CheckSizelessVectorOperands(LHS, RHS, Loc, ACK_Arithmetic);
if (CompLHSTy)
*CompLHSTy = compType;
return compType;
@@ -11078,7 +11081,8 @@ QualType Sema::CheckSubtractionOperands(ExprResult &LHS, ExprResult &RHS,
if (LHS.get()->getType()->isVLSTBuiltinType() ||
RHS.get()->getType()->isVLSTBuiltinType()) {
- QualType compType = CheckSizelessVectorOperands(LHS, RHS, Loc);
+ QualType compType =
+ CheckSizelessVectorOperands(LHS, RHS, Loc, ACK_Arithmetic);
if (CompLHSTy)
*CompLHSTy = compType;
return compType;
@@ -11417,6 +11421,10 @@ QualType Sema::CheckShiftOperands(ExprResult &LHS, ExprResult &RHS,
return checkVectorShift(*this, LHS, RHS, Loc, IsCompAssign);
}
+ if (LHS.get()->getType()->isVLSTBuiltinType() ||
+ RHS.get()->getType()->isVLSTBuiltinType())
+ return InvalidOperands(Loc, LHS, RHS);
+
// Shifts don't perform usual arithmetic conversions, they just do integer
// promotions on each operand. C99 6.5.7p3
@@ -12885,6 +12893,14 @@ inline QualType Sema::CheckBitwiseOperands(ExprResult &LHS, ExprResult &RHS,
return InvalidOperands(Loc, LHS, RHS);
}
+ if (LHS.get()->getType()->isVLSTBuiltinType() ||
+ RHS.get()->getType()->isVLSTBuiltinType()) {
+ if (LHS.get()->getType()->hasIntegerRepresentation() &&
+ RHS.get()->getType()->hasIntegerRepresentation())
+ return CheckSizelessVectorOperands(LHS, RHS, Loc, ACK_BitwiseOp);
+ return InvalidOperands(Loc, LHS, RHS);
+ }
+
if (Opc == BO_And)
diagnoseLogicalNotOnLHSofCheck(*this, LHS, RHS, Loc, Opc);
diff --git a/clang/test/CodeGen/aarch64-sve-vector-ops.c b/clang/test/CodeGen/aarch64-sve-vector-arith-ops.c
similarity index 100%
rename from clang/test/CodeGen/aarch64-sve-vector-ops.c
rename to clang/test/CodeGen/aarch64-sve-vector-arith-ops.c
diff --git a/clang/test/CodeGen/aarch64-sve-vector-bitwise-ops.c b/clang/test/CodeGen/aarch64-sve-vector-bitwise-ops.c
new file mode 100644
index 0000000000000..996f92ebb8fb4
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve-vector-bitwise-ops.c
@@ -0,0 +1,340 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve \
+// RUN: -fallow-half-arguments-and-returns -disable-O0-optnone \
+// RUN: -emit-llvm -o - %s | opt -S -sroa | FileCheck %s
+
+// REQUIRES: aarch64-registered-target
+
+#include <arm_sve.h>
+
+// AND
+
+// CHECK-LABEL: @and_bool(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[AND:%.*]] = and <vscale x 16 x i1> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 16 x i1> [[AND]]
+//
+svbool_t and_bool(svbool_t a, svbool_t b) {
+ return a & b;
+}
+
+// CHECK-LABEL: @and_i8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[AND:%.*]] = and <vscale x 16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 16 x i8> [[AND]]
+//
+svint8_t and_i8(svint8_t a, svint8_t b) {
+ return a & b;
+}
+
+// CHECK-LABEL: @and_i16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[AND:%.*]] = and <vscale x 8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 8 x i16> [[AND]]
+//
+svint16_t and_i16(svint16_t a, svint16_t b) {
+ return a & b;
+}
+
+// CHECK-LABEL: @and_i32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[AND:%.*]] = and <vscale x 4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 4 x i32> [[AND]]
+//
+svint32_t and_i32(svint32_t a, svint32_t b) {
+ return a & b;
+}
+
+// CHECK-LABEL: @and_i64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[AND:%.*]] = and <vscale x 2 x i64> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 2 x i64> [[AND]]
+//
+svint64_t and_i64(svint64_t a, svint64_t b) {
+ return a & b;
+}
+
+// CHECK-LABEL: @and_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[AND:%.*]] = and <vscale x 16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 16 x i8> [[AND]]
+//
+svuint8_t and_u8(svuint8_t a, svuint8_t b) {
+ return a & b;
+}
+
+// CHECK-LABEL: @and_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[AND:%.*]] = and <vscale x 8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 8 x i16> [[AND]]
+//
+svuint16_t and_u16(svuint16_t a, svuint16_t b) {
+ return a & b;
+}
+
+// CHECK-LABEL: @and_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[AND:%.*]] = and <vscale x 4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 4 x i32> [[AND]]
+//
+svuint32_t and_u32(svuint32_t a, svuint32_t b) {
+ return a & b;
+}
+
+// CHECK-LABEL: @and_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[AND:%.*]] = and <vscale x 2 x i64> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 2 x i64> [[AND]]
+//
+svuint64_t and_u64(svuint64_t a, svuint64_t b) {
+ return a & b;
+}
+
+// OR
+
+// CHECK-LABEL: @or_bool(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[OR:%.*]] = or <vscale x 16 x i1> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 16 x i1> [[OR]]
+//
+svbool_t or_bool(svbool_t a, svbool_t b) {
+ return a | b;
+}
+
+// CHECK-LABEL: @or_i8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[OR:%.*]] = or <vscale x 16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 16 x i8> [[OR]]
+//
+svint8_t or_i8(svint8_t a, svint8_t b) {
+ return a | b;
+}
+
+// CHECK-LABEL: @or_i16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[OR:%.*]] = or <vscale x 8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 8 x i16> [[OR]]
+//
+svint16_t or_i16(svint16_t a, svint16_t b) {
+ return a | b;
+}
+
+// CHECK-LABEL: @or_i32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[OR:%.*]] = or <vscale x 4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 4 x i32> [[OR]]
+//
+svint32_t or_i32(svint32_t a, svint32_t b) {
+ return a | b;
+}
+
+// CHECK-LABEL: @or_i64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[OR:%.*]] = or <vscale x 2 x i64> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 2 x i64> [[OR]]
+//
+svint64_t or_i64(svint64_t a, svint64_t b) {
+ return a | b;
+}
+
+// CHECK-LABEL: @or_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[OR:%.*]] = or <vscale x 16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 16 x i8> [[OR]]
+//
+svuint8_t or_u8(svuint8_t a, svuint8_t b) {
+ return a | b;
+}
+
+// CHECK-LABEL: @or_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[OR:%.*]] = or <vscale x 8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 8 x i16> [[OR]]
+//
+svuint16_t or_u16(svuint16_t a, svuint16_t b) {
+ return a | b;
+}
+
+// CHECK-LABEL: @or_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[OR:%.*]] = or <vscale x 4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 4 x i32> [[OR]]
+//
+svuint32_t or_u32(svuint32_t a, svuint32_t b) {
+ return a | b;
+}
+
+// CHECK-LABEL: @or_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[OR:%.*]] = or <vscale x 2 x i64> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 2 x i64> [[OR]]
+//
+svuint64_t or_u64(svuint64_t a, svuint64_t b) {
+ return a | b;
+}
+
+// XOR
+
+// CHECK-LABEL: @xor_bool(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[XOR:%.*]] = xor <vscale x 16 x i1> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 16 x i1> [[XOR]]
+//
+svbool_t xor_bool(svbool_t a, svbool_t b) {
+ return a ^ b;
+}
+
+// CHECK-LABEL: @xor_i8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[XOR:%.*]] = xor <vscale x 16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 16 x i8> [[XOR]]
+//
+svint8_t xor_i8(svint8_t a, svint8_t b) {
+ return a ^ b;
+}
+
+// CHECK-LABEL: @xor_i16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[XOR:%.*]] = xor <vscale x 8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 8 x i16> [[XOR]]
+//
+svint16_t xor_i16(svint16_t a, svint16_t b) {
+ return a ^ b;
+}
+
+// CHECK-LABEL: @xor_i32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[XOR:%.*]] = xor <vscale x 4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 4 x i32> [[XOR]]
+//
+svint32_t xor_i32(svint32_t a, svint32_t b) {
+ return a ^ b;
+}
+
+// CHECK-LABEL: @xor_i64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[XOR:%.*]] = xor <vscale x 2 x i64> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 2 x i64> [[XOR]]
+//
+svint64_t xor_i64(svint64_t a, svint64_t b) {
+ return a ^ b;
+}
+
+// CHECK-LABEL: @xor_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[XOR:%.*]] = xor <vscale x 16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 16 x i8> [[XOR]]
+//
+svuint8_t xor_u8(svuint8_t a, svuint8_t b) {
+ return a ^ b;
+}
+
+// CHECK-LABEL: @xor_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[XOR:%.*]] = xor <vscale x 8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 8 x i16> [[XOR]]
+//
+svuint16_t xor_u16(svuint16_t a, svuint16_t b) {
+ return a ^ b;
+}
+
+// CHECK-LABEL: @xor_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[XOR:%.*]] = xor <vscale x 4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 4 x i32> [[XOR]]
+//
+svuint32_t xor_u32(svuint32_t a, svuint32_t b) {
+ return a ^ b;
+}
+
+// CHECK-LABEL: @xor_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[XOR:%.*]] = xor <vscale x 2 x i64> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <vscale x 2 x i64> [[XOR]]
+//
+svuint64_t xor_u64(svuint64_t a, svuint64_t b) {
+ return a ^ b;
+}
+
+// NEG
+
+// CHECK-LABEL: @neg_bool(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 16 x i1> [[A:%.*]], shufflevector (<vscale x 16 x i1> insertelement (<vscale x 16 x i1> poison, i1 true, i32 0), <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer)
+// CHECK-NEXT: ret <vscale x 16 x i1> [[NEG]]
+//
+svbool_t neg_bool(svbool_t a) {
+ return ~a;
+}
+
+// CHECK-LABEL: @neg_i8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 16 x i8> [[A:%.*]], shufflevector (<vscale x 16 x i8> insertelement (<vscale x 16 x i8> poison, i8 -1, i32 0), <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer)
+// CHECK-NEXT: ret <vscale x 16 x i8> [[NEG]]
+//
+svint8_t neg_i8(svint8_t a) {
+ return ~a;
+}
+
+// CHECK-LABEL: @neg_i16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 8 x i16> [[A:%.*]], shufflevector (<vscale x 8 x i16> insertelement (<vscale x 8 x i16> poison, i16 -1, i32 0), <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer)
+// CHECK-NEXT: ret <vscale x 8 x i16> [[NEG]]
+//
+svint16_t neg_i16(svint16_t a) {
+ return ~a;
+}
+
+// CHECK-LABEL: @neg_i32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 4 x i32> [[A:%.*]], shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32 -1, i32 0), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
+// CHECK-NEXT: ret <vscale x 4 x i32> [[NEG]]
+//
+svint32_t neg_i32(svint32_t a) {
+ return ~a;
+}
+
+// CHECK-LABEL: @neg_i64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 2 x i64> [[A:%.*]], shufflevector (<vscale x 2 x i64> insertelement (<vscale x 2 x i64> poison, i64 -1, i32 0), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
+// CHECK-NEXT: ret <vscale x 2 x i64> [[NEG]]
+//
+svint64_t neg_i64(svint64_t a) {
+ return ~a;
+}
+
+// CHECK-LABEL: @neg_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 16 x i8> [[A:%.*]], shufflevector (<vscale x 16 x i8> insertelement (<vscale x 16 x i8> poison, i8 -1, i32 0), <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer)
+// CHECK-NEXT: ret <vscale x 16 x i8> [[NEG]]
+//
+svuint8_t neg_u8(svuint8_t a) {
+ return ~a;
+}
+
+// CHECK-LABEL: @neg_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 8 x i16> [[A:%.*]], shufflevector (<vscale x 8 x i16> insertelement (<vscale x 8 x i16> poison, i16 -1, i32 0), <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer)
+// CHECK-NEXT: ret <vscale x 8 x i16> [[NEG]]
+//
+svuint16_t neg_u16(svuint16_t a) {
+ return ~a;
+}
+
+// CHECK-LABEL: @neg_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 4 x i32> [[A:%.*]], shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32 -1, i32 0), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
+// CHECK-NEXT: ret <vscale x 4 x i32> [[NEG]]
+//
+svuint32_t neg_u32(svuint32_t a) {
+ return ~a;
+}
+
+// CHECK-LABEL: @neg_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[NEG:%.*]] = xor <vscale x 2 x i64> [[A:%.*]], shufflevector (<vscale x 2 x i64> insertelement (<vscale x 2 x i64> poison, i64 -1, i32 0), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
+// CHECK-NEXT: ret <vscale x 2 x i64> [[NEG]]
+//
+svuint64_t neg_u64(svuint64_t a) {
+ return ~a;
+}
diff --git a/clang/test/Sema/aarch64-sve-vector-ops.c b/clang/test/Sema/aarch64-sve-vector-arith-ops.c
similarity index 100%
rename from clang/test/Sema/aarch64-sve-vector-ops.c
rename to clang/test/Sema/aarch64-sve-vector-arith-ops.c
diff --git a/clang/test/Sema/aarch64-sve-vector-bitwise-ops.c b/clang/test/Sema/aarch64-sve-vector-bitwise-ops.c
new file mode 100644
index 0000000000000..d1afd116a7758
--- /dev/null
+++ b/clang/test/Sema/aarch64-sve-vector-bitwise-ops.c
@@ -0,0 +1,394 @@
+// 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 and (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)(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 & f32); // 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)(f64 & f64); // expected-error{{invalid operands to binary expression}}
+}
+
+void or (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)(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 | f16); // 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 | f32); // 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)(f64 | f64); // expected-error{{invalid operands to binary expression}}
+}
+
+void xor (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)(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 ^ f16); // 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 ^ f32); // 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)(f64 ^ f64); // expected-error{{invalid operands to binary expression}}
+}
+
+ void not(svfloat16_t f16, svfloat32_t f32, svfloat32_t f64) {
+ (void)(~f16); // expected-error{{invalid argument type}}
+ (void)(~f32); // expected-error{{invalid argument type}}
+ (void)(~f64); // expected-error{{invalid argument type}}
+}
diff --git a/clang/test/Sema/attr-arm-sve-vector-bits.c b/clang/test/Sema/attr-arm-sve-vector-bits.c
index 8ae65c926899e..33d9798707d2b 100644
--- a/clang/test/Sema/attr-arm-sve-vector-bits.c
+++ b/clang/test/Sema/attr-arm-sve-vector-bits.c
@@ -165,13 +165,13 @@ void f(int c) {
gs8 = gs8 == ss8; // expected-error {{cannot combine GNU and SVE vectors in expression, result is ambiguous}}
gs8 = gs8 == fs8; // expected-error {{cannot combine GNU and SVE vectors in expression, result is ambiguous}}
- ss8 = ss8 & fs8; // expected-error {{invalid operands to binary expression}}
- ss8 = ss8 & gs8; // expected-error {{invalid operands to binary expression}}
+ ss8 = ss8 & fs8; // expected-error {{cannot combine fixed-length and sizeless SVE vectors in expression, result is ambiguous}}
+ ss8 = ss8 & gs8; // expected-error {{cannot combine GNU and SVE vectors in expression, result is ambiguous}}
- fs8 = fs8 & ss8; // expected-error {{invalid operands to binary expression}}
+ fs8 = fs8 & ss8; // expected-error {{cannot combine fixed-length and sizeless SVE vectors in expression, result is ambiguous}}
fs8 = fs8 & gs8; // expected-error {{cannot combine GNU and SVE vectors in expression, result is ambiguous}}
- gs8 = gs8 & ss8; // expected-error {{invalid operands to binary expression}}
+ gs8 = gs8 & ss8; // expected-error {{cannot combine GNU and SVE vectors in expression, result is ambiguous}}
gs8 = gs8 & fs8; // expected-error {{cannot combine GNU and SVE vectors in expression, result is ambiguous}}
}
diff --git a/clang/test/Sema/sizeless-1.c b/clang/test/Sema/sizeless-1.c
index e7e374d099b47..1bf344e2bf0b2 100644
--- a/clang/test/Sema/sizeless-1.c
+++ b/clang/test/Sema/sizeless-1.c
@@ -193,15 +193,11 @@ void func(int sel) {
-init_int8; // expected-error {{invalid argument type 'svint8_t'}}
--init_int8; // expected-error {{cannot decrement value of type 'svint8_t'}}
init_int8--; // expected-error {{cannot decrement value of type 'svint8_t'}}
- ~init_int8; // expected-error {{invalid argument type 'svint8_t'}}
!init_int8; // expected-error {{invalid argument type 'svint8_t'}}
*init_int8; // expected-error {{indirection requires pointer operand}}
__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}}
@@ -213,9 +209,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}}
diff --git a/clang/test/SemaCXX/sizeless-1.cpp b/clang/test/SemaCXX/sizeless-1.cpp
index f4d020b9ab515..d7684c08641d4 100644
--- a/clang/test/SemaCXX/sizeless-1.cpp
+++ b/clang/test/SemaCXX/sizeless-1.cpp
@@ -205,15 +205,11 @@ void func(int sel) {
-init_int8; // expected-error {{invalid argument type 'svint8_t'}}
--init_int8; // expected-error {{cannot decrement value of type 'svint8_t'}}
init_int8--; // expected-error {{cannot decrement value of type 'svint8_t'}}
- ~init_int8; // expected-error {{invalid argument type 'svint8_t'}}
!init_int8; // expected-error {{invalid argument type 'svint8_t'}}
*init_int8; // expected-error {{indirection requires pointer operand}}
__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}}
@@ -225,9 +221,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}}
More information about the cfe-commits
mailing list