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 @@ -11958,7 +11958,7 @@ // type checking for sizeless vector binary operators. QualType CheckSizelessVectorOperands(ExprResult &LHS, ExprResult &RHS, - SourceLocation Loc, + SourceLocation Loc, bool IsCompAssign, ArithConvKind OperationKind); /// Type checking for matrix binary operators. 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 @@ -32,6 +32,7 @@ #include "llvm/IR/CFG.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DataLayout.h" +#include "llvm/IR/DerivedTypes.h" #include "llvm/IR/FixedPointBuilder.h" #include "llvm/IR/Function.h" #include "llvm/IR/GetElementPtrTypeIterator.h" @@ -40,6 +41,7 @@ #include "llvm/IR/IntrinsicsPowerPC.h" #include "llvm/IR/MatrixBuilder.h" #include "llvm/IR/Module.h" +#include "llvm/Support/TypeSize.h" #include using namespace clang; @@ -2330,9 +2332,10 @@ } case CK_VectorSplat: { llvm::Type *DstTy = ConvertType(DestTy); - Value *Elt = Visit(const_cast(E)); + Value *Elt = Visit(const_cast(E)); // Splat the element across to all elements - unsigned NumElements = cast(DstTy)->getNumElements(); + llvm::ElementCount NumElements = + cast(DstTy)->getElementCount(); return Builder.CreateVectorSplat(NumElements, Elt, "splat"); } 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 @@ -10465,7 +10465,17 @@ QualType Sema::CheckSizelessVectorOperands(ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, + bool IsCompAssign, ArithConvKind OperationKind) { + if (!IsCompAssign) { + LHS = DefaultFunctionArrayLvalueConversion(LHS.get()); + if (LHS.isInvalid()) + return QualType(); + } + RHS = DefaultFunctionArrayLvalueConversion(RHS.get()); + if (RHS.isInvalid()) + return QualType(); + QualType LHSType = LHS.get()->getType().getUnqualifiedType(); QualType RHSType = RHS.get()->getType().getUnqualifiedType(); @@ -10483,6 +10493,34 @@ if (Context.hasSameType(LHSType, RHSType)) return LHSType; + auto tryScalableVectorConvert = [this](ExprResult *Src, QualType SrcType, + QualType DestType) { + const QualType DestBaseType = DestType->getSveEltType(Context); + if (DestBaseType->getUnqualifiedDesugaredType() == + SrcType->getUnqualifiedDesugaredType()) { + unsigned DiagID = diag::err_typecheck_invalid_operands; + if (!tryVectorConvertAndSplat(*this, Src, SrcType, DestBaseType, DestType, + DiagID)) + return DestType; + } + return QualType(); + }; + + if (LHSType->isVLSTBuiltinType() && !RHSType->isVLSTBuiltinType()) { + auto DestType = tryScalableVectorConvert(&RHS, RHSType, LHSType); + if (DestType == QualType()) + return InvalidOperands(Loc, LHS, RHS); + return DestType; + } + + if (RHSType->isVLSTBuiltinType() && !LHSType->isVLSTBuiltinType()) { + auto DestType = tryScalableVectorConvert((IsCompAssign ? nullptr : &LHS), + LHSType, RHSType); + if (DestType == QualType()) + return InvalidOperands(Loc, LHS, RHS); + return DestType; + } + Diag(Loc, DiagID) << LHSType << RHSType << LHS.get()->getSourceRange() << RHS.get()->getSourceRange(); return QualType(); @@ -10602,7 +10640,8 @@ /*AllowBooleanOperation*/ false, /*ReportInvalid*/ true); if (LHSTy->isVLSTBuiltinType() || RHSTy->isVLSTBuiltinType()) - return CheckSizelessVectorOperands(LHS, RHS, Loc, ACK_Arithmetic); + return CheckSizelessVectorOperands(LHS, RHS, Loc, IsCompAssign, + ACK_Arithmetic); if (!IsDiv && (LHSTy->isConstantMatrixType() || RHSTy->isConstantMatrixType())) return CheckMatrixMultiplyOperands(LHS, RHS, Loc, IsCompAssign); @@ -10642,17 +10681,12 @@ return InvalidOperands(Loc, LHS, RHS); } - if (LHS.get()->getType()->isVLSTBuiltinType() && + if (LHS.get()->getType()->isVLSTBuiltinType() || RHS.get()->getType()->isVLSTBuiltinType()) { - if (LHS.get() - ->getType() - ->getSveEltType(Context) - ->hasIntegerRepresentation() && - RHS.get() - ->getType() - ->getSveEltType(Context) - ->hasIntegerRepresentation()) - return CheckSizelessVectorOperands(LHS, RHS, Loc, ACK_Arithmetic); + if (LHS.get()->getType()->hasIntegerRepresentation() && + RHS.get()->getType()->hasIntegerRepresentation()) + return CheckSizelessVectorOperands(LHS, RHS, Loc, IsCompAssign, + ACK_Arithmetic); return InvalidOperands(Loc, LHS, RHS); } @@ -10967,7 +11001,7 @@ if (LHS.get()->getType()->isVLSTBuiltinType() || RHS.get()->getType()->isVLSTBuiltinType()) { QualType compType = - CheckSizelessVectorOperands(LHS, RHS, Loc, ACK_Arithmetic); + CheckSizelessVectorOperands(LHS, RHS, Loc, CompLHSTy, ACK_Arithmetic); if (CompLHSTy) *CompLHSTy = compType; return compType; @@ -11082,7 +11116,7 @@ if (LHS.get()->getType()->isVLSTBuiltinType() || RHS.get()->getType()->isVLSTBuiltinType()) { QualType compType = - CheckSizelessVectorOperands(LHS, RHS, Loc, ACK_Arithmetic); + CheckSizelessVectorOperands(LHS, RHS, Loc, CompLHSTy, ACK_Arithmetic); if (CompLHSTy) *CompLHSTy = compType; return compType; @@ -12897,7 +12931,17 @@ RHS.get()->getType()->isVLSTBuiltinType()) { if (LHS.get()->getType()->hasIntegerRepresentation() && RHS.get()->getType()->hasIntegerRepresentation()) - return CheckSizelessVectorOperands(LHS, RHS, Loc, ACK_BitwiseOp); + return CheckSizelessVectorOperands(LHS, RHS, Loc, IsCompAssign, + ACK_BitwiseOp); + 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, IsCompAssign, + ACK_BitwiseOp); return InvalidOperands(Loc, LHS, RHS); } diff --git a/clang/test/CodeGen/aarch64-sve-vector-arith-ops.c b/clang/test/CodeGen/aarch64-sve-vector-arith-ops.c --- a/clang/test/CodeGen/aarch64-sve-vector-arith-ops.c +++ b/clang/test/CodeGen/aarch64-sve-vector-arith-ops.c @@ -207,6 +207,127 @@ return a += b; } +// CHECK-LABEL: @add_scalar_i8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i8 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[ADD:%.*]] = add [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[ADD]] +// +svint8_t add_scalar_i8(svint8_t a, int8_t b) { + return a + b; +} + +// CHECK-LABEL: @add_scalar_i16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i16 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[ADD:%.*]] = add [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[ADD]] +// +svint16_t add_scalar_i16(svint16_t a, int16_t b) { + return a + b; +} + +// CHECK-LABEL: @add_scalar_i32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i32 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[ADD:%.*]] = add [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[ADD]] +// +svint32_t add_scalar_i32(svint32_t a, int32_t b) { + return a + b; +} + +// CHECK-LABEL: @add_scalar_i64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i64 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[ADD:%.*]] = add [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[ADD]] +// +svint64_t add_scalar_i64(svint64_t a, int64_t b) { + return a + b; +} + +// CHECK-LABEL: @add_scalar_u8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i8 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[ADD:%.*]] = add [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[ADD]] +// +svuint8_t add_scalar_u8(svuint8_t a, uint8_t b) { + return a + b; +} + +// CHECK-LABEL: @add_scalar_u16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i16 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[ADD:%.*]] = add [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[ADD]] +// +svuint16_t add_scalar_u16(svuint16_t a, uint16_t b) { + return a + b; +} + +// CHECK-LABEL: @add_scalar_u32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i32 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[ADD:%.*]] = add [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[ADD]] +// +svuint32_t add_scalar_u32(svuint32_t a, uint32_t b) { + return a + b; +} + +// CHECK-LABEL: @add_scalar_u64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i64 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[ADD:%.*]] = add [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[ADD]] +// +svuint64_t add_scalar_u64(svuint64_t a, uint64_t b) { + return a + b; +} + +// CHECK-LABEL: @add_scalar_f16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, half [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[ADD:%.*]] = fadd [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[ADD]] +// +svfloat16_t add_scalar_f16(svfloat16_t a, __fp16 b) { + return a + b; +} + +// CHECK-LABEL: @add_scalar_f32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, float [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[ADD:%.*]] = fadd [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[ADD]] +// +svfloat32_t add_scalar_f32(svfloat32_t a, float b) { + return a + b; +} + +// CHECK-LABEL: @add_scalar_f64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, double [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[ADD:%.*]] = fadd [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[ADD]] +// +svfloat64_t add_scalar_f64(svfloat64_t a, double b) { + return a + b; +} + // SUBTRACTION // CHECK-LABEL: @sub_i8( @@ -407,6 +528,127 @@ return a - b; } +// CHECK-LABEL: @sub_scalar_i8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i8 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[SUB:%.*]] = sub [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[SUB]] +// +svint8_t sub_scalar_i8(svint8_t a, int8_t b) { + return a - b; +} + +// CHECK-LABEL: @sub_scalar_i16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i16 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[SUB:%.*]] = sub [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[SUB]] +// +svint16_t sub_scalar_i16(svint16_t a, int16_t b) { + return a - b; +} + +// CHECK-LABEL: @sub_scalar_i32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i32 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[SUB:%.*]] = sub [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[SUB]] +// +svint32_t sub_scalar_i32(svint32_t a, int32_t b) { + return a - b; +} + +// CHECK-LABEL: @sub_scalar_i64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i64 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[SUB:%.*]] = sub [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[SUB]] +// +svint64_t sub_scalar_i64(svint64_t a, int64_t b) { + return a - b; +} + +// CHECK-LABEL: @sub_scalar_u8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i8 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[SUB:%.*]] = sub [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[SUB]] +// +svuint8_t sub_scalar_u8(svuint8_t a, uint8_t b) { + return a - b; +} + +// CHECK-LABEL: @sub_scalar_u16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i16 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[SUB:%.*]] = sub [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[SUB]] +// +svuint16_t sub_scalar_u16(svuint16_t a, uint16_t b) { + return a - b; +} + +// CHECK-LABEL: @sub_scalar_u32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i32 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[SUB:%.*]] = sub [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[SUB]] +// +svuint32_t sub_scalar_u32(svuint32_t a, uint32_t b) { + return a - b; +} + +// CHECK-LABEL: @sub_scalar_u64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i64 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[SUB:%.*]] = sub [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[SUB]] +// +svuint64_t sub_scalar_u64(svuint64_t a, uint64_t b) { + return a - b; +} + +// CHECK-LABEL: @sub_scalar_f16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, half [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[SUB:%.*]] = fsub [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[SUB]] +// +svfloat16_t sub_scalar_f16(svfloat16_t a, __fp16 b) { + return a - b; +} + +// CHECK-LABEL: @sub_scalar_f32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, float [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[SUB:%.*]] = fsub [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[SUB]] +// +svfloat32_t sub_scalar_f32(svfloat32_t a, float b) { + return a - b; +} + +// CHECK-LABEL: @sub_scalar_f64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, double [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[SUB:%.*]] = fsub [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[SUB]] +// +svfloat64_t sub_scalar_f64(svfloat64_t a, double b) { + return a - b; +} + // MULTIPLICATION // CHECK-LABEL: @mul_i8( @@ -607,6 +849,127 @@ return a * b; } +// CHECK-LABEL: @mul_scalar_i8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i8 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[MUL:%.*]] = mul [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[MUL]] +// +svint8_t mul_scalar_i8(svint8_t a, int8_t b) { + return a * b; +} + +// CHECK-LABEL: @mul_scalar_i16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i16 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[MUL:%.*]] = mul [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[MUL]] +// +svint16_t mul_scalar_i16(svint16_t a, int16_t b) { + return a * b; +} + +// CHECK-LABEL: @mul_scalar_i32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i32 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[MUL:%.*]] = mul [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[MUL]] +// +svint32_t mul_scalar_i32(svint32_t a, int32_t b) { + return a * b; +} + +// CHECK-LABEL: @mul_scalar_i64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i64 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[MUL:%.*]] = mul [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[MUL]] +// +svint64_t mul_scalar_i64(svint64_t a, int64_t b) { + return a * b; +} + +// CHECK-LABEL: @mul_scalar_u8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i8 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[MUL:%.*]] = mul [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[MUL]] +// +svuint8_t mul_scalar_u8(svuint8_t a, uint8_t b) { + return a * b; +} + +// CHECK-LABEL: @mul_scalar_u16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i16 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[MUL:%.*]] = mul [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[MUL]] +// +svuint16_t mul_scalar_u16(svuint16_t a, uint16_t b) { + return a * b; +} + +// CHECK-LABEL: @mul_scalar_u32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i32 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[MUL:%.*]] = mul [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[MUL]] +// +svuint32_t mul_scalar_u32(svuint32_t a, uint32_t b) { + return a * b; +} + +// CHECK-LABEL: @mul_scalar_u64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i64 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[MUL:%.*]] = mul [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[MUL]] +// +svuint64_t mul_scalar_u64(svuint64_t a, uint64_t b) { + return a * b; +} + +// CHECK-LABEL: @mul_scalar_f16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, half [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[MUL:%.*]] = fmul [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[MUL]] +// +svfloat16_t mul_scalar_f16(svfloat16_t a, __fp16 b) { + return a * b; +} + +// CHECK-LABEL: @mul_scalar_f32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, float [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[MUL:%.*]] = fmul [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[MUL]] +// +svfloat32_t mul_scalar_f32(svfloat32_t a, float b) { + return a * b; +} + +// CHECK-LABEL: @mul_scalar_f64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, double [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[MUL:%.*]] = fmul [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[MUL]] +// +svfloat64_t mul_scalar_f64(svfloat64_t a, double b) { + return a * b; +} + // DIVISION // CHECK-LABEL: @div_i8( @@ -807,6 +1170,127 @@ return a / b; } +// CHECK-LABEL: @div_scalar_i8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i8 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[DIV:%.*]] = sdiv [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[DIV]] +// +svint8_t div_scalar_i8(svint8_t a, int8_t b) { + return a / b; +} + +// CHECK-LABEL: @div_scalar_i16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i16 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[DIV:%.*]] = sdiv [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[DIV]] +// +svint16_t div_scalar_i16(svint16_t a, int16_t b) { + return a / b; +} + +// CHECK-LABEL: @div_scalar_i32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i32 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[DIV:%.*]] = sdiv [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[DIV]] +// +svint32_t div_scalar_i32(svint32_t a, int32_t b) { + return a / b; +} + +// CHECK-LABEL: @div_scalar_i64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i64 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[DIV:%.*]] = sdiv [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[DIV]] +// +svint64_t div_scalar_i64(svint64_t a, int64_t b) { + return a / b; +} + +// CHECK-LABEL: @div_scalar_u8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i8 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[DIV:%.*]] = udiv [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[DIV]] +// +svuint8_t div_scalar_u8(svuint8_t a, uint8_t b) { + return a / b; +} + +// CHECK-LABEL: @div_scalar_u16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i16 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[DIV:%.*]] = udiv [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[DIV]] +// +svuint16_t div_scalar_u16(svuint16_t a, uint16_t b) { + return a / b; +} + +// CHECK-LABEL: @div_scalar_u32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i32 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[DIV:%.*]] = udiv [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[DIV]] +// +svuint32_t div_scalar_u32(svuint32_t a, uint32_t b) { + return a / b; +} + +// CHECK-LABEL: @div_scalar_u64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i64 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[DIV:%.*]] = udiv [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[DIV]] +// +svuint64_t div_scalar_u64(svuint64_t a, uint64_t b) { + return a / b; +} + +// CHECK-LABEL: @div_scalar_f16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, half [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[DIV:%.*]] = fdiv [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[DIV]] +// +svfloat16_t div_scalar_f16(svfloat16_t a, __fp16 b) { + return a / b; +} + +// CHECK-LABEL: @div_scalar_f32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, float [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[DIV:%.*]] = fdiv [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[DIV]] +// +svfloat32_t div_scalar_f32(svfloat32_t a, float b) { + return a / b; +} + +// CHECK-LABEL: @div_scalar_f64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, double [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[DIV:%.*]] = fdiv [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[DIV]] +// +svfloat64_t div_scalar_f64(svfloat64_t a, double b) { + return a / b; +} + // REMAINDER // CHECK-LABEL: @rem_i8( @@ -952,3 +1436,91 @@ svuint64_t rem_inplace_u64(svuint64_t a, svuint64_t b) { return a % b; } + +// CHECK-LABEL: @rem_scalar_i8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i8 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[REM:%.*]] = srem [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[REM]] +// +svint8_t rem_scalar_i8(svint8_t a, int8_t b) { + return a % b; +} + +// CHECK-LABEL: @rem_scalar_i16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i16 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[REM:%.*]] = srem [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[REM]] +// +svint16_t rem_scalar_i16(svint16_t a, int16_t b) { + return a % b; +} + +// CHECK-LABEL: @rem_scalar_i32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i32 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[REM:%.*]] = srem [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[REM]] +// +svint32_t rem_scalar_i32(svint32_t a, int32_t b) { + return a % b; +} + +// CHECK-LABEL: @rem_scalar_i64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i64 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[REM:%.*]] = srem [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[REM]] +// +svint64_t rem_scalar_i64(svint64_t a, int64_t b) { + return a % b; +} + +// CHECK-LABEL: @rem_scalar_u8( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i8 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[REM:%.*]] = urem [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[REM]] +// +svuint8_t rem_scalar_u8(svuint8_t a, uint8_t b) { + return a % b; +} + +// CHECK-LABEL: @rem_scalar_u16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i16 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[REM:%.*]] = urem [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[REM]] +// +svuint16_t rem_scalar_u16(svuint16_t a, uint16_t b) { + return a % b; +} + +// CHECK-LABEL: @rem_scalar_u32( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i32 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[REM:%.*]] = urem [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[REM]] +// +svuint32_t rem_scalar_u32(svuint32_t a, uint32_t b) { + return a % b; +} + +// CHECK-LABEL: @rem_scalar_u64( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement poison, i64 [[B:%.*]], i32 0 +// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector [[SPLAT_SPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[REM:%.*]] = urem [[A:%.*]], [[SPLAT_SPLAT]] +// CHECK-NEXT: ret [[REM]] +// +svuint64_t rem_scalar_u64(svuint64_t a, uint64_t b) { + return a % b; +} diff --git a/clang/test/Sema/aarch64-sve-vector-arith-ops.c b/clang/test/Sema/aarch64-sve-vector-arith-ops.c --- a/clang/test/Sema/aarch64-sve-vector-arith-ops.c +++ b/clang/test/Sema/aarch64-sve-vector-arith-ops.c @@ -20,6 +20,12 @@ (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)(i8 + 0); // expected-error{{invalid operands to binary expression}} + (void)(i8 + 0l); // expected-error{{invalid operands to binary expression}} + (void)(i8 + 0u); // expected-error{{invalid operands to binary expression}} + (void)(i8 + 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i8 + 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i8 + 0.); // 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}} @@ -31,6 +37,12 @@ (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)(u8 + 0); // expected-error{{invalid operands to binary expression}} + (void)(u8 + 0l); // expected-error{{invalid operands to binary expression}} + (void)(u8 + 0u); // expected-error{{invalid operands to binary expression}} + (void)(u8 + 0ul); // expected-error{{invalid operands to binary expression}} + (void)(u8 + 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u8 + 0.); // 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}} @@ -42,6 +54,12 @@ (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)(i16 + 0); // expected-error{{invalid operands to binary expression}} + (void)(i16 + 0l); // expected-error{{invalid operands to binary expression}} + (void)(i16 + 0u); // expected-error{{invalid operands to binary expression}} + (void)(i16 + 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i16 + 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i16 + 0.); // 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}} @@ -53,6 +71,12 @@ (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)(u16 + 0); // expected-error{{invalid operands to binary expression}} + (void)(u16 + 0l); // expected-error{{invalid operands to binary expression}} + (void)(u16 + 0u); // expected-error{{invalid operands to binary expression}} + (void)(u16 + 0ul); // expected-error{{invalid operands to binary expression}} + (void)(u16 + 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u16 + 0.); // 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}} @@ -64,6 +88,11 @@ (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)(i32 + 0l); // expected-error{{invalid operands to binary expression}} + (void)(i32 + 0u); // expected-error{{invalid operands to binary expression}} + (void)(i32 + 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i32 + 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i32 + 0.); // 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}} @@ -75,6 +104,11 @@ (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)(u32 + 0); // expected-error{{invalid operands to binary expression}} + (void)(u32 + 0l); // expected-error{{invalid operands to binary expression}} + (void)(u32 + 0ul); // expected-error{{invalid operands to binary expression}} + (void)(u32 + 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u32 + 0.); // 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}} @@ -86,6 +120,11 @@ (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)(i64 + 0); // expected-error{{invalid operands to binary expression}} + (void)(i64 + 0u); // expected-error{{invalid operands to binary expression}} + (void)(i64 + 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i64 + 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i64 + 0.); // 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}} @@ -97,6 +136,11 @@ (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)(u64 + 0); // expected-error{{invalid operands to binary expression}} + (void)(u64 + 0l); // expected-error{{invalid operands to binary expression}} + (void)(u64 + 0u); // expected-error{{invalid operands to binary expression}} + (void)(u64 + 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u64 + 0.); // 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}} @@ -108,6 +152,12 @@ (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)(f16 + 0); // expected-error{{invalid operands to binary expression}} + (void)(f16 + 0l); // expected-error{{invalid operands to binary expression}} + (void)(f16 + 0u); // expected-error{{invalid operands to binary expression}} + (void)(f16 + 0ul); // expected-error{{invalid operands to binary expression}} + (void)(f16 + 0.f); // expected-error{{invalid operands to binary expression}} + (void)(f16 + 0.); // 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}} @@ -119,6 +169,11 @@ (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)(f32 + 0); // expected-error{{invalid operands to binary expression}} + (void)(f32 + 0l); // expected-error{{invalid operands to binary expression}} + (void)(f32 + 0u); // expected-error{{invalid operands to binary expression}} + (void)(f32 + 0ul); // expected-error{{invalid operands to binary expression}} + (void)(f32 + 0.); // 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}} @@ -130,6 +185,11 @@ (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 + 0); // expected-error{{invalid operands to binary expression}} + (void)(f64 + 0l); // expected-error{{invalid operands to binary expression}} + (void)(f64 + 0u); // expected-error{{invalid operands to binary expression}} + (void)(f64 + 0ul); // expected-error{{invalid operands to binary expression}} + (void)(f64 + 0.f); // expected-error{{invalid operands to binary expression}} } void sub(svint8_t i8, svint16_t i16, svint32_t i32, svint64_t i64, @@ -148,6 +208,12 @@ (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)(i8 - 0); // expected-error{{invalid operands to binary expression}} + (void)(i8 - 0l); // expected-error{{invalid operands to binary expression}} + (void)(i8 - 0u); // expected-error{{invalid operands to binary expression}} + (void)(i8 - 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i8 - 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i8 - 0.); // 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}} @@ -159,6 +225,12 @@ (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)(u8 - 0); // expected-error{{invalid operands to binary expression}} + (void)(u8 - 0l); // expected-error{{invalid operands to binary expression}} + (void)(u8 - 0u); // expected-error{{invalid operands to binary expression}} + (void)(u8 - 0ul); // expected-error{{invalid operands to binary expression}} + (void)(u8 - 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u8 - 0.); // 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}} @@ -170,6 +242,12 @@ (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)(i16 - 0); // expected-error{{invalid operands to binary expression}} + (void)(i16 - 0l); // expected-error{{invalid operands to binary expression}} + (void)(i16 - 0u); // expected-error{{invalid operands to binary expression}} + (void)(i16 - 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i16 - 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i16 - 0.); // 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}} @@ -181,6 +259,12 @@ (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)(u16 - 0); // expected-error{{invalid operands to binary expression}} + (void)(u16 - 0l); // expected-error{{invalid operands to binary expression}} + (void)(u16 - 0u); // expected-error{{invalid operands to binary expression}} + (void)(u16 - 0ul); // expected-error{{invalid operands to binary expression}} + (void)(u16 - 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u16 - 0.); // 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}} @@ -192,6 +276,11 @@ (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)(i32 - 0l); // expected-error{{invalid operands to binary expression}} + (void)(i32 - 0u); // expected-error{{invalid operands to binary expression}} + (void)(i32 - 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i32 - 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i32 - 0.); // 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}} @@ -203,6 +292,11 @@ (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)(u32 - 0); // expected-error{{invalid operands to binary expression}} + (void)(u32 - 0l); // expected-error{{invalid operands to binary expression}} + (void)(u32 - 0ul); // expected-error{{invalid operands to binary expression}} + (void)(u32 - 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u32 - 0.); // 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}} @@ -214,6 +308,11 @@ (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)(i64 - 0); // expected-error{{invalid operands to binary expression}} + (void)(i64 - 0u); // expected-error{{invalid operands to binary expression}} + (void)(i64 - 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i64 - 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i64 - 0.); // 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}} @@ -225,6 +324,11 @@ (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)(u64 - 0); // expected-error{{invalid operands to binary expression}} + (void)(u64 - 0l); // expected-error{{invalid operands to binary expression}} + (void)(u64 - 0u); // expected-error{{invalid operands to binary expression}} + (void)(u64 - 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u64 - 0.); // 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}} @@ -236,6 +340,12 @@ (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)(f16 - 0); // expected-error{{invalid operands to binary expression}} + (void)(f16 - 0l); // expected-error{{invalid operands to binary expression}} + (void)(f16 - 0u); // expected-error{{invalid operands to binary expression}} + (void)(f16 - 0ul); // expected-error{{invalid operands to binary expression}} + (void)(f16 - 0.f); // expected-error{{invalid operands to binary expression}} + (void)(f16 - 0.); // 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}} @@ -247,6 +357,11 @@ (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)(f32 - 0); // expected-error{{invalid operands to binary expression}} + (void)(f32 - 0l); // expected-error{{invalid operands to binary expression}} + (void)(f32 - 0u); // expected-error{{invalid operands to binary expression}} + (void)(f32 - 0ul); // expected-error{{invalid operands to binary expression}} + (void)(f32 - 0.); // 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}} @@ -258,6 +373,11 @@ (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 - 0); // expected-error{{invalid operands to binary expression}} + (void)(f64 - 0l); // expected-error{{invalid operands to binary expression}} + (void)(f64 - 0u); // expected-error{{invalid operands to binary expression}} + (void)(f64 - 0ul); // expected-error{{invalid operands to binary expression}} + (void)(f64 - 0.f); // expected-error{{invalid operands to binary expression}} } void mul(svint8_t i8, svint16_t i16, svint32_t i32, svint64_t i64, @@ -276,6 +396,12 @@ (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)(i8 * 0); // expected-error{{invalid operands to binary expression}} + (void)(i8 * 0l); // expected-error{{invalid operands to binary expression}} + (void)(i8 * 0u); // expected-error{{invalid operands to binary expression}} + (void)(i8 * 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i8 * 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i8 * 0.); // 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}} @@ -287,6 +413,12 @@ (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)(u8 * 0); // expected-error{{invalid operands to binary expression}} + (void)(u8 * 0l); // expected-error{{invalid operands to binary expression}} + (void)(u8 * 0u); // expected-error{{invalid operands to binary expression}} + (void)(u8 * 0ul); // expected-error{{invalid operands to binary expression}} + (void)(u8 * 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u8 * 0.); // 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}} @@ -298,6 +430,12 @@ (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)(i16 * 0); // expected-error{{invalid operands to binary expression}} + (void)(i16 * 0l); // expected-error{{invalid operands to binary expression}} + (void)(i16 * 0u); // expected-error{{invalid operands to binary expression}} + (void)(i16 * 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i16 * 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i16 * 0.); // 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}} @@ -309,6 +447,12 @@ (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)(u16 * 0); // expected-error{{invalid operands to binary expression}} + (void)(u16 * 0l); // expected-error{{invalid operands to binary expression}} + (void)(u16 * 0u); // expected-error{{invalid operands to binary expression}} + (void)(u16 * 0ul); // expected-error{{invalid operands to binary expression}} + (void)(u16 * 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u16 * 0.); // 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}} @@ -320,6 +464,11 @@ (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)(i32 * 0l); // expected-error{{invalid operands to binary expression}} + (void)(i32 * 0u); // expected-error{{invalid operands to binary expression}} + (void)(i32 * 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i32 * 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i32 * 0.); // 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}} @@ -331,6 +480,11 @@ (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)(u32 * 0); // expected-error{{invalid operands to binary expression}} + (void)(u32 * 0l); // expected-error{{invalid operands to binary expression}} + (void)(u32 * 0ul); // expected-error{{invalid operands to binary expression}} + (void)(u32 * 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u32 * 0.); // 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}} @@ -342,6 +496,11 @@ (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)(i64 * 0); // expected-error{{invalid operands to binary expression}} + (void)(i64 * 0u); // expected-error{{invalid operands to binary expression}} + (void)(i64 * 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i64 * 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i64 * 0.); // 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}} @@ -353,6 +512,11 @@ (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)(u64 * 0); // expected-error{{invalid operands to binary expression}} + (void)(u64 * 0l); // expected-error{{invalid operands to binary expression}} + (void)(u64 * 0u); // expected-error{{invalid operands to binary expression}} + (void)(u64 * 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u64 * 0.); // 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}} @@ -364,6 +528,12 @@ (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)(f16 * 0); // expected-error{{invalid operands to binary expression}} + (void)(f16 * 0l); // expected-error{{invalid operands to binary expression}} + (void)(f16 * 0u); // expected-error{{invalid operands to binary expression}} + (void)(f16 * 0ul); // expected-error{{invalid operands to binary expression}} + (void)(f16 * 0.f); // expected-error{{invalid operands to binary expression}} + (void)(f16 * 0.); // 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}} @@ -375,6 +545,11 @@ (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)(f32 * 0); // expected-error{{invalid operands to binary expression}} + (void)(f32 * 0l); // expected-error{{invalid operands to binary expression}} + (void)(f32 * 0u); // expected-error{{invalid operands to binary expression}} + (void)(f32 * 0ul); // expected-error{{invalid operands to binary expression}} + (void)(f32 * 0.); // 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}} @@ -386,6 +561,11 @@ (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 * 0); // expected-error{{invalid operands to binary expression}} + (void)(f64 * 0l); // expected-error{{invalid operands to binary expression}} + (void)(f64 * 0u); // expected-error{{invalid operands to binary expression}} + (void)(f64 * 0ul); // expected-error{{invalid operands to binary expression}} + (void)(f64 * 0.f); // expected-error{{invalid operands to binary expression}} } void div(svint8_t i8, svint16_t i16, svint32_t i32, svint64_t i64, @@ -404,6 +584,12 @@ (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)(i8 / 0); // expected-error{{invalid operands to binary expression}} + (void)(i8 / 0l); // expected-error{{invalid operands to binary expression}} + (void)(i8 / 0u); // expected-error{{invalid operands to binary expression}} + (void)(i8 / 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i8 / 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i8 / 0.); // 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}} @@ -415,6 +601,12 @@ (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)(u8 / 0); // expected-error{{invalid operands to binary expression}} + (void)(u8 / 0l); // expected-error{{invalid operands to binary expression}} + (void)(u8 / 0u); // expected-error{{invalid operands to binary expression}} + (void)(u8 / 0ul); // expected-error{{invalid operands to binary expression}} + (void)(u8 / 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u8 / 0.); // 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}} @@ -426,6 +618,12 @@ (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)(i16 / 0); // expected-error{{invalid operands to binary expression}} + (void)(i16 / 0l); // expected-error{{invalid operands to binary expression}} + (void)(i16 / 0u); // expected-error{{invalid operands to binary expression}} + (void)(i16 / 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i16 / 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i16 / 0.); // 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}} @@ -437,6 +635,12 @@ (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)(u16 / 0); // expected-error{{invalid operands to binary expression}} + (void)(u16 / 0l); // expected-error{{invalid operands to binary expression}} + (void)(u16 / 0u); // expected-error{{invalid operands to binary expression}} + (void)(u16 / 0ul); // expected-error{{invalid operands to binary expression}} + (void)(u16 / 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u16 / 0.); // 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}} @@ -448,6 +652,11 @@ (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)(i32 / 0l); // expected-error{{invalid operands to binary expression}} + (void)(i32 / 0u); // expected-error{{invalid operands to binary expression}} + (void)(i32 / 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i32 / 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i32 / 0.); // 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}} @@ -459,6 +668,11 @@ (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)(u32 / 0); // expected-error{{invalid operands to binary expression}} + (void)(u32 / 0l); // expected-error{{invalid operands to binary expression}} + (void)(u32 / 0ul); // expected-error{{invalid operands to binary expression}} + (void)(u32 / 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u32 / 0.); // 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}} @@ -470,6 +684,11 @@ (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)(i64 / 0); // expected-error{{invalid operands to binary expression}} + (void)(i64 / 0u); // expected-error{{invalid operands to binary expression}} + (void)(i64 / 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i64 / 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i64 / 0.); // 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}} @@ -481,6 +700,11 @@ (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)(u64 / 0); // expected-error{{invalid operands to binary expression}} + (void)(u64 / 0l); // expected-error{{invalid operands to binary expression}} + (void)(u64 / 0u); // expected-error{{invalid operands to binary expression}} + (void)(u64 / 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u64 / 0.); // 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}} @@ -492,6 +716,12 @@ (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)(f16 / 0); // expected-error{{invalid operands to binary expression}} + (void)(f16 / 0l); // expected-error{{invalid operands to binary expression}} + (void)(f16 / 0u); // expected-error{{invalid operands to binary expression}} + (void)(f16 / 0ul); // expected-error{{invalid operands to binary expression}} + (void)(f16 / 0.f); // expected-error{{invalid operands to binary expression}} + (void)(f16 / 0.); // 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}} @@ -503,6 +733,11 @@ (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)(f32 / 0); // expected-error{{invalid operands to binary expression}} + (void)(f32 / 0l); // expected-error{{invalid operands to binary expression}} + (void)(f32 / 0u); // expected-error{{invalid operands to binary expression}} + (void)(f32 / 0ul); // expected-error{{invalid operands to binary expression}} + (void)(f32 / 0.); // 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}} @@ -514,6 +749,11 @@ (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 / 0); // expected-error{{invalid operands to binary expression}} + (void)(f64 / 0l); // expected-error{{invalid operands to binary expression}} + (void)(f64 / 0u); // expected-error{{invalid operands to binary expression}} + (void)(f64 / 0ul); // expected-error{{invalid operands to binary expression}} + (void)(f64 / 0.f); // expected-error{{invalid operands to binary expression}} } void mod(svint8_t i8, svint16_t i16, svint32_t i32, svint64_t i64, @@ -532,6 +772,12 @@ (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)(i8 % 0); // expected-error{{invalid operands to binary expression}} + (void)(i8 % 0l); // expected-error{{invalid operands to binary expression}} + (void)(i8 % 0u); // expected-error{{invalid operands to binary expression}} + (void)(i8 % 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i8 % 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i8 % 0.); // 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}} @@ -543,6 +789,12 @@ (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)(u8 % 0); // expected-error{{invalid operands to binary expression}} + (void)(u8 % 0l); // expected-error{{invalid operands to binary expression}} + (void)(u8 % 0u); // expected-error{{invalid operands to binary expression}} + (void)(u8 % 0ul); // expected-error{{invalid operands to binary expression}} + (void)(u8 % 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u8 % 0.); // 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}} @@ -554,6 +806,12 @@ (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)(i16 % 0); // expected-error{{invalid operands to binary expression}} + (void)(i16 % 0l); // expected-error{{invalid operands to binary expression}} + (void)(i16 % 0u); // expected-error{{invalid operands to binary expression}} + (void)(i16 % 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i16 % 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i16 % 0.); // 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}} @@ -565,6 +823,12 @@ (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)(u16 % 0); // expected-error{{invalid operands to binary expression}} + (void)(u16 % 0l); // expected-error{{invalid operands to binary expression}} + (void)(u16 % 0u); // expected-error{{invalid operands to binary expression}} + (void)(u16 % 0ul); // expected-error{{invalid operands to binary expression}} + (void)(u16 % 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u16 % 0.); // 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}} @@ -576,6 +840,11 @@ (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)(i32 % 0l); // expected-error{{invalid operands to binary expression}} + (void)(i32 % 0u); // expected-error{{invalid operands to binary expression}} + (void)(i32 % 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i32 % 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i32 % 0.); // 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}} @@ -587,6 +856,11 @@ (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)(u32 % 0); // expected-error{{invalid operands to binary expression}} + (void)(u32 % 0l); // expected-error{{invalid operands to binary expression}} + (void)(u32 % 0ul); // expected-error{{invalid operands to binary expression}} + (void)(u32 % 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u32 % 0.); // 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}} @@ -598,6 +872,11 @@ (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)(i64 % 0); // expected-error{{invalid operands to binary expression}} + (void)(i64 % 0u); // expected-error{{invalid operands to binary expression}} + (void)(i64 % 0ul); // expected-error{{invalid operands to binary expression}} + (void)(i64 % 0.f); // expected-error{{invalid operands to binary expression}} + (void)(i64 % 0.); // 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}} @@ -609,6 +888,11 @@ (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)(u64 % 0); // expected-error{{invalid operands to binary expression}} + (void)(u64 % 0l); // expected-error{{invalid operands to binary expression}} + (void)(u64 % 0u); // expected-error{{invalid operands to binary expression}} + (void)(u64 % 0.f); // expected-error{{invalid operands to binary expression}} + (void)(u64 % 0.); // 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}} @@ -620,6 +904,12 @@ (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)(f16 % 0); // expected-error{{invalid operands to binary expression}} + (void)(f16 % 0l); // expected-error{{invalid operands to binary expression}} + (void)(f16 % 0u); // expected-error{{invalid operands to binary expression}} + (void)(f16 % 0ul); // expected-error{{invalid operands to binary expression}} + (void)(f16 % 0.f); // expected-error{{invalid operands to binary expression}} + (void)(f16 % 0.); // 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}} @@ -631,6 +921,12 @@ (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)(f32 % 0); // expected-error{{invalid operands to binary expression}} + (void)(f32 % 0l); // expected-error{{invalid operands to binary expression}} + (void)(f32 % 0u); // expected-error{{invalid operands to binary expression}} + (void)(f32 % 0ul); // expected-error{{invalid operands to binary expression}} + (void)(f32 % 0.f); // expected-error{{invalid operands to binary expression}} + (void)(f32 % 0.); // 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}} @@ -642,4 +938,10 @@ (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 % 0); // expected-error{{invalid operands to binary expression}} + (void)(f64 % 0l); // expected-error{{invalid operands to binary expression}} + (void)(f64 % 0u); // expected-error{{invalid operands to binary expression}} + (void)(f64 % 0ul); // expected-error{{invalid operands to binary expression}} + (void)(f64 % 0.f); // expected-error{{invalid operands to binary expression}} + (void)(f64 % 0.); // expected-error{{invalid operands to binary expression}} }