diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h --- a/clang/include/clang/Sema/Sema.h +++ b/clang/include/clang/Sema/Sema.h @@ -11976,9 +11976,13 @@ bool AllowBothBool, bool AllowBoolConversion, bool AllowBoolOperation, bool ReportInvalid); QualType GetSignedVectorType(QualType V); + QualType GetSignedSizelessVectorType(QualType V); QualType CheckVectorCompareOperands(ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc); + QualType CheckSizelessVectorCompareOperands(ExprResult &LHS, ExprResult &RHS, + SourceLocation Loc, + BinaryOperatorKind Opc); QualType CheckVectorLogicalOperands(ExprResult &LHS, ExprResult &RHS, SourceLocation Loc); diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -1390,8 +1390,8 @@ if (isa(SrcTy) || isa(DstTy)) { // Allow bitcast from vector to integer/fp of the same size. - unsigned SrcSize = SrcTy->getPrimitiveSizeInBits(); - unsigned DstSize = DstTy->getPrimitiveSizeInBits(); + llvm::TypeSize SrcSize = SrcTy->getPrimitiveSizeInBits(); + llvm::TypeSize DstSize = DstTy->getPrimitiveSizeInBits(); if (SrcSize == DstSize) return Builder.CreateBitCast(Src, DstTy, "conv"); diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -50,8 +50,10 @@ #include "clang/Sema/Template.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/Support/Casting.h" #include "llvm/Support/ConvertUTF.h" #include "llvm/Support/SaveAndRestore.h" +#include "llvm/Support/TypeSize.h" using namespace clang; using namespace sema; @@ -12153,6 +12155,10 @@ RHS.get()->getType()->isVectorType()) return CheckVectorCompareOperands(LHS, RHS, Loc, Opc); + if (LHS.get()->getType()->isVLSTBuiltinType() || + RHS.get()->getType()->isVLSTBuiltinType()) + return CheckSizelessVectorCompareOperands(LHS, RHS, Loc, Opc); + diagnoseLogicalNotOnLHSofCheck(*this, LHS, RHS, Loc, Opc); diagnoseTautologicalComparison(*this, Loc, LHS.get(), RHS.get(), Opc); @@ -12614,6 +12620,18 @@ VectorType::GenericVector); } +QualType Sema::GetSignedSizelessVectorType(QualType V) { + const BuiltinType *VTy = V->castAs(); + assert(VTy->isSizelessBuiltinType() && "expected sizeless type"); + + const QualType ETy = V->getSveEltType(Context); + const auto TypeSize = Context.getTypeSize(ETy); + + const QualType IntTy = Context.getIntTypeForBitwidth(TypeSize, true); + const llvm::ElementCount VecSize = Context.getBuiltinVectorTypeInfo(VTy).EC; + return Context.getScalableVectorType(IntTy, VecSize.getKnownMinValue()); +} + /// CheckVectorCompareOperands - vector comparisons are a clang extension that /// operates on extended vector types. Instead of producing an IntTy result, /// like a scalar comparison, a vector comparison produces a vector of integer @@ -12680,6 +12698,48 @@ return GetSignedVectorType(vType); } +QualType Sema::CheckSizelessVectorCompareOperands(ExprResult &LHS, + ExprResult &RHS, + SourceLocation Loc, + BinaryOperatorKind Opc) { + if (Opc == BO_Cmp) { + Diag(Loc, diag::err_three_way_vector_comparison); + return QualType(); + } + + // Check to make sure we're operating on vectors of the same type and width, + // Allowing one side to be a scalar of element type. + QualType vType = CheckSizelessVectorOperands( + LHS, RHS, Loc, /*isCompAssign*/ false, ACK_Comparison); + + if (vType.isNull()) + return vType; + + QualType LHSType = LHS.get()->getType(); + + // For non-floating point types, check for self-comparisons of the form + // x == x, x != x, x < x, etc. These always evaluate to a constant, and + // often indicate logic errors in the program. + diagnoseTautologicalComparison(*this, Loc, LHS.get(), RHS.get(), Opc); + + // Check for comparisons of floating point operands using != and ==. + if (BinaryOperator::isEqualityOp(Opc) && + LHSType->hasFloatingRepresentation()) { + assert(RHS.get()->getType()->hasFloatingRepresentation()); + CheckFloatComparison(Loc, LHS.get(), RHS.get(), Opc); + } + + const BuiltinType *LHSBuiltinTy = LHSType->getAs(); + const BuiltinType *RHSBuiltinTy = RHS.get()->getType()->getAs(); + + if (LHSBuiltinTy && RHSBuiltinTy && LHSBuiltinTy->isSVEBool() && + RHSBuiltinTy->isSVEBool()) + return LHSType; + + // Return a signed type for the vector. + return GetSignedSizelessVectorType(vType); +} + static void diagnoseXorMisusedAsPow(Sema &S, const ExprResult &XorLHS, const ExprResult &XorRHS, const SourceLocation Loc) { @@ -12986,7 +13046,8 @@ SourceLocation Loc, BinaryOperatorKind Opc) { // Check vector operands differently. - if (LHS.get()->getType()->isVectorType() || RHS.get()->getType()->isVectorType()) + if (LHS.get()->getType()->isVectorType() || + RHS.get()->getType()->isVectorType()) return CheckVectorLogicalOperands(LHS, RHS, Loc); bool EnumConstantInBoolContext = false; @@ -13020,14 +13081,13 @@ !RHS.get()->getExprLoc().isMacroID()) || (Result != 0 && Result != 1)) { Diag(Loc, diag::warn_logical_instead_of_bitwise) - << RHS.get()->getSourceRange() - << (Opc == BO_LAnd ? "&&" : "||"); + << RHS.get()->getSourceRange() << (Opc == BO_LAnd ? "&&" : "||"); // Suggest replacing the logical operator with the bitwise version Diag(Loc, diag::note_logical_instead_of_bitwise_change_operator) << (Opc == BO_LAnd ? "&" : "|") - << FixItHint::CreateReplacement(SourceRange( - Loc, getLocForEndOfToken(Loc)), - Opc == BO_LAnd ? "&" : "|"); + << FixItHint::CreateReplacement( + SourceRange(Loc, getLocForEndOfToken(Loc)), + Opc == BO_LAnd ? "&" : "|"); if (Opc == BO_LAnd) // Suggest replacing "Foo() && kNonZero" with "Foo()" Diag(Loc, diag::note_logical_instead_of_bitwise_remove_constant) diff --git a/clang/test/CodeGen/aarch64-sve-vector-compare-ops.c b/clang/test/CodeGen/aarch64-sve-vector-compare-ops.c new file mode 100644 --- /dev/null +++ b/clang/test/CodeGen/aarch64-sve-vector-compare-ops.c @@ -0,0 +1,734 @@ +// 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 + +// EQ + +// CHECK-LABEL: @eq_bool( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp eq [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: ret [[CMP]] +// +svbool_t eq_bool(svbool_t a, svbool_t b) { + return a == b; +} + +// CHECK-LABEL: @eq_i8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp eq [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint8_t eq_i8(svint8_t a, svint8_t b) { + return a == b; +} + +// CHECK-LABEL: @eq_i16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp eq [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint16_t eq_i16(svint16_t a, svint16_t b) { + return a == b; +} + +// CHECK-LABEL: @eq_i32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp eq [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint32_t eq_i32(svint32_t a, svint32_t b) { + return a == b; +} + +// CHECK-LABEL: @eq_i64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp eq [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint64_t eq_i64(svint64_t a, svint64_t b) { + return a == b; +} + +// CHECK-LABEL: @eq_u8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp eq [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint8_t eq_u8(svuint8_t a, svuint8_t b) { + return a == b; +} + +// CHECK-LABEL: @eq_u16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp eq [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint16_t eq_u16(svuint16_t a, svuint16_t b) { + return a == b; +} + +// CHECK-LABEL: @eq_u32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp eq [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint32_t eq_u32(svuint32_t a, svuint32_t b) { + return a == b; +} + +// CHECK-LABEL: @eq_u64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp eq [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint64_t eq_u64(svuint64_t a, svuint64_t b) { + return a == b; +} + +// CHECK-LABEL: @eq_f16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = fcmp oeq [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint16_t eq_f16(svfloat16_t a, svfloat16_t b) { + return a == b; +} + +// CHECK-LABEL: @eq_f32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = fcmp oeq [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint32_t eq_f32(svfloat32_t a, svfloat32_t b) { + return a == b; +} + +// CHECK-LABEL: @eq_f64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = fcmp oeq [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint64_t eq_f64(svfloat64_t a, svfloat64_t b) { + return a == b; +} + +// NEQ + +// CHECK-LABEL: @neq_bool( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ne [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: ret [[CMP]] +// +svbool_t neq_bool(svbool_t a, svbool_t b) { + return a != b; +} + +// CHECK-LABEL: @neq_i8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ne [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint8_t neq_i8(svint8_t a, svint8_t b) { + return a != b; +} + +// CHECK-LABEL: @neq_i16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ne [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint16_t neq_i16(svint16_t a, svint16_t b) { + return a != b; +} + +// CHECK-LABEL: @neq_i32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ne [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint32_t neq_i32(svint32_t a, svint32_t b) { + return a != b; +} + +// CHECK-LABEL: @neq_i64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ne [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint64_t neq_i64(svint64_t a, svint64_t b) { + return a != b; +} + +// CHECK-LABEL: @neq_u8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ne [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint8_t neq_u8(svuint8_t a, svuint8_t b) { + return a != b; +} + +// CHECK-LABEL: @neq_u16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ne [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint16_t neq_u16(svuint16_t a, svuint16_t b) { + return a != b; +} + +// CHECK-LABEL: @neq_u32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ne [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint32_t neq_u32(svuint32_t a, svuint32_t b) { + return a != b; +} + +// CHECK-LABEL: @neq_u64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ne [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint64_t neq_u64(svuint64_t a, svuint64_t b) { + return a != b; +} + +// CHECK-LABEL: @neq_f16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = fcmp une [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint16_t neq_f16(svfloat16_t a, svfloat16_t b) { + return a != b; +} + +// CHECK-LABEL: @neq_f32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = fcmp une [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint32_t neq_f32(svfloat32_t a, svfloat32_t b) { + return a != b; +} + +// CHECK-LABEL: @neq_f64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = fcmp une [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint64_t neq_f64(svfloat64_t a, svfloat64_t b) { + return a != b; +} + +// LT + +// CHECK-LABEL: @lt_bool( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ult [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: ret [[CMP]] +// +svbool_t lt_bool(svbool_t a, svbool_t b) { + return a < b; +} + +// CHECK-LABEL: @lt_i8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ult [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint8_t lt_i8(svint8_t a, svint8_t b) { + return a < b; +} + +// CHECK-LABEL: @lt_i16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ult [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint16_t lt_i16(svint16_t a, svint16_t b) { + return a < b; +} + +// CHECK-LABEL: @lt_i32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ult [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint32_t lt_i32(svint32_t a, svint32_t b) { + return a < b; +} + +// CHECK-LABEL: @lt_i64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ult [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint64_t lt_i64(svint64_t a, svint64_t b) { + return a < b; +} + +// CHECK-LABEL: @lt_u8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ult [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint8_t lt_u8(svuint8_t a, svuint8_t b) { + return a < b; +} + +// CHECK-LABEL: @lt_u16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ult [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint16_t lt_u16(svuint16_t a, svuint16_t b) { + return a < b; +} + +// CHECK-LABEL: @lt_u32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ult [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint32_t lt_u32(svuint32_t a, svuint32_t b) { + return a < b; +} + +// CHECK-LABEL: @lt_u64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ult [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint64_t lt_u64(svuint64_t a, svuint64_t b) { + return a < b; +} + +// CHECK-LABEL: @lt_f16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = fcmp olt [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint16_t lt_f16(svfloat16_t a, svfloat16_t b) { + return a < b; +} + +// CHECK-LABEL: @lt_f32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = fcmp olt [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint32_t lt_f32(svfloat32_t a, svfloat32_t b) { + return a < b; +} + +// CHECK-LABEL: @lt_f64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = fcmp olt [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint64_t lt_f64(svfloat64_t a, svfloat64_t b) { + return a < b; +} + +// LEQ + +// CHECK-LABEL: @leq_bool( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ule [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: ret [[CMP]] +// +svbool_t leq_bool(svbool_t a, svbool_t b) { + return a <= b; +} + +// CHECK-LABEL: @leq_i8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ule [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint8_t leq_i8(svint8_t a, svint8_t b) { + return a <= b; +} + +// CHECK-LABEL: @leq_i16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ule [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint16_t leq_i16(svint16_t a, svint16_t b) { + return a <= b; +} + +// CHECK-LABEL: @leq_i32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ule [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint32_t leq_i32(svint32_t a, svint32_t b) { + return a <= b; +} + +// CHECK-LABEL: @leq_i64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ule [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint64_t leq_i64(svint64_t a, svint64_t b) { + return a <= b; +} + +// CHECK-LABEL: @leq_u8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ule [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint8_t leq_u8(svuint8_t a, svuint8_t b) { + return a <= b; +} + +// CHECK-LABEL: @leq_u16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ule [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint16_t leq_u16(svuint16_t a, svuint16_t b) { + return a <= b; +} + +// CHECK-LABEL: @leq_u32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ule [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint32_t leq_u32(svuint32_t a, svuint32_t b) { + return a <= b; +} + +// CHECK-LABEL: @leq_u64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ule [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint64_t leq_u64(svuint64_t a, svuint64_t b) { + return a <= b; +} + +// CHECK-LABEL: @leq_f16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = fcmp ole [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint16_t leq_f16(svfloat16_t a, svfloat16_t b) { + return a <= b; +} + +// CHECK-LABEL: @leq_f32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = fcmp ole [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint32_t leq_f32(svfloat32_t a, svfloat32_t b) { + return a <= b; +} + +// CHECK-LABEL: @leq_f64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = fcmp ole [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint64_t leq_f64(svfloat64_t a, svfloat64_t b) { + return a <= b; +} + +// GT + +// CHECK-LABEL: @gt_bool( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ugt [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: ret [[CMP]] +// +svbool_t gt_bool(svbool_t a, svbool_t b) { + return a > b; +} + +// CHECK-LABEL: @gt_i8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ugt [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint8_t gt_i8(svint8_t a, svint8_t b) { + return a > b; +} + +// CHECK-LABEL: @gt_i16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ugt [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint16_t gt_i16(svint16_t a, svint16_t b) { + return a > b; +} + +// CHECK-LABEL: @gt_i32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ugt [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint32_t gt_i32(svint32_t a, svint32_t b) { + return a > b; +} + +// CHECK-LABEL: @gt_i64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ugt [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint64_t gt_i64(svint64_t a, svint64_t b) { + return a > b; +} + +// CHECK-LABEL: @gt_u8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ugt [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint8_t gt_u8(svuint8_t a, svuint8_t b) { + return a > b; +} + +// CHECK-LABEL: @gt_u16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ugt [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint16_t gt_u16(svuint16_t a, svuint16_t b) { + return a > b; +} + +// CHECK-LABEL: @gt_u32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ugt [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint32_t gt_u32(svuint32_t a, svuint32_t b) { + return a > b; +} + +// CHECK-LABEL: @gt_u64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp ugt [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint64_t gt_u64(svuint64_t a, svuint64_t b) { + return a > b; +} + +// CHECK-LABEL: @gt_f16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = fcmp ogt [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint16_t gt_f16(svfloat16_t a, svfloat16_t b) { + return a > b; +} + +// CHECK-LABEL: @gt_f32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = fcmp ogt [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint32_t gt_f32(svfloat32_t a, svfloat32_t b) { + return a > b; +} + +// CHECK-LABEL: @gt_f64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = fcmp ogt [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint64_t gt_f64(svfloat64_t a, svfloat64_t b) { + return a > b; +} + +// GEQ + +// CHECK-LABEL: @geq_bool( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp uge [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: ret [[CMP]] +// +svbool_t geq_bool(svbool_t a, svbool_t b) { + return a >= b; +} + +// CHECK-LABEL: @geq_i8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp uge [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint8_t geq_i8(svint8_t a, svint8_t b) { + return a >= b; +} + +// CHECK-LABEL: @geq_i16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp uge [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint16_t geq_i16(svint16_t a, svint16_t b) { + return a >= b; +} + +// CHECK-LABEL: @geq_i32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp uge [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint32_t geq_i32(svint32_t a, svint32_t b) { + return a >= b; +} + +// CHECK-LABEL: @geq_i64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp uge [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint64_t geq_i64(svint64_t a, svint64_t b) { + return a >= b; +} + +// CHECK-LABEL: @geq_u8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp uge [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint8_t geq_u8(svuint8_t a, svuint8_t b) { + return a >= b; +} + +// CHECK-LABEL: @geq_u16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp uge [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint16_t geq_u16(svuint16_t a, svuint16_t b) { + return a >= b; +} + +// CHECK-LABEL: @geq_u32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp uge [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint32_t geq_u32(svuint32_t a, svuint32_t b) { + return a >= b; +} + +// CHECK-LABEL: @geq_u64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = icmp uge [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint64_t geq_u64(svuint64_t a, svuint64_t b) { + return a >= b; +} + +// CHECK-LABEL: @geq_f16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = fcmp oge [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint16_t geq_f16(svfloat16_t a, svfloat16_t b) { + return a >= b; +} + +// CHECK-LABEL: @geq_f32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = fcmp oge [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint32_t geq_f32(svfloat32_t a, svfloat32_t b) { + return a >= b; +} + +// CHECK-LABEL: @geq_f64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[CMP:%.*]] = fcmp oge [[A:%.*]], [[B:%.*]] +// CHECK-NEXT: [[CONV:%.*]] = zext [[CMP]] to +// CHECK-NEXT: ret [[CONV]] +// +svint64_t geq_f64(svfloat64_t a, svfloat64_t b) { + return a >= b; +} diff --git a/clang/test/Sema/aarch64-sve-vector-compare-ops.c b/clang/test/Sema/aarch64-sve-vector-compare-ops.c new file mode 100644 --- /dev/null +++ b/clang/test/Sema/aarch64-sve-vector-compare-ops.c @@ -0,0 +1,761 @@ +// 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 + +void eq(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 == 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 neq(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 != 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 lt(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 < 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 leq(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 <= 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 gt(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 > 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 geq(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 >= 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 --- a/clang/test/Sema/sizeless-1.c +++ b/clang/test/Sema/sizeless-1.c @@ -200,12 +200,6 @@ 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 --- a/clang/test/SemaCXX/sizeless-1.cpp +++ b/clang/test/SemaCXX/sizeless-1.cpp @@ -212,12 +212,6 @@ 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}} expected-error {{not contextually convertible}} local_int8 || init_int8; // expected-error {{invalid operands to binary expression}} expected-error {{not contextually convertible}}