From 8fb055932c085da21f3b721995a06f42006744bd Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Wed, 2 Sep 2020 08:09:24 -0400 Subject: [PATCH 01/26] [VectorCombine] allow vector loads with mismatched insert type This is an enhancement to D81766 to allow loading the minimum target vector type into an IR vector with a different number of elements. In one of the motivating tests from PR16739, SLP creates <2 x float> load ops mixed with <4 x float> insert ops, so we want to handle that pattern in addition to potential oversized vectors created by the vectorizers. For now, we are assuming the insert/extract subvector with undef is free because there is no exact corresponding TTI modeling for that. Differential Revision: https://reviews.llvm.org/D86160 --- .../Transforms/Vectorize/VectorCombine.cpp | 36 ++++++++++++------- .../test/Transforms/VectorCombine/X86/load.ll | 28 ++++++--------- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp index 1cc0e40da3a2..a954b9b29315 100644 --- a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp +++ b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp @@ -100,36 +100,36 @@ bool VectorCombine::vectorizeLoadInsert(Instruction &I) { Type *ScalarTy = Scalar->getType(); if (!Load || !Load->isSimple()) return false; + auto *Ty = dyn_cast(I.getType()); + if (!Ty) + return false; // TODO: Extend this to match GEP with constant offsets. Value *PtrOp = Load->getPointerOperand()->stripPointerCasts(); assert(isa(PtrOp->getType()) && "Expected a pointer type"); - unsigned VectorSize = TTI.getMinVectorRegisterBitWidth(); + unsigned MinVectorSize = TTI.getMinVectorRegisterBitWidth(); uint64_t ScalarSize = ScalarTy->getPrimitiveSizeInBits(); - if (!ScalarSize || !VectorSize || VectorSize % ScalarSize != 0) + if (!ScalarSize || !MinVectorSize || MinVectorSize % ScalarSize != 0) return false; // Check safety of replacing the scalar load with a larger vector load. - unsigned VecNumElts = VectorSize / ScalarSize; - auto *VectorTy = VectorType::get(ScalarTy, VecNumElts, false); - // TODO: Allow insert/extract subvector if the type does not match. - if (VectorTy != I.getType()) - return false; + unsigned MinVecNumElts = MinVectorSize / ScalarSize; + auto *MinVecTy = VectorType::get(ScalarTy, MinVecNumElts, false); Align Alignment = Load->getAlign(); const DataLayout &DL = I.getModule()->getDataLayout(); - if (!isSafeToLoadUnconditionally(PtrOp, VectorTy, Alignment, DL, Load, &DT)) + if (!isSafeToLoadUnconditionally(PtrOp, MinVecTy, Alignment, DL, Load, &DT)) return false; unsigned AS = Load->getPointerAddressSpace(); // Original pattern: insertelt undef, load [free casts of] ScalarPtr, 0 int OldCost = TTI.getMemoryOpCost(Instruction::Load, ScalarTy, Alignment, AS); - APInt DemandedElts = APInt::getOneBitSet(VecNumElts, 0); - OldCost += TTI.getScalarizationOverhead(VectorTy, DemandedElts, true, false); + APInt DemandedElts = APInt::getOneBitSet(MinVecNumElts, 0); + OldCost += TTI.getScalarizationOverhead(MinVecTy, DemandedElts, true, false); // New pattern: load VecPtr - int NewCost = TTI.getMemoryOpCost(Instruction::Load, VectorTy, Alignment, AS); + int NewCost = TTI.getMemoryOpCost(Instruction::Load, MinVecTy, Alignment, AS); // We can aggressively convert to the vector form because the backend can // invert this transform if it does not result in a performance win. @@ -139,8 +139,18 @@ bool VectorCombine::vectorizeLoadInsert(Instruction &I) { // It is safe and potentially profitable to load a vector directly: // inselt undef, load Scalar, 0 --> load VecPtr IRBuilder<> Builder(Load); - Value *CastedPtr = Builder.CreateBitCast(PtrOp, VectorTy->getPointerTo(AS)); - LoadInst *VecLd = Builder.CreateAlignedLoad(VectorTy, CastedPtr, Alignment); + Value *CastedPtr = Builder.CreateBitCast(PtrOp, MinVecTy->getPointerTo(AS)); + Value *VecLd = Builder.CreateAlignedLoad(MinVecTy, CastedPtr, Alignment); + + // If the insert type does not match the target's minimum vector type, + // use an identity shuffle to shrink/grow the vector. + if (Ty != MinVecTy) { + unsigned OutputNumElts = Ty->getNumElements(); + SmallVector Mask(OutputNumElts, UndefMaskElem); + for (unsigned i = 0; i < OutputNumElts && i < MinVecNumElts; ++i) + Mask[i] = i; + VecLd = Builder.CreateShuffleVector(VecLd, UndefValue::get(MinVecTy), Mask); + } replaceValue(I, *VecLd); ++NumVecLoad; return true; diff --git a/llvm/test/Transforms/VectorCombine/X86/load.ll b/llvm/test/Transforms/VectorCombine/X86/load.ll index e24ffb8da66f..f0c5b6ef7ad8 100644 --- a/llvm/test/Transforms/VectorCombine/X86/load.ll +++ b/llvm/test/Transforms/VectorCombine/X86/load.ll @@ -346,12 +346,11 @@ define <4 x float> @load_f32_insert_v4f32_deref(float* align 4 dereferenceable(1 ret <4 x float> %r } -; TODO: Should load v4i32. - define <8 x i32> @load_i32_insert_v8i32(i32* align 16 dereferenceable(16) %p) { ; CHECK-LABEL: @load_i32_insert_v8i32( -; CHECK-NEXT: [[S:%.*]] = load i32, i32* [[P:%.*]], align 4 -; CHECK-NEXT: [[R:%.*]] = insertelement <8 x i32> undef, i32 [[S]], i32 0 +; CHECK-NEXT: [[TMP1:%.*]] = bitcast i32* [[P:%.*]] to <4 x i32>* +; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i32>, <4 x i32>* [[TMP1]], align 4 +; CHECK-NEXT: [[R:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> undef, <8 x i32> ; CHECK-NEXT: ret <8 x i32> [[R]] ; %s = load i32, i32* %p, align 4 @@ -359,13 +358,10 @@ define <8 x i32> @load_i32_insert_v8i32(i32* align 16 dereferenceable(16) %p) { ret <8 x i32> %r } -; TODO: Should load v4i32. - define <8 x i32> @casted_load_i32_insert_v8i32(<4 x i32>* align 4 dereferenceable(16) %p) { ; CHECK-LABEL: @casted_load_i32_insert_v8i32( -; CHECK-NEXT: [[B:%.*]] = bitcast <4 x i32>* [[P:%.*]] to i32* -; CHECK-NEXT: [[S:%.*]] = load i32, i32* [[B]], align 4 -; CHECK-NEXT: [[R:%.*]] = insertelement <8 x i32> undef, i32 [[S]], i32 0 +; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, <4 x i32>* [[P:%.*]], align 4 +; CHECK-NEXT: [[R:%.*]] = shufflevector <4 x i32> [[TMP1]], <4 x i32> undef, <8 x i32> ; CHECK-NEXT: ret <8 x i32> [[R]] ; %b = bitcast <4 x i32>* %p to i32* @@ -374,12 +370,11 @@ define <8 x i32> @casted_load_i32_insert_v8i32(<4 x i32>* align 4 dereferenceabl ret <8 x i32> %r } -; TODO: Should load v4f32. - define <16 x float> @load_f32_insert_v16f32(float* align 16 dereferenceable(16) %p) { ; CHECK-LABEL: @load_f32_insert_v16f32( -; CHECK-NEXT: [[S:%.*]] = load float, float* [[P:%.*]], align 4 -; CHECK-NEXT: [[R:%.*]] = insertelement <16 x float> undef, float [[S]], i32 0 +; CHECK-NEXT: [[TMP1:%.*]] = bitcast float* [[P:%.*]] to <4 x float>* +; CHECK-NEXT: [[TMP2:%.*]] = load <4 x float>, <4 x float>* [[TMP1]], align 4 +; CHECK-NEXT: [[R:%.*]] = shufflevector <4 x float> [[TMP2]], <4 x float> undef, <16 x i32> ; CHECK-NEXT: ret <16 x float> [[R]] ; %s = load float, float* %p, align 4 @@ -387,12 +382,11 @@ define <16 x float> @load_f32_insert_v16f32(float* align 16 dereferenceable(16) ret <16 x float> %r } -; TODO: Should load v4f32. - define <2 x float> @load_f32_insert_v2f32(float* align 16 dereferenceable(16) %p) { ; CHECK-LABEL: @load_f32_insert_v2f32( -; CHECK-NEXT: [[S:%.*]] = load float, float* [[P:%.*]], align 4 -; CHECK-NEXT: [[R:%.*]] = insertelement <2 x float> undef, float [[S]], i32 0 +; CHECK-NEXT: [[TMP1:%.*]] = bitcast float* [[P:%.*]] to <4 x float>* +; CHECK-NEXT: [[TMP2:%.*]] = load <4 x float>, <4 x float>* [[TMP1]], align 4 +; CHECK-NEXT: [[R:%.*]] = shufflevector <4 x float> [[TMP2]], <4 x float> undef, <2 x i32> ; CHECK-NEXT: ret <2 x float> [[R]] ; %s = load float, float* %p, align 4 From 626c3738cdfa49527097fccdf89e22949138ade7 Mon Sep 17 00:00:00 2001 From: Venkataramanan Kumar Date: Wed, 2 Sep 2020 08:23:48 -0400 Subject: [PATCH 02/26] [InstCombine] Transform 1.0/sqrt(X) * X to X/sqrt(X) These transforms will now be performed irrespective of the number of uses for the expression "1.0/sqrt(X)": 1.0/sqrt(X) * X => X/sqrt(X) X * 1.0/sqrt(X) => X/sqrt(X) We already handle more general cases, and we are intentionally not creating extra (and likely expensive) fdiv ops in IR. This pattern is the exception to the rule because we always expect the Backend to reduce X/sqrt(X) to sqrt(X), if it has the necessary (reassoc) fast-math-flags. Ref: DagCombiner optimizes the X/sqrt(X) to sqrt(X). Differential Revision: https://reviews.llvm.org/D86726 --- .../InstCombine/InstCombineMulDivRem.cpp | 15 +++++++++++++++ llvm/test/Transforms/InstCombine/fmul-sqrt.ll | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp index 26db91cc5112..99f19d9663b7 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp @@ -544,6 +544,21 @@ Instruction *InstCombinerImpl::visitFMul(BinaryOperator &I) { return replaceInstUsesWith(I, Sqrt); } + // The following transforms are done irrespective of the number of uses + // for the expression "1.0/sqrt(X)". + // 1) 1.0/sqrt(X) * X -> X/sqrt(X) + // 2) X * 1.0/sqrt(X) -> X/sqrt(X) + // We always expect the backend to reduce X/sqrt(X) to sqrt(X), if it + // has the necessary (reassoc) fast-math-flags. + if (I.hasNoSignedZeros() && + match(Op0, (m_FDiv(m_SpecificFP(1.0), m_Value(Y)))) && + match(Y, m_Intrinsic(m_Value(X))) && Op1 == X) + return BinaryOperator::CreateFDivFMF(X, Y, &I); + if (I.hasNoSignedZeros() && + match(Op1, (m_FDiv(m_SpecificFP(1.0), m_Value(Y)))) && + match(Y, m_Intrinsic(m_Value(X))) && Op0 == X) + return BinaryOperator::CreateFDivFMF(X, Y, &I); + // Like the similar transform in instsimplify, this requires 'nsz' because // sqrt(-0.0) = -0.0, and -0.0 * -0.0 does not simplify to -0.0. if (I.hasNoNaNs() && I.hasNoSignedZeros() && Op0 == Op1 && diff --git a/llvm/test/Transforms/InstCombine/fmul-sqrt.ll b/llvm/test/Transforms/InstCombine/fmul-sqrt.ll index de030bb59c56..e77a828729e1 100644 --- a/llvm/test/Transforms/InstCombine/fmul-sqrt.ll +++ b/llvm/test/Transforms/InstCombine/fmul-sqrt.ll @@ -103,7 +103,7 @@ define double @rsqrt_x_reassociate_extra_use(double %x, double * %p) { ; CHECK-LABEL: @rsqrt_x_reassociate_extra_use( ; CHECK-NEXT: [[SQRT:%.*]] = call double @llvm.sqrt.f64(double [[X:%.*]]) ; CHECK-NEXT: [[RSQRT:%.*]] = fdiv double 1.000000e+00, [[SQRT]] -; CHECK-NEXT: [[RES:%.*]] = fmul reassoc nsz double [[RSQRT]], [[X]] +; CHECK-NEXT: [[RES:%.*]] = fdiv reassoc nsz double [[X:%.*]], [[SQRT]] ; CHECK-NEXT: store double [[RSQRT]], double* [[P:%.*]], align 8 ; CHECK-NEXT: ret double [[RES]] ; @@ -119,7 +119,7 @@ define <2 x float> @x_add_y_rsqrt_reassociate_extra_use(<2 x float> %x, <2 x flo ; CHECK-NEXT: [[ADD:%.*]] = fadd fast <2 x float> [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: [[SQRT:%.*]] = call fast <2 x float> @llvm.sqrt.v2f32(<2 x float> [[ADD]]) ; CHECK-NEXT: [[RSQRT:%.*]] = fdiv fast <2 x float> , [[SQRT]] -; CHECK-NEXT: [[RES:%.*]] = fmul fast <2 x float> [[ADD]], [[RSQRT]] +; CHECK-NEXT: [[RES:%.*]] = fdiv fast <2 x float> [[ADD]], [[SQRT]] ; CHECK-NEXT: store <2 x float> [[RSQRT]], <2 x float>* [[P:%.*]], align 8 ; CHECK-NEXT: ret <2 x float> [[RES]] ; From f5ed22f09dd95c879b57a11c42d2fa7f5ef5e72d Mon Sep 17 00:00:00 2001 From: Jakub Lichman Date: Wed, 26 Aug 2020 16:41:04 +0000 Subject: [PATCH 03/26] [mlir][VectorToSCF] 128 byte alignment of alloc ops Added 128 byte alignment to alloc ops created in VectorToSCF pass. 128b alignment was already introduced to this pass but not to all alloc ops. This commit changes that by adding 128b alignment to the remaining ops. The point of specifying alignment is to prevent possible memory alignment errors on weakly tested architectures. Differential Revision: https://reviews.llvm.org/D86454 --- mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp | 12 ++++++++---- .../test/Conversion/VectorToSCF/vector-to-loops.mlir | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp b/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp index 0f428f887d12..267aea90cc9d 100644 --- a/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp +++ b/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp @@ -35,6 +35,8 @@ #include "mlir/Pass/Pass.h" #include "mlir/Transforms/Passes.h" +#define ALIGNMENT_SIZE 128 + using namespace mlir; using namespace mlir::edsc; using namespace mlir::edsc::intrinsics; @@ -232,8 +234,8 @@ static Value setAllocAtFunctionEntry(MemRefType memRefMinorVectorType, op->getParentWithTrait(); assert(scope && "Expected op to be inside automatic allocation scope"); b.setInsertionPointToStart(&scope->getRegion(0).front()); - Value res = - std_alloca(memRefMinorVectorType, ValueRange{}, b.getI64IntegerAttr(128)); + Value res = std_alloca(memRefMinorVectorType, ValueRange{}, + b.getI64IntegerAttr(ALIGNMENT_SIZE)); return res; } @@ -575,7 +577,8 @@ LogicalResult VectorTransferRewriter::matchAndRewrite( steps.push_back(std_constant_index(step)); // 2. Emit alloc-copy-load-dealloc. - Value tmp = std_alloc(tmpMemRefType(transfer)); + Value tmp = std_alloc(tmpMemRefType(transfer), ValueRange{}, + rewriter.getI64IntegerAttr(ALIGNMENT_SIZE)); StdIndexedValue local(tmp); Value vec = vector_type_cast(tmp); loopNestBuilder(lbs, ubs, steps, [&](ValueRange loopIvs) { @@ -648,7 +651,8 @@ LogicalResult VectorTransferRewriter::matchAndRewrite( steps.push_back(std_constant_index(step)); // 2. Emit alloc-store-copy-dealloc. - Value tmp = std_alloc(tmpMemRefType(transfer)); + Value tmp = std_alloc(tmpMemRefType(transfer), ValueRange{}, + rewriter.getI64IntegerAttr(ALIGNMENT_SIZE)); StdIndexedValue local(tmp); Value vec = vector_type_cast(tmp); std_store(vectorValue, vec); diff --git a/mlir/test/Conversion/VectorToSCF/vector-to-loops.mlir b/mlir/test/Conversion/VectorToSCF/vector-to-loops.mlir index 5c2da799d861..b19ea9dde793 100644 --- a/mlir/test/Conversion/VectorToSCF/vector-to-loops.mlir +++ b/mlir/test/Conversion/VectorToSCF/vector-to-loops.mlir @@ -68,7 +68,7 @@ func @materialize_read(%M: index, %N: index, %O: index, %P: index) { // CHECK-NEXT: affine.for %[[I1:.*]] = 0 to %{{.*}} { // CHECK-NEXT: affine.for %[[I2:.*]] = 0 to %{{.*}} { // CHECK-NEXT: affine.for %[[I3:.*]] = 0 to %{{.*}} step 5 { - // CHECK: %[[ALLOC:.*]] = alloc() : memref<5x4x3xf32> + // CHECK: %[[ALLOC:.*]] = alloc() {alignment = 128 : i64} : memref<5x4x3xf32> // CHECK-NEXT: scf.for %[[I4:.*]] = %[[C0]] to %[[C3]] step %[[C1]] { // CHECK-NEXT: scf.for %[[I5:.*]] = %[[C0]] to %[[C4]] step %[[C1]] { // CHECK-NEXT: scf.for %[[I6:.*]] = %[[C0]] to %[[C5]] step %[[C1]] { @@ -145,7 +145,7 @@ func @materialize_write(%M: index, %N: index, %O: index, %P: index) { // CHECK-NEXT: affine.for %[[I1:.*]] = 0 to %{{.*}} step 4 { // CHECK-NEXT: affine.for %[[I2:.*]] = 0 to %{{.*}} { // CHECK-NEXT: affine.for %[[I3:.*]] = 0 to %{{.*}} step 5 { - // CHECK: %[[ALLOC:.*]] = alloc() : memref<5x4x3xf32> + // CHECK: %[[ALLOC:.*]] = alloc() {alignment = 128 : i64} : memref<5x4x3xf32> // CHECK-NEXT: %[[VECTOR_VIEW:.*]] = vector.type_cast {{.*}} : memref<5x4x3xf32> // CHECK: store %{{.*}}, {{.*}} : memref> // CHECK-NEXT: scf.for %[[I4:.*]] = %[[C0]] to %[[C3]] step %[[C1]] { From 6d36b22b219f663b9b8317147ea8f7a9cb4e18dc Mon Sep 17 00:00:00 2001 From: David Stenberg Date: Wed, 2 Sep 2020 08:46:53 +0200 Subject: [PATCH 04/26] [GlobalOpt] Fix an incorrect Modified status When marking a global variable constant, and simplifying users using CleanupConstantGlobalUsers(), the pass could incorrectly return false if there were still some uses left, and no further optimizations was done. This was caught using the check introduced by D80916. This fixes PR46749. Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D85837 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp | 12 +++++--- .../GlobalOpt/const-return-status-atomic.ll | 27 ++++++++++++++++++ .../GlobalOpt/const-return-status.ll | 28 +++++++++++++++++++ 3 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 llvm/test/Transforms/GlobalOpt/const-return-status-atomic.ll create mode 100644 llvm/test/Transforms/GlobalOpt/const-return-status.ll diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp index 05d1465b3663..f3053398cd5a 100644 --- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp +++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp @@ -1990,12 +1990,13 @@ processInternalGlobal(GlobalVariable *GV, const GlobalStatus &GS, return true; } + bool Changed = false; + // If the global is never loaded (but may be stored to), it is dead. // Delete it now. if (!GS.IsLoaded) { LLVM_DEBUG(dbgs() << "GLOBAL NEVER LOADED: " << *GV << "\n"); - bool Changed; if (isLeakCheckerRoot(GV)) { // Delete any constant stores to the global. Changed = CleanupPointerRootUsers(GV, GetTLI); @@ -2021,11 +2022,14 @@ processInternalGlobal(GlobalVariable *GV, const GlobalStatus &GS, // Don't actually mark a global constant if it's atomic because atomic loads // are implemented by a trivial cmpxchg in some edge-cases and that usually // requires write access to the variable even if it's not actually changed. - if (GS.Ordering == AtomicOrdering::NotAtomic) + if (GS.Ordering == AtomicOrdering::NotAtomic) { + assert(!GV->isConstant() && "Expected a non-constant global"); GV->setConstant(true); + Changed = true; + } // Clean up any obviously simplifiable users now. - CleanupConstantGlobalUsers(GV, GV->getInitializer(), DL, GetTLI); + Changed |= CleanupConstantGlobalUsers(GV, GV->getInitializer(), DL, GetTLI); // If the global is dead now, just nuke it. if (GV->use_empty()) { @@ -2085,7 +2089,7 @@ processInternalGlobal(GlobalVariable *GV, const GlobalStatus &GS, } } - return false; + return Changed; } /// Analyze the specified global variable and optimize it if possible. If we diff --git a/llvm/test/Transforms/GlobalOpt/const-return-status-atomic.ll b/llvm/test/Transforms/GlobalOpt/const-return-status-atomic.ll new file mode 100644 index 000000000000..f52ba05e6c19 --- /dev/null +++ b/llvm/test/Transforms/GlobalOpt/const-return-status-atomic.ll @@ -0,0 +1,27 @@ +; RUN: opt -globalopt < %s -S -o - | FileCheck %s + +; When simplifying users of a global variable, the pass could incorrectly +; return false if there were still some uses left, and no further optimizations +; was done. This was caught by the pass return status check that is hidden +; under EXPENSIVE_CHECKS. + +@GV1 = internal unnamed_addr global i64 1, align 8 + +; CHECK: @GV1 = internal unnamed_addr global i64 1, align 8 + +define void @test1() local_unnamed_addr { +; CHECK-LABEL: @test1 +; CHECK-NEXT: %val = load atomic i8 +; CHECK-NEXT: ret void + + %val = load atomic i8, i8* bitcast (i64* @GV1 to i8*) acquire, align 8 + ret void +} + +define i64 @test2() local_unnamed_addr { +; CHECK-LABEL: @test2 +; CHECK-NEXT: ret i64 1 + + %val = load atomic i64, i64* @GV1 acquire, align 8 + ret i64 %val +} diff --git a/llvm/test/Transforms/GlobalOpt/const-return-status.ll b/llvm/test/Transforms/GlobalOpt/const-return-status.ll new file mode 100644 index 000000000000..32c4eb895dc1 --- /dev/null +++ b/llvm/test/Transforms/GlobalOpt/const-return-status.ll @@ -0,0 +1,28 @@ +; RUN: opt -globalopt < %s -S -o - | FileCheck %s + +; When simplifying users of a global variable, the pass could incorrectly +; return false if there were still some uses left, and no further optimizations +; was done. This was caught by the pass return status check that is hidden +; under EXPENSIVE_CHECKS. + +; CHECK: @src = internal unnamed_addr constant + +; CHECK: entry: +; CHECK-NEXT: %call = call i32 @f(i32 0) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 bitcast (i32* @dst to i8*), i8* align 4 bitcast ([1 x i32]* @src to i8*), i64 1, i1 false) +; CHECK-NEXT: ret void + +@src = internal unnamed_addr global [1 x i32] zeroinitializer, align 4 +@dst = external dso_local local_unnamed_addr global i32, align 4 + +define dso_local void @d() local_unnamed_addr { +entry: + %0 = load i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @src, i64 0, i64 0), align 4 + %call = call i32 @f(i32 %0) + call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 bitcast (i32* @dst to i8*), i8* align 4 bitcast ([1 x i32]* @src to i8*), i64 1, i1 false) + ret void +} + +declare dso_local i32 @f(i32) local_unnamed_addr + +declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) From 1b88bbf5eb80b38a4dee129df969d5632993fdd1 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 2 Sep 2020 09:24:36 -0400 Subject: [PATCH 05/26] Revert "[mlir] Extend BufferAssignmentTypeConverter with result conversion callbacks" This reverts commit 94f5d248772ba0f1f9c8b0746fe75a5d246c5540 because of failing the following tests: MLIR :: Dialect/Linalg/tensors-to-buffers.mlir MLIR :: Transforms/buffer-placement-preparation-allowed-memref-results.mlir MLIR :: Transforms/buffer-placement-preparation.mlir --- .../include/mlir/Transforms/BufferPlacement.h | 344 +++++++++--------- .../Linalg/Transforms/TensorsToBuffers.cpp | 11 +- mlir/lib/Transforms/BufferPlacement.cpp | 220 +---------- ...nt-preparation-allowed-memref-results.mlir | 66 ---- .../buffer-placement-preparation.mlir | 85 ----- mlir/test/lib/Dialect/Test/TestOps.td | 29 +- .../lib/Transforms/TestBufferPlacement.cpp | 48 +-- 7 files changed, 191 insertions(+), 612 deletions(-) diff --git a/mlir/include/mlir/Transforms/BufferPlacement.h b/mlir/include/mlir/Transforms/BufferPlacement.h index 8fc254e6be1e..f8559a9dd939 100644 --- a/mlir/include/mlir/Transforms/BufferPlacement.h +++ b/mlir/include/mlir/Transforms/BufferPlacement.h @@ -52,111 +52,6 @@ class BufferAssignmentPlacer { Operation *operation; }; -/// A helper type converter class for using inside Buffer Assignment operation -/// conversion patterns. The default constructor keeps all the types intact -/// except for the ranked-tensor types which is converted to memref types. -class BufferAssignmentTypeConverter : public TypeConverter { -public: - /// This enum is for showing how buffer placement operation converters should - /// conduct with certain result type after type conversion. This value can be - /// set/get for each specific type using setResultConversionKind or - /// getResultConversionKind. - enum ResultConversionKind { AppendToArgumentsList, KeepAsFunctionResult }; - - BufferAssignmentTypeConverter(); - - /// This method tries to decompose a value of a certain type using provided - /// decompose callback functions. If it is unable to do so, the original value - /// is returned. - void tryDecomposeValue(OpBuilder &, Location, Type, Value, - SmallVectorImpl &); - - /// This method tries to decompose a type using provided decompose callback - /// functions. If it is unable to do so, the original type is returned. - void tryDecomposeType(Type, SmallVectorImpl &); - - /// This method registers a callback function that will be called to decompose - /// a value of a certain type into several values. - template ::template arg_t<2>> - void addDecomposeValueConversion(FnT &&callback) { - decomposeValueConversions.emplace_back( - wrapDecomposeValueConversionCallback(std::forward(callback))); - } - - /// This method registers a callback function that will be called to decompose - /// a type into several types. - template ::template arg_t<0>> - void addDecomposeTypeConversion(FnT &&callback) { - auto wrapper = - wrapDecomposeTypeConversionCallback(std::forward(callback)); - decomposeTypeConversions.emplace_back(wrapper); - addConversion(std::forward(callback)); - } - - /// This method returns ResultConversionKind for the mapping from `origin` - /// type to `input` type. - ResultConversionKind getResultConversionKind(Type origin, Type input); - - /// This method registers ResultConversionKind for the mapping from type 'T' - /// to type 'U'. - template - void setResultConversionKind(ResultConversionKind kind) { - assert((kind != AppendToArgumentsList || - llvm::is_one_of::value) && - "Only the memref typed values can be set to be appended to the " - "function argument list at the moment"); - resultTypeConversions.emplace_back( - [&](Type origin, Type input) -> Optional { - if (origin.template isa() && input.template isa()) - return kind; - return llvm::None; - }); - } - -private: - using DecomposeValueConversionCallFn = std::function( - OpBuilder &, Location, Type, Value, SmallVectorImpl &)>; - - using DecomposeTypeConversionCallFn = - std::function(Type, SmallVectorImpl &)>; - - using ResultConversionKindFn = - std::function(Type, Type)>; - - /// Generate a wrapper for the given decompose value conversion callback. - template - DecomposeValueConversionCallFn - wrapDecomposeValueConversionCallback(FnT &&callback) { - return [callback = std::forward(callback)]( - OpBuilder &builder, Location loc, Type type, Value value, - SmallVectorImpl &newValues) -> Optional { - if (T derivedType = type.dyn_cast()) - return callback(builder, loc, derivedType, value, newValues); - return llvm::None; - }; - } - - /// Generate a wrapper for the given decompose type conversion callback. - template - DecomposeTypeConversionCallFn - wrapDecomposeTypeConversionCallback(FnT &&callback) { - return [callback = std::forward(callback)]( - Type type, - SmallVectorImpl &results) -> Optional { - T derivedType = type.dyn_cast(); - if (!derivedType) - return llvm::None; - return callback(derivedType, results); - }; - } - - SmallVector resultTypeConversions; - SmallVector decomposeValueConversions; - SmallVector decomposeTypeConversions; -}; - /// Helper conversion pattern that encapsulates a BufferAssignmentPlacer /// instance. Sample usage: /// class CustomConversionPattern : public @@ -173,22 +68,43 @@ class BufferAssignmentOpConversionPattern public: explicit BufferAssignmentOpConversionPattern( MLIRContext *context, BufferAssignmentPlacer *bufferAssignment = nullptr, - BufferAssignmentTypeConverter *converter = nullptr, - PatternBenefit benefit = 1) + TypeConverter *converter = nullptr, PatternBenefit benefit = 1) : OpConversionPattern(context, benefit), - bufferAssignment(bufferAssignment), converter(converter) { - assert(converter && "The type converter has not been defined"); - } + bufferAssignment(bufferAssignment), converter(converter) {} protected: BufferAssignmentPlacer *bufferAssignment; - BufferAssignmentTypeConverter *converter; + TypeConverter *converter; +}; + +/// A helper type converter class for using inside Buffer Assignment operation +/// conversion patterns. The default constructor keeps all the types intact +/// except for the ranked-tensor types which is converted to memref types. +class BufferAssignmentTypeConverter : public TypeConverter { +public: + BufferAssignmentTypeConverter(); + + /// A helper function to check if `type` has been converted from non-memref + /// type to memref. + static bool isConvertedMemref(Type type, Type before); }; -/// Converts the signature of the function using BufferAssignmentTypeConverter. -/// Each result type of the function is kept as a function result or appended to -/// the function arguments list based on ResultConversionKind for the converted -/// result type. +namespace detail { + +/// Converts the signature of the function based on whether the function is +/// allowed to return memref typed results or not using +/// `allowMemrefFunctionResults` parameter. If this option is false, then it +/// adds an extra function argument as an output buffer for each function result +/// which is going to be a memref type only after type conversion. The +/// other function result types remain unchanged. If +/// `allowMemrefFunctionResults` is true, the types are converted in place. +/// Any changes in function signature need to be applied +/// to return and caller operations. `BufferAssignmentReturnOpConverter` and +/// `BufferAssignmentCallOpConverter` are two helper function that match the +/// return and caller operation with the new function signature. Furthermore, +/// `BufferAssignmentTypeConverter` is a helper `TypeConverter` for converting +/// tensor typed values to memref typed ones. +template class BufferAssignmentFuncOpConverter : public BufferAssignmentOpConversionPattern { public: @@ -196,16 +112,58 @@ class BufferAssignmentFuncOpConverter FuncOp>::BufferAssignmentOpConversionPattern; /// Performs the actual signature rewriting step. - LogicalResult matchAndRewrite(mlir::FuncOp, ArrayRef, - ConversionPatternRewriter &) const; + LogicalResult + matchAndRewrite(mlir::FuncOp funcOp, ArrayRef operands, + ConversionPatternRewriter &rewriter) const final { + if (!converter) + return funcOp.emitError("The type converter has not been defined for " + "BufferAssignmentFuncOpConverter"); + auto funcType = funcOp.getType(); + + // Convert function arguments using the provided TypeConverter. + TypeConverter::SignatureConversion conversion(funcType.getNumInputs()); + for (auto argType : llvm::enumerate(funcType.getInputs())) + conversion.addInputs(argType.index(), + converter->convertType(argType.value())); + + // If allowMemrefFunctionResults is false and a function result type is not + // a memref but it would be a memref after type conversion, a new argument + // should be appended to the function arguments list for this result. + // Otherwise, it remains unchanged as a function result. + SmallVector newResultTypes; + newResultTypes.reserve(funcOp.getNumResults()); + for (Type resType : funcType.getResults()) { + Type convertedType = converter->convertType(resType); + if (!allowMemrefFunctionResults && + BufferAssignmentTypeConverter::isConvertedMemref(convertedType, + resType)) + conversion.addInputs(convertedType); + else + newResultTypes.push_back(convertedType); + } + if (failed(rewriter.convertRegionTypes(&funcOp.getBody(), *converter, + &conversion))) + return failure(); + + // Update the signature of the function. + rewriter.updateRootInPlace(funcOp, [&] { + funcOp.setType(rewriter.getFunctionType(conversion.getConvertedTypes(), + newResultTypes)); + }); + return success(); + } }; /// Rewrites the `ReturnOp` to conform with the changed function signature. -/// Operands that correspond to return values and their types have been set to -/// AppendToArgumentsList are dropped. In their place, a corresponding copy -/// operation from the operand to the target function argument is inserted. +/// if allowMemrefFunctionResults is false, operands that correspond to return +/// values and have been rewritten from illegal typed results to memref +/// arguments are dropped. In their place, a corresponding copy operation from +/// the operand to the output function argument is inserted. Otherwise, the +/// memref typed operands are returned. +/// Note: If this pattern rewriter is used with BufferAssignmentFuncOpConverter, +/// allowMemrefFunctionResults must be set/unset for both. template + typename CopyOpTy, bool allowMemrefFunctionResults> class BufferAssignmentReturnOpConverter : public BufferAssignmentOpConversionPattern { public: @@ -216,48 +174,44 @@ class BufferAssignmentReturnOpConverter LogicalResult matchAndRewrite(ReturnOpSourceTy returnOp, ArrayRef operands, ConversionPatternRewriter &rewriter) const final { - Location loc = returnOp.getLoc(); - - // Split the operands depending on whether they need a copy operation or - // they remain as operands of the return operation. If an operand is - // decomposable and a decompose callback function has been provided by the - // user, it will be unpacked. - SmallVector newOperands, needCopyOperands; - OpBuilder builder(returnOp); - for (auto operand : llvm::enumerate(operands)) { - SmallVector values; - this->converter->tryDecomposeValue( - builder, loc, operand.value().getType(), operand.value(), values); - Type type = returnOp.getOperand(operand.index()).getType(); - SmallVector originTypes; - this->converter->tryDecomposeType(type, originTypes); - for (auto value : llvm::enumerate(values)) { - Type origin = originTypes[value.index()]; - Type converted = value.value().getType(); - auto kind = this->converter->getResultConversionKind(origin, converted); - if (kind == BufferAssignmentTypeConverter::KeepAsFunctionResult) - newOperands.push_back(value.value()); - else - // kind = BufferAssignmentTypeConverter::AppendToArgumentsList - needCopyOperands.push_back(value.value()); - } + // If the memref typed results can be returned as function results, the new + // `ReturnOp` should only return the type converted operands. + if (allowMemrefFunctionResults) { + rewriter.replaceOpWithNewOp(returnOp, operands); + return success(); } - // Insert Copy operations instead for the operands that have been removed - // from operand list and appended to the function arguments list. + // Split the operands by their kinds whether they are converted memref or + // not. + SmallVector needCopyOperands, newOperands; + unsigned operandsSize = operands.size(); + needCopyOperands.reserve(operandsSize); + newOperands.reserve(operandsSize); + for (auto operand : llvm::enumerate(operands)) + if (BufferAssignmentTypeConverter::isConvertedMemref( + operand.value().getType(), + returnOp.getOperand(operand.index()).getType())) + needCopyOperands.push_back(operand.value()); + else + newOperands.push_back(operand.value()); + Block &entryBlock = returnOp.getParentRegion()->front(); unsigned numFuncArgs = entryBlock.getNumArguments(); - if (needCopyOperands.size() > numFuncArgs) - return returnOp.emitError( - "The number of operands that need Copy operations is more " - "than the number of target function arguments."); + + // Find the index of the first destination buffer. + assert(needCopyOperands.size() <= numFuncArgs && + "The number of operands of return operation is more than the " + "number of function arguments."); unsigned destArgNum = numFuncArgs - needCopyOperands.size(); rewriter.setInsertionPoint(returnOp); for (Value operand : needCopyOperands) { - rewriter.create(loc, operand, + // Insert a `CopyOp` for each converted memref-type operand. + rewriter.create(returnOp.getLoc(), operand, entryBlock.getArgument(destArgNum)); ++destArgNum; } + + // Insert the new target Return operation. rewriter.replaceOpWithNewOp(returnOp, newOperands); return success(); } @@ -265,32 +219,94 @@ class BufferAssignmentReturnOpConverter /// Rewrites the `CallOp` to match its operands and results with the signature /// of the callee after rewriting the callee with -/// BufferAssignmentFuncOpConverter. +/// BufferAssignmentFuncOpConverter. If allowMemrefFunctionResults is false, a +/// buffer is allocated as an output buffer only for each memref typed result +/// that has been rewritten. The new allocated buffer is passed through the +/// operands list of the new `CallOp`. +/// Note: If this pattern rewriter is used with BufferAssignmentFuncOpConverter, +/// allowMemrefFunctionResults must be set/unset for both. +template class BufferAssignmentCallOpConverter : public BufferAssignmentOpConversionPattern { public: using BufferAssignmentOpConversionPattern< CallOp>::BufferAssignmentOpConversionPattern; - /// Performs the actual rewriting step. - LogicalResult matchAndRewrite(CallOp, ArrayRef, - ConversionPatternRewriter &) const; + LogicalResult + matchAndRewrite(CallOp callOp, ArrayRef operands, + ConversionPatternRewriter &rewriter) const final { + if (!converter) + return callOp.emitError("The type converter has not been defined for " + "BufferAssignmentCallOpConverter"); + Location loc = callOp.getLoc(); + + // If the memref typed results can be returned as function results, there is + // no need to create output buffers. It is only required to convert the type + // of operands and results in place for creating the new `CallOp`. + if (allowMemrefFunctionResults) { + SmallVector resultTypes; + resultTypes.reserve(callOp.getNumResults()); + for (Type type : callOp.getResultTypes()) + resultTypes.push_back(converter->convertType(type)); + rewriter.replaceOpWithNewOp(callOp, callOp.getCallee(), + resultTypes, operands); + return success(); + } + + SmallVector newOperands, replacingValues; + SmallVector newResultTypes; + unsigned numResults = callOp.getNumResults(); + newOperands.reserve(numResults + operands.size()); + newOperands.append(operands.begin(), operands.end()); + newResultTypes.reserve(numResults); + replacingValues.reserve(numResults); + + // For each memref result of `CallOp` which has not been a memref before + // the type conversion, a new buffer is allocated and passed to the operands + // list of the new `CallOp`. Otherwise, it remains as a caller result. + for (Value result : callOp.getResults()) { + Type currType = result.getType(); + Type newType = converter->convertType(result.getType()); + if (BufferAssignmentTypeConverter::isConvertedMemref(newType, currType)) { + OpBuilder::InsertionGuard guard(rewriter); + rewriter.restoreInsertionPoint(bufferAssignment->computeAllocPosition( + result.dyn_cast())); + Value alloc = + rewriter.create(loc, newType.dyn_cast()); + newOperands.push_back(alloc); + replacingValues.push_back(alloc); + } else { + newResultTypes.push_back(currType); + + // No replacing is required. + replacingValues.push_back(nullptr); + } + } + + // Creating the new `CallOp`. + rewriter.create(loc, callOp.getCallee(), newResultTypes, + newOperands); + + // Replacing the results of the old `CallOp`. + rewriter.replaceOp(callOp, replacingValues); + return success(); + } }; +} // end namespace detail /// Populates `patterns` with the conversion patterns of buffer /// assignment. template + typename CopyOpTy, bool allowMemrefFunctionResults> static void populateWithBufferAssignmentOpConversionPatterns( MLIRContext *context, BufferAssignmentPlacer *placer, - BufferAssignmentTypeConverter *converter, - OwningRewritePatternList *patterns) { + TypeConverter *converter, OwningRewritePatternList *patterns) { // clang-format off patterns->insert< - BufferAssignmentCallOpConverter, - BufferAssignmentFuncOpConverter, - BufferAssignmentReturnOpConverter - + detail::BufferAssignmentCallOpConverter, + detail::BufferAssignmentFuncOpConverter, + detail::BufferAssignmentReturnOpConverter + >(context, placer, converter); // clang-format on } diff --git a/mlir/lib/Dialect/Linalg/Transforms/TensorsToBuffers.cpp b/mlir/lib/Dialect/Linalg/Transforms/TensorsToBuffers.cpp index 89a01f9ca629..04c1fbd5d565 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/TensorsToBuffers.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/TensorsToBuffers.cpp @@ -100,11 +100,11 @@ class GenericOpConverter /// tensors to buffers. static void populateConvertLinalgOnTensorsToBuffersPattern( MLIRContext *context, BufferAssignmentPlacer *placer, - BufferAssignmentTypeConverter *converter, - OwningRewritePatternList *patterns) { + TypeConverter *converter, OwningRewritePatternList *patterns) { populateWithBufferAssignmentOpConversionPatterns< - mlir::ReturnOp, mlir::ReturnOp, linalg::CopyOp>(context, placer, - converter, patterns); + mlir::ReturnOp, mlir::ReturnOp, linalg::CopyOp, + /*allowMemrefFunctionResults=*/false>(context, placer, converter, + patterns); patterns->insert(context, placer, converter); } @@ -141,9 +141,6 @@ struct ConvertLinalgOnTensorsToBuffers converter.isLegal(&funcOp.getBody()); }); - converter.setResultConversionKind( - BufferAssignmentTypeConverter::AppendToArgumentsList); - // Walk over all the functions to apply buffer assignment. getOperation().walk([&](FuncOp function) -> WalkResult { OwningRewritePatternList patterns; diff --git a/mlir/lib/Transforms/BufferPlacement.cpp b/mlir/lib/Transforms/BufferPlacement.cpp index 1ab3e7e2e48d..201570a244ff 100644 --- a/mlir/lib/Transforms/BufferPlacement.cpp +++ b/mlir/lib/Transforms/BufferPlacement.cpp @@ -713,223 +713,9 @@ BufferAssignmentTypeConverter::BufferAssignmentTypeConverter() { }); } -/// This method tries to decompose a value of a certain type using provided -/// decompose callback functions. If it is unable to do so, the original value -/// is returned. -void BufferAssignmentTypeConverter::tryDecomposeValue( - OpBuilder &builder, Location loc, Type type, Value value, - SmallVectorImpl &results) { - for (auto conversion : decomposeValueConversions) - if (conversion(builder, loc, type, value, results) != llvm::None) - return; - results.push_back(value); -} - -/// This method tries to decompose a type using provided decompose callback -/// functions. If it is unable to do so, the original type is returned. -void BufferAssignmentTypeConverter::tryDecomposeType( - Type type, SmallVectorImpl &types) { - for (auto conversion : decomposeTypeConversions) - if (conversion(type, types) != llvm::None) - return; - types.push_back(type); -} - -/// This method returns ResultConversionKind for the input type. -BufferAssignmentTypeConverter::ResultConversionKind -BufferAssignmentTypeConverter::getResultConversionKind(Type origin, - Type converted) { - for (auto conversion : resultTypeConversions) { - auto res = conversion(origin, converted); - if (res != llvm::None) - return res.getValue(); - } - return KeepAsFunctionResult; -} - -//===----------------------------------------------------------------------===// -// BufferAssignmentFuncOpConverter -//===----------------------------------------------------------------------===// - -/// Performs the actual function signature rewriting step. -LogicalResult BufferAssignmentFuncOpConverter::matchAndRewrite( - mlir::FuncOp funcOp, ArrayRef operands, - ConversionPatternRewriter &rewriter) const { - auto funcType = funcOp.getType(); - - // Convert function arguments using the provided TypeConverter. - TypeConverter::SignatureConversion conversion(funcType.getNumInputs()); - for (auto argType : llvm::enumerate(funcType.getInputs())) { - SmallVector decomposedTypes, convertedTypes; - converter->tryDecomposeType(argType.value(), decomposedTypes); - converter->convertTypes(decomposedTypes, convertedTypes); - conversion.addInputs(argType.index(), convertedTypes); - } - - // Convert the result types of the function. - SmallVector newResultTypes; - newResultTypes.reserve(funcOp.getNumResults()); - for (Type resultType : funcType.getResults()) { - SmallVector originTypes; - converter->tryDecomposeType(resultType, originTypes); - for (auto origin : originTypes) { - Type converted = converter->convertType(origin); - auto kind = converter->getResultConversionKind(origin, converted); - if (kind == BufferAssignmentTypeConverter::AppendToArgumentsList) - conversion.addInputs(converted); - else - // kind = BufferAssignmentTypeConverter::KeepAsFunctionResult - newResultTypes.push_back(converted); - } - } - - if (failed(rewriter.convertRegionTypes(&funcOp.getBody(), *converter, - &conversion))) - return failure(); - - // Update the signature of the function. - rewriter.updateRootInPlace(funcOp, [&] { - funcOp.setType(rewriter.getFunctionType(conversion.getConvertedTypes(), - newResultTypes)); - }); - return success(); -} - -//===----------------------------------------------------------------------===// -// BufferAssignmentCallOpConverter -//===----------------------------------------------------------------------===// - -/// Performs the actual rewriting step. -LogicalResult BufferAssignmentCallOpConverter::matchAndRewrite( - CallOp callOp, ArrayRef operands, - ConversionPatternRewriter &rewriter) const { - - // This class represents a mapping from a result to a list of values and some - // results that have not yet constructed. Instead, the indices of these - // results in the operation that will be constructed are known. They will be - // replaced with the actual values when they are available. The order of - // adding to this mapping is important. - class ResultMapping { - public: - ResultMapping() { order = 0; }; - - /// Add an available value to the mapping. - void addMapping(Value value) { - toValuesMapping.push_back({order++, value}); - } - - /// Add the index of unavailble result value to the mapping. - void addMapping(unsigned index) { - toIndicesMapping.push_back({order++, index}); - } - - /// This method returns the mapping values list. The unknown result values - /// that only their indicies are available are replaced with their values. - void getMappingValues(ValueRange valuesToReplaceIndices, - SmallVectorImpl &values) { - // Append available values to the list. - SmallVector, 2> res(toValuesMapping.begin(), - toValuesMapping.end()); - // Replace the indices with the actual values. - llvm::for_each( - toIndicesMapping, [&](const std::pair &entry) { - assert(entry.second < valuesToReplaceIndices.size() && - "The value index is out of range."); - res.push_back({entry.first, valuesToReplaceIndices[entry.second]}); - }); - // Sort the values based on their adding orders. - llvm::sort(res, [](const std::pair &v1, - const std::pair &v2) { - return v1.first < v2.first; - }); - // Fill the values. - llvm::for_each(res, [&](const std::pair &entry) { - values.push_back(entry.second); - }); - } - - private: - /// Keeping the inserting order of mapping values. - int order; - - /// Containing the mapping values with their inserting orders. - SmallVector, 2> toValuesMapping; - - /// Containing the indices of result values with their inserting orders. - SmallVector, 2> toIndicesMapping; - }; - - Location loc = callOp.getLoc(); - OpBuilder builder(callOp); - SmallVector newOperands; - - // Create the operands list of the new `CallOp`. It unpacks the decomposable - // values if a decompose callback function has been provided by the user. - for (auto operand : operands) { - SmallVector values; - this->converter->tryDecomposeValue(builder, loc, operand.getType(), operand, - values); - newOperands.append(values.begin(), values.end()); - } - - // Create the new result types for the new `CallOp` and a mapping from the old - // result to new value(s). - SmallVector newResultTypes; - SmallVector mappings; - mappings.resize(callOp.getNumResults()); - for (auto result : llvm::enumerate(callOp.getResults())) { - SmallVector originTypes; - converter->tryDecomposeType(result.value().getType(), originTypes); - auto &resultMapping = mappings[result.index()]; - for (Type origin : originTypes) { - Type converted = converter->convertType(origin); - auto kind = converter->getResultConversionKind(origin, converted); - if (kind == BufferAssignmentTypeConverter::KeepAsFunctionResult) { - newResultTypes.push_back(converted); - // The result value is not yet available. Its index is kept and it is - // replaced with the actual value of the new `CallOp` later. - resultMapping.addMapping(newResultTypes.size() - 1); - } else { - // kind = BufferAssignmentTypeConverter::AppendToArgumentsList - OpBuilder::InsertionGuard guard(rewriter); - rewriter.restoreInsertionPoint( - bufferAssignment->computeAllocPosition(result.value())); - MemRefType memref = converted.dyn_cast(); - if (!memref) - return callOp.emitError("Cannot allocate for a non-Memref type"); - Value alloc = rewriter.create(loc, memref); - newOperands.push_back(alloc); - resultMapping.addMapping(alloc); - } - } - } - - CallOp newCallOp = rewriter.create(loc, callOp.getCallee(), - newResultTypes, newOperands); - - // Build a replacing value for each result to replace its uses. If a result - // has multiple mapping values, it needs to be packed to a single value. - OpBuilder nextBuilder(callOp.getOperation()->getNextNode()); - SmallVector replacedValues; - replacedValues.reserve(callOp.getNumResults()); - for (unsigned i = 0, e = callOp.getNumResults(); i < e; ++i) { - SmallVector valuesToPack; - mappings[i].getMappingValues(newCallOp.getResults(), valuesToPack); - if (valuesToPack.empty()) { - // No replacement is required. - replacedValues.push_back(nullptr); - } else if (valuesToPack.size() == 1) { - replacedValues.push_back(valuesToPack.front()); - } else { - // Values need to be packed using callback function. The same callback - // that is used for materializeArgumentConversion is used for packing. - Value packed = converter->materializeArgumentConversion( - nextBuilder, loc, callOp.getType(i), valuesToPack); - replacedValues.push_back(packed); - } - } - rewriter.replaceOp(callOp, replacedValues); - return success(); +/// Checks if `type` has been converted from non-memref type to memref. +bool BufferAssignmentTypeConverter::isConvertedMemref(Type type, Type before) { + return type.isa() && !before.isa(); } //===----------------------------------------------------------------------===// diff --git a/mlir/test/Transforms/buffer-placement-preparation-allowed-memref-results.mlir b/mlir/test/Transforms/buffer-placement-preparation-allowed-memref-results.mlir index e1dacdf0184e..084ac38af6e3 100644 --- a/mlir/test/Transforms/buffer-placement-preparation-allowed-memref-results.mlir +++ b/mlir/test/Transforms/buffer-placement-preparation-allowed-memref-results.mlir @@ -111,73 +111,7 @@ func @caller(%arg0: tensor<5xf32>) -> tensor<5xf32> { // CHECK: %[[Y:.*]]:2 = call @callee(%[[X]]#0) // CHECK: return %[[Y]]#0 -// ----- - -// Test case: Testing BufferAssginmnetCallOpConverter to see if it matches with the -// signature of the new signature of the callee function when there are tuple typed -// args and results. BufferAssginmentTypeConverter is set to flatten tuple typed -// arguments. The tuple typed values should be decomposed and composed using -// get_tuple_element and make_tuple operations of test dialect. Tensor types are -// converted to Memref. Memref typed function results remain as function results. -// CHECK-LABEL: func @callee -func @callee(%arg0: tuple,i1, tensor<5xf32>>) -> (tuple,i1, tensor<5xf32>>){ - return %arg0 : tuple,i1, tensor<5xf32>> -} -// CHECK-SAME: (%[[ARG0:.*]]: memref<2xf32>, %[[ARG1:.*]]: i1, %[[ARG2:.*]]: memref<5xf32>) -// CHECK-SAME: (memref<2xf32>, i1, memref<5xf32>) -// CHECK-NEXT: %[[TUPLE:.*]] = "test.make_tuple"(%[[ARG0]], %[[ARG1]], %[[ARG2]]) -// CHECK-NEXT: %[[FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 0 : i32} -// CHECK-NEXT: %[[SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 1 : i32} -// CHECK-NEXT: %[[THIRD_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 2 : i32} -// CHECK-NEXT: return %[[FIRST_ELEM]], %[[SECOND_ELEM]], %[[THIRD_ELEM]] -// CHECK-LABEL: func @caller -func @caller(%arg0: tuple,i1, tensor<5xf32>>) -> tuple,i1, tensor<5xf32>>{ - %x0 = call @callee(%arg0) : (tuple,i1, tensor<5xf32>>) -> (tuple,i1, tensor<5xf32>>) - %y0 = call @callee(%x0) : (tuple,i1, tensor<5xf32>>) -> (tuple,i1, tensor<5xf32>>) - return %y0 : tuple,i1, tensor<5xf32>> -} -// CHECK-SAME: (%[[ARG0:.*]]: memref<2xf32>, %[[ARG1:.*]]: i1, %[[ARG2:.*]]: memref<5xf32>) -// CHECK-SAME: (memref<2xf32>, i1, memref<5xf32>) -// CHECK-NEXT: %[[ARG_TUPLE:.*]] = "test.make_tuple"(%[[ARG0]], %[[ARG1]], %[[ARG2]]) -// CHECK-NEXT: %[[FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[ARG_TUPLE]]) {index = 0 : i32} -// CHECK-NEXT: %[[SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[ARG_TUPLE]]) {index = 1 : i32} -// CHECK-NEXT: %[[THIRD_ELEM:.*]] = "test.get_tuple_element"(%[[ARG_TUPLE]]) {index = 2 : i32} -// CHECK-NEXT: %[[CALLEE_RESULTS:.*]]:3 = call @callee(%[[FIRST_ELEM]], %[[SECOND_ELEM]], %[[THIRD_ELEM]]) -// CHECK-SAME: (memref<2xf32>, i1, memref<5xf32>) -> (memref<2xf32>, i1, memref<5xf32>) -// CHECK-NEXT: %[[RESULT_TUPLE:.*]] = "test.make_tuple"(%[[CALLEE_RESULTS]]#0, %[[CALLEE_RESULTS]]#1, %[[CALLEE_RESULTS]]#2) -// CHECK-NEXT: %[[FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[RESULT_TUPLE]]) {index = 0 : i32} -// CHECK-NEXT: %[[SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[RESULT_TUPLE]]) {index = 1 : i32} -// CHECK-NEXT: %[[THIRD_ELEM:.*]] = "test.get_tuple_element"(%[[RESULT_TUPLE]]) {index = 2 : i32} -// CHECK-NEXT: %[[CALLEE_RESULTS:.*]]:3 = call @callee(%[[FIRST_ELEM]], %[[SECOND_ELEM]], %[[THIRD_ELEM]]) -// CHECK-SAME: (memref<2xf32>, i1, memref<5xf32>) -> (memref<2xf32>, i1, memref<5xf32>) -// CHECK-NEXT: %[[RETURN_TUPLE:.*]] = "test.make_tuple"(%[[CALLEE_RESULTS]]#0, %[[CALLEE_RESULTS]]#1, %[[CALLEE_RESULTS]]#2) -// CHECK-NEXT: %[[FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[RETURN_TUPLE]]) {index = 0 : i32} -// CHECK-NEXT: %[[SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[RETURN_TUPLE]]) {index = 1 : i32} -// CHECK-NEXT: %[[THIRD_ELEM:.*]] = "test.get_tuple_element"(%[[RETURN_TUPLE]]) {index = 2 : i32} -// CHECK-NEXT: return %[[FIRST_ELEM]], %[[SECOND_ELEM]], %[[THIRD_ELEM]] -// ----- -// Test case: Testing BufferAssginmnetFuncOpConverter and -// BufferAssginmentReturnOpConverter to see if the return operation matches with -// the new function signature when there are tuple typed args and results. -// BufferAssginmentTypeConverter is set to flatten tuple typed arguments. The tuple -// typed values should be decomposed and composed using get_tuple_element and -// make_tuple operations of test dialect. Tensor types are converted to Memref. -// Memref typed function results remain as function results. - -// CHECK-LABEL: func @decompose_tuple_typed_function_args_and_results -func @decompose_tuple_typed_function_args_and_results(%arg0: tuple, %arg1: tensor<10xf32>, %arg2: tuple>) -> (tuple>, tensor<10xf32>, tuple){ - return %arg2, %arg1, %arg0 : tuple>, tensor<10xf32>, tuple -} -// CHECK-SAME: %[[ARG0:.*]]: i1, %[[ARG1:.*]]: f32, %[[ARG2:.*]]: memref<10xf32>, %[[ARG3:.*]]: i1, %[[ARG4:.*]]: memref<5xf32> -// CHECK-SAME: (i1, memref<5xf32>, memref<10xf32>, i1, f32) -// CHECK-NEXT: %[[FIRST_TUPLE:.*]] = "test.make_tuple"(%[[ARG0]], %[[ARG1]]) -// CHECK-NEXT: %[[SECOND_TUPLE:.*]] = "test.make_tuple"(%[[ARG3]], %[[ARG4]]) -// CHECK-NEXT: %[[SECOND_TUPLE_FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[SECOND_TUPLE]]) {index = 0 : i32} -// CHECK-NEXT: %[[SECOND_TUPLE_SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[SECOND_TUPLE]]) {index = 1 : i32} -// CHECK-NEXT: %[[FIRST_TUPLE_FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[FIRST_TUPLE]]) {index = 0 : i32} -// CHECK-NEXT: %[[FIRST_TUPLE_SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[FIRST_TUPLE]]) {index = 1 : i32} -// CHECK-NEXT: return %[[SECOND_TUPLE_FIRST_ELEM]], %[[SECOND_TUPLE_SECOND_ELEM]], %[[ARG2]], %[[FIRST_TUPLE_FIRST_ELEM]], %[[FIRST_TUPLE_SECOND_ELEM]] diff --git a/mlir/test/Transforms/buffer-placement-preparation.mlir b/mlir/test/Transforms/buffer-placement-preparation.mlir index b1cfdfd690cf..064b0fd7e85a 100644 --- a/mlir/test/Transforms/buffer-placement-preparation.mlir +++ b/mlir/test/Transforms/buffer-placement-preparation.mlir @@ -285,93 +285,8 @@ func @caller(%arg0: tensor<5xf32>) -> tensor<5xf32> { // CHECK: linalg.copy(%[[Y0]], %[[CALLER_RESULT]]) // CHECK: return -// ----- - // CHECK-LABEL: func @func_with_unranked_arg func @func_with_unranked_arg(%arg0: tensor<*xf32>) { return } // CHECK-SAME: ([[ARG:%.*]]: memref<*xf32>) - -// ----- - -// Test case: Testing BufferAssginmnetCallOpConverter to see if it matches with the -// signature of the new signature of the callee function when there are tuple typed -// args and results. BufferAssginmentTypeConverter is set to flatten tuple typed -// arguments. The tuple typed values should be decomposed and composed using -// get_tuple_element and make_tuple operations of test dialect. Tensor types are -// converted to Memref. Memref typed function results are appended to the function -// arguments list. - -// CHECK-LABEL: func @callee -func @callee(%arg0: tuple,i1, tensor<5xf32>>) -> (tuple,i1, tensor<5xf32>>){ - return %arg0 : tuple,i1, tensor<5xf32>> -} -// CHECK-SAME: (%[[ARG0:.*]]: memref<2xf32>, %[[ARG1:.*]]: i1, %[[ARG2:.*]]: memref<5xf32>, %[[RESULT0:.*]]: memref<2xf32>, %[[RESULT1:.*]]: memref<5xf32>) -// CHECK-SAME: i1 -// CHECK-NEXT: %[[TUPLE:.*]] = "test.make_tuple"(%[[ARG0]], %[[ARG1]], %[[ARG2]]) -// CHECK-NEXT: %[[FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 0 : i32} -// CHECK-NEXT: %[[SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 1 : i32} -// CHECK-NEXT: %[[THIRD_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 2 : i32} -// CHECK-NEXT: linalg.copy(%[[FIRST_ELEM]], %[[RESULT0]]) -// CHECK-NEXT: linalg.copy(%[[THIRD_ELEM]], %[[RESULT1]]) -// CHECK-NEXT: return %[[SECOND_ELEM]] - - -// CHECK-LABEL: func @caller -func @caller(%arg0: tuple,i1, tensor<5xf32>>) -> tuple,i1, tensor<5xf32>>{ - %x0 = call @callee(%arg0) : (tuple,i1, tensor<5xf32>>) -> (tuple,i1, tensor<5xf32>>) - %y0 = call @callee(%x0) : (tuple,i1, tensor<5xf32>>) -> (tuple,i1, tensor<5xf32>>) - return %y0 : tuple,i1, tensor<5xf32>> -} -// CHECK-SAME: (%[[ARG0:.*]]: memref<2xf32>, %[[ARG1:.*]]: i1, %[[ARG2:.*]]: memref<5xf32>, %[[RESULT0:.*]]: memref<2xf32>, %[[RESULT1:.*]]: memref<5xf32>) -// CHECK-SAME: i1 -// CHECK-NEXT: %[[TUPLE:.*]] = "test.make_tuple"(%[[ARG0]], %[[ARG1]], %[[ARG2]]) -// CHECK-NEXT: %[[FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 0 : i32} -// CHECK-NEXT: %[[SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 1 : i32} -// CHECK-NEXT: %[[THIRD_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 2 : i32} -// CHECK-NEXT: %[[FIRST_ALLOC:.*]] = alloc() -// CHECK-NEXT: %[[SECOND_ALLOC:.*]] = alloc() -// CHECK-NEXT: %[[CALLEE_RESULT:.*]] = call @callee(%[[FIRST_ELEM]], %[[SECOND_ELEM]], %[[THIRD_ELEM]], %[[FIRST_ALLOC]], %[[SECOND_ALLOC]]) -// CHECK-SAME: (memref<2xf32>, i1, memref<5xf32>, memref<2xf32>, memref<5xf32>) -> i1 -// CHECK-NEXT: %[[TUPLE:.*]] = "test.make_tuple"(%[[FIRST_ALLOC]], %[[CALLEE_RESULT]], %[[SECOND_ALLOC]]) -// CHECK-NEXT: %[[FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 0 : i32} -// CHECK-NEXT: %[[SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 1 : i32} -// CHECK-NEXT: %[[THIRD_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 2 : i32} -// CHECK-NEXT: %[[FIRST_ALLOC:.*]] = alloc() -// CHECK-NEXT: %[[SECOND_ALLOC:.*]] = alloc() -// CHECK-NEXT: %[[CALLEE_RESULT:.*]] = call @callee(%[[FIRST_ELEM]], %[[SECOND_ELEM]], %[[THIRD_ELEM]], %[[FIRST_ALLOC]], %[[SECOND_ALLOC]]) -// CHECK-SAME: (memref<2xf32>, i1, memref<5xf32>, memref<2xf32>, memref<5xf32>) -> i1 -// CHECK-NEXT: %[[TUPLE:.*]] = "test.make_tuple"(%[[FIRST_ALLOC]], %[[CALLEE_RESULT]], %[[SECOND_ALLOC]]) -// CHECK-NEXT: %[[FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 0 : i32} -// CHECK-NEXT: %[[SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 1 : i32} -// CHECK-NEXT: %[[THIRD_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 2 : i32} -// CHECK-NEXT: linalg.copy(%[[FIRST_ELEM]], %[[RESULT0]]) -// CHECK-NEXT: linalg.copy(%[[THIRD_ELEM]], %[[RESULT1]]) -// CHECK-NEXT: return %[[SECOND_ELEM]] - -// ----- - -// Test case: Testing BufferAssginmnetFuncOpConverter and -// BufferAssginmentReturnOpConverter to see if the return operation matches with -// the new function signature when there are tuple typed args and results. -// BufferAssginmentTypeConverter is set to flatten tuple typed arguments. The tuple -// typed values should be decomposed and composed using get_tuple_element and -// make_tuple operations of test dialect. Tensor types are converted to Memref. -// Memref typed function results are appended to the function arguments list. - -// CHECK-LABEL: func @decompose_tuple_typed_function_args_and_results -func @decompose_tuple_typed_function_args_and_results(%arg0: tuple, %arg1: tensor<10xf32>, %arg2: tuple>) -> (tuple>, tensor<10xf32>, tuple){ - return %arg2, %arg1, %arg0 : tuple>, tensor<10xf32>, tuple -} -// CHECK-SAME: %[[ARG0:.*]]: i1, %[[ARG1:.*]]: f32, %[[ARG2:.*]]: memref<10xf32>, %[[ARG3:.*]]: i1, %[[ARG4:.*]]: memref<5xf32>, %[[RESULT0:.*]]: memref<5xf32>, %[[RESULT1:.*]]: memref<10xf32> -// CHECK-SAME: (i1, i1, f32) -// CHECK-NEXT: %[[FIRST_TUPLE:.*]] = "test.make_tuple"(%[[ARG0]], %[[ARG1]]) -// CHECK-NEXT: %[[SECOND_TUPLE:.*]] = "test.make_tuple"(%[[ARG3]], %[[ARG4]]) -// CHECK-NEXT: %[[SECOND_TUPLE_FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[SECOND_TUPLE]]) {index = 0 : i32} -// CHECK-NEXT: %[[SECOND_TUPLE_SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[SECOND_TUPLE]]) {index = 1 : i32} -// CHECK-NEXT: %[[FIRST_TUPLE_FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[FIRST_TUPLE]]) {index = 0 : i32} -// CHECK-NEXT: %[[FIRST_TUPLE_SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[FIRST_TUPLE]]) {index = 1 : i32} -// CHECK-NEXT: linalg.copy(%[[SECOND_TUPLE_SECOND_ELEM]], %[[RESULT0]]) -// CHECK-NEXT: linalg.copy(%[[ARG2]], %[[RESULT1]]) -// CHECK-NEXT: return %[[SECOND_TUPLE_FIRST_ELEM]], %[[FIRST_TUPLE_FIRST_ELEM]], %[[FIRST_TUPLE_SECOND_ELEM]] diff --git a/mlir/test/lib/Dialect/Test/TestOps.td b/mlir/test/lib/Dialect/Test/TestOps.td index f03c953396a4..bc26a8659831 100644 --- a/mlir/test/lib/Dialect/Test/TestOps.td +++ b/mlir/test/lib/Dialect/Test/TestOps.td @@ -1669,7 +1669,7 @@ def TableGenBuildOp5 : TEST_Op<"tblgen_build_5", let results = (outs AnyType:$result); let extraClassDeclaration = [{ - static LogicalResult inferReturnTypes(MLIRContext *, + static LogicalResult inferReturnTypes(MLIRContext *, Optional location, ValueRange operands, DictionaryAttr attributes, RegionRange regions, SmallVectorImpl &inferredReturnTypes) { @@ -1679,31 +1679,4 @@ def TableGenBuildOp5 : TEST_Op<"tblgen_build_5", }]; } -//===----------------------------------------------------------------------===// -// Test BufferPlacement -//===----------------------------------------------------------------------===// - -def GetTupleElementOp: TEST_Op<"get_tuple_element"> { - let description = [{ - Test op that returns a specified element of the tuple. - }]; - - let arguments = (ins - TupleOf<[AnyType]>, - I32Attr:$index - ); - let results = (outs AnyType); -} - -def MakeTupleOp: TEST_Op<"make_tuple"> { - let description = [{ - Test op that creates a tuple value from a list of values. - }]; - - let arguments = (ins - Variadic:$inputs - ); - let results = (outs TupleOf<[AnyType]>); -} - #endif // TEST_OPS diff --git a/mlir/test/lib/Transforms/TestBufferPlacement.cpp b/mlir/test/lib/Transforms/TestBufferPlacement.cpp index 14b72b9fc92a..6cc0924191cb 100644 --- a/mlir/test/lib/Transforms/TestBufferPlacement.cpp +++ b/mlir/test/lib/Transforms/TestBufferPlacement.cpp @@ -11,8 +11,6 @@ // //===----------------------------------------------------------------------===// -#include "TestDialect.h" -#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h" #include "mlir/Dialect/Linalg/IR/LinalgOps.h" #include "mlir/IR/Function.h" #include "mlir/IR/Operation.h" @@ -111,16 +109,14 @@ struct TestBufferPlacementPreparationPass void populateTensorLinalgToBufferLinalgConversionPattern( MLIRContext *context, BufferAssignmentPlacer *placer, - BufferAssignmentTypeConverter *converter, - OwningRewritePatternList *patterns) { + TypeConverter *converter, OwningRewritePatternList *patterns) { populateWithBufferAssignmentOpConversionPatterns< - mlir::ReturnOp, mlir::ReturnOp, linalg::CopyOp>(context, placer, - converter, patterns); + mlir::ReturnOp, mlir::ReturnOp, linalg::CopyOp, + allowMemrefFunctionResults>(context, placer, converter, patterns); patterns->insert(context, placer, converter); } void getDependentDialects(DialectRegistry ®istry) const override { - registry.insert(); registry.insert(); } @@ -131,8 +127,6 @@ struct TestBufferPlacementPreparationPass // Mark all Standard operations legal. target.addLegalDialect(); - target.addLegalOp(); - target.addLegalOp(); // Mark all Linalg operations illegal as long as they work on tensors. auto isLegalOperation = [&](Operation *op) { @@ -155,42 +149,6 @@ struct TestBufferPlacementPreparationPass converter.isLegal(&funcOp.getBody()); }); - auto kind = allowMemrefFunctionResults - ? BufferAssignmentTypeConverter::KeepAsFunctionResult - : BufferAssignmentTypeConverter::AppendToArgumentsList; - converter.setResultConversionKind(kind); - converter.setResultConversionKind( - kind); - - converter.addDecomposeTypeConversion( - [](TupleType tupleType, SmallVectorImpl &types) { - tupleType.getFlattenedTypes(types); - return success(); - }); - - converter.addArgumentMaterialization( - [](OpBuilder &builder, TupleType resultType, ValueRange inputs, - Location loc) -> Optional { - if (inputs.size() == 1) - return llvm::None; - TypeRange TypeRange = inputs.getTypes(); - SmallVector types(TypeRange.begin(), TypeRange.end()); - TupleType tuple = TupleType::get(types, builder.getContext()); - mlir::Value value = builder.create(loc, tuple, inputs); - return value; - }); - - converter.addDecomposeValueConversion([](OpBuilder &builder, Location loc, - TupleType resultType, Value value, - SmallVectorImpl &values) { - for (unsigned i = 0, e = resultType.size(); i < e; ++i) { - Value res = builder.create( - loc, resultType.getType(i), value, builder.getI32IntegerAttr(i)); - values.push_back(res); - } - return success(); - }); - // Walk over all the functions to apply buffer assignment. this->getOperation().walk([&](FuncOp function) -> WalkResult { OwningRewritePatternList patterns; From 255a60cdd6fdf564bcca645b67ea2d1fb127c9ce Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Tue, 1 Sep 2020 17:13:24 -0400 Subject: [PATCH 06/26] [libc++] Make some testing utilities constexpr This will be needed in order to test constexpr std::vector. --- libcxx/test/support/emplace_constructible.h | 20 +-- libcxx/test/support/min_allocator.h | 146 ++++++++++---------- 2 files changed, 83 insertions(+), 83 deletions(-) diff --git a/libcxx/test/support/emplace_constructible.h b/libcxx/test/support/emplace_constructible.h index f0d11ba76c87..42a62fabe656 100644 --- a/libcxx/test/support/emplace_constructible.h +++ b/libcxx/test/support/emplace_constructible.h @@ -7,7 +7,7 @@ template struct EmplaceConstructible { T value; - explicit EmplaceConstructible(T xvalue) : value(xvalue) {} + TEST_CONSTEXPR_CXX14 explicit EmplaceConstructible(T xvalue) : value(xvalue) {} EmplaceConstructible(EmplaceConstructible const&) = delete; }; @@ -15,9 +15,9 @@ template struct EmplaceConstructibleAndMoveInsertable { int copied = 0; T value; - explicit EmplaceConstructibleAndMoveInsertable(T xvalue) : value(xvalue) {} + TEST_CONSTEXPR_CXX14 explicit EmplaceConstructibleAndMoveInsertable(T xvalue) : value(xvalue) {} - EmplaceConstructibleAndMoveInsertable( + TEST_CONSTEXPR_CXX14 EmplaceConstructibleAndMoveInsertable( EmplaceConstructibleAndMoveInsertable&& Other) : copied(Other.copied + 1), value(std::move(Other.value)) {} }; @@ -27,13 +27,13 @@ struct EmplaceConstructibleAndMoveable { int copied = 0; int assigned = 0; T value; - explicit EmplaceConstructibleAndMoveable(T xvalue) noexcept : value(xvalue) {} + TEST_CONSTEXPR_CXX14 explicit EmplaceConstructibleAndMoveable(T xvalue) noexcept : value(xvalue) {} - EmplaceConstructibleAndMoveable(EmplaceConstructibleAndMoveable&& Other) + TEST_CONSTEXPR_CXX14 EmplaceConstructibleAndMoveable(EmplaceConstructibleAndMoveable&& Other) noexcept : copied(Other.copied + 1), value(std::move(Other.value)) {} - EmplaceConstructibleAndMoveable& + TEST_CONSTEXPR_CXX14 EmplaceConstructibleAndMoveable& operator=(EmplaceConstructibleAndMoveable&& Other) noexcept { copied = Other.copied; assigned = Other.assigned + 1; @@ -47,15 +47,15 @@ struct EmplaceConstructibleMoveableAndAssignable { int copied = 0; int assigned = 0; T value; - explicit EmplaceConstructibleMoveableAndAssignable(T xvalue) noexcept + TEST_CONSTEXPR_CXX14 explicit EmplaceConstructibleMoveableAndAssignable(T xvalue) noexcept : value(xvalue) {} - EmplaceConstructibleMoveableAndAssignable( + TEST_CONSTEXPR_CXX14 EmplaceConstructibleMoveableAndAssignable( EmplaceConstructibleMoveableAndAssignable&& Other) noexcept : copied(Other.copied + 1), value(std::move(Other.value)) {} - EmplaceConstructibleMoveableAndAssignable& + TEST_CONSTEXPR_CXX14 EmplaceConstructibleMoveableAndAssignable& operator=(EmplaceConstructibleMoveableAndAssignable&& Other) noexcept { copied = Other.copied; assigned = Other.assigned + 1; @@ -63,7 +63,7 @@ struct EmplaceConstructibleMoveableAndAssignable { return *this; } - EmplaceConstructibleMoveableAndAssignable& operator=(T xvalue) { + TEST_CONSTEXPR_CXX14 EmplaceConstructibleMoveableAndAssignable& operator=(T xvalue) { value = std::move(xvalue); ++assigned; return *this; diff --git a/libcxx/test/support/min_allocator.h b/libcxx/test/support/min_allocator.h index fd23fc4383f3..b9f6f6147609 100644 --- a/libcxx/test/support/min_allocator.h +++ b/libcxx/test/support/min_allocator.h @@ -220,19 +220,19 @@ class min_pointer void* ptr_; public: min_pointer() TEST_NOEXCEPT = default; - min_pointer(std::nullptr_t) TEST_NOEXCEPT : ptr_(nullptr) {} + TEST_CONSTEXPR_CXX14 min_pointer(std::nullptr_t) TEST_NOEXCEPT : ptr_(nullptr) {} template ::value >::type > - min_pointer(min_pointer p) TEST_NOEXCEPT : ptr_(p.ptr_) {} + TEST_CONSTEXPR_CXX14 min_pointer(min_pointer p) TEST_NOEXCEPT : ptr_(p.ptr_) {} - explicit operator bool() const {return ptr_ != nullptr;} + TEST_CONSTEXPR_CXX14 explicit operator bool() const {return ptr_ != nullptr;} - friend bool operator==(min_pointer x, min_pointer y) {return x.ptr_ == y.ptr_;} - friend bool operator!=(min_pointer x, min_pointer y) {return !(x == y);} + TEST_CONSTEXPR_CXX14 friend bool operator==(min_pointer x, min_pointer y) {return x.ptr_ == y.ptr_;} + TEST_CONSTEXPR_CXX14 friend bool operator!=(min_pointer x, min_pointer y) {return !(x == y);} template friend class min_pointer; }; @@ -241,13 +241,13 @@ class min_pointer { T* ptr_; - explicit min_pointer(T* p) TEST_NOEXCEPT : ptr_(p) {} + TEST_CONSTEXPR_CXX14 explicit min_pointer(T* p) TEST_NOEXCEPT : ptr_(p) {} public: min_pointer() TEST_NOEXCEPT = default; - min_pointer(std::nullptr_t) TEST_NOEXCEPT : ptr_(nullptr) {} - explicit min_pointer(min_pointer p) TEST_NOEXCEPT : ptr_(static_cast(p.ptr_)) {} + TEST_CONSTEXPR_CXX14 min_pointer(std::nullptr_t) TEST_NOEXCEPT : ptr_(nullptr) {} + TEST_CONSTEXPR_CXX14 explicit min_pointer(min_pointer p) TEST_NOEXCEPT : ptr_(static_cast(p.ptr_)) {} - explicit operator bool() const {return ptr_ != nullptr;} + TEST_CONSTEXPR_CXX14 explicit operator bool() const {return ptr_ != nullptr;} typedef std::ptrdiff_t difference_type; typedef T& reference; @@ -255,53 +255,53 @@ class min_pointer typedef T value_type; typedef std::random_access_iterator_tag iterator_category; - reference operator*() const {return *ptr_;} - pointer operator->() const {return ptr_;} + TEST_CONSTEXPR_CXX14 reference operator*() const {return *ptr_;} + TEST_CONSTEXPR_CXX14 pointer operator->() const {return ptr_;} - min_pointer& operator++() {++ptr_; return *this;} - min_pointer operator++(int) {min_pointer tmp(*this); ++ptr_; return tmp;} + TEST_CONSTEXPR_CXX14 min_pointer& operator++() {++ptr_; return *this;} + TEST_CONSTEXPR_CXX14 min_pointer operator++(int) {min_pointer tmp(*this); ++ptr_; return tmp;} - min_pointer& operator--() {--ptr_; return *this;} - min_pointer operator--(int) {min_pointer tmp(*this); --ptr_; return tmp;} + TEST_CONSTEXPR_CXX14 min_pointer& operator--() {--ptr_; return *this;} + TEST_CONSTEXPR_CXX14 min_pointer operator--(int) {min_pointer tmp(*this); --ptr_; return tmp;} - min_pointer& operator+=(difference_type n) {ptr_ += n; return *this;} - min_pointer& operator-=(difference_type n) {ptr_ -= n; return *this;} + TEST_CONSTEXPR_CXX14 min_pointer& operator+=(difference_type n) {ptr_ += n; return *this;} + TEST_CONSTEXPR_CXX14 min_pointer& operator-=(difference_type n) {ptr_ -= n; return *this;} - min_pointer operator+(difference_type n) const + TEST_CONSTEXPR_CXX14 min_pointer operator+(difference_type n) const { min_pointer tmp(*this); tmp += n; return tmp; } - friend min_pointer operator+(difference_type n, min_pointer x) + friend TEST_CONSTEXPR_CXX14 min_pointer operator+(difference_type n, min_pointer x) { return x + n; } - min_pointer operator-(difference_type n) const + TEST_CONSTEXPR_CXX14 min_pointer operator-(difference_type n) const { min_pointer tmp(*this); tmp -= n; return tmp; } - friend difference_type operator-(min_pointer x, min_pointer y) + friend TEST_CONSTEXPR_CXX14 difference_type operator-(min_pointer x, min_pointer y) { return x.ptr_ - y.ptr_; } - reference operator[](difference_type n) const {return ptr_[n];} + TEST_CONSTEXPR_CXX14 reference operator[](difference_type n) const {return ptr_[n];} - friend bool operator< (min_pointer x, min_pointer y) {return x.ptr_ < y.ptr_;} - friend bool operator> (min_pointer x, min_pointer y) {return y < x;} - friend bool operator<=(min_pointer x, min_pointer y) {return !(y < x);} - friend bool operator>=(min_pointer x, min_pointer y) {return !(x < y);} + friend TEST_CONSTEXPR_CXX14 bool operator< (min_pointer x, min_pointer y) {return x.ptr_ < y.ptr_;} + friend TEST_CONSTEXPR_CXX14 bool operator> (min_pointer x, min_pointer y) {return y < x;} + friend TEST_CONSTEXPR_CXX14 bool operator<=(min_pointer x, min_pointer y) {return !(y < x);} + friend TEST_CONSTEXPR_CXX14 bool operator>=(min_pointer x, min_pointer y) {return !(x < y);} - static min_pointer pointer_to(T& t) {return min_pointer(std::addressof(t));} + static TEST_CONSTEXPR_CXX14 min_pointer pointer_to(T& t) {return min_pointer(std::addressof(t));} - friend bool operator==(min_pointer x, min_pointer y) {return x.ptr_ == y.ptr_;} - friend bool operator!=(min_pointer x, min_pointer y) {return !(x == y);} + friend TEST_CONSTEXPR_CXX14 bool operator==(min_pointer x, min_pointer y) {return x.ptr_ == y.ptr_;} + friend TEST_CONSTEXPR_CXX14 bool operator!=(min_pointer x, min_pointer y) {return !(x == y);} template friend class min_pointer; template friend class min_allocator; }; @@ -311,14 +311,14 @@ class min_pointer { const T* ptr_; - explicit min_pointer(const T* p) : ptr_(p) {} + TEST_CONSTEXPR_CXX14 explicit min_pointer(const T* p) : ptr_(p) {} public: min_pointer() TEST_NOEXCEPT = default; - min_pointer(std::nullptr_t) : ptr_(nullptr) {} - min_pointer(min_pointer p) : ptr_(p.ptr_) {} - explicit min_pointer(min_pointer p) : ptr_(static_cast(p.ptr_)) {} + TEST_CONSTEXPR_CXX14 min_pointer(std::nullptr_t) : ptr_(nullptr) {} + TEST_CONSTEXPR_CXX14 min_pointer(min_pointer p) : ptr_(p.ptr_) {} + TEST_CONSTEXPR_CXX14 explicit min_pointer(min_pointer p) : ptr_(static_cast(p.ptr_)) {} - explicit operator bool() const {return ptr_ != nullptr;} + TEST_CONSTEXPR_CXX14 explicit operator bool() const {return ptr_ != nullptr;} typedef std::ptrdiff_t difference_type; typedef const T& reference; @@ -326,58 +326,58 @@ class min_pointer typedef const T value_type; typedef std::random_access_iterator_tag iterator_category; - reference operator*() const {return *ptr_;} - pointer operator->() const {return ptr_;} + TEST_CONSTEXPR_CXX14 reference operator*() const {return *ptr_;} + TEST_CONSTEXPR_CXX14 pointer operator->() const {return ptr_;} - min_pointer& operator++() {++ptr_; return *this;} - min_pointer operator++(int) {min_pointer tmp(*this); ++ptr_; return tmp;} + TEST_CONSTEXPR_CXX14 min_pointer& operator++() {++ptr_; return *this;} + TEST_CONSTEXPR_CXX14 min_pointer operator++(int) {min_pointer tmp(*this); ++ptr_; return tmp;} - min_pointer& operator--() {--ptr_; return *this;} - min_pointer operator--(int) {min_pointer tmp(*this); --ptr_; return tmp;} + TEST_CONSTEXPR_CXX14 min_pointer& operator--() {--ptr_; return *this;} + TEST_CONSTEXPR_CXX14 min_pointer operator--(int) {min_pointer tmp(*this); --ptr_; return tmp;} - min_pointer& operator+=(difference_type n) {ptr_ += n; return *this;} - min_pointer& operator-=(difference_type n) {ptr_ -= n; return *this;} + TEST_CONSTEXPR_CXX14 min_pointer& operator+=(difference_type n) {ptr_ += n; return *this;} + TEST_CONSTEXPR_CXX14 min_pointer& operator-=(difference_type n) {ptr_ -= n; return *this;} - min_pointer operator+(difference_type n) const + TEST_CONSTEXPR_CXX14 min_pointer operator+(difference_type n) const { min_pointer tmp(*this); tmp += n; return tmp; } - friend min_pointer operator+(difference_type n, min_pointer x) + friend TEST_CONSTEXPR_CXX14 min_pointer operator+(difference_type n, min_pointer x) { return x + n; } - min_pointer operator-(difference_type n) const + TEST_CONSTEXPR_CXX14 min_pointer operator-(difference_type n) const { min_pointer tmp(*this); tmp -= n; return tmp; } - friend difference_type operator-(min_pointer x, min_pointer y) + friend TEST_CONSTEXPR_CXX14 difference_type operator-(min_pointer x, min_pointer y) { return x.ptr_ - y.ptr_; } - reference operator[](difference_type n) const {return ptr_[n];} + TEST_CONSTEXPR_CXX14 reference operator[](difference_type n) const {return ptr_[n];} - friend bool operator< (min_pointer x, min_pointer y) {return x.ptr_ < y.ptr_;} - friend bool operator> (min_pointer x, min_pointer y) {return y < x;} - friend bool operator<=(min_pointer x, min_pointer y) {return !(y < x);} - friend bool operator>=(min_pointer x, min_pointer y) {return !(x < y);} + friend TEST_CONSTEXPR_CXX14 bool operator< (min_pointer x, min_pointer y) {return x.ptr_ < y.ptr_;} + friend TEST_CONSTEXPR_CXX14 bool operator> (min_pointer x, min_pointer y) {return y < x;} + friend TEST_CONSTEXPR_CXX14 bool operator<=(min_pointer x, min_pointer y) {return !(y < x);} + friend TEST_CONSTEXPR_CXX14 bool operator>=(min_pointer x, min_pointer y) {return !(x < y);} - static min_pointer pointer_to(const T& t) {return min_pointer(std::addressof(t));} + static TEST_CONSTEXPR_CXX14 min_pointer pointer_to(const T& t) {return min_pointer(std::addressof(t));} - friend bool operator==(min_pointer x, min_pointer y) {return x.ptr_ == y.ptr_;} - friend bool operator!=(min_pointer x, min_pointer y) {return !(x == y);} + friend TEST_CONSTEXPR_CXX14 bool operator==(min_pointer x, min_pointer y) {return x.ptr_ == y.ptr_;} + friend TEST_CONSTEXPR_CXX14 bool operator!=(min_pointer x, min_pointer y) {return !(x == y);} template friend class min_pointer; }; template -inline +TEST_CONSTEXPR_CXX14 inline bool operator==(min_pointer x, std::nullptr_t) { @@ -385,7 +385,7 @@ operator==(min_pointer x, std::nullptr_t) } template -inline +TEST_CONSTEXPR_CXX14 inline bool operator==(std::nullptr_t, min_pointer x) { @@ -393,7 +393,7 @@ operator==(std::nullptr_t, min_pointer x) } template -inline +TEST_CONSTEXPR_CXX14 inline bool operator!=(min_pointer x, std::nullptr_t) { @@ -401,7 +401,7 @@ operator!=(min_pointer x, std::nullptr_t) } template -inline +TEST_CONSTEXPR_CXX14 inline bool operator!=(std::nullptr_t, min_pointer x) { @@ -417,20 +417,20 @@ class min_allocator min_allocator() = default; template - min_allocator(min_allocator) {} + TEST_CONSTEXPR_CXX20 min_allocator(min_allocator) {} - pointer allocate(std::ptrdiff_t n) + TEST_CONSTEXPR_CXX20 pointer allocate(std::ptrdiff_t n) { - return pointer(static_cast(::operator new(n*sizeof(T)))); + return pointer(std::allocator().allocate(n)); } - void deallocate(pointer p, std::ptrdiff_t) + TEST_CONSTEXPR_CXX20 void deallocate(pointer p, std::ptrdiff_t n) { - return ::operator delete(p.ptr_); + std::allocator().deallocate(p.ptr_, n); } - friend bool operator==(min_allocator, min_allocator) {return true;} - friend bool operator!=(min_allocator x, min_allocator y) {return !(x == y);} + TEST_CONSTEXPR_CXX20 friend bool operator==(min_allocator, min_allocator) {return true;} + TEST_CONSTEXPR_CXX20 friend bool operator!=(min_allocator x, min_allocator y) {return !(x == y);} }; template @@ -439,23 +439,23 @@ class explicit_allocator public: typedef T value_type; - explicit_allocator() TEST_NOEXCEPT {} + TEST_CONSTEXPR_CXX20 explicit_allocator() TEST_NOEXCEPT {} template - explicit explicit_allocator(explicit_allocator) TEST_NOEXCEPT {} + TEST_CONSTEXPR_CXX20 explicit explicit_allocator(explicit_allocator) TEST_NOEXCEPT {} - T* allocate(std::size_t n) + TEST_CONSTEXPR_CXX20 T* allocate(std::size_t n) { - return static_cast(::operator new(n*sizeof(T))); + return static_cast(std::allocator().allocate(n)); } - void deallocate(T* p, std::size_t) + TEST_CONSTEXPR_CXX20 void deallocate(T* p, std::size_t n) { - return ::operator delete(static_cast(p)); + std::allocator().deallocate(p, n); } - friend bool operator==(explicit_allocator, explicit_allocator) {return true;} - friend bool operator!=(explicit_allocator x, explicit_allocator y) {return !(x == y);} + TEST_CONSTEXPR_CXX20 friend bool operator==(explicit_allocator, explicit_allocator) {return true;} + TEST_CONSTEXPR_CXX20 friend bool operator!=(explicit_allocator x, explicit_allocator y) {return !(x == y);} }; #endif // MIN_ALLOCATOR_H From 6f7737c46811993c0ed9b9143cbe4cb49dcf1d03 Mon Sep 17 00:00:00 2001 From: Anna Thomas Date: Wed, 2 Sep 2020 10:06:27 -0400 Subject: [PATCH 07/26] [ImplicitNullChecks] NFC: Separated out checks and added comments Separated out some checks in isSuitableMemoryOp and added comments explaining why some of those checks are done. Tests-Run:X86 implicit null checks tests. --- llvm/lib/CodeGen/ImplicitNullChecks.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/llvm/lib/CodeGen/ImplicitNullChecks.cpp b/llvm/lib/CodeGen/ImplicitNullChecks.cpp index 16c9bfc672af..c6b1eeb3408c 100644 --- a/llvm/lib/CodeGen/ImplicitNullChecks.cpp +++ b/llvm/lib/CodeGen/ImplicitNullChecks.cpp @@ -368,18 +368,26 @@ ImplicitNullChecks::isSuitableMemoryOp(const MachineInstr &MI, const MachineOperand *BaseOp; - if (!TII->getMemOperandWithOffset(MI, BaseOp, Offset, OffsetIsScalable, TRI) || - !BaseOp->isReg() || BaseOp->getReg() != PointerReg) + // FIXME: This handles only simple addressing mode. + if (!TII->getMemOperandWithOffset(MI, BaseOp, Offset, OffsetIsScalable, TRI)) + return SR_Unsuitable; + + // We need the base of the memory instruction to be same as the register + // where the null check is performed (i.e. PointerReg). + if (!BaseOp->isReg() || BaseOp->getReg() != PointerReg) return SR_Unsuitable; - // FIXME: This algorithm assumes instructions have fixed-size offsets. + // Scalable offsets are a part of scalable vectors (SVE for AArch64). That + // target is in-practice unsupported for ImplicitNullChecks. if (OffsetIsScalable) return SR_Unsuitable; + if (!MI.mayLoadOrStore() || MI.isPredicable()) + return SR_Unsuitable; + // We want the mem access to be issued at a sane offset from PointerReg, // so that if PointerReg is null then the access reliably page faults. - if (!(MI.mayLoadOrStore() && !MI.isPredicable() && - -PageSize < Offset && Offset < PageSize)) + if (!(-PageSize < Offset && Offset < PageSize)) return SR_Unsuitable; // Finally, check whether the current memory access aliases with previous one. From 425573a2fa2dc5666273944a584acdb286447b66 Mon Sep 17 00:00:00 2001 From: Anna Thomas Date: Wed, 2 Sep 2020 10:19:10 -0400 Subject: [PATCH 08/26] [ImplicitNullChecks] NFC: Refactor dependence safety check After computing dependence, we check if it is safe to hoist by identifying if it clobbers any liveIns in the sibling block (NullSucc). This check is moved to its own function which will be used in the soon-to-be modified dependence checking algorithm for implicit null checks pass. Tests-Run: lit tests on X86/implicit-* --- llvm/lib/CodeGen/ImplicitNullChecks.cpp | 71 +++++++++++++++---------- 1 file changed, 44 insertions(+), 27 deletions(-) diff --git a/llvm/lib/CodeGen/ImplicitNullChecks.cpp b/llvm/lib/CodeGen/ImplicitNullChecks.cpp index c6b1eeb3408c..dc1b0a867b0d 100644 --- a/llvm/lib/CodeGen/ImplicitNullChecks.cpp +++ b/llvm/lib/CodeGen/ImplicitNullChecks.cpp @@ -200,6 +200,13 @@ class ImplicitNullChecks : public MachineFunctionPass { unsigned PointerReg, ArrayRef PrevInsts); + /// Returns true if \p DependenceMI can clobber the liveIns in NullSucc block + /// if it was hoisted to the NullCheck block. This is used by caller + /// canHoistInst to decide if DependenceMI can be hoisted safely. + bool canDependenceHoistingClobberLiveIns(MachineInstr *DependenceMI, + MachineBasicBlock *NullSucc, + unsigned PointerReg); + /// Return true if \p FaultingMI can be hoisted from after the /// instructions in \p InstsSeenSoFar to before them. Set \p Dependence to a /// non-null value if we also need to (and legally can) hoist a depedency. @@ -401,32 +408,9 @@ ImplicitNullChecks::isSuitableMemoryOp(const MachineInstr &MI, return SR_Suitable; } -bool ImplicitNullChecks::canHoistInst(MachineInstr *FaultingMI, - unsigned PointerReg, - ArrayRef InstsSeenSoFar, - MachineBasicBlock *NullSucc, - MachineInstr *&Dependence) { - auto DepResult = computeDependence(FaultingMI, InstsSeenSoFar); - if (!DepResult.CanReorder) - return false; - - if (!DepResult.PotentialDependence) { - Dependence = nullptr; - return true; - } - - auto DependenceItr = *DepResult.PotentialDependence; - auto *DependenceMI = *DependenceItr; - - // We don't want to reason about speculating loads. Note -- at this point - // we should have already filtered out all of the other non-speculatable - // things, like calls and stores. - // We also do not want to hoist stores because it might change the memory - // while the FaultingMI may result in faulting. - assert(canHandle(DependenceMI) && "Should never have reached here!"); - if (DependenceMI->mayLoadOrStore()) - return false; - +bool ImplicitNullChecks::canDependenceHoistingClobberLiveIns( + MachineInstr *DependenceMI, MachineBasicBlock *NullSucc, + unsigned PointerReg) { for (auto &DependenceMO : DependenceMI->operands()) { if (!(DependenceMO.isReg() && DependenceMO.getReg())) continue; @@ -449,7 +433,7 @@ bool ImplicitNullChecks::canHoistInst(MachineInstr *FaultingMI, // same as it would have been had the load not have executed and we'd have // branched to NullSucc directly. if (AnyAliasLiveIn(TRI, NullSucc, DependenceMO.getReg())) - return false; + return true; // The Dependency can't be re-defining the base register -- then we won't // get the memory operation on the address we want. This is already @@ -459,6 +443,39 @@ bool ImplicitNullChecks::canHoistInst(MachineInstr *FaultingMI, "Should have been checked before!"); } + // The dependence does not clobber live-ins in NullSucc block. + return false; +} + +bool ImplicitNullChecks::canHoistInst(MachineInstr *FaultingMI, + unsigned PointerReg, + ArrayRef InstsSeenSoFar, + MachineBasicBlock *NullSucc, + MachineInstr *&Dependence) { + auto DepResult = computeDependence(FaultingMI, InstsSeenSoFar); + if (!DepResult.CanReorder) + return false; + + if (!DepResult.PotentialDependence) { + Dependence = nullptr; + return true; + } + + auto DependenceItr = *DepResult.PotentialDependence; + auto *DependenceMI = *DependenceItr; + + // We don't want to reason about speculating loads. Note -- at this point + // we should have already filtered out all of the other non-speculatable + // things, like calls and stores. + // We also do not want to hoist stores because it might change the memory + // while the FaultingMI may result in faulting. + assert(canHandle(DependenceMI) && "Should never have reached here!"); + if (DependenceMI->mayLoadOrStore()) + return false; + + if (canDependenceHoistingClobberLiveIns(DependenceMI, NullSucc, PointerReg)) + return false; + auto DepDepResult = computeDependence(DependenceMI, {InstsSeenSoFar.begin(), DependenceItr}); From addb5148f58d710fcaba04bb2afec8006ae8ac15 Mon Sep 17 00:00:00 2001 From: Med Ismail Bennani Date: Fri, 28 Aug 2020 15:38:39 +0200 Subject: [PATCH 09/26] [lldb/Target] Add custom interpreter option to `platform shell` This patch adds the ability to use a custom interpreter with the `platform shell` command. If the user set the `-s|--shell` option with the path to a binary, lldb passes it down to the platform's `RunShellProcess` method and set it as the shell to use in `ProcessLaunchInfo to run commands. Note that not all the Platforms support running shell commands with custom interpreters (i.e. RemoteGDBServer is only expected to use the default shell). This patch also makes some refactoring and cleanups, like swapping CString for StringRef when possible and updating `SBPlatformShellCommand` with new methods and a new constructor. rdar://67759256 Differential Revision: https://reviews.llvm.org/D86667 Signed-off-by: Med Ismail Bennani --- lldb/bindings/interface/SBPlatform.i | 7 +++ lldb/include/lldb/API/SBPlatform.h | 5 ++ lldb/include/lldb/Host/Host.h | 41 ++++++++++++++-- lldb/include/lldb/Target/Platform.h | 13 ++++- .../include/lldb/Target/RemoteAwarePlatform.h | 7 ++- lldb/source/API/SBPlatform.cpp | 47 +++++++++++++++++-- .../source/Commands/CommandObjectPlatform.cpp | 18 ++++++- lldb/source/Commands/Options.td | 2 + lldb/source/Host/common/Host.cpp | 45 +++++++++++++----- lldb/source/Host/macosx/objcxx/Host.mm | 8 ++-- .../gdb-server/PlatformRemoteGDBServer.cpp | 2 +- .../gdb-server/PlatformRemoteGDBServer.h | 2 +- .../GDBRemoteCommunicationClient.cpp | 4 +- .../gdb-remote/GDBRemoteCommunicationClient.h | 2 +- lldb/source/Target/Platform.cpp | 22 +++++++-- lldb/source/Target/RemoteAwarePlatform.cpp | 19 ++++++-- .../test/API/commands/platform/basic/Makefile | 5 ++ .../platform/basic/TestPlatformCommand.py | 9 ++++ .../platform/basic/TestPlatformPython.py | 17 +++++++ .../API/commands/platform/basic/myshell.c | 24 ++++++++++ 20 files changed, 258 insertions(+), 41 deletions(-) create mode 100644 lldb/test/API/commands/platform/basic/Makefile create mode 100644 lldb/test/API/commands/platform/basic/myshell.c diff --git a/lldb/bindings/interface/SBPlatform.i b/lldb/bindings/interface/SBPlatform.i index 81945222c059..07aecfc354bb 100644 --- a/lldb/bindings/interface/SBPlatform.i +++ b/lldb/bindings/interface/SBPlatform.i @@ -45,6 +45,7 @@ public: class SBPlatformShellCommand { public: + SBPlatformShellCommand (const char *shell, const char *shell_command); SBPlatformShellCommand (const char *shell_command); SBPlatformShellCommand (const SBPlatformShellCommand &rhs); @@ -54,6 +55,12 @@ public: void Clear(); + const char * + GetShell(); + + void + SetShell(const char *shell_interpreter); + const char * GetCommand(); diff --git a/lldb/include/lldb/API/SBPlatform.h b/lldb/include/lldb/API/SBPlatform.h index 4d251b129954..98291f18247d 100644 --- a/lldb/include/lldb/API/SBPlatform.h +++ b/lldb/include/lldb/API/SBPlatform.h @@ -51,6 +51,7 @@ class LLDB_API SBPlatformConnectOptions { class LLDB_API SBPlatformShellCommand { public: + SBPlatformShellCommand(const char *shell, const char *shell_command); SBPlatformShellCommand(const char *shell_command); SBPlatformShellCommand(const SBPlatformShellCommand &rhs); @@ -61,6 +62,10 @@ class LLDB_API SBPlatformShellCommand { void Clear(); + const char *GetShell(); + + void SetShell(const char *shell); + const char *GetCommand(); void SetCommand(const char *shell_command); diff --git a/lldb/include/lldb/Host/Host.h b/lldb/include/lldb/Host/Host.h index f19cb85d2329..76792cc6eab5 100644 --- a/lldb/include/lldb/Host/Host.h +++ b/lldb/include/lldb/Host/Host.h @@ -196,19 +196,34 @@ class Host { static Status ShellExpandArguments(ProcessLaunchInfo &launch_info); /// Run a shell command. - /// \arg command shouldn't be NULL + /// \arg command shouldn't be empty /// \arg working_dir Pass empty FileSpec to use the current working directory /// \arg status_ptr Pass NULL if you don't want the process exit status /// \arg signo_ptr Pass NULL if you don't want the signal that caused the /// process to exit /// \arg command_output Pass NULL if you don't want the command output /// \arg hide_stderr if this is false, redirect stderr to stdout - /// TODO: Convert this function to take a StringRef. - static Status RunShellCommand(const char *command, + static Status RunShellCommand(llvm::StringRef command, const FileSpec &working_dir, int *status_ptr, int *signo_ptr, std::string *command_output, const Timeout &timeout, - bool run_in_default_shell = true, + bool run_in_shell = true, + bool hide_stderr = false); + + /// Run a shell command. + /// \arg shell Pass an empty string if you want to use the default shell + /// interpreter \arg command \arg working_dir Pass empty FileSpec to use the + /// current working directory \arg status_ptr Pass NULL if you don't want + /// the process exit status \arg signo_ptr Pass NULL if you don't want the + /// signal that caused + /// the process to exit + /// \arg command_output Pass NULL if you don't want the command output + /// \arg hide_stderr If this is \b false, redirect stderr to stdout + static Status RunShellCommand(llvm::StringRef shell, llvm::StringRef command, + const FileSpec &working_dir, int *status_ptr, + int *signo_ptr, std::string *command_output, + const Timeout &timeout, + bool run_in_shell = true, bool hide_stderr = false); /// Run a shell command. @@ -222,7 +237,23 @@ class Host { int *status_ptr, int *signo_ptr, std::string *command_output, const Timeout &timeout, - bool run_in_default_shell = true, + bool run_in_shell = true, + bool hide_stderr = false); + + /// Run a shell command. + /// \arg shell Pass an empty string if you want to use the default + /// shell interpreter \arg command \arg working_dir Pass empty FileSpec to use + /// the current working directory \arg status_ptr Pass NULL if you don't + /// want the process exit status \arg signo_ptr Pass NULL if you don't + /// want the signal that caused the + /// process to exit + /// \arg command_output Pass NULL if you don't want the command output + /// \arg hide_stderr If this is \b false, redirect stderr to stdout + static Status RunShellCommand(llvm::StringRef shell, const Args &args, + const FileSpec &working_dir, int *status_ptr, + int *signo_ptr, std::string *command_output, + const Timeout &timeout, + bool run_in_shell = true, bool hide_stderr = false); static bool OpenFileInExternalEditor(const FileSpec &file_spec, diff --git a/lldb/include/lldb/Target/Platform.h b/lldb/include/lldb/Target/Platform.h index 9335f73b37df..64b49ecca606 100644 --- a/lldb/include/lldb/Target/Platform.h +++ b/lldb/include/lldb/Target/Platform.h @@ -621,7 +621,18 @@ class Platform : public PluginInterface { } virtual lldb_private::Status RunShellCommand( - const char *command, // Shouldn't be nullptr + llvm::StringRef command, + const FileSpec &working_dir, // Pass empty FileSpec to use the current + // working directory + int *status_ptr, // Pass nullptr if you don't want the process exit status + int *signo_ptr, // Pass nullptr if you don't want the signal that caused + // the process to exit + std::string + *command_output, // Pass nullptr if you don't want the command output + const Timeout &timeout); + + virtual lldb_private::Status RunShellCommand( + llvm::StringRef shell, llvm::StringRef command, const FileSpec &working_dir, // Pass empty FileSpec to use the current // working directory int *status_ptr, // Pass nullptr if you don't want the process exit status diff --git a/lldb/include/lldb/Target/RemoteAwarePlatform.h b/lldb/include/lldb/Target/RemoteAwarePlatform.h index 5741dbe027b7..6d6ac99c093f 100644 --- a/lldb/include/lldb/Target/RemoteAwarePlatform.h +++ b/lldb/include/lldb/Target/RemoteAwarePlatform.h @@ -68,11 +68,16 @@ class RemoteAwarePlatform : public Platform { bool GetRemoteOSKernelDescription(std::string &s) override; ArchSpec GetRemoteSystemArchitecture() override; - Status RunShellCommand(const char *command, const FileSpec &working_dir, + Status RunShellCommand(llvm::StringRef command, const FileSpec &working_dir, int *status_ptr, int *signo_ptr, std::string *command_output, const Timeout &timeout) override; + Status RunShellCommand(llvm::StringRef interpreter, llvm::StringRef command, + const FileSpec &working_dir, int *status_ptr, + int *signo_ptr, std::string *command_output, + const Timeout &timeout) override; + const char *GetHostname() override; UserIDResolver &GetUserIDResolver() override; lldb_private::Environment GetEnvironment() override; diff --git a/lldb/source/API/SBPlatform.cpp b/lldb/source/API/SBPlatform.cpp index 7ac852488ffb..3c6422e211fc 100644 --- a/lldb/source/API/SBPlatform.cpp +++ b/lldb/source/API/SBPlatform.cpp @@ -50,14 +50,25 @@ struct PlatformConnectOptions { // PlatformShellCommand struct PlatformShellCommand { - PlatformShellCommand(const char *shell_command = nullptr) + PlatformShellCommand(llvm::StringRef shell_interpreter, + llvm::StringRef shell_command) : m_command(), m_working_dir(), m_status(0), m_signo(0) { - if (shell_command && shell_command[0]) - m_command = shell_command; + if (!shell_interpreter.empty()) + m_shell = shell_interpreter.str(); + + if (!m_shell.empty() && !shell_command.empty()) + m_command = shell_command.str(); + } + + PlatformShellCommand(llvm::StringRef shell_command = llvm::StringRef()) + : m_shell(), m_command(), m_working_dir(), m_status(0), m_signo(0) { + if (!shell_command.empty()) + m_command = shell_command.str(); } ~PlatformShellCommand() = default; + std::string m_shell; std::string m_command; std::string m_working_dir; std::string m_output; @@ -163,6 +174,13 @@ void SBPlatformConnectOptions::SetLocalCacheDirectory(const char *path) { } // SBPlatformShellCommand +SBPlatformShellCommand::SBPlatformShellCommand(const char *shell_interpreter, + const char *shell_command) + : m_opaque_ptr(new PlatformShellCommand(shell_interpreter, shell_command)) { + LLDB_RECORD_CONSTRUCTOR(SBPlatformShellCommand, (const char *, const char *), + shell_interpreter, shell_command); +} + SBPlatformShellCommand::SBPlatformShellCommand(const char *shell_command) : m_opaque_ptr(new PlatformShellCommand(shell_command)) { LLDB_RECORD_CONSTRUCTOR(SBPlatformShellCommand, (const char *), @@ -200,6 +218,24 @@ void SBPlatformShellCommand::Clear() { m_opaque_ptr->m_signo = 0; } +const char *SBPlatformShellCommand::GetShell() { + LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatformShellCommand, GetShell); + + if (m_opaque_ptr->m_shell.empty()) + return nullptr; + return m_opaque_ptr->m_shell.c_str(); +} + +void SBPlatformShellCommand::SetShell(const char *shell_interpreter) { + LLDB_RECORD_METHOD(void, SBPlatformShellCommand, SetShell, (const char *), + shell_interpreter); + + if (shell_interpreter && shell_interpreter[0]) + m_opaque_ptr->m_shell = shell_interpreter; + else + m_opaque_ptr->m_shell.clear(); +} + const char *SBPlatformShellCommand::GetCommand() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatformShellCommand, GetCommand); @@ -557,7 +593,8 @@ SBError SBPlatform::Run(SBPlatformShellCommand &shell_command) { if (working_dir) shell_command.SetWorkingDirectory(working_dir); } - return platform_sp->RunShellCommand(command, FileSpec(working_dir), + return platform_sp->RunShellCommand(shell_command.m_opaque_ptr->m_shell, + command, FileSpec(working_dir), &shell_command.m_opaque_ptr->m_status, &shell_command.m_opaque_ptr->m_signo, &shell_command.m_opaque_ptr->m_output, @@ -699,6 +736,8 @@ void RegisterMethods(Registry &R) { SBPlatformShellCommand &, SBPlatformShellCommand, operator=,(const lldb::SBPlatformShellCommand &)); LLDB_REGISTER_METHOD(void, SBPlatformShellCommand, Clear, ()); + LLDB_REGISTER_METHOD(const char *, SBPlatformShellCommand, GetShell, ()); + LLDB_REGISTER_METHOD(void, SBPlatformShellCommand, SetShell, (const char *)); LLDB_REGISTER_METHOD(const char *, SBPlatformShellCommand, GetCommand, ()); LLDB_REGISTER_METHOD(void, SBPlatformShellCommand, SetCommand, (const char *)); diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp index b5409e611f05..3a5af9f91cf1 100644 --- a/lldb/source/Commands/CommandObjectPlatform.cpp +++ b/lldb/source/Commands/CommandObjectPlatform.cpp @@ -1611,6 +1611,16 @@ class CommandObjectPlatformShell : public CommandObjectRaw { else m_timeout = std::chrono::seconds(timeout_sec); break; + case 's': { + if (option_arg.empty()) { + error.SetErrorStringWithFormat( + "missing shell interpreter path for option -i|--interpreter."); + return error; + } + + m_shell_interpreter = option_arg.str(); + break; + } default: llvm_unreachable("Unimplemented option"); } @@ -1621,10 +1631,12 @@ class CommandObjectPlatformShell : public CommandObjectRaw { void OptionParsingStarting(ExecutionContext *execution_context) override { m_timeout.reset(); m_use_host_platform = false; + m_shell_interpreter.clear(); } Timeout m_timeout = std::chrono::seconds(10); bool m_use_host_platform; + std::string m_shell_interpreter; }; CommandObjectPlatformShell(CommandInterpreter &interpreter) @@ -1650,7 +1662,6 @@ class CommandObjectPlatformShell : public CommandObjectRaw { const bool is_alias = !raw_command_line.contains("platform"); OptionsWithRaw args(raw_command_line); - const char *expr = args.GetRawPart().c_str(); if (args.HasArgs()) if (!ParseOptions(args.GetArgs(), result)) @@ -1662,6 +1673,8 @@ class CommandObjectPlatformShell : public CommandObjectRaw { return false; } + llvm::StringRef cmd = args.GetRawPart(); + PlatformSP platform_sp( m_options.m_use_host_platform ? Platform::GetHostPlatform() @@ -1672,7 +1685,8 @@ class CommandObjectPlatformShell : public CommandObjectRaw { std::string output; int status = -1; int signo = -1; - error = (platform_sp->RunShellCommand(expr, working_dir, &status, &signo, + error = (platform_sp->RunShellCommand(m_options.m_shell_interpreter, cmd, + working_dir, &status, &signo, &output, m_options.m_timeout)); if (!output.empty()) result.GetOutputStream().PutCString(output); diff --git a/lldb/source/Commands/Options.td b/lldb/source/Commands/Options.td index fbb64957f48d..4bfaf18ec302 100644 --- a/lldb/source/Commands/Options.td +++ b/lldb/source/Commands/Options.td @@ -631,6 +631,8 @@ let Command = "platform shell" in { Desc<"Run the commands on the host shell when enabled.">; def platform_shell_timeout : Option<"timeout", "t">, Arg<"Value">, Desc<"Seconds to wait for the remote host to finish running the command.">; + def platform_shell_interpreter : Option<"shell", "s">, Arg<"Path">, + Desc<"Shell interpreter path. This is the binary used to run the command.">; } let Command = "process attach" in { diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp index 71c2983ab00f..958fca07850b 100644 --- a/lldb/source/Host/common/Host.cpp +++ b/lldb/source/Host/common/Host.cpp @@ -467,14 +467,24 @@ MonitorShellCommand(std::shared_ptr shell_info, lldb::pid_t pid, return true; } -Status Host::RunShellCommand(const char *command, const FileSpec &working_dir, - int *status_ptr, int *signo_ptr, - std::string *command_output_ptr, +Status Host::RunShellCommand(llvm::StringRef command, + const FileSpec &working_dir, int *status_ptr, + int *signo_ptr, std::string *command_output_ptr, + const Timeout &timeout, + bool run_in_shell, bool hide_stderr) { + return RunShellCommand(llvm::StringRef(), Args(command), working_dir, + status_ptr, signo_ptr, command_output_ptr, timeout, + run_in_shell, hide_stderr); +} + +Status Host::RunShellCommand(llvm::StringRef shell_path, + llvm::StringRef command, + const FileSpec &working_dir, int *status_ptr, + int *signo_ptr, std::string *command_output_ptr, const Timeout &timeout, - bool run_in_default_shell, - bool hide_stderr) { - return RunShellCommand(Args(command), working_dir, status_ptr, signo_ptr, - command_output_ptr, timeout, run_in_default_shell, + bool run_in_shell, bool hide_stderr) { + return RunShellCommand(shell_path, Args(command), working_dir, status_ptr, + signo_ptr, command_output_ptr, timeout, run_in_shell, hide_stderr); } @@ -482,14 +492,27 @@ Status Host::RunShellCommand(const Args &args, const FileSpec &working_dir, int *status_ptr, int *signo_ptr, std::string *command_output_ptr, const Timeout &timeout, - bool run_in_default_shell, - bool hide_stderr) { + bool run_in_shell, bool hide_stderr) { + return RunShellCommand(llvm::StringRef(), args, working_dir, status_ptr, + signo_ptr, command_output_ptr, timeout, run_in_shell, + hide_stderr); +} + +Status Host::RunShellCommand(llvm::StringRef shell_path, const Args &args, + const FileSpec &working_dir, int *status_ptr, + int *signo_ptr, std::string *command_output_ptr, + const Timeout &timeout, + bool run_in_shell, bool hide_stderr) { Status error; ProcessLaunchInfo launch_info; launch_info.SetArchitecture(HostInfo::GetArchitecture()); - if (run_in_default_shell) { + if (run_in_shell) { // Run the command in a shell - launch_info.SetShell(HostInfo::GetDefaultShell()); + FileSpec shell = HostInfo::GetDefaultShell(); + if (!shell_path.empty()) + shell.SetPath(shell_path); + + launch_info.SetShell(shell); launch_info.GetArguments().AppendArguments(args); const bool localhost = true; const bool will_debug = false; diff --git a/lldb/source/Host/macosx/objcxx/Host.mm b/lldb/source/Host/macosx/objcxx/Host.mm index faac6f59190a..8cd3b3591993 100644 --- a/lldb/source/Host/macosx/objcxx/Host.mm +++ b/lldb/source/Host/macosx/objcxx/Host.mm @@ -1323,11 +1323,11 @@ static bool ShouldLaunchUsingXPC(ProcessLaunchInfo &launch_info) { launch_info.SetWorkingDirectory(working_dir); } } - bool run_in_default_shell = true; + bool run_in_shell = true; bool hide_stderr = true; - Status e = RunShellCommand(expand_command, cwd, &status, nullptr, &output, - std::chrono::seconds(10), run_in_default_shell, - hide_stderr); + Status e = + RunShellCommand(expand_command, cwd, &status, nullptr, &output, + std::chrono::seconds(10), run_in_shell, hide_stderr); if (e.Fail()) return e; diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp index e1eb15c3e8c9..0e0b61f1534f 100644 --- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -711,7 +711,7 @@ bool PlatformRemoteGDBServer::GetFileExists(const FileSpec &file_spec) { } Status PlatformRemoteGDBServer::RunShellCommand( - const char *command, // Shouldn't be NULL + llvm::StringRef shell, llvm::StringRef command, const FileSpec & working_dir, // Pass empty FileSpec to use the current working directory int *status_ptr, // Pass NULL if you don't want the process exit status diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h index 3562b2bb09df..297b482eb87a 100644 --- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h +++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h @@ -140,7 +140,7 @@ class PlatformRemoteGDBServer : public Platform, private UserIDResolver { Status Unlink(const FileSpec &path) override; Status RunShellCommand( - const char *command, // Shouldn't be NULL + llvm::StringRef shell, llvm::StringRef command, const FileSpec &working_dir, // Pass empty FileSpec to use the current // working directory int *status_ptr, // Pass NULL if you don't want the process exit status diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 0949b9918523..dd0f69841aa7 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -2812,7 +2812,7 @@ lldb::addr_t GDBRemoteCommunicationClient::GetShlibInfoAddr() { } lldb_private::Status GDBRemoteCommunicationClient::RunShellCommand( - const char *command, // Shouldn't be NULL + llvm::StringRef command, const FileSpec & working_dir, // Pass empty FileSpec to use the current working directory int *status_ptr, // Pass NULL if you don't want the process exit status @@ -2823,7 +2823,7 @@ lldb_private::Status GDBRemoteCommunicationClient::RunShellCommand( const Timeout &timeout) { lldb_private::StreamString stream; stream.PutCString("qPlatform_shell:"); - stream.PutBytesAsRawHex8(command, strlen(command)); + stream.PutBytesAsRawHex8(command.data(), command.size()); stream.PutChar(','); uint32_t timeout_sec = UINT32_MAX; if (timeout) { diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h index 0159125a433b..61acfad5d313 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h @@ -399,7 +399,7 @@ class GDBRemoteCommunicationClient : public GDBRemoteClientBase { bool GetFileExists(const FileSpec &file_spec); Status RunShellCommand( - const char *command, // Shouldn't be nullptr + llvm::StringRef command, const FileSpec &working_dir, // Pass empty FileSpec to use the current // working directory int *status_ptr, // Pass nullptr if you don't want the process exit status diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index e867b8db4723..7416ea6dd40c 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -1319,7 +1319,23 @@ MmapArgList Platform::GetMmapArgumentList(const ArchSpec &arch, addr_t addr, } lldb_private::Status Platform::RunShellCommand( - const char *command, // Shouldn't be nullptr + llvm::StringRef command, + const FileSpec & + working_dir, // Pass empty FileSpec to use the current working directory + int *status_ptr, // Pass nullptr if you don't want the process exit status + int *signo_ptr, // Pass nullptr if you don't want the signal that caused the + // process to exit + std::string + *command_output, // Pass nullptr if you don't want the command output + const Timeout &timeout) { + return RunShellCommand(llvm::StringRef(), command, working_dir, status_ptr, + signo_ptr, command_output, timeout); +} + +lldb_private::Status Platform::RunShellCommand( + llvm::StringRef shell, // Pass empty if you want to use the default + // shell interpreter + llvm::StringRef command, // Shouldn't be empty const FileSpec & working_dir, // Pass empty FileSpec to use the current working directory int *status_ptr, // Pass nullptr if you don't want the process exit status @@ -1329,8 +1345,8 @@ lldb_private::Status Platform::RunShellCommand( *command_output, // Pass nullptr if you don't want the command output const Timeout &timeout) { if (IsHost()) - return Host::RunShellCommand(command, working_dir, status_ptr, signo_ptr, - command_output, timeout); + return Host::RunShellCommand(shell, command, working_dir, status_ptr, + signo_ptr, command_output, timeout); else return Status("unimplemented"); } diff --git a/lldb/source/Target/RemoteAwarePlatform.cpp b/lldb/source/Target/RemoteAwarePlatform.cpp index f53158b06b8f..3a186adca04c 100644 --- a/lldb/source/Target/RemoteAwarePlatform.cpp +++ b/lldb/source/Target/RemoteAwarePlatform.cpp @@ -171,15 +171,24 @@ Status RemoteAwarePlatform::ResolveExecutable( } Status RemoteAwarePlatform::RunShellCommand( - const char *command, const FileSpec &working_dir, int *status_ptr, + llvm::StringRef command, const FileSpec &working_dir, int *status_ptr, int *signo_ptr, std::string *command_output, const Timeout &timeout) { + return RunShellCommand(llvm::StringRef(), command, working_dir, status_ptr, + signo_ptr, command_output, timeout); +} + +Status RemoteAwarePlatform::RunShellCommand( + llvm::StringRef shell, llvm::StringRef command, const FileSpec &working_dir, + int *status_ptr, int *signo_ptr, std::string *command_output, + const Timeout &timeout) { if (IsHost()) - return Host::RunShellCommand(command, working_dir, status_ptr, signo_ptr, - command_output, timeout); + return Host::RunShellCommand(shell, command, working_dir, status_ptr, + signo_ptr, command_output, timeout); if (m_remote_platform_sp) - return m_remote_platform_sp->RunShellCommand( - command, working_dir, status_ptr, signo_ptr, command_output, timeout); + return m_remote_platform_sp->RunShellCommand(shell, command, working_dir, + status_ptr, signo_ptr, + command_output, timeout); return Status("unable to run a remote command without a platform"); } diff --git a/lldb/test/API/commands/platform/basic/Makefile b/lldb/test/API/commands/platform/basic/Makefile new file mode 100644 index 000000000000..3626466f607c --- /dev/null +++ b/lldb/test/API/commands/platform/basic/Makefile @@ -0,0 +1,5 @@ +C_SOURCES := myshell.c +CFLAGS_EXTRAS := -g0 # No debug info. +MAKE_DSYM := NO + +include Makefile.rules diff --git a/lldb/test/API/commands/platform/basic/TestPlatformCommand.py b/lldb/test/API/commands/platform/basic/TestPlatformCommand.py index 570f9b3f828d..dc1701258246 100644 --- a/lldb/test/API/commands/platform/basic/TestPlatformCommand.py +++ b/lldb/test/API/commands/platform/basic/TestPlatformCommand.py @@ -13,6 +13,7 @@ class PlatformCommandTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) + NO_DEBUG_INFO_TESTCASE = True @no_debug_info_test def test_help_platform(self): @@ -92,3 +93,11 @@ def test_shell_timeout(self): "error: timed out waiting for shell command to complete"]) self.expect("shell -t 1 -- sleep 3", error=True, substrs=[ "error: timed out waiting for shell command to complete"]) + + @no_debug_info_test + def test_host_shell_interpreter(self): + """ Test the host platform shell with a different interpreter """ + self.build() + exe = self.getBuildArtifact('a.out') + self.expect("platform shell -h -s " + exe + " -- 'echo $0'", + substrs=['SUCCESS', 'a.out']) diff --git a/lldb/test/API/commands/platform/basic/TestPlatformPython.py b/lldb/test/API/commands/platform/basic/TestPlatformPython.py index ab10d30b6ff5..0063621e5800 100644 --- a/lldb/test/API/commands/platform/basic/TestPlatformPython.py +++ b/lldb/test/API/commands/platform/basic/TestPlatformPython.py @@ -79,3 +79,20 @@ def test_available_platform_list(self): self.assertEqual( desc_data.GetType(), lldb.eStructuredDataTypeString, 'Platform description is a string') + + @add_test_categories(['pyapi']) + @no_debug_info_test + def test_shell_interpreter(self): + """ Test a shell with a custom interpreter """ + platform = self.dbg.GetSelectedPlatform() + self.assertTrue(platform.IsValid()) + + sh_cmd = lldb.SBPlatformShellCommand('/bin/zsh', 'echo $0') + self.assertIn('/bin/zsh', sh_cmd.GetShell()) + self.assertIn('echo $0', sh_cmd.GetCommand()) + + self.build() + sh_cmd.SetShell(self.getBuildArtifact('a.out')) + err = platform.Run(sh_cmd) + self.assertTrue(err.Success()) + self.assertIn("SUCCESS", sh_cmd.GetOutput()) diff --git a/lldb/test/API/commands/platform/basic/myshell.c b/lldb/test/API/commands/platform/basic/myshell.c new file mode 100644 index 000000000000..d1c0eecb943e --- /dev/null +++ b/lldb/test/API/commands/platform/basic/myshell.c @@ -0,0 +1,24 @@ +#include +#include +#include + +int main(int argc, char *argv[]) { + if (argc < 3) { + fprintf(stderr, "ERROR: Too few arguments (count: %d).\n", argc - 1); + exit(1); + } + +#ifdef WIN32 + char *cmd_opt = "/C"; +#else + char *cmd_opt = "-c"; +#endif + + if (strncmp(argv[1], cmd_opt, 2)) { + fprintf(stderr, "ERROR: Missing shell command option ('%s').\n", cmd_opt); + exit(1); + } + + printf("SUCCESS: %s\n", argv[0]); + return 0; +} From b6b63684b19813eda9d1b81a113304e7735f0d5c Mon Sep 17 00:00:00 2001 From: Qiu Chaofan Date: Wed, 2 Sep 2020 23:09:48 +0800 Subject: [PATCH 10/26] [NFC] [PowerPC] Add FMA flag propagation test --- llvm/test/CodeGen/PowerPC/fma-combine.ll | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/llvm/test/CodeGen/PowerPC/fma-combine.ll b/llvm/test/CodeGen/PowerPC/fma-combine.ll index 6683d925a1b1..bf2abe0b6b83 100644 --- a/llvm/test/CodeGen/PowerPC/fma-combine.ll +++ b/llvm/test/CodeGen/PowerPC/fma-combine.ll @@ -239,4 +239,26 @@ define double @getNegatedExpression_crash(double %x, double %y) { %fma1 = call reassoc nsz double @llvm.fma.f64(double %fma, double %y, double %add) ret double %fma1 } + +define double @fma_flag_propagation(double %a) { +; CHECK-FAST-LABEL: fma_flag_propagation: +; CHECK-FAST: # %bb.0: # %entry +; CHECK-FAST-NEXT: xssubdp 1, 1, 1 +; CHECK-FAST-NEXT: blr +; +; CHECK-FAST-NOVSX-LABEL: fma_flag_propagation: +; CHECK-FAST-NOVSX: # %bb.0: # %entry +; CHECK-FAST-NOVSX-NEXT: fsub 1, 1, 1 +; CHECK-FAST-NOVSX-NEXT: blr +; +; CHECK-LABEL: fma_flag_propagation: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: xssubdp 1, 1, 1 +; CHECK-NEXT: blr +entry: + %0 = fneg double %a + %1 = call reassoc nnan double @llvm.fma.f64(double %0, double 1.0, double %a) + ret double %1 +} + declare double @llvm.fma.f64(double, double, double) nounwind readnone From ec489ae048fd971b22400c61458a5295eeba368a Mon Sep 17 00:00:00 2001 From: Congzhe Cao Date: Wed, 2 Sep 2020 11:02:58 -0400 Subject: [PATCH 11/26] [IPSCCP] Fix a bug that the "returned" attribute is not cleared when function is optimized to return undef In IPSCCP when a function is optimized to return undef, it should clear the returned attribute for all its input arguments and its corresponding call sites. The bug is exposed when the value of an input argument of the function is assigned to a physical register and because of the argument having a returned attribute, the value of this physical register will continue to be used as the function return value right after the call instruction returns, even if the value that this register holds may be clobbered during the function call. This potentially results in incorrect values being used afterwards. Reviewed By: jdoerfert, fhahn Differential Revision: https://reviews.llvm.org/D84220 --- llvm/lib/Transforms/Scalar/SCCP.cpp | 19 ++++++ .../Transforms/SCCP/ipsccp-clear-returned.ll | 62 +++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 llvm/test/Transforms/SCCP/ipsccp-clear-returned.ll diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp index 57befc9c3cfb..2afc778ed821 100644 --- a/llvm/lib/Transforms/Scalar/SCCP.cpp +++ b/llvm/lib/Transforms/Scalar/SCCP.cpp @@ -23,6 +23,7 @@ #include "llvm/ADT/MapVector.h" #include "llvm/ADT/PointerIntPair.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" @@ -2112,9 +2113,27 @@ bool llvm::runIPSCCP( } // Zap all returns which we've identified as zap to change. + SmallSetVector FuncZappedReturn; for (unsigned i = 0, e = ReturnsToZap.size(); i != e; ++i) { Function *F = ReturnsToZap[i]->getParent()->getParent(); ReturnsToZap[i]->setOperand(0, UndefValue::get(F->getReturnType())); + // Record all functions that are zapped. + FuncZappedReturn.insert(F); + } + + // Remove the returned attribute for zapped functions and the + // corresponding call sites. + for (Function *F : FuncZappedReturn) { + for (Argument &A : F->args()) + F->removeParamAttr(A.getArgNo(), Attribute::Returned); + for (Use &U : F->uses()) { + // Skip over blockaddr users. + if (isa(U.getUser())) + continue; + CallBase *CB = cast(U.getUser()); + for (Use &Arg : CB->args()) + CB->removeParamAttr(CB->getArgOperandNo(&Arg), Attribute::Returned); + } } // If we inferred constant or undef values for globals variables, we can diff --git a/llvm/test/Transforms/SCCP/ipsccp-clear-returned.ll b/llvm/test/Transforms/SCCP/ipsccp-clear-returned.ll new file mode 100644 index 000000000000..d8b5fbff4e62 --- /dev/null +++ b/llvm/test/Transforms/SCCP/ipsccp-clear-returned.ll @@ -0,0 +1,62 @@ +; if IPSCCP determines a function returns undef, +; then the "returned" attribute of input arguments +; should be cleared. + +; RUN: opt < %s -ipsccp -S | FileCheck %s +define i32 @main() { +; CHECK-LABEL: @main +entry: +; CHECK-NEXT: entry: + %call = call i32 @func_return_undef(i32 returned 1) +; CHECK: call i32 @func_return_undef(i32 1) +; CHECK-NOT: returned + ret i32 %call +; CHECK: ret i32 1 +} + +define internal i32 @func_return_undef(i32 returned %arg) { +; CHECK: {{define.*@func_return_undef}} +; CHECK-NOT: returned +entry: +; CHECK-NEXT: entry: +; CHECK-NEXT: {{ret.*undef}} + ret i32 %arg +} + + +; The only case that users of zapped functions are non-call site +; users is that they are blockaddr users. Skip them because we +; want to remove the returned attribute for call sites + +; CHECK: {{define.*@blockaddr_user}} +; CHECK-NOT: returned +define internal i32 @blockaddr_user(i1 %c, i32 returned %d) { +entry: + br i1 %c, label %bb1, label %bb2 + +bb1: + br label %branch.block + +bb2: + br label %branch.block + +branch.block: + %addr = phi i8* [blockaddress(@blockaddr_user, %target1), %bb1], [blockaddress(@blockaddr_user, %target2), %bb2] + indirectbr i8* %addr, [label %target1, label %target2] + +target1: + br label %target2 + +; CHECK: ret i32 undef +target2: + ret i32 %d +} + +define i32 @call_blockaddr_user(i1 %c) { +; CHECK-LABEL: define i32 @call_blockaddr_user( +; CHECK-NEXT: %r = call i32 @blockaddr_user(i1 %c +; CHECK-NOT: returned +; CHECK-NEXT: ret i32 10 + %r = call i32 @blockaddr_user(i1 %c, i32 returned 10) + ret i32 %r +} From c5aa63dd560b9cf5825c1e4da2a9ee53dbd772f3 Mon Sep 17 00:00:00 2001 From: Jordan Rupprecht Date: Wed, 2 Sep 2020 08:24:06 -0700 Subject: [PATCH 12/26] [lldb/Host] Add missing proc states The /proc//status parsing is missing a few cases: - Idle - Parked - Dead If we encounter an unknown proc state, this leads to an msan warning. In reality, we only check that the state != Zombie, so it doesn't really matter that we handle all cases, but handle them anyway (current list: [1]). Also explicitly set it to unknown if we encounter an unknown state. There will still be an msan warning if the proc entry has no `State:` line, but that should not happen. Use a StringSwitch to make the handling of proc states a little more compact. [1] https://github.com/torvalds/linux/blob/master/fs/proc/array.c Reviewed By: labath Differential Revision: https://reviews.llvm.org/D86818 --- lldb/source/Host/linux/Host.cpp | 41 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/lldb/source/Host/linux/Host.cpp b/lldb/source/Host/linux/Host.cpp index 45973f5d214b..520a00df35f6 100644 --- a/lldb/source/Host/linux/Host.cpp +++ b/lldb/source/Host/linux/Host.cpp @@ -16,6 +16,7 @@ #include #include +#include "llvm/ADT/StringSwitch.h" #include "llvm/Object/ELF.h" #include "llvm/Support/ScopedPrinter.h" @@ -35,8 +36,11 @@ using namespace lldb_private; namespace { enum class ProcessState { Unknown, + Dead, DiskSleep, + Idle, Paging, + Parked, Running, Sleeping, TracedOrStopped, @@ -50,12 +54,14 @@ class ProcessLaunchInfo; static bool GetStatusInfo(::pid_t Pid, ProcessInstanceInfo &ProcessInfo, ProcessState &State, ::pid_t &TracerPid) { + Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST); + auto BufferOrError = getProcFile(Pid, "status"); if (!BufferOrError) return false; llvm::StringRef Rest = BufferOrError.get()->getBuffer(); - while(!Rest.empty()) { + while (!Rest.empty()) { llvm::StringRef Line; std::tie(Line, Rest) = Rest.split('\n'); @@ -84,26 +90,19 @@ static bool GetStatusInfo(::pid_t Pid, ProcessInstanceInfo &ProcessInfo, Line.ltrim().consumeInteger(10, PPid); ProcessInfo.SetParentProcessID(PPid); } else if (Line.consume_front("State:")) { - char S = Line.ltrim().front(); - switch (S) { - case 'R': - State = ProcessState::Running; - break; - case 'S': - State = ProcessState::Sleeping; - break; - case 'D': - State = ProcessState::DiskSleep; - break; - case 'Z': - State = ProcessState::Zombie; - break; - case 'T': - State = ProcessState::TracedOrStopped; - break; - case 'W': - State = ProcessState::Paging; - break; + State = llvm::StringSwitch(Line.ltrim().take_front(1)) + .Case("D", ProcessState::DiskSleep) + .Case("I", ProcessState::Idle) + .Case("R", ProcessState::Running) + .Case("S", ProcessState::Sleeping) + .CaseLower("T", ProcessState::TracedOrStopped) + .Case("W", ProcessState::Paging) + .Case("P", ProcessState::Parked) + .Case("X", ProcessState::Dead) + .Case("Z", ProcessState::Zombie) + .Default(ProcessState::Unknown); + if (State == ProcessState::Unknown) { + LLDB_LOG(log, "Unknown process state {0}", Line); } } else if (Line.consume_front("TracerPid:")) { Line = Line.ltrim(); From 39cf83cc78ff0a017fb9de27d45b87217aa6f558 Mon Sep 17 00:00:00 2001 From: Ehsan Toosi Date: Fri, 31 Jul 2020 15:20:37 +0200 Subject: [PATCH 13/26] [mlir] Extend BufferAssignmentTypeConverter with result conversion callbacks In this PR, the users of BufferPlacement can configure BufferAssginmentTypeConverter. These new configurations would give the user more freedom in the process of converting function signature, and return and call operation conversions. These are the new features: - Accepting callback functions for decomposing types (i.e. 1 to N type conversion such as unpacking tuple types). - Defining ResultConversionKind for specifying whether a function result with a certain type should be appended to the function arguments list or should be kept as function result. (Usage: converter.setResultConversionKind(AppendToArgumentList)) - Accepting callback functions for composing or decomposing values (i.e. N to 1 and 1 to N value conversion). Differential Revision: https://reviews.llvm.org/D85133 --- .../include/mlir/Transforms/BufferPlacement.h | 344 +++++++++--------- .../Linalg/Transforms/TensorsToBuffers.cpp | 11 +- mlir/lib/Transforms/BufferPlacement.cpp | 220 ++++++++++- ...nt-preparation-allowed-memref-results.mlir | 66 ++++ .../buffer-placement-preparation.mlir | 85 +++++ mlir/test/lib/Dialect/Test/TestOps.td | 29 +- .../lib/Transforms/TestBufferPlacement.cpp | 48 ++- 7 files changed, 612 insertions(+), 191 deletions(-) diff --git a/mlir/include/mlir/Transforms/BufferPlacement.h b/mlir/include/mlir/Transforms/BufferPlacement.h index f8559a9dd939..b3db7794fd97 100644 --- a/mlir/include/mlir/Transforms/BufferPlacement.h +++ b/mlir/include/mlir/Transforms/BufferPlacement.h @@ -52,6 +52,111 @@ class BufferAssignmentPlacer { Operation *operation; }; +/// A helper type converter class for using inside Buffer Assignment operation +/// conversion patterns. The default constructor keeps all the types intact +/// except for the ranked-tensor types which is converted to memref types. +class BufferAssignmentTypeConverter : public TypeConverter { +public: + /// This enum is for showing how buffer placement operation converters should + /// conduct with certain result type after type conversion. This value can be + /// set/get for each specific type using setResultConversionKind or + /// getResultConversionKind. + enum ResultConversionKind { AppendToArgumentsList, KeepAsFunctionResult }; + + BufferAssignmentTypeConverter(); + + /// This method tries to decompose a value of a certain type using provided + /// decompose callback functions. If it is unable to do so, the original value + /// is returned. + void tryDecomposeValue(OpBuilder &, Location, Type, Value, + SmallVectorImpl &); + + /// This method tries to decompose a type using provided decompose callback + /// functions. If it is unable to do so, the original type is returned. + void tryDecomposeType(Type, SmallVectorImpl &); + + /// This method registers a callback function that will be called to decompose + /// a value of a certain type into several values. + template ::template arg_t<2>> + void addDecomposeValueConversion(FnT &&callback) { + decomposeValueConversions.emplace_back( + wrapDecomposeValueConversionCallback(std::forward(callback))); + } + + /// This method registers a callback function that will be called to decompose + /// a type into several types. + template ::template arg_t<0>> + void addDecomposeTypeConversion(FnT &&callback) { + auto wrapper = + wrapDecomposeTypeConversionCallback(std::forward(callback)); + decomposeTypeConversions.emplace_back(wrapper); + addConversion(std::forward(callback)); + } + + /// This method returns ResultConversionKind for the mapping from `origin` + /// type to `input` type. + ResultConversionKind getResultConversionKind(Type origin, Type input); + + /// This method registers ResultConversionKind for the mapping from type 'T' + /// to type 'U'. + template + void setResultConversionKind(ResultConversionKind kind) { + assert((kind != AppendToArgumentsList || + llvm::is_one_of::value) && + "Only the memref typed values can be set to be appended to the " + "function argument list at the moment"); + resultTypeConversions.emplace_back( + [=](Type origin, Type input) -> Optional { + if (origin.template isa() && input.template isa()) + return kind; + return llvm::None; + }); + } + +private: + using DecomposeValueConversionCallFn = std::function( + OpBuilder &, Location, Type, Value, SmallVectorImpl &)>; + + using DecomposeTypeConversionCallFn = + std::function(Type, SmallVectorImpl &)>; + + using ResultConversionKindFn = + std::function(Type, Type)>; + + /// Generate a wrapper for the given decompose value conversion callback. + template + DecomposeValueConversionCallFn + wrapDecomposeValueConversionCallback(FnT &&callback) { + return [callback = std::forward(callback)]( + OpBuilder &builder, Location loc, Type type, Value value, + SmallVectorImpl &newValues) -> Optional { + if (T derivedType = type.dyn_cast()) + return callback(builder, loc, derivedType, value, newValues); + return llvm::None; + }; + } + + /// Generate a wrapper for the given decompose type conversion callback. + template + DecomposeTypeConversionCallFn + wrapDecomposeTypeConversionCallback(FnT &&callback) { + return [callback = std::forward(callback)]( + Type type, + SmallVectorImpl &results) -> Optional { + T derivedType = type.dyn_cast(); + if (!derivedType) + return llvm::None; + return callback(derivedType, results); + }; + } + + SmallVector resultTypeConversions; + SmallVector decomposeValueConversions; + SmallVector decomposeTypeConversions; +}; + /// Helper conversion pattern that encapsulates a BufferAssignmentPlacer /// instance. Sample usage: /// class CustomConversionPattern : public @@ -68,43 +173,22 @@ class BufferAssignmentOpConversionPattern public: explicit BufferAssignmentOpConversionPattern( MLIRContext *context, BufferAssignmentPlacer *bufferAssignment = nullptr, - TypeConverter *converter = nullptr, PatternBenefit benefit = 1) + BufferAssignmentTypeConverter *converter = nullptr, + PatternBenefit benefit = 1) : OpConversionPattern(context, benefit), - bufferAssignment(bufferAssignment), converter(converter) {} + bufferAssignment(bufferAssignment), converter(converter) { + assert(converter && "The type converter has not been defined"); + } protected: BufferAssignmentPlacer *bufferAssignment; - TypeConverter *converter; -}; - -/// A helper type converter class for using inside Buffer Assignment operation -/// conversion patterns. The default constructor keeps all the types intact -/// except for the ranked-tensor types which is converted to memref types. -class BufferAssignmentTypeConverter : public TypeConverter { -public: - BufferAssignmentTypeConverter(); - - /// A helper function to check if `type` has been converted from non-memref - /// type to memref. - static bool isConvertedMemref(Type type, Type before); + BufferAssignmentTypeConverter *converter; }; -namespace detail { - -/// Converts the signature of the function based on whether the function is -/// allowed to return memref typed results or not using -/// `allowMemrefFunctionResults` parameter. If this option is false, then it -/// adds an extra function argument as an output buffer for each function result -/// which is going to be a memref type only after type conversion. The -/// other function result types remain unchanged. If -/// `allowMemrefFunctionResults` is true, the types are converted in place. -/// Any changes in function signature need to be applied -/// to return and caller operations. `BufferAssignmentReturnOpConverter` and -/// `BufferAssignmentCallOpConverter` are two helper function that match the -/// return and caller operation with the new function signature. Furthermore, -/// `BufferAssignmentTypeConverter` is a helper `TypeConverter` for converting -/// tensor typed values to memref typed ones. -template +/// Converts the signature of the function using BufferAssignmentTypeConverter. +/// Each result type of the function is kept as a function result or appended to +/// the function arguments list based on ResultConversionKind for the converted +/// result type. class BufferAssignmentFuncOpConverter : public BufferAssignmentOpConversionPattern { public: @@ -112,58 +196,16 @@ class BufferAssignmentFuncOpConverter FuncOp>::BufferAssignmentOpConversionPattern; /// Performs the actual signature rewriting step. - LogicalResult - matchAndRewrite(mlir::FuncOp funcOp, ArrayRef operands, - ConversionPatternRewriter &rewriter) const final { - if (!converter) - return funcOp.emitError("The type converter has not been defined for " - "BufferAssignmentFuncOpConverter"); - auto funcType = funcOp.getType(); - - // Convert function arguments using the provided TypeConverter. - TypeConverter::SignatureConversion conversion(funcType.getNumInputs()); - for (auto argType : llvm::enumerate(funcType.getInputs())) - conversion.addInputs(argType.index(), - converter->convertType(argType.value())); - - // If allowMemrefFunctionResults is false and a function result type is not - // a memref but it would be a memref after type conversion, a new argument - // should be appended to the function arguments list for this result. - // Otherwise, it remains unchanged as a function result. - SmallVector newResultTypes; - newResultTypes.reserve(funcOp.getNumResults()); - for (Type resType : funcType.getResults()) { - Type convertedType = converter->convertType(resType); - if (!allowMemrefFunctionResults && - BufferAssignmentTypeConverter::isConvertedMemref(convertedType, - resType)) - conversion.addInputs(convertedType); - else - newResultTypes.push_back(convertedType); - } - if (failed(rewriter.convertRegionTypes(&funcOp.getBody(), *converter, - &conversion))) - return failure(); - - // Update the signature of the function. - rewriter.updateRootInPlace(funcOp, [&] { - funcOp.setType(rewriter.getFunctionType(conversion.getConvertedTypes(), - newResultTypes)); - }); - return success(); - } + LogicalResult matchAndRewrite(mlir::FuncOp, ArrayRef, + ConversionPatternRewriter &) const; }; /// Rewrites the `ReturnOp` to conform with the changed function signature. -/// if allowMemrefFunctionResults is false, operands that correspond to return -/// values and have been rewritten from illegal typed results to memref -/// arguments are dropped. In their place, a corresponding copy operation from -/// the operand to the output function argument is inserted. Otherwise, the -/// memref typed operands are returned. -/// Note: If this pattern rewriter is used with BufferAssignmentFuncOpConverter, -/// allowMemrefFunctionResults must be set/unset for both. +/// Operands that correspond to return values and their types have been set to +/// AppendToArgumentsList are dropped. In their place, a corresponding copy +/// operation from the operand to the target function argument is inserted. template + typename CopyOpTy> class BufferAssignmentReturnOpConverter : public BufferAssignmentOpConversionPattern { public: @@ -174,44 +216,48 @@ class BufferAssignmentReturnOpConverter LogicalResult matchAndRewrite(ReturnOpSourceTy returnOp, ArrayRef operands, ConversionPatternRewriter &rewriter) const final { - // If the memref typed results can be returned as function results, the new - // `ReturnOp` should only return the type converted operands. - if (allowMemrefFunctionResults) { - rewriter.replaceOpWithNewOp(returnOp, operands); - return success(); + Location loc = returnOp.getLoc(); + + // Split the operands depending on whether they need a copy operation or + // they remain as operands of the return operation. If an operand is + // decomposable and a decompose callback function has been provided by the + // user, it will be unpacked. + SmallVector newOperands, needCopyOperands; + OpBuilder builder(returnOp); + for (auto operand : llvm::enumerate(operands)) { + SmallVector values; + this->converter->tryDecomposeValue( + builder, loc, operand.value().getType(), operand.value(), values); + Type type = returnOp.getOperand(operand.index()).getType(); + SmallVector originTypes; + this->converter->tryDecomposeType(type, originTypes); + for (auto value : llvm::enumerate(values)) { + Type origin = originTypes[value.index()]; + Type converted = value.value().getType(); + auto kind = this->converter->getResultConversionKind(origin, converted); + if (kind == BufferAssignmentTypeConverter::KeepAsFunctionResult) + newOperands.push_back(value.value()); + else + // kind = BufferAssignmentTypeConverter::AppendToArgumentsList + needCopyOperands.push_back(value.value()); + } } - // Split the operands by their kinds whether they are converted memref or - // not. - SmallVector needCopyOperands, newOperands; - unsigned operandsSize = operands.size(); - needCopyOperands.reserve(operandsSize); - newOperands.reserve(operandsSize); - for (auto operand : llvm::enumerate(operands)) - if (BufferAssignmentTypeConverter::isConvertedMemref( - operand.value().getType(), - returnOp.getOperand(operand.index()).getType())) - needCopyOperands.push_back(operand.value()); - else - newOperands.push_back(operand.value()); - + // Insert Copy operations instead for the operands that have been removed + // from operand list and appended to the function arguments list. Block &entryBlock = returnOp.getParentRegion()->front(); unsigned numFuncArgs = entryBlock.getNumArguments(); - - // Find the index of the first destination buffer. - assert(needCopyOperands.size() <= numFuncArgs && - "The number of operands of return operation is more than the " - "number of function arguments."); + if (needCopyOperands.size() > numFuncArgs) + return returnOp.emitError( + "The number of operands that need Copy operations is more " + "than the number of target function arguments."); unsigned destArgNum = numFuncArgs - needCopyOperands.size(); rewriter.setInsertionPoint(returnOp); for (Value operand : needCopyOperands) { - // Insert a `CopyOp` for each converted memref-type operand. - rewriter.create(returnOp.getLoc(), operand, + rewriter.create(loc, operand, entryBlock.getArgument(destArgNum)); ++destArgNum; } - - // Insert the new target Return operation. rewriter.replaceOpWithNewOp(returnOp, newOperands); return success(); } @@ -219,94 +265,32 @@ class BufferAssignmentReturnOpConverter /// Rewrites the `CallOp` to match its operands and results with the signature /// of the callee after rewriting the callee with -/// BufferAssignmentFuncOpConverter. If allowMemrefFunctionResults is false, a -/// buffer is allocated as an output buffer only for each memref typed result -/// that has been rewritten. The new allocated buffer is passed through the -/// operands list of the new `CallOp`. -/// Note: If this pattern rewriter is used with BufferAssignmentFuncOpConverter, -/// allowMemrefFunctionResults must be set/unset for both. -template +/// BufferAssignmentFuncOpConverter. class BufferAssignmentCallOpConverter : public BufferAssignmentOpConversionPattern { public: using BufferAssignmentOpConversionPattern< CallOp>::BufferAssignmentOpConversionPattern; - LogicalResult - matchAndRewrite(CallOp callOp, ArrayRef operands, - ConversionPatternRewriter &rewriter) const final { - if (!converter) - return callOp.emitError("The type converter has not been defined for " - "BufferAssignmentCallOpConverter"); - Location loc = callOp.getLoc(); - - // If the memref typed results can be returned as function results, there is - // no need to create output buffers. It is only required to convert the type - // of operands and results in place for creating the new `CallOp`. - if (allowMemrefFunctionResults) { - SmallVector resultTypes; - resultTypes.reserve(callOp.getNumResults()); - for (Type type : callOp.getResultTypes()) - resultTypes.push_back(converter->convertType(type)); - rewriter.replaceOpWithNewOp(callOp, callOp.getCallee(), - resultTypes, operands); - return success(); - } - - SmallVector newOperands, replacingValues; - SmallVector newResultTypes; - unsigned numResults = callOp.getNumResults(); - newOperands.reserve(numResults + operands.size()); - newOperands.append(operands.begin(), operands.end()); - newResultTypes.reserve(numResults); - replacingValues.reserve(numResults); - - // For each memref result of `CallOp` which has not been a memref before - // the type conversion, a new buffer is allocated and passed to the operands - // list of the new `CallOp`. Otherwise, it remains as a caller result. - for (Value result : callOp.getResults()) { - Type currType = result.getType(); - Type newType = converter->convertType(result.getType()); - if (BufferAssignmentTypeConverter::isConvertedMemref(newType, currType)) { - OpBuilder::InsertionGuard guard(rewriter); - rewriter.restoreInsertionPoint(bufferAssignment->computeAllocPosition( - result.dyn_cast())); - Value alloc = - rewriter.create(loc, newType.dyn_cast()); - newOperands.push_back(alloc); - replacingValues.push_back(alloc); - } else { - newResultTypes.push_back(currType); - - // No replacing is required. - replacingValues.push_back(nullptr); - } - } - - // Creating the new `CallOp`. - rewriter.create(loc, callOp.getCallee(), newResultTypes, - newOperands); - - // Replacing the results of the old `CallOp`. - rewriter.replaceOp(callOp, replacingValues); - return success(); - } + /// Performs the actual rewriting step. + LogicalResult matchAndRewrite(CallOp, ArrayRef, + ConversionPatternRewriter &) const; }; -} // end namespace detail /// Populates `patterns` with the conversion patterns of buffer /// assignment. template + typename CopyOpTy> static void populateWithBufferAssignmentOpConversionPatterns( MLIRContext *context, BufferAssignmentPlacer *placer, - TypeConverter *converter, OwningRewritePatternList *patterns) { + BufferAssignmentTypeConverter *converter, + OwningRewritePatternList *patterns) { // clang-format off patterns->insert< - detail::BufferAssignmentCallOpConverter, - detail::BufferAssignmentFuncOpConverter, - detail::BufferAssignmentReturnOpConverter - + BufferAssignmentCallOpConverter, + BufferAssignmentFuncOpConverter, + BufferAssignmentReturnOpConverter + >(context, placer, converter); // clang-format on } diff --git a/mlir/lib/Dialect/Linalg/Transforms/TensorsToBuffers.cpp b/mlir/lib/Dialect/Linalg/Transforms/TensorsToBuffers.cpp index 04c1fbd5d565..89a01f9ca629 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/TensorsToBuffers.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/TensorsToBuffers.cpp @@ -100,11 +100,11 @@ class GenericOpConverter /// tensors to buffers. static void populateConvertLinalgOnTensorsToBuffersPattern( MLIRContext *context, BufferAssignmentPlacer *placer, - TypeConverter *converter, OwningRewritePatternList *patterns) { + BufferAssignmentTypeConverter *converter, + OwningRewritePatternList *patterns) { populateWithBufferAssignmentOpConversionPatterns< - mlir::ReturnOp, mlir::ReturnOp, linalg::CopyOp, - /*allowMemrefFunctionResults=*/false>(context, placer, converter, - patterns); + mlir::ReturnOp, mlir::ReturnOp, linalg::CopyOp>(context, placer, + converter, patterns); patterns->insert(context, placer, converter); } @@ -141,6 +141,9 @@ struct ConvertLinalgOnTensorsToBuffers converter.isLegal(&funcOp.getBody()); }); + converter.setResultConversionKind( + BufferAssignmentTypeConverter::AppendToArgumentsList); + // Walk over all the functions to apply buffer assignment. getOperation().walk([&](FuncOp function) -> WalkResult { OwningRewritePatternList patterns; diff --git a/mlir/lib/Transforms/BufferPlacement.cpp b/mlir/lib/Transforms/BufferPlacement.cpp index 201570a244ff..1ab3e7e2e48d 100644 --- a/mlir/lib/Transforms/BufferPlacement.cpp +++ b/mlir/lib/Transforms/BufferPlacement.cpp @@ -713,9 +713,223 @@ BufferAssignmentTypeConverter::BufferAssignmentTypeConverter() { }); } -/// Checks if `type` has been converted from non-memref type to memref. -bool BufferAssignmentTypeConverter::isConvertedMemref(Type type, Type before) { - return type.isa() && !before.isa(); +/// This method tries to decompose a value of a certain type using provided +/// decompose callback functions. If it is unable to do so, the original value +/// is returned. +void BufferAssignmentTypeConverter::tryDecomposeValue( + OpBuilder &builder, Location loc, Type type, Value value, + SmallVectorImpl &results) { + for (auto conversion : decomposeValueConversions) + if (conversion(builder, loc, type, value, results) != llvm::None) + return; + results.push_back(value); +} + +/// This method tries to decompose a type using provided decompose callback +/// functions. If it is unable to do so, the original type is returned. +void BufferAssignmentTypeConverter::tryDecomposeType( + Type type, SmallVectorImpl &types) { + for (auto conversion : decomposeTypeConversions) + if (conversion(type, types) != llvm::None) + return; + types.push_back(type); +} + +/// This method returns ResultConversionKind for the input type. +BufferAssignmentTypeConverter::ResultConversionKind +BufferAssignmentTypeConverter::getResultConversionKind(Type origin, + Type converted) { + for (auto conversion : resultTypeConversions) { + auto res = conversion(origin, converted); + if (res != llvm::None) + return res.getValue(); + } + return KeepAsFunctionResult; +} + +//===----------------------------------------------------------------------===// +// BufferAssignmentFuncOpConverter +//===----------------------------------------------------------------------===// + +/// Performs the actual function signature rewriting step. +LogicalResult BufferAssignmentFuncOpConverter::matchAndRewrite( + mlir::FuncOp funcOp, ArrayRef operands, + ConversionPatternRewriter &rewriter) const { + auto funcType = funcOp.getType(); + + // Convert function arguments using the provided TypeConverter. + TypeConverter::SignatureConversion conversion(funcType.getNumInputs()); + for (auto argType : llvm::enumerate(funcType.getInputs())) { + SmallVector decomposedTypes, convertedTypes; + converter->tryDecomposeType(argType.value(), decomposedTypes); + converter->convertTypes(decomposedTypes, convertedTypes); + conversion.addInputs(argType.index(), convertedTypes); + } + + // Convert the result types of the function. + SmallVector newResultTypes; + newResultTypes.reserve(funcOp.getNumResults()); + for (Type resultType : funcType.getResults()) { + SmallVector originTypes; + converter->tryDecomposeType(resultType, originTypes); + for (auto origin : originTypes) { + Type converted = converter->convertType(origin); + auto kind = converter->getResultConversionKind(origin, converted); + if (kind == BufferAssignmentTypeConverter::AppendToArgumentsList) + conversion.addInputs(converted); + else + // kind = BufferAssignmentTypeConverter::KeepAsFunctionResult + newResultTypes.push_back(converted); + } + } + + if (failed(rewriter.convertRegionTypes(&funcOp.getBody(), *converter, + &conversion))) + return failure(); + + // Update the signature of the function. + rewriter.updateRootInPlace(funcOp, [&] { + funcOp.setType(rewriter.getFunctionType(conversion.getConvertedTypes(), + newResultTypes)); + }); + return success(); +} + +//===----------------------------------------------------------------------===// +// BufferAssignmentCallOpConverter +//===----------------------------------------------------------------------===// + +/// Performs the actual rewriting step. +LogicalResult BufferAssignmentCallOpConverter::matchAndRewrite( + CallOp callOp, ArrayRef operands, + ConversionPatternRewriter &rewriter) const { + + // This class represents a mapping from a result to a list of values and some + // results that have not yet constructed. Instead, the indices of these + // results in the operation that will be constructed are known. They will be + // replaced with the actual values when they are available. The order of + // adding to this mapping is important. + class ResultMapping { + public: + ResultMapping() { order = 0; }; + + /// Add an available value to the mapping. + void addMapping(Value value) { + toValuesMapping.push_back({order++, value}); + } + + /// Add the index of unavailble result value to the mapping. + void addMapping(unsigned index) { + toIndicesMapping.push_back({order++, index}); + } + + /// This method returns the mapping values list. The unknown result values + /// that only their indicies are available are replaced with their values. + void getMappingValues(ValueRange valuesToReplaceIndices, + SmallVectorImpl &values) { + // Append available values to the list. + SmallVector, 2> res(toValuesMapping.begin(), + toValuesMapping.end()); + // Replace the indices with the actual values. + llvm::for_each( + toIndicesMapping, [&](const std::pair &entry) { + assert(entry.second < valuesToReplaceIndices.size() && + "The value index is out of range."); + res.push_back({entry.first, valuesToReplaceIndices[entry.second]}); + }); + // Sort the values based on their adding orders. + llvm::sort(res, [](const std::pair &v1, + const std::pair &v2) { + return v1.first < v2.first; + }); + // Fill the values. + llvm::for_each(res, [&](const std::pair &entry) { + values.push_back(entry.second); + }); + } + + private: + /// Keeping the inserting order of mapping values. + int order; + + /// Containing the mapping values with their inserting orders. + SmallVector, 2> toValuesMapping; + + /// Containing the indices of result values with their inserting orders. + SmallVector, 2> toIndicesMapping; + }; + + Location loc = callOp.getLoc(); + OpBuilder builder(callOp); + SmallVector newOperands; + + // Create the operands list of the new `CallOp`. It unpacks the decomposable + // values if a decompose callback function has been provided by the user. + for (auto operand : operands) { + SmallVector values; + this->converter->tryDecomposeValue(builder, loc, operand.getType(), operand, + values); + newOperands.append(values.begin(), values.end()); + } + + // Create the new result types for the new `CallOp` and a mapping from the old + // result to new value(s). + SmallVector newResultTypes; + SmallVector mappings; + mappings.resize(callOp.getNumResults()); + for (auto result : llvm::enumerate(callOp.getResults())) { + SmallVector originTypes; + converter->tryDecomposeType(result.value().getType(), originTypes); + auto &resultMapping = mappings[result.index()]; + for (Type origin : originTypes) { + Type converted = converter->convertType(origin); + auto kind = converter->getResultConversionKind(origin, converted); + if (kind == BufferAssignmentTypeConverter::KeepAsFunctionResult) { + newResultTypes.push_back(converted); + // The result value is not yet available. Its index is kept and it is + // replaced with the actual value of the new `CallOp` later. + resultMapping.addMapping(newResultTypes.size() - 1); + } else { + // kind = BufferAssignmentTypeConverter::AppendToArgumentsList + OpBuilder::InsertionGuard guard(rewriter); + rewriter.restoreInsertionPoint( + bufferAssignment->computeAllocPosition(result.value())); + MemRefType memref = converted.dyn_cast(); + if (!memref) + return callOp.emitError("Cannot allocate for a non-Memref type"); + Value alloc = rewriter.create(loc, memref); + newOperands.push_back(alloc); + resultMapping.addMapping(alloc); + } + } + } + + CallOp newCallOp = rewriter.create(loc, callOp.getCallee(), + newResultTypes, newOperands); + + // Build a replacing value for each result to replace its uses. If a result + // has multiple mapping values, it needs to be packed to a single value. + OpBuilder nextBuilder(callOp.getOperation()->getNextNode()); + SmallVector replacedValues; + replacedValues.reserve(callOp.getNumResults()); + for (unsigned i = 0, e = callOp.getNumResults(); i < e; ++i) { + SmallVector valuesToPack; + mappings[i].getMappingValues(newCallOp.getResults(), valuesToPack); + if (valuesToPack.empty()) { + // No replacement is required. + replacedValues.push_back(nullptr); + } else if (valuesToPack.size() == 1) { + replacedValues.push_back(valuesToPack.front()); + } else { + // Values need to be packed using callback function. The same callback + // that is used for materializeArgumentConversion is used for packing. + Value packed = converter->materializeArgumentConversion( + nextBuilder, loc, callOp.getType(i), valuesToPack); + replacedValues.push_back(packed); + } + } + rewriter.replaceOp(callOp, replacedValues); + return success(); } //===----------------------------------------------------------------------===// diff --git a/mlir/test/Transforms/buffer-placement-preparation-allowed-memref-results.mlir b/mlir/test/Transforms/buffer-placement-preparation-allowed-memref-results.mlir index 084ac38af6e3..e1dacdf0184e 100644 --- a/mlir/test/Transforms/buffer-placement-preparation-allowed-memref-results.mlir +++ b/mlir/test/Transforms/buffer-placement-preparation-allowed-memref-results.mlir @@ -111,7 +111,73 @@ func @caller(%arg0: tensor<5xf32>) -> tensor<5xf32> { // CHECK: %[[Y:.*]]:2 = call @callee(%[[X]]#0) // CHECK: return %[[Y]]#0 +// ----- + +// Test case: Testing BufferAssginmnetCallOpConverter to see if it matches with the +// signature of the new signature of the callee function when there are tuple typed +// args and results. BufferAssginmentTypeConverter is set to flatten tuple typed +// arguments. The tuple typed values should be decomposed and composed using +// get_tuple_element and make_tuple operations of test dialect. Tensor types are +// converted to Memref. Memref typed function results remain as function results. +// CHECK-LABEL: func @callee +func @callee(%arg0: tuple,i1, tensor<5xf32>>) -> (tuple,i1, tensor<5xf32>>){ + return %arg0 : tuple,i1, tensor<5xf32>> +} +// CHECK-SAME: (%[[ARG0:.*]]: memref<2xf32>, %[[ARG1:.*]]: i1, %[[ARG2:.*]]: memref<5xf32>) +// CHECK-SAME: (memref<2xf32>, i1, memref<5xf32>) +// CHECK-NEXT: %[[TUPLE:.*]] = "test.make_tuple"(%[[ARG0]], %[[ARG1]], %[[ARG2]]) +// CHECK-NEXT: %[[FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 0 : i32} +// CHECK-NEXT: %[[SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 1 : i32} +// CHECK-NEXT: %[[THIRD_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 2 : i32} +// CHECK-NEXT: return %[[FIRST_ELEM]], %[[SECOND_ELEM]], %[[THIRD_ELEM]] +// CHECK-LABEL: func @caller +func @caller(%arg0: tuple,i1, tensor<5xf32>>) -> tuple,i1, tensor<5xf32>>{ + %x0 = call @callee(%arg0) : (tuple,i1, tensor<5xf32>>) -> (tuple,i1, tensor<5xf32>>) + %y0 = call @callee(%x0) : (tuple,i1, tensor<5xf32>>) -> (tuple,i1, tensor<5xf32>>) + return %y0 : tuple,i1, tensor<5xf32>> +} +// CHECK-SAME: (%[[ARG0:.*]]: memref<2xf32>, %[[ARG1:.*]]: i1, %[[ARG2:.*]]: memref<5xf32>) +// CHECK-SAME: (memref<2xf32>, i1, memref<5xf32>) +// CHECK-NEXT: %[[ARG_TUPLE:.*]] = "test.make_tuple"(%[[ARG0]], %[[ARG1]], %[[ARG2]]) +// CHECK-NEXT: %[[FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[ARG_TUPLE]]) {index = 0 : i32} +// CHECK-NEXT: %[[SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[ARG_TUPLE]]) {index = 1 : i32} +// CHECK-NEXT: %[[THIRD_ELEM:.*]] = "test.get_tuple_element"(%[[ARG_TUPLE]]) {index = 2 : i32} +// CHECK-NEXT: %[[CALLEE_RESULTS:.*]]:3 = call @callee(%[[FIRST_ELEM]], %[[SECOND_ELEM]], %[[THIRD_ELEM]]) +// CHECK-SAME: (memref<2xf32>, i1, memref<5xf32>) -> (memref<2xf32>, i1, memref<5xf32>) +// CHECK-NEXT: %[[RESULT_TUPLE:.*]] = "test.make_tuple"(%[[CALLEE_RESULTS]]#0, %[[CALLEE_RESULTS]]#1, %[[CALLEE_RESULTS]]#2) +// CHECK-NEXT: %[[FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[RESULT_TUPLE]]) {index = 0 : i32} +// CHECK-NEXT: %[[SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[RESULT_TUPLE]]) {index = 1 : i32} +// CHECK-NEXT: %[[THIRD_ELEM:.*]] = "test.get_tuple_element"(%[[RESULT_TUPLE]]) {index = 2 : i32} +// CHECK-NEXT: %[[CALLEE_RESULTS:.*]]:3 = call @callee(%[[FIRST_ELEM]], %[[SECOND_ELEM]], %[[THIRD_ELEM]]) +// CHECK-SAME: (memref<2xf32>, i1, memref<5xf32>) -> (memref<2xf32>, i1, memref<5xf32>) +// CHECK-NEXT: %[[RETURN_TUPLE:.*]] = "test.make_tuple"(%[[CALLEE_RESULTS]]#0, %[[CALLEE_RESULTS]]#1, %[[CALLEE_RESULTS]]#2) +// CHECK-NEXT: %[[FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[RETURN_TUPLE]]) {index = 0 : i32} +// CHECK-NEXT: %[[SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[RETURN_TUPLE]]) {index = 1 : i32} +// CHECK-NEXT: %[[THIRD_ELEM:.*]] = "test.get_tuple_element"(%[[RETURN_TUPLE]]) {index = 2 : i32} +// CHECK-NEXT: return %[[FIRST_ELEM]], %[[SECOND_ELEM]], %[[THIRD_ELEM]] +// ----- +// Test case: Testing BufferAssginmnetFuncOpConverter and +// BufferAssginmentReturnOpConverter to see if the return operation matches with +// the new function signature when there are tuple typed args and results. +// BufferAssginmentTypeConverter is set to flatten tuple typed arguments. The tuple +// typed values should be decomposed and composed using get_tuple_element and +// make_tuple operations of test dialect. Tensor types are converted to Memref. +// Memref typed function results remain as function results. + +// CHECK-LABEL: func @decompose_tuple_typed_function_args_and_results +func @decompose_tuple_typed_function_args_and_results(%arg0: tuple, %arg1: tensor<10xf32>, %arg2: tuple>) -> (tuple>, tensor<10xf32>, tuple){ + return %arg2, %arg1, %arg0 : tuple>, tensor<10xf32>, tuple +} +// CHECK-SAME: %[[ARG0:.*]]: i1, %[[ARG1:.*]]: f32, %[[ARG2:.*]]: memref<10xf32>, %[[ARG3:.*]]: i1, %[[ARG4:.*]]: memref<5xf32> +// CHECK-SAME: (i1, memref<5xf32>, memref<10xf32>, i1, f32) +// CHECK-NEXT: %[[FIRST_TUPLE:.*]] = "test.make_tuple"(%[[ARG0]], %[[ARG1]]) +// CHECK-NEXT: %[[SECOND_TUPLE:.*]] = "test.make_tuple"(%[[ARG3]], %[[ARG4]]) +// CHECK-NEXT: %[[SECOND_TUPLE_FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[SECOND_TUPLE]]) {index = 0 : i32} +// CHECK-NEXT: %[[SECOND_TUPLE_SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[SECOND_TUPLE]]) {index = 1 : i32} +// CHECK-NEXT: %[[FIRST_TUPLE_FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[FIRST_TUPLE]]) {index = 0 : i32} +// CHECK-NEXT: %[[FIRST_TUPLE_SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[FIRST_TUPLE]]) {index = 1 : i32} +// CHECK-NEXT: return %[[SECOND_TUPLE_FIRST_ELEM]], %[[SECOND_TUPLE_SECOND_ELEM]], %[[ARG2]], %[[FIRST_TUPLE_FIRST_ELEM]], %[[FIRST_TUPLE_SECOND_ELEM]] diff --git a/mlir/test/Transforms/buffer-placement-preparation.mlir b/mlir/test/Transforms/buffer-placement-preparation.mlir index 064b0fd7e85a..b1cfdfd690cf 100644 --- a/mlir/test/Transforms/buffer-placement-preparation.mlir +++ b/mlir/test/Transforms/buffer-placement-preparation.mlir @@ -285,8 +285,93 @@ func @caller(%arg0: tensor<5xf32>) -> tensor<5xf32> { // CHECK: linalg.copy(%[[Y0]], %[[CALLER_RESULT]]) // CHECK: return +// ----- + // CHECK-LABEL: func @func_with_unranked_arg func @func_with_unranked_arg(%arg0: tensor<*xf32>) { return } // CHECK-SAME: ([[ARG:%.*]]: memref<*xf32>) + +// ----- + +// Test case: Testing BufferAssginmnetCallOpConverter to see if it matches with the +// signature of the new signature of the callee function when there are tuple typed +// args and results. BufferAssginmentTypeConverter is set to flatten tuple typed +// arguments. The tuple typed values should be decomposed and composed using +// get_tuple_element and make_tuple operations of test dialect. Tensor types are +// converted to Memref. Memref typed function results are appended to the function +// arguments list. + +// CHECK-LABEL: func @callee +func @callee(%arg0: tuple,i1, tensor<5xf32>>) -> (tuple,i1, tensor<5xf32>>){ + return %arg0 : tuple,i1, tensor<5xf32>> +} +// CHECK-SAME: (%[[ARG0:.*]]: memref<2xf32>, %[[ARG1:.*]]: i1, %[[ARG2:.*]]: memref<5xf32>, %[[RESULT0:.*]]: memref<2xf32>, %[[RESULT1:.*]]: memref<5xf32>) +// CHECK-SAME: i1 +// CHECK-NEXT: %[[TUPLE:.*]] = "test.make_tuple"(%[[ARG0]], %[[ARG1]], %[[ARG2]]) +// CHECK-NEXT: %[[FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 0 : i32} +// CHECK-NEXT: %[[SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 1 : i32} +// CHECK-NEXT: %[[THIRD_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 2 : i32} +// CHECK-NEXT: linalg.copy(%[[FIRST_ELEM]], %[[RESULT0]]) +// CHECK-NEXT: linalg.copy(%[[THIRD_ELEM]], %[[RESULT1]]) +// CHECK-NEXT: return %[[SECOND_ELEM]] + + +// CHECK-LABEL: func @caller +func @caller(%arg0: tuple,i1, tensor<5xf32>>) -> tuple,i1, tensor<5xf32>>{ + %x0 = call @callee(%arg0) : (tuple,i1, tensor<5xf32>>) -> (tuple,i1, tensor<5xf32>>) + %y0 = call @callee(%x0) : (tuple,i1, tensor<5xf32>>) -> (tuple,i1, tensor<5xf32>>) + return %y0 : tuple,i1, tensor<5xf32>> +} +// CHECK-SAME: (%[[ARG0:.*]]: memref<2xf32>, %[[ARG1:.*]]: i1, %[[ARG2:.*]]: memref<5xf32>, %[[RESULT0:.*]]: memref<2xf32>, %[[RESULT1:.*]]: memref<5xf32>) +// CHECK-SAME: i1 +// CHECK-NEXT: %[[TUPLE:.*]] = "test.make_tuple"(%[[ARG0]], %[[ARG1]], %[[ARG2]]) +// CHECK-NEXT: %[[FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 0 : i32} +// CHECK-NEXT: %[[SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 1 : i32} +// CHECK-NEXT: %[[THIRD_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 2 : i32} +// CHECK-NEXT: %[[FIRST_ALLOC:.*]] = alloc() +// CHECK-NEXT: %[[SECOND_ALLOC:.*]] = alloc() +// CHECK-NEXT: %[[CALLEE_RESULT:.*]] = call @callee(%[[FIRST_ELEM]], %[[SECOND_ELEM]], %[[THIRD_ELEM]], %[[FIRST_ALLOC]], %[[SECOND_ALLOC]]) +// CHECK-SAME: (memref<2xf32>, i1, memref<5xf32>, memref<2xf32>, memref<5xf32>) -> i1 +// CHECK-NEXT: %[[TUPLE:.*]] = "test.make_tuple"(%[[FIRST_ALLOC]], %[[CALLEE_RESULT]], %[[SECOND_ALLOC]]) +// CHECK-NEXT: %[[FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 0 : i32} +// CHECK-NEXT: %[[SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 1 : i32} +// CHECK-NEXT: %[[THIRD_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 2 : i32} +// CHECK-NEXT: %[[FIRST_ALLOC:.*]] = alloc() +// CHECK-NEXT: %[[SECOND_ALLOC:.*]] = alloc() +// CHECK-NEXT: %[[CALLEE_RESULT:.*]] = call @callee(%[[FIRST_ELEM]], %[[SECOND_ELEM]], %[[THIRD_ELEM]], %[[FIRST_ALLOC]], %[[SECOND_ALLOC]]) +// CHECK-SAME: (memref<2xf32>, i1, memref<5xf32>, memref<2xf32>, memref<5xf32>) -> i1 +// CHECK-NEXT: %[[TUPLE:.*]] = "test.make_tuple"(%[[FIRST_ALLOC]], %[[CALLEE_RESULT]], %[[SECOND_ALLOC]]) +// CHECK-NEXT: %[[FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 0 : i32} +// CHECK-NEXT: %[[SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 1 : i32} +// CHECK-NEXT: %[[THIRD_ELEM:.*]] = "test.get_tuple_element"(%[[TUPLE]]) {index = 2 : i32} +// CHECK-NEXT: linalg.copy(%[[FIRST_ELEM]], %[[RESULT0]]) +// CHECK-NEXT: linalg.copy(%[[THIRD_ELEM]], %[[RESULT1]]) +// CHECK-NEXT: return %[[SECOND_ELEM]] + +// ----- + +// Test case: Testing BufferAssginmnetFuncOpConverter and +// BufferAssginmentReturnOpConverter to see if the return operation matches with +// the new function signature when there are tuple typed args and results. +// BufferAssginmentTypeConverter is set to flatten tuple typed arguments. The tuple +// typed values should be decomposed and composed using get_tuple_element and +// make_tuple operations of test dialect. Tensor types are converted to Memref. +// Memref typed function results are appended to the function arguments list. + +// CHECK-LABEL: func @decompose_tuple_typed_function_args_and_results +func @decompose_tuple_typed_function_args_and_results(%arg0: tuple, %arg1: tensor<10xf32>, %arg2: tuple>) -> (tuple>, tensor<10xf32>, tuple){ + return %arg2, %arg1, %arg0 : tuple>, tensor<10xf32>, tuple +} +// CHECK-SAME: %[[ARG0:.*]]: i1, %[[ARG1:.*]]: f32, %[[ARG2:.*]]: memref<10xf32>, %[[ARG3:.*]]: i1, %[[ARG4:.*]]: memref<5xf32>, %[[RESULT0:.*]]: memref<5xf32>, %[[RESULT1:.*]]: memref<10xf32> +// CHECK-SAME: (i1, i1, f32) +// CHECK-NEXT: %[[FIRST_TUPLE:.*]] = "test.make_tuple"(%[[ARG0]], %[[ARG1]]) +// CHECK-NEXT: %[[SECOND_TUPLE:.*]] = "test.make_tuple"(%[[ARG3]], %[[ARG4]]) +// CHECK-NEXT: %[[SECOND_TUPLE_FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[SECOND_TUPLE]]) {index = 0 : i32} +// CHECK-NEXT: %[[SECOND_TUPLE_SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[SECOND_TUPLE]]) {index = 1 : i32} +// CHECK-NEXT: %[[FIRST_TUPLE_FIRST_ELEM:.*]] = "test.get_tuple_element"(%[[FIRST_TUPLE]]) {index = 0 : i32} +// CHECK-NEXT: %[[FIRST_TUPLE_SECOND_ELEM:.*]] = "test.get_tuple_element"(%[[FIRST_TUPLE]]) {index = 1 : i32} +// CHECK-NEXT: linalg.copy(%[[SECOND_TUPLE_SECOND_ELEM]], %[[RESULT0]]) +// CHECK-NEXT: linalg.copy(%[[ARG2]], %[[RESULT1]]) +// CHECK-NEXT: return %[[SECOND_TUPLE_FIRST_ELEM]], %[[FIRST_TUPLE_FIRST_ELEM]], %[[FIRST_TUPLE_SECOND_ELEM]] diff --git a/mlir/test/lib/Dialect/Test/TestOps.td b/mlir/test/lib/Dialect/Test/TestOps.td index bc26a8659831..f03c953396a4 100644 --- a/mlir/test/lib/Dialect/Test/TestOps.td +++ b/mlir/test/lib/Dialect/Test/TestOps.td @@ -1669,7 +1669,7 @@ def TableGenBuildOp5 : TEST_Op<"tblgen_build_5", let results = (outs AnyType:$result); let extraClassDeclaration = [{ - static LogicalResult inferReturnTypes(MLIRContext *, + static LogicalResult inferReturnTypes(MLIRContext *, Optional location, ValueRange operands, DictionaryAttr attributes, RegionRange regions, SmallVectorImpl &inferredReturnTypes) { @@ -1679,4 +1679,31 @@ def TableGenBuildOp5 : TEST_Op<"tblgen_build_5", }]; } +//===----------------------------------------------------------------------===// +// Test BufferPlacement +//===----------------------------------------------------------------------===// + +def GetTupleElementOp: TEST_Op<"get_tuple_element"> { + let description = [{ + Test op that returns a specified element of the tuple. + }]; + + let arguments = (ins + TupleOf<[AnyType]>, + I32Attr:$index + ); + let results = (outs AnyType); +} + +def MakeTupleOp: TEST_Op<"make_tuple"> { + let description = [{ + Test op that creates a tuple value from a list of values. + }]; + + let arguments = (ins + Variadic:$inputs + ); + let results = (outs TupleOf<[AnyType]>); +} + #endif // TEST_OPS diff --git a/mlir/test/lib/Transforms/TestBufferPlacement.cpp b/mlir/test/lib/Transforms/TestBufferPlacement.cpp index 6cc0924191cb..14b72b9fc92a 100644 --- a/mlir/test/lib/Transforms/TestBufferPlacement.cpp +++ b/mlir/test/lib/Transforms/TestBufferPlacement.cpp @@ -11,6 +11,8 @@ // //===----------------------------------------------------------------------===// +#include "TestDialect.h" +#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h" #include "mlir/Dialect/Linalg/IR/LinalgOps.h" #include "mlir/IR/Function.h" #include "mlir/IR/Operation.h" @@ -109,14 +111,16 @@ struct TestBufferPlacementPreparationPass void populateTensorLinalgToBufferLinalgConversionPattern( MLIRContext *context, BufferAssignmentPlacer *placer, - TypeConverter *converter, OwningRewritePatternList *patterns) { + BufferAssignmentTypeConverter *converter, + OwningRewritePatternList *patterns) { populateWithBufferAssignmentOpConversionPatterns< - mlir::ReturnOp, mlir::ReturnOp, linalg::CopyOp, - allowMemrefFunctionResults>(context, placer, converter, patterns); + mlir::ReturnOp, mlir::ReturnOp, linalg::CopyOp>(context, placer, + converter, patterns); patterns->insert(context, placer, converter); } void getDependentDialects(DialectRegistry ®istry) const override { + registry.insert(); registry.insert(); } @@ -127,6 +131,8 @@ struct TestBufferPlacementPreparationPass // Mark all Standard operations legal. target.addLegalDialect(); + target.addLegalOp(); + target.addLegalOp(); // Mark all Linalg operations illegal as long as they work on tensors. auto isLegalOperation = [&](Operation *op) { @@ -149,6 +155,42 @@ struct TestBufferPlacementPreparationPass converter.isLegal(&funcOp.getBody()); }); + auto kind = allowMemrefFunctionResults + ? BufferAssignmentTypeConverter::KeepAsFunctionResult + : BufferAssignmentTypeConverter::AppendToArgumentsList; + converter.setResultConversionKind(kind); + converter.setResultConversionKind( + kind); + + converter.addDecomposeTypeConversion( + [](TupleType tupleType, SmallVectorImpl &types) { + tupleType.getFlattenedTypes(types); + return success(); + }); + + converter.addArgumentMaterialization( + [](OpBuilder &builder, TupleType resultType, ValueRange inputs, + Location loc) -> Optional { + if (inputs.size() == 1) + return llvm::None; + TypeRange TypeRange = inputs.getTypes(); + SmallVector types(TypeRange.begin(), TypeRange.end()); + TupleType tuple = TupleType::get(types, builder.getContext()); + mlir::Value value = builder.create(loc, tuple, inputs); + return value; + }); + + converter.addDecomposeValueConversion([](OpBuilder &builder, Location loc, + TupleType resultType, Value value, + SmallVectorImpl &values) { + for (unsigned i = 0, e = resultType.size(); i < e; ++i) { + Value res = builder.create( + loc, resultType.getType(i), value, builder.getI32IntegerAttr(i)); + values.push_back(res); + } + return success(); + }); + // Walk over all the functions to apply buffer assignment. this->getOperation().walk([&](FuncOp function) -> WalkResult { OwningRewritePatternList patterns; From 888049b97a7495ba669020522bcae6691287bd9a Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Wed, 2 Sep 2020 16:53:41 +0100 Subject: [PATCH 14/26] [X86][SSE] Fold vselect(pshufb,pshufb) -> or(pshufb,pshufb) If the PSHUFBs have no other uses, then we can force the unselected elements to zero to OR them instead, avoiding both an extra mask load and a costly variable blend. Eventually we should try to bring this into shuffle combining, once we can more easily convert between shuffles + select patterns. --- llvm/lib/Target/X86/X86ISelLowering.cpp | 57 ++++++-- .../CodeGen/X86/vector-shuffle-256-v16.ll | 21 ++- .../CodeGen/X86/vector-shuffle-256-v32.ll | 132 ++++++++---------- .../CodeGen/X86/vector-shuffle-combining.ll | 29 ++-- 4 files changed, 127 insertions(+), 112 deletions(-) diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 674e3d88ae89..2af3d743728e 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -10888,20 +10888,25 @@ static bool isTargetShuffleEquivalent(ArrayRef Mask, // Attempt to create a shuffle mask from a VSELECT condition mask. static bool createShuffleMaskFromVSELECT(SmallVectorImpl &Mask, SDValue Cond) { - if (!ISD::isBuildVectorOfConstantSDNodes(Cond.getNode())) + EVT CondVT = Cond.getValueType(); + unsigned EltSizeInBits = CondVT.getScalarSizeInBits(); + unsigned NumElts = CondVT.getVectorNumElements(); + + APInt UndefElts; + SmallVector EltBits; + if (!getTargetConstantBitsFromNode(Cond, EltSizeInBits, UndefElts, EltBits, + true, false)) return false; - unsigned Size = Cond.getValueType().getVectorNumElements(); - Mask.resize(Size, SM_SentinelUndef); + Mask.resize(NumElts, SM_SentinelUndef); - for (int i = 0; i != (int)Size; ++i) { - SDValue CondElt = Cond.getOperand(i); + for (int i = 0; i != (int)NumElts; ++i) { Mask[i] = i; // Arbitrarily choose from the 2nd operand if the select condition element // is undef. // TODO: Can we do better by matching patterns such as even/odd? - if (CondElt.isUndef() || isNullConstant(CondElt)) - Mask[i] += Size; + if (UndefElts[i] || EltBits[i].isNullValue()) + Mask[i] += NumElts; } return true; @@ -18139,9 +18144,11 @@ static SDValue lowerVSELECTtoVectorShuffle(SDValue Op, // Only non-legal VSELECTs reach this lowering, convert those into generic // shuffles and re-use the shuffle lowering path for blends. - SmallVector Mask; - if (createShuffleMaskFromVSELECT(Mask, Cond)) - return DAG.getVectorShuffle(VT, SDLoc(Op), LHS, RHS, Mask); + if (ISD::isBuildVectorOfConstantSDNodes(Cond.getNode())) { + SmallVector Mask; + if (createShuffleMaskFromVSELECT(Mask, Cond)) + return DAG.getVectorShuffle(VT, SDLoc(Op), LHS, RHS, Mask); + } return SDValue(); } @@ -40270,6 +40277,36 @@ static SDValue combineSelect(SDNode *N, SelectionDAG &DAG, return DAG.getVectorShuffle(VT, DL, LHS, RHS, Mask); } + // fold vselect(cond, pshufb(x), pshufb(y)) -> or (pshufb(x), pshufb(y)) + // by forcing the unselected elements to zero. + // TODO: Can we handle more shuffles with this? + if (N->getOpcode() == ISD::VSELECT && CondVT.isVector() && + LHS.getOpcode() == X86ISD::PSHUFB && RHS.getOpcode() == X86ISD::PSHUFB && + LHS.hasOneUse() && RHS.hasOneUse()) { + MVT SimpleVT = VT.getSimpleVT(); + bool LHSUnary, RHSUnary; + SmallVector LHSOps, RHSOps; + SmallVector LHSMask, RHSMask, CondMask; + if (createShuffleMaskFromVSELECT(CondMask, Cond) && + getTargetShuffleMask(LHS.getNode(), SimpleVT, true, LHSOps, LHSMask, + LHSUnary) && + getTargetShuffleMask(RHS.getNode(), SimpleVT, true, RHSOps, RHSMask, + RHSUnary)) { + int NumElts = VT.getVectorNumElements(); + for (int i = 0; i != NumElts; ++i) { + if (CondMask[i] < NumElts) + RHSMask[i] = 0x80; + else + LHSMask[i] = 0x80; + } + LHS = DAG.getNode(X86ISD::PSHUFB, DL, VT, LHS.getOperand(0), + getConstVector(LHSMask, SimpleVT, DAG, DL, true)); + RHS = DAG.getNode(X86ISD::PSHUFB, DL, VT, RHS.getOperand(0), + getConstVector(RHSMask, SimpleVT, DAG, DL, true)); + return DAG.getNode(ISD::OR, DL, VT, LHS, RHS); + } + } + // If we have SSE[12] support, try to form min/max nodes. SSE min/max // instructions match the semantics of the common C idiom x @PR24935(<16 x i16> %a, <16 x i16> %b) { ; ; AVX2-SLOW-LABEL: PR24935: ; AVX2-SLOW: # %bb.0: -; AVX2-SLOW-NEXT: vpshufb {{.*#+}} ymm2 = ymm1[8,9,8,9,8,9,8,9,0,1,14,15,12,13,0,1,24,25,24,25,24,25,24,25,16,17,30,31,28,29,16,17] +; AVX2-SLOW-NEXT: vpshufb {{.*#+}} ymm2 = zero,zero,zero,zero,ymm1[8,9],zero,zero,zero,zero,ymm1[14,15,12,13,0,1,24,25,24,25],zero,zero,ymm1[24,25,16,17,30,31,28,29,16,17] ; AVX2-SLOW-NEXT: vpermq {{.*#+}} ymm1 = ymm1[2,3,0,1] -; AVX2-SLOW-NEXT: vpshufb {{.*#+}} ymm1 = ymm1[6,7,4,5,0,1,10,11,4,5,4,5,4,5,4,5,22,23,20,21,16,17,26,27,20,21,20,21,20,21,20,21] -; AVX2-SLOW-NEXT: vmovdqa {{.*#+}} ymm3 = <255,255,255,255,u,u,255,255,255,255,0,0,u,u,0,0,u,u,u,u,255,255,0,0,u,u,u,u,u,u,0,0> -; AVX2-SLOW-NEXT: vpblendvb %ymm3, %ymm1, %ymm2, %ymm1 +; AVX2-SLOW-NEXT: vpshufb {{.*#+}} ymm1 = ymm1[6,7,4,5],zero,zero,ymm1[10,11,4,5],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,ymm1[16,17],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero +; AVX2-SLOW-NEXT: vpor %ymm2, %ymm1, %ymm1 ; AVX2-SLOW-NEXT: vpshuflw {{.*#+}} ymm2 = ymm0[1,1,1,1,4,5,6,7,9,9,9,9,12,13,14,15] ; AVX2-SLOW-NEXT: vpshufhw {{.*#+}} ymm2 = ymm2[0,1,2,3,5,5,5,5,8,9,10,11,13,13,13,13] ; AVX2-SLOW-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,3,0,1] @@ -7294,11 +7293,10 @@ define <16 x i16> @PR24935(<16 x i16> %a, <16 x i16> %b) { ; ; AVX2-FAST-LABEL: PR24935: ; AVX2-FAST: # %bb.0: -; AVX2-FAST-NEXT: vpshufb {{.*#+}} ymm2 = ymm1[8,9,8,9,8,9,8,9,0,1,14,15,12,13,0,1,24,25,24,25,24,25,24,25,16,17,30,31,28,29,16,17] +; AVX2-FAST-NEXT: vpshufb {{.*#+}} ymm2 = zero,zero,zero,zero,ymm1[8,9],zero,zero,zero,zero,ymm1[14,15,12,13,0,1,24,25,24,25],zero,zero,ymm1[24,25,16,17,30,31,28,29,16,17] ; AVX2-FAST-NEXT: vpermq {{.*#+}} ymm1 = ymm1[2,3,0,1] -; AVX2-FAST-NEXT: vpshufb {{.*#+}} ymm1 = ymm1[6,7,4,5,0,1,10,11,4,5,4,5,4,5,4,5,22,23,20,21,16,17,26,27,20,21,20,21,20,21,20,21] -; AVX2-FAST-NEXT: vmovdqa {{.*#+}} ymm3 = <255,255,255,255,u,u,255,255,255,255,0,0,u,u,0,0,u,u,u,u,255,255,0,0,u,u,u,u,u,u,0,0> -; AVX2-FAST-NEXT: vpblendvb %ymm3, %ymm1, %ymm2, %ymm1 +; AVX2-FAST-NEXT: vpshufb {{.*#+}} ymm1 = ymm1[6,7,4,5],zero,zero,ymm1[10,11,4,5],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,ymm1[16,17],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero +; AVX2-FAST-NEXT: vpor %ymm2, %ymm1, %ymm1 ; AVX2-FAST-NEXT: vpshufb {{.*#+}} ymm2 = ymm0[u,u,2,3,2,3,u,u,10,11,u,u,u,u,u,u,u,u,18,19,18,19,u,u,26,27,u,u,u,u,u,u] ; AVX2-FAST-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,3,0,1] ; AVX2-FAST-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[u,u,u,u,u,u,u,u,u,u,u,u,6,7,u,u,18,19,u,u,u,u,u,u,u,u,24,25,16,17,u,u] @@ -7330,11 +7328,10 @@ define <16 x i16> @PR24935(<16 x i16> %a, <16 x i16> %b) { ; ; XOPAVX2-LABEL: PR24935: ; XOPAVX2: # %bb.0: -; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm2 = ymm1[8,9,8,9,8,9,8,9,0,1,14,15,12,13,0,1,24,25,24,25,24,25,24,25,16,17,30,31,28,29,16,17] +; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm2 = zero,zero,zero,zero,ymm1[8,9],zero,zero,zero,zero,ymm1[14,15,12,13,0,1,24,25,24,25],zero,zero,ymm1[24,25,16,17,30,31,28,29,16,17] ; XOPAVX2-NEXT: vpermq {{.*#+}} ymm1 = ymm1[2,3,0,1] -; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm1 = ymm1[6,7,4,5,0,1,10,11,4,5,4,5,4,5,4,5,22,23,20,21,16,17,26,27,20,21,20,21,20,21,20,21] -; XOPAVX2-NEXT: vmovdqa {{.*#+}} ymm3 = <255,255,255,255,u,u,255,255,255,255,0,0,u,u,0,0,u,u,u,u,255,255,0,0,u,u,u,u,u,u,0,0> -; XOPAVX2-NEXT: vpblendvb %ymm3, %ymm1, %ymm2, %ymm1 +; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm1 = ymm1[6,7,4,5],zero,zero,ymm1[10,11,4,5],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,ymm1[16,17],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero +; XOPAVX2-NEXT: vpor %ymm2, %ymm1, %ymm1 ; XOPAVX2-NEXT: vpshuflw {{.*#+}} ymm2 = ymm0[1,1,1,1,4,5,6,7,9,9,9,9,12,13,14,15] ; XOPAVX2-NEXT: vpshufhw {{.*#+}} ymm2 = ymm2[0,1,2,3,5,5,5,5,8,9,10,11,13,13,13,13] ; XOPAVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,3,0,1] diff --git a/llvm/test/CodeGen/X86/vector-shuffle-256-v32.ll b/llvm/test/CodeGen/X86/vector-shuffle-256-v32.ll index 82d1997cddfa..e06b75355f6f 100644 --- a/llvm/test/CodeGen/X86/vector-shuffle-256-v32.ll +++ b/llvm/test/CodeGen/X86/vector-shuffle-256-v32.ll @@ -2891,18 +2891,16 @@ define <32 x i8> @shuffle_v32i8_00_32_01_33_02_34_03_35_04_36_05_37_06_38_07_39_ ; ; AVX2-LABEL: shuffle_v32i8_00_32_01_33_02_34_03_35_04_36_05_37_06_38_07_39_24_56_25_57_26_58_27_59_28_60_29_61_30_62_31_63: ; AVX2: # %bb.0: -; AVX2-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[0,u,1,u,2,u,3,u,4,u,5,u,6,u,7,u,24,u,25,u,26,u,27,u,28,u,29,u,30,u,31,u] -; AVX2-NEXT: vpshufb {{.*#+}} ymm1 = ymm1[u,0,u,1,u,2,u,3,u,4,u,5,u,6,u,7,u,24,u,25,u,26,u,27,u,28,u,29,u,30,u,31] -; AVX2-NEXT: vmovdqa {{.*#+}} ymm2 = [255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0] -; AVX2-NEXT: vpblendvb %ymm2, %ymm0, %ymm1, %ymm0 +; AVX2-NEXT: vpshufb {{.*#+}} ymm1 = zero,ymm1[0],zero,ymm1[1],zero,ymm1[2],zero,ymm1[3],zero,ymm1[4],zero,ymm1[5],zero,ymm1[6],zero,ymm1[7],zero,ymm1[24],zero,ymm1[25],zero,ymm1[26],zero,ymm1[27],zero,ymm1[28],zero,ymm1[29],zero,ymm1[30],zero,ymm1[31] +; AVX2-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[24],zero,ymm0[25],zero,ymm0[26],zero,ymm0[27],zero,ymm0[28],zero,ymm0[29],zero,ymm0[30],zero,ymm0[31],zero +; AVX2-NEXT: vpor %ymm1, %ymm0, %ymm0 ; AVX2-NEXT: retq ; ; AVX512VLBW-LABEL: shuffle_v32i8_00_32_01_33_02_34_03_35_04_36_05_37_06_38_07_39_24_56_25_57_26_58_27_59_28_60_29_61_30_62_31_63: ; AVX512VLBW: # %bb.0: -; AVX512VLBW-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[0,u,1,u,2,u,3,u,4,u,5,u,6,u,7,u,24,u,25,u,26,u,27,u,28,u,29,u,30,u,31,u] -; AVX512VLBW-NEXT: movl $-1431655766, %eax # imm = 0xAAAAAAAA -; AVX512VLBW-NEXT: kmovd %eax, %k1 -; AVX512VLBW-NEXT: vpshufb {{.*#+}} ymm0 {%k1} = ymm1[u,0,u,1,u,2,u,3,u,4,u,5,u,6,u,7,u,24,u,25,u,26,u,27,u,28,u,29,u,30,u,31] +; AVX512VLBW-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[24],zero,ymm0[25],zero,ymm0[26],zero,ymm0[27],zero,ymm0[28],zero,ymm0[29],zero,ymm0[30],zero,ymm0[31],zero +; AVX512VLBW-NEXT: vpshufb {{.*#+}} ymm1 = zero,ymm1[0],zero,ymm1[1],zero,ymm1[2],zero,ymm1[3],zero,ymm1[4],zero,ymm1[5],zero,ymm1[6],zero,ymm1[7],zero,ymm1[24],zero,ymm1[25],zero,ymm1[26],zero,ymm1[27],zero,ymm1[28],zero,ymm1[29],zero,ymm1[30],zero,ymm1[31] +; AVX512VLBW-NEXT: vpor %ymm0, %ymm1, %ymm0 ; AVX512VLBW-NEXT: retq ; ; AVX512VLVBMI-LABEL: shuffle_v32i8_00_32_01_33_02_34_03_35_04_36_05_37_06_38_07_39_24_56_25_57_26_58_27_59_28_60_29_61_30_62_31_63: @@ -2922,10 +2920,9 @@ define <32 x i8> @shuffle_v32i8_00_32_01_33_02_34_03_35_04_36_05_37_06_38_07_39_ ; ; XOPAVX2-LABEL: shuffle_v32i8_00_32_01_33_02_34_03_35_04_36_05_37_06_38_07_39_24_56_25_57_26_58_27_59_28_60_29_61_30_62_31_63: ; XOPAVX2: # %bb.0: -; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[0,u,1,u,2,u,3,u,4,u,5,u,6,u,7,u,24,u,25,u,26,u,27,u,28,u,29,u,30,u,31,u] -; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm1 = ymm1[u,0,u,1,u,2,u,3,u,4,u,5,u,6,u,7,u,24,u,25,u,26,u,27,u,28,u,29,u,30,u,31] -; XOPAVX2-NEXT: vmovdqa {{.*#+}} ymm2 = [255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0] -; XOPAVX2-NEXT: vpblendvb %ymm2, %ymm0, %ymm1, %ymm0 +; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm1 = zero,ymm1[0],zero,ymm1[1],zero,ymm1[2],zero,ymm1[3],zero,ymm1[4],zero,ymm1[5],zero,ymm1[6],zero,ymm1[7],zero,ymm1[24],zero,ymm1[25],zero,ymm1[26],zero,ymm1[27],zero,ymm1[28],zero,ymm1[29],zero,ymm1[30],zero,ymm1[31] +; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[24],zero,ymm0[25],zero,ymm0[26],zero,ymm0[27],zero,ymm0[28],zero,ymm0[29],zero,ymm0[30],zero,ymm0[31],zero +; XOPAVX2-NEXT: vpor %ymm1, %ymm0, %ymm0 ; XOPAVX2-NEXT: retq %shuffle = shufflevector <32 x i8> %a, <32 x i8> %b, <32 x i32> ret <32 x i8> %shuffle @@ -2943,18 +2940,16 @@ define <32 x i8> @shuffle_v32i8_08_40_09_41_10_42_11_43_12_44_13_45_14_46_15_47_ ; ; AVX2-LABEL: shuffle_v32i8_08_40_09_41_10_42_11_43_12_44_13_45_14_46_15_47_16_48_17_49_18_50_19_51_20_52_21_53_22_54_23_55: ; AVX2: # %bb.0: -; AVX2-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[8,u,9,u,10,u,11,u,12,u,13,u,14,u,15,u,16,u,17,u,18,u,19,u,20,u,21,u,22,u,23,u] -; AVX2-NEXT: vpshufb {{.*#+}} ymm1 = ymm1[u,8,u,9,u,10,u,11,u,12,u,13,u,14,u,15,u,16,u,17,u,18,u,19,u,20,u,21,u,22,u,23] -; AVX2-NEXT: vmovdqa {{.*#+}} ymm2 = [255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0] -; AVX2-NEXT: vpblendvb %ymm2, %ymm0, %ymm1, %ymm0 +; AVX2-NEXT: vpshufb {{.*#+}} ymm1 = zero,ymm1[8],zero,ymm1[9],zero,ymm1[10],zero,ymm1[11],zero,ymm1[12],zero,ymm1[13],zero,ymm1[14],zero,ymm1[15],zero,ymm1[16],zero,ymm1[17],zero,ymm1[18],zero,ymm1[19],zero,ymm1[20],zero,ymm1[21],zero,ymm1[22],zero,ymm1[23] +; AVX2-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero,ymm0[16],zero,ymm0[17],zero,ymm0[18],zero,ymm0[19],zero,ymm0[20],zero,ymm0[21],zero,ymm0[22],zero,ymm0[23],zero +; AVX2-NEXT: vpor %ymm1, %ymm0, %ymm0 ; AVX2-NEXT: retq ; ; AVX512VLBW-LABEL: shuffle_v32i8_08_40_09_41_10_42_11_43_12_44_13_45_14_46_15_47_16_48_17_49_18_50_19_51_20_52_21_53_22_54_23_55: ; AVX512VLBW: # %bb.0: -; AVX512VLBW-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[8,u,9,u,10,u,11,u,12,u,13,u,14,u,15,u,16,u,17,u,18,u,19,u,20,u,21,u,22,u,23,u] -; AVX512VLBW-NEXT: movl $-1431655766, %eax # imm = 0xAAAAAAAA -; AVX512VLBW-NEXT: kmovd %eax, %k1 -; AVX512VLBW-NEXT: vpshufb {{.*#+}} ymm0 {%k1} = ymm1[u,8,u,9,u,10,u,11,u,12,u,13,u,14,u,15,u,16,u,17,u,18,u,19,u,20,u,21,u,22,u,23] +; AVX512VLBW-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero,ymm0[16],zero,ymm0[17],zero,ymm0[18],zero,ymm0[19],zero,ymm0[20],zero,ymm0[21],zero,ymm0[22],zero,ymm0[23],zero +; AVX512VLBW-NEXT: vpshufb {{.*#+}} ymm1 = zero,ymm1[8],zero,ymm1[9],zero,ymm1[10],zero,ymm1[11],zero,ymm1[12],zero,ymm1[13],zero,ymm1[14],zero,ymm1[15],zero,ymm1[16],zero,ymm1[17],zero,ymm1[18],zero,ymm1[19],zero,ymm1[20],zero,ymm1[21],zero,ymm1[22],zero,ymm1[23] +; AVX512VLBW-NEXT: vpor %ymm0, %ymm1, %ymm0 ; AVX512VLBW-NEXT: retq ; ; AVX512VLVBMI-LABEL: shuffle_v32i8_08_40_09_41_10_42_11_43_12_44_13_45_14_46_15_47_16_48_17_49_18_50_19_51_20_52_21_53_22_54_23_55: @@ -2974,10 +2969,9 @@ define <32 x i8> @shuffle_v32i8_08_40_09_41_10_42_11_43_12_44_13_45_14_46_15_47_ ; ; XOPAVX2-LABEL: shuffle_v32i8_08_40_09_41_10_42_11_43_12_44_13_45_14_46_15_47_16_48_17_49_18_50_19_51_20_52_21_53_22_54_23_55: ; XOPAVX2: # %bb.0: -; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[8,u,9,u,10,u,11,u,12,u,13,u,14,u,15,u,16,u,17,u,18,u,19,u,20,u,21,u,22,u,23,u] -; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm1 = ymm1[u,8,u,9,u,10,u,11,u,12,u,13,u,14,u,15,u,16,u,17,u,18,u,19,u,20,u,21,u,22,u,23] -; XOPAVX2-NEXT: vmovdqa {{.*#+}} ymm2 = [255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0] -; XOPAVX2-NEXT: vpblendvb %ymm2, %ymm0, %ymm1, %ymm0 +; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm1 = zero,ymm1[8],zero,ymm1[9],zero,ymm1[10],zero,ymm1[11],zero,ymm1[12],zero,ymm1[13],zero,ymm1[14],zero,ymm1[15],zero,ymm1[16],zero,ymm1[17],zero,ymm1[18],zero,ymm1[19],zero,ymm1[20],zero,ymm1[21],zero,ymm1[22],zero,ymm1[23] +; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero,ymm0[16],zero,ymm0[17],zero,ymm0[18],zero,ymm0[19],zero,ymm0[20],zero,ymm0[21],zero,ymm0[22],zero,ymm0[23],zero +; XOPAVX2-NEXT: vpor %ymm1, %ymm0, %ymm0 ; XOPAVX2-NEXT: retq %shuffle = shufflevector <32 x i8> %a, <32 x i8> %b, <32 x i32> ret <32 x i8> %shuffle @@ -3368,11 +3362,10 @@ define <32 x i8> @shuffle_v32i8_42_45_12_13_35_35_60_40_17_22_29_44_33_12_48_51_ ; ; AVX2-LABEL: shuffle_v32i8_42_45_12_13_35_35_60_40_17_22_29_44_33_12_48_51_20_19_52_19_49_54_37_32_48_42_59_07_36_34_36_39: ; AVX2: # %bb.0: -; AVX2-NEXT: vpshufb {{.*#+}} ymm2 = ymm1[10,13,u,u,3,3,u,8,u,u,u,12,1,u,u,u,u,u,20,u,17,22,u,u,16,u,27,u,u,u,u,u] +; AVX2-NEXT: vpshufb {{.*#+}} ymm2 = ymm1[10,13],zero,zero,ymm1[3,3],zero,ymm1[8],zero,zero,zero,ymm1[12,1],zero,zero,zero,zero,zero,ymm1[20],zero,ymm1[17,22],zero,zero,ymm1[16],zero,ymm1[27],zero,zero,zero,zero,zero ; AVX2-NEXT: vpermq {{.*#+}} ymm1 = ymm1[2,3,0,1] -; AVX2-NEXT: vpshufb {{.*#+}} ymm1 = ymm1[u,u,u,u,u,u,12,u,u,u,u,u,u,u,0,3,u,u,u,u,u,u,21,16,u,26,u,u,20,18,20,23] -; AVX2-NEXT: vmovdqa {{.*#+}} ymm3 = <255,255,u,u,255,255,0,255,u,u,u,255,255,u,0,0,u,u,255,u,255,255,0,0,255,0,255,u,0,0,0,0> -; AVX2-NEXT: vpblendvb %ymm3, %ymm2, %ymm1, %ymm1 +; AVX2-NEXT: vpshufb {{.*#+}} ymm1 = zero,zero,ymm1[u,u],zero,zero,ymm1[12],zero,ymm1[u,u,u],zero,zero,ymm1[u,0,3,u,u],zero,ymm1[u],zero,zero,ymm1[21,16],zero,ymm1[26],zero,ymm1[u,20,18,20,23] +; AVX2-NEXT: vpor %ymm1, %ymm2, %ymm1 ; AVX2-NEXT: vpshufb {{.*#+}} ymm2 = ymm0[u,u,12,13,u,u,u,u,u,u,u,u,u,12,u,u,20,19,u,19,u,u,u,u,u,u,u,u,u,u,u,u] ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,3,0,1] ; AVX2-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[u,u,u,u,u,u,u,u,1,6,13,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,23,u,u,u,u] @@ -3383,19 +3376,17 @@ define <32 x i8> @shuffle_v32i8_42_45_12_13_35_35_60_40_17_22_29_44_33_12_48_51_ ; ; AVX512VLBW-LABEL: shuffle_v32i8_42_45_12_13_35_35_60_40_17_22_29_44_33_12_48_51_20_19_52_19_49_54_37_32_48_42_59_07_36_34_36_39: ; AVX512VLBW: # %bb.0: -; AVX512VLBW-NEXT: vpermq {{.*#+}} ymm2 = ymm1[2,3,0,1] -; AVX512VLBW-NEXT: vpshufb {{.*#+}} ymm1 = ymm1[10,13,u,u,3,3,u,8,u,u,u,12,1,u,u,u,u,u,20,u,17,22,u,u,16,u,27,u,u,u,u,u] -; AVX512VLBW-NEXT: movl $-222248896, %eax # imm = 0xF2C0C040 -; AVX512VLBW-NEXT: kmovd %eax, %k1 -; AVX512VLBW-NEXT: vpshufb {{.*#+}} ymm1 {%k1} = ymm2[u,u,u,u,u,u,12,u,u,u,u,u,u,u,0,3,u,u,u,u,u,u,21,16,u,26,u,u,20,18,20,23] ; AVX512VLBW-NEXT: vpshufb {{.*#+}} ymm2 = ymm0[u,u,12,13,u,u,u,u,u,u,u,u,u,12,u,u,20,19,u,19,u,u,u,u,u,u,u,u,u,u,u,u] ; AVX512VLBW-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,3,0,1] ; AVX512VLBW-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[u,u,u,u,u,u,u,u,1,6,13,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,23,u,u,u,u] -; AVX512VLBW-NEXT: vpblendd {{.*#+}} ymm0 = ymm2[0,1],ymm0[2],ymm2[3,4,5],ymm0[6],ymm2[7] +; AVX512VLBW-NEXT: vpblendd {{.*#+}} ymm2 = ymm2[0,1],ymm0[2],ymm2[3,4,5],ymm0[6],ymm2[7] +; AVX512VLBW-NEXT: vpshufb {{.*#+}} ymm0 = ymm1[10,13,u,u,3,3],zero,ymm1[8,u,u,u,12,1,u],zero,zero,ymm1[u,u,20,u,17,22],zero,zero,ymm1[16],zero,ymm1[27,u],zero,zero,zero,zero +; AVX512VLBW-NEXT: vpermq {{.*#+}} ymm1 = ymm1[2,3,0,1] +; AVX512VLBW-NEXT: vpshufb {{.*#+}} ymm1 = zero,zero,zero,zero,zero,zero,ymm1[12],zero,zero,zero,zero,zero,zero,zero,ymm1[0,3],zero,zero,zero,zero,zero,zero,ymm1[21,16],zero,ymm1[26],zero,zero,ymm1[20,18,20,23] +; AVX512VLBW-NEXT: vpor %ymm0, %ymm1, %ymm0 ; AVX512VLBW-NEXT: movl $134948620, %eax # imm = 0x80B270C ; AVX512VLBW-NEXT: kmovd %eax, %k1 -; AVX512VLBW-NEXT: vmovdqu8 %ymm0, %ymm1 {%k1} -; AVX512VLBW-NEXT: vmovdqa %ymm1, %ymm0 +; AVX512VLBW-NEXT: vmovdqu8 %ymm2, %ymm0 {%k1} ; AVX512VLBW-NEXT: retq ; ; AVX512VLVBMI-LABEL: shuffle_v32i8_42_45_12_13_35_35_60_40_17_22_29_44_33_12_48_51_20_19_52_19_49_54_37_32_48_42_59_07_36_34_36_39: @@ -3422,11 +3413,10 @@ define <32 x i8> @shuffle_v32i8_42_45_12_13_35_35_60_40_17_22_29_44_33_12_48_51_ ; ; XOPAVX2-LABEL: shuffle_v32i8_42_45_12_13_35_35_60_40_17_22_29_44_33_12_48_51_20_19_52_19_49_54_37_32_48_42_59_07_36_34_36_39: ; XOPAVX2: # %bb.0: -; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm2 = ymm1[10,13,u,u,3,3,u,8,u,u,u,12,1,u,u,u,u,u,20,u,17,22,u,u,16,u,27,u,u,u,u,u] +; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm2 = ymm1[10,13],zero,zero,ymm1[3,3],zero,ymm1[8],zero,zero,zero,ymm1[12,1],zero,zero,zero,zero,zero,ymm1[20],zero,ymm1[17,22],zero,zero,ymm1[16],zero,ymm1[27],zero,zero,zero,zero,zero ; XOPAVX2-NEXT: vpermq {{.*#+}} ymm1 = ymm1[2,3,0,1] -; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm1 = ymm1[u,u,u,u,u,u,12,u,u,u,u,u,u,u,0,3,u,u,u,u,u,u,21,16,u,26,u,u,20,18,20,23] -; XOPAVX2-NEXT: vmovdqa {{.*#+}} ymm3 = <255,255,u,u,255,255,0,255,u,u,u,255,255,u,0,0,u,u,255,u,255,255,0,0,255,0,255,u,0,0,0,0> -; XOPAVX2-NEXT: vpblendvb %ymm3, %ymm2, %ymm1, %ymm1 +; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm1 = zero,zero,ymm1[u,u],zero,zero,ymm1[12],zero,ymm1[u,u,u],zero,zero,ymm1[u,0,3,u,u],zero,ymm1[u],zero,zero,ymm1[21,16],zero,ymm1[26],zero,ymm1[u,20,18,20,23] +; XOPAVX2-NEXT: vpor %ymm1, %ymm2, %ymm1 ; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm2 = ymm0[u,u,12,13,u,u,u,u,u,u,u,u,u,12,u,u,20,19,u,19,u,u,u,u,u,u,u,u,u,u,u,u] ; XOPAVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,3,0,1] ; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[u,u,u,u,u,u,u,u,1,6,13,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,23,u,u,u,u] @@ -4415,11 +4405,10 @@ define <32 x i8> @shuffle_v32i8_00_01_16_17_02_03_18_19_04_05_20_21_06_07_22_23_ ; ; AVX2-LABEL: shuffle_v32i8_00_01_16_17_02_03_18_19_04_05_20_21_06_07_22_23_08_09_24_25_10_11_26_27_12_13_28_29_14_15_30_31: ; AVX2: # %bb.0: -; AVX2-NEXT: vpshufb {{.*#+}} ymm1 = ymm0[0,1,8,9,2,3,10,11,4,5,12,13,6,7,14,15,16,17,24,25,18,19,26,27,20,21,28,29,22,23,30,31] +; AVX2-NEXT: vpshufb {{.*#+}} ymm1 = ymm0[0,1],zero,zero,ymm0[2,3],zero,zero,ymm0[4,5],zero,zero,ymm0[6,7],zero,zero,zero,zero,ymm0[24,25],zero,zero,ymm0[26,27],zero,zero,ymm0[28,29],zero,zero,ymm0[30,31] ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,3,0,1] -; AVX2-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[8,9,0,1,10,11,2,3,12,13,4,5,14,15,6,7,24,25,16,17,26,27,18,19,28,29,20,21,30,31,22,23] -; AVX2-NEXT: vmovdqa {{.*#+}} ymm2 = [255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0,0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255] -; AVX2-NEXT: vpblendvb %ymm2, %ymm1, %ymm0, %ymm0 +; AVX2-NEXT: vpshufb {{.*#+}} ymm0 = zero,zero,ymm0[0,1],zero,zero,ymm0[2,3],zero,zero,ymm0[4,5],zero,zero,ymm0[6,7,24,25],zero,zero,ymm0[26,27],zero,zero,ymm0[28,29],zero,zero,ymm0[30,31],zero,zero +; AVX2-NEXT: vpor %ymm0, %ymm1, %ymm0 ; AVX2-NEXT: retq ; ; AVX512VL-LABEL: shuffle_v32i8_00_01_16_17_02_03_18_19_04_05_20_21_06_07_22_23_08_09_24_25_10_11_26_27_12_13_28_29_14_15_30_31: @@ -4438,11 +4427,10 @@ define <32 x i8> @shuffle_v32i8_00_01_16_17_02_03_18_19_04_05_20_21_06_07_22_23_ ; ; XOPAVX2-LABEL: shuffle_v32i8_00_01_16_17_02_03_18_19_04_05_20_21_06_07_22_23_08_09_24_25_10_11_26_27_12_13_28_29_14_15_30_31: ; XOPAVX2: # %bb.0: -; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm1 = ymm0[0,1,8,9,2,3,10,11,4,5,12,13,6,7,14,15,16,17,24,25,18,19,26,27,20,21,28,29,22,23,30,31] +; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm1 = ymm0[0,1],zero,zero,ymm0[2,3],zero,zero,ymm0[4,5],zero,zero,ymm0[6,7],zero,zero,zero,zero,ymm0[24,25],zero,zero,ymm0[26,27],zero,zero,ymm0[28,29],zero,zero,ymm0[30,31] ; XOPAVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,3,0,1] -; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[8,9,0,1,10,11,2,3,12,13,4,5,14,15,6,7,24,25,16,17,26,27,18,19,28,29,20,21,30,31,22,23] -; XOPAVX2-NEXT: vmovdqa {{.*#+}} ymm2 = [255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0,0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255] -; XOPAVX2-NEXT: vpblendvb %ymm2, %ymm1, %ymm0, %ymm0 +; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm0 = zero,zero,ymm0[0,1],zero,zero,ymm0[2,3],zero,zero,ymm0[4,5],zero,zero,ymm0[6,7,24,25],zero,zero,ymm0[26,27],zero,zero,ymm0[28,29],zero,zero,ymm0[30,31],zero,zero +; XOPAVX2-NEXT: vpor %ymm0, %ymm1, %ymm0 ; XOPAVX2-NEXT: retq %shuffle = shufflevector <32 x i8> %a, <32 x i8> %b, <32 x i32> ret <32 x i8> %shuffle @@ -4879,17 +4867,16 @@ define <32 x i8> @shuffle_v32i8_shift_00_02_04_06_08_10_12_14_16_18_20_22_24_26_ define <4 x i64> @PR28136(<32 x i8> %a0, <32 x i8> %a1) { ; AVX1-LABEL: PR28136: ; AVX1: # %bb.0: -; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2 -; AVX1-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7] -; AVX1-NEXT: vpshufb {{.*#+}} xmm2 = xmm0[8,u,10,u,12,u,14,u,9,u,11,u,13,u,15,u] -; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3 -; AVX1-NEXT: vpunpcklbw {{.*#+}} xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1],xmm1[2],xmm3[2],xmm1[3],xmm3[3],xmm1[4],xmm3[4],xmm1[5],xmm3[5],xmm1[6],xmm3[6],xmm1[7],xmm3[7] -; AVX1-NEXT: vpshufb {{.*#+}} xmm3 = xmm1[u,8,u,10,u,12,u,14,u,9,u,11,u,13,u,15] -; AVX1-NEXT: vmovdqa {{.*#+}} xmm4 = [255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0] -; AVX1-NEXT: vpblendvb %xmm4, %xmm2, %xmm3, %xmm2 -; AVX1-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,u,2,u,4,u,6,u,1,u,3,u,5,u,7,u] -; AVX1-NEXT: vpshufb {{.*#+}} xmm1 = xmm1[u,0,u,2,u,4,u,6,u,1,u,3,u,5,u,7] -; AVX1-NEXT: vpblendvb %xmm4, %xmm0, %xmm1, %xmm0 +; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2 +; AVX1-NEXT: vpunpcklbw {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3],xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] +; AVX1-NEXT: vpshufb {{.*#+}} xmm2 = zero,xmm1[8],zero,xmm1[10],zero,xmm1[12],zero,xmm1[14],zero,xmm1[9],zero,xmm1[11],zero,xmm1[13],zero,xmm1[15] +; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3 +; AVX1-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1],xmm0[2],xmm3[2],xmm0[3],xmm3[3],xmm0[4],xmm3[4],xmm0[5],xmm3[5],xmm0[6],xmm3[6],xmm0[7],xmm3[7] +; AVX1-NEXT: vpshufb {{.*#+}} xmm3 = xmm0[8],zero,xmm0[10],zero,xmm0[12],zero,xmm0[14],zero,xmm0[9],zero,xmm0[11],zero,xmm0[13],zero,xmm0[15],zero +; AVX1-NEXT: vpor %xmm2, %xmm3, %xmm2 +; AVX1-NEXT: vpshufb {{.*#+}} xmm1 = zero,xmm1[0],zero,xmm1[2],zero,xmm1[4],zero,xmm1[6],zero,xmm1[1],zero,xmm1[3],zero,xmm1[5],zero,xmm1[7] +; AVX1-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0],zero,xmm0[2],zero,xmm0[4],zero,xmm0[6],zero,xmm0[1],zero,xmm0[3],zero,xmm0[5],zero,xmm0[7],zero +; AVX1-NEXT: vpor %xmm1, %xmm0, %xmm0 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0 ; AVX1-NEXT: retq ; @@ -4921,15 +4908,12 @@ define <4 x i64> @PR28136(<32 x i8> %a0, <32 x i8> %a1) { ; XOPAVX1: # %bb.0: ; XOPAVX1-NEXT: vextractf128 $1, %ymm0, %xmm2 ; XOPAVX1-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7] -; XOPAVX1-NEXT: vpshufb {{.*#+}} xmm2 = xmm0[8,u,10,u,12,u,14,u,9,u,11,u,13,u,15,u] -; XOPAVX1-NEXT: vextractf128 $1, %ymm1, %xmm3 -; XOPAVX1-NEXT: vpunpcklbw {{.*#+}} xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1],xmm1[2],xmm3[2],xmm1[3],xmm3[3],xmm1[4],xmm3[4],xmm1[5],xmm3[5],xmm1[6],xmm3[6],xmm1[7],xmm3[7] -; XOPAVX1-NEXT: vpshufb {{.*#+}} xmm3 = xmm1[u,8,u,10,u,12,u,14,u,9,u,11,u,13,u,15] -; XOPAVX1-NEXT: vmovdqa {{.*#+}} xmm4 = [255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0] -; XOPAVX1-NEXT: vpblendvb %xmm4, %xmm2, %xmm3, %xmm2 -; XOPAVX1-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,u,2,u,4,u,6,u,1,u,3,u,5,u,7,u] +; XOPAVX1-NEXT: vextractf128 $1, %ymm1, %xmm2 +; XOPAVX1-NEXT: vpunpcklbw {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3],xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] +; XOPAVX1-NEXT: vpshufb {{.*#+}} xmm2 = xmm1[u,8,u,10,u,12,u,14,u,9,u,11,u,13,u,15] +; XOPAVX1-NEXT: vpperm {{.*#+}} xmm2 = xmm0[8],xmm2[1],xmm0[10],xmm2[3],xmm0[12],xmm2[5],xmm0[14],xmm2[7],xmm0[9],xmm2[9],xmm0[11],xmm2[11],xmm0[13],xmm2[13],xmm0[15],xmm2[15] ; XOPAVX1-NEXT: vpshufb {{.*#+}} xmm1 = xmm1[u,0,u,2,u,4,u,6,u,1,u,3,u,5,u,7] -; XOPAVX1-NEXT: vpblendvb %xmm4, %xmm0, %xmm1, %xmm0 +; XOPAVX1-NEXT: vpperm {{.*#+}} xmm0 = xmm0[0],xmm1[1],xmm0[2],xmm1[3],xmm0[4],xmm1[5],xmm0[6],xmm1[7],xmm0[1],xmm1[9],xmm0[3],xmm1[11],xmm0[5],xmm1[13],xmm0[7],xmm1[15] ; XOPAVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0 ; XOPAVX1-NEXT: retq ; @@ -4958,11 +4942,10 @@ define <32 x i8> @PR47262(<4 x i64> %a0) { ; ; AVX2-LABEL: PR47262: ; AVX2: # %bb.0: -; AVX2-NEXT: vpshufb {{.*#+}} ymm1 = ymm0[0,4,u,u,1,5,u,u,2,6,u,u,3,7,u,u,u,u,24,28,u,u,25,29,u,u,26,30,u,u,27,31] +; AVX2-NEXT: vpshufb {{.*#+}} ymm1 = ymm0[0,4],zero,zero,ymm0[1,5],zero,zero,ymm0[2,6],zero,zero,ymm0[3,7],zero,zero,zero,zero,ymm0[24,28],zero,zero,ymm0[25,29],zero,zero,ymm0[26,30],zero,zero,ymm0[27,31] ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,3,0,1] -; AVX2-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[u,u,0,4,u,u,1,5,u,u,2,6,u,u,3,7,24,28,u,u,25,29,u,u,26,30,u,u,27,31,u,u] -; AVX2-NEXT: vmovdqa {{.*#+}} ymm2 = [255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0,0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255] -; AVX2-NEXT: vpblendvb %ymm2, %ymm1, %ymm0, %ymm0 +; AVX2-NEXT: vpshufb {{.*#+}} ymm0 = zero,zero,ymm0[0,4],zero,zero,ymm0[1,5],zero,zero,ymm0[2,6],zero,zero,ymm0[3,7,24,28],zero,zero,ymm0[25,29],zero,zero,ymm0[26,30],zero,zero,ymm0[27,31],zero,zero +; AVX2-NEXT: vpor %ymm0, %ymm1, %ymm0 ; AVX2-NEXT: retq ; ; AVX512VLBW-LABEL: PR47262: @@ -4992,11 +4975,10 @@ define <32 x i8> @PR47262(<4 x i64> %a0) { ; ; XOPAVX2-LABEL: PR47262: ; XOPAVX2: # %bb.0: -; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm1 = ymm0[0,4,u,u,1,5,u,u,2,6,u,u,3,7,u,u,u,u,24,28,u,u,25,29,u,u,26,30,u,u,27,31] +; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm1 = ymm0[0,4],zero,zero,ymm0[1,5],zero,zero,ymm0[2,6],zero,zero,ymm0[3,7],zero,zero,zero,zero,ymm0[24,28],zero,zero,ymm0[25,29],zero,zero,ymm0[26,30],zero,zero,ymm0[27,31] ; XOPAVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,3,0,1] -; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[u,u,0,4,u,u,1,5,u,u,2,6,u,u,3,7,24,28,u,u,25,29,u,u,26,30,u,u,27,31,u,u] -; XOPAVX2-NEXT: vmovdqa {{.*#+}} ymm2 = [255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0,0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255] -; XOPAVX2-NEXT: vpblendvb %ymm2, %ymm1, %ymm0, %ymm0 +; XOPAVX2-NEXT: vpshufb {{.*#+}} ymm0 = zero,zero,ymm0[0,4],zero,zero,ymm0[1,5],zero,zero,ymm0[2,6],zero,zero,ymm0[3,7,24,28],zero,zero,ymm0[25,29],zero,zero,ymm0[26,30],zero,zero,ymm0[27,31],zero,zero +; XOPAVX2-NEXT: vpor %ymm0, %ymm1, %ymm0 ; XOPAVX2-NEXT: retq %t1 = shufflevector <4 x i64> %a0, <4 x i64> undef, <4 x i32> %t2 = bitcast <4 x i64> %t1 to <32 x i8> diff --git a/llvm/test/CodeGen/X86/vector-shuffle-combining.ll b/llvm/test/CodeGen/X86/vector-shuffle-combining.ll index 6420a62ff0ba..5b3b1d4fba18 100644 --- a/llvm/test/CodeGen/X86/vector-shuffle-combining.ll +++ b/llvm/test/CodeGen/X86/vector-shuffle-combining.ll @@ -3281,22 +3281,21 @@ define void @PR45604(<32 x i16>* %dst, <8 x i16>* %src) { ; ; AVX2-FAST-LABEL: PR45604: ; AVX2-FAST: # %bb.0: -; AVX2-FAST-NEXT: vmovdqa (%rsi), %xmm0 -; AVX2-FAST-NEXT: vpshufb {{.*#+}} ymm1 = ymm0[0,1,4,5,u,u,u,u,2,3,6,7,u,u,u,u,16,17,20,21,u,u,u,u,18,19,22,23,u,u,u,u] -; AVX2-FAST-NEXT: vpermq {{.*#+}} ymm2 = ymm0[2,3,0,1] -; AVX2-FAST-NEXT: vpshufb {{.*#+}} ymm3 = ymm2[4,5,0,1,u,u,u,u,6,7,2,3,u,u,u,u,20,21,16,17,u,u,u,u,22,23,18,19,u,u,u,u] -; AVX2-FAST-NEXT: vmovdqa {{.*#+}} ymm4 = -; AVX2-FAST-NEXT: vmovdqa {{.*#+}} ymm5 = [0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11] -; AVX2-FAST-NEXT: vpblendvb %ymm4, {{.*}}(%rip), %ymm5, %ymm4 -; AVX2-FAST-NEXT: vmovdqa {{.*#+}} ymm5 = <255,255,0,0,u,u,u,u,255,255,0,0,u,u,u,u,0,0,255,255,u,u,u,u,0,0,255,255,u,u,u,u> -; AVX2-FAST-NEXT: vpblendvb %ymm5, %ymm1, %ymm3, %ymm1 -; AVX2-FAST-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[8,9,12,13,u,u,u,u,10,11,14,15,u,u,u,u,24,25,28,29,u,u,u,u,26,27,30,31,u,u,u,u] -; AVX2-FAST-NEXT: vpshufb {{.*#+}} ymm2 = ymm2[12,13,8,9,u,u,u,u,14,15,10,11,u,u,u,u,28,29,24,25,u,u,u,u,30,31,26,27,u,u,u,u] -; AVX2-FAST-NEXT: vpblendvb %ymm5, %ymm0, %ymm2, %ymm0 -; AVX2-FAST-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0],ymm4[1],ymm1[2],ymm4[3],ymm1[4],ymm4[5],ymm1[6],ymm4[7] -; AVX2-FAST-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0],ymm4[1],ymm0[2],ymm4[3],ymm0[4],ymm4[5],ymm0[6],ymm4[7] +; AVX2-FAST-NEXT: vmovdqa {{.*#+}} ymm0 = +; AVX2-FAST-NEXT: vmovdqa {{.*#+}} ymm1 = [0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11] +; AVX2-FAST-NEXT: vpblendvb %ymm0, {{.*}}(%rip), %ymm1, %ymm0 +; AVX2-FAST-NEXT: vmovdqa (%rsi), %xmm1 +; AVX2-FAST-NEXT: vpshufb {{.*#+}} ymm2 = ymm1[0,1],zero,zero,ymm1[u,u,u,u,2,3],zero,zero,ymm1[u,u,u,u],zero,zero,ymm1[20,21,u,u,u,u],zero,zero,ymm1[22,23,u,u,u,u] +; AVX2-FAST-NEXT: vpermq {{.*#+}} ymm3 = ymm1[2,3,0,1] +; AVX2-FAST-NEXT: vpshufb {{.*#+}} ymm4 = zero,zero,ymm3[0,1,u,u,u,u],zero,zero,ymm3[2,3,u,u,u,u,20,21],zero,zero,ymm3[u,u,u,u,22,23],zero,zero,ymm3[u,u,u,u] +; AVX2-FAST-NEXT: vpor %ymm4, %ymm2, %ymm2 +; AVX2-FAST-NEXT: vpblendd {{.*#+}} ymm2 = ymm2[0],ymm0[1],ymm2[2],ymm0[3],ymm2[4],ymm0[5],ymm2[6],ymm0[7] +; AVX2-FAST-NEXT: vpshufb {{.*#+}} ymm1 = ymm1[8,9],zero,zero,ymm1[u,u,u,u,10,11],zero,zero,ymm1[u,u,u,u],zero,zero,ymm1[28,29,u,u,u,u],zero,zero,ymm1[30,31,u,u,u,u] +; AVX2-FAST-NEXT: vpshufb {{.*#+}} ymm3 = zero,zero,ymm3[8,9,u,u,u,u],zero,zero,ymm3[10,11,u,u,u,u,28,29],zero,zero,ymm3[u,u,u,u,30,31],zero,zero,ymm3[u,u,u,u] +; AVX2-FAST-NEXT: vpor %ymm3, %ymm1, %ymm1 +; AVX2-FAST-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0],ymm0[1],ymm1[2],ymm0[3],ymm1[4],ymm0[5],ymm1[6],ymm0[7] ; AVX2-FAST-NEXT: vmovdqu %ymm0, 32(%rdi) -; AVX2-FAST-NEXT: vmovdqu %ymm1, (%rdi) +; AVX2-FAST-NEXT: vmovdqu %ymm2, (%rdi) ; AVX2-FAST-NEXT: vzeroupper ; AVX2-FAST-NEXT: retq %v1 = load <8 x i16>, <8 x i16>* %src, align 16 From ddd48cdba690fdeefc6ad02a912b63bdb66401b4 Mon Sep 17 00:00:00 2001 From: Eric Astor Date: Wed, 2 Sep 2020 12:11:29 -0400 Subject: [PATCH 15/26] [ms] [llvm-ml] Add support for line continuations in MASM Add support for line continuations (the "backslash operator") in MASM by modifying the Parser's Lex method. Reviewed By: thakis Differential Revision: https://reviews.llvm.org/D83347 --- llvm/lib/MC/MCParser/MasmParser.cpp | 8 ++++++++ llvm/test/tools/llvm-ml/line_continuations.test | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 llvm/test/tools/llvm-ml/line_continuations.test diff --git a/llvm/lib/MC/MCParser/MasmParser.cpp b/llvm/lib/MC/MCParser/MasmParser.cpp index fb7aaae295df..45165ffe3cac 100644 --- a/llvm/lib/MC/MCParser/MasmParser.cpp +++ b/llvm/lib/MC/MCParser/MasmParser.cpp @@ -1094,6 +1094,14 @@ const AsmToken &MasmParser::Lex() { tok = &Lexer.Lex(); } + // Recognize and bypass line continuations. + while (tok->is(AsmToken::BackSlash) && + Lexer.peekTok().is(AsmToken::EndOfStatement)) { + // Eat both the backslash and the end of statement. + Lexer.Lex(); + tok = &Lexer.Lex(); + } + if (tok->is(AsmToken::Eof)) { // If this is the end of an included file, pop the parent file off the // include stack. diff --git a/llvm/test/tools/llvm-ml/line_continuations.test b/llvm/test/tools/llvm-ml/line_continuations.test new file mode 100644 index 000000000000..604bbe91b32a --- /dev/null +++ b/llvm/test/tools/llvm-ml/line_continuations.test @@ -0,0 +1,17 @@ +# RUN: llvm-ml -filetype=asm %s | FileCheck %s + +.code + +t1: +mov eax, \ + ebx +# CHECK: t1: +# CHECK-NEXT: mov eax, ebx + +t2: +mov eax, [ebx + \ + 1] +# CHECK: t2: +# CHECK-NEXT: mov eax, dword ptr [ebx + 1] + +END From 8ff44e644bb70dfb8decc397a42679df6e6f8ba1 Mon Sep 17 00:00:00 2001 From: Erik Pilkington Date: Tue, 1 Sep 2020 11:52:28 -0400 Subject: [PATCH 16/26] [IRGen] Fix an assert when __attribute__((used)) is used on an ObjC method This assert doesn't really make sense for functions in general, since they start life as declarations, and there isn't really any reason to require them to be defined before attributes are applied to them. rdar://67895846 --- clang/lib/CodeGen/CodeGenModule.cpp | 2 +- clang/test/CodeGenObjC/attr-used-on-method.m | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 clang/test/CodeGenObjC/attr-used-on-method.m diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 77a5079bd0f1..1f362e2b6b31 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1989,7 +1989,7 @@ void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, llvm::Function *F, } void CodeGenModule::addUsedGlobal(llvm::GlobalValue *GV) { - assert(!GV->isDeclaration() && + assert(isa(GV) || !GV->isDeclaration() && "Only globals with definition can force usage."); LLVMUsed.emplace_back(GV); } diff --git a/clang/test/CodeGenObjC/attr-used-on-method.m b/clang/test/CodeGenObjC/attr-used-on-method.m new file mode 100644 index 000000000000..d8b2a5d29184 --- /dev/null +++ b/clang/test/CodeGenObjC/attr-used-on-method.m @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 %s -S -emit-llvm -o - | FileCheck %s + +// CHECK: @llvm.used = +// CHECK-SAME: @"\01-[X m]" + +// CHECK: define internal void @"\01-[X m]"( + +@interface X @end +@implementation X +-(void) m __attribute__((used)) {} +@end From d46f2c51e4c849683434bb5a0fb6164957474b8f Mon Sep 17 00:00:00 2001 From: Erik Pilkington Date: Tue, 1 Sep 2020 20:17:00 -0400 Subject: [PATCH 17/26] Make -fvisibility-inlines-hidden apply to static local variables in inline functions on Darwin This effectively disables r340386 on Darwin, and provides a command line flag to opt into/out of this behaviour. This change is needed to compile certain Apple headers correctly. rdar://47688592 Differential revision: https://reviews.llvm.org/D86881 --- clang/include/clang/Basic/LangOptions.def | 3 ++ clang/include/clang/Driver/Options.td | 11 ++++ clang/lib/AST/Decl.cpp | 3 +- clang/lib/Driver/ToolChains/Clang.cpp | 2 + clang/lib/Driver/ToolChains/Darwin.cpp | 7 +++ clang/lib/Frontend/CompilerInvocation.cpp | 3 ++ ...bility-inlines-hidden-static-local-var.cpp | 53 +++++++++++++++++++ clang/test/Driver/darwin-objc-options.m | 9 ++++ 8 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 clang/test/CodeGenCXX/visibility-inlines-hidden-static-local-var.cpp diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def index d7bba5426c2a..55a784196bb9 100644 --- a/clang/include/clang/Basic/LangOptions.def +++ b/clang/include/clang/Basic/LangOptions.def @@ -265,6 +265,9 @@ BENIGN_LANGOPT(DumpRecordLayoutsSimple , 1, 0, "dumping the layout of IRgen'd re BENIGN_LANGOPT(DumpVTableLayouts , 1, 0, "dumping the layouts of emitted vtables") LANGOPT(NoConstantCFStrings , 1, 0, "no constant CoreFoundation strings") BENIGN_LANGOPT(InlineVisibilityHidden , 1, 0, "hidden visibility for inline C++ methods") +BENIGN_LANGOPT(VisibilityInlinesHiddenStaticLocalVar, 1, 0, + "hidden visibility for static local variables in inline C++ " + "methods when -fvisibility-inlines hidden is enabled") LANGOPT(GlobalAllocationFunctionVisibilityHidden , 1, 0, "hidden visibility for global operator new and delete declaration") BENIGN_LANGOPT(ParseUnknownAnytype, 1, 0, "__unknown_anytype") BENIGN_LANGOPT(DebuggerSupport , 1, 0, "debugger support") diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index ff7b4aa9320c..5a6a196191e7 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -1943,6 +1943,17 @@ def fvisibility_EQ : Joined<["-"], "fvisibility=">, Group, def fvisibility_inlines_hidden : Flag<["-"], "fvisibility-inlines-hidden">, Group, HelpText<"Give inline C++ member functions hidden visibility by default">, Flags<[CC1Option]>; +def fvisibility_inlines_hidden_static_local_var : + Flag<["-"], "fvisibility-inlines-hidden-static-local-var">, Group, + HelpText<"When -fvisibility-inlines-hidden is enabled, static variables in " + "inline C++ member functions will also be given hidden visibility " + "by default">, + Flags<[CC1Option]>; +def fno_visibility_inlines_hidden_static_local_var : + Flag<["-"], "fno-visibility-inlines-hidden-static-local-var">, Group, + HelpText<"Disables -fvisibility-inlines-hidden-static-local-var " + "(this is the default on non-darwin targets)">, + Flags<[CC1Option]>; def fvisibility_ms_compat : Flag<["-"], "fvisibility-ms-compat">, Group, HelpText<"Give global types 'default' visibility and global functions and " "variables 'hidden' visibility by default">; diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 5c0a98815dd7..9815f0648ad7 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -1299,7 +1299,8 @@ LinkageInfo LinkageComputer::getLVForLocalDecl(const NamedDecl *D, // we should not make static local variables in the function hidden. LV = getLVForDecl(FD, computation); if (isa(D) && useInlineVisibilityHidden(FD) && - !LV.isVisibilityExplicit()) { + !LV.isVisibilityExplicit() && + !Context.getLangOpts().VisibilityInlinesHiddenStaticLocalVar) { assert(cast(D)->isStaticLocal()); // If this was an implicitly hidden inline method, check again for // explicit visibility on the parent class, and use that for static locals diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 3023c94bf10c..bd5a89c2360c 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -5210,6 +5210,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, } Args.AddLastArg(CmdArgs, options::OPT_fvisibility_inlines_hidden); + Args.AddLastArg(CmdArgs, options::OPT_fvisibility_inlines_hidden_static_local_var, + options::OPT_fno_visibility_inlines_hidden_static_local_var); Args.AddLastArg(CmdArgs, options::OPT_fvisibility_global_new_delete_hidden); Args.AddLastArg(CmdArgs, options::OPT_ftlsmodel_EQ); diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp index 04349ff6af98..9d22cda21711 100644 --- a/clang/lib/Driver/ToolChains/Darwin.cpp +++ b/clang/lib/Driver/ToolChains/Darwin.cpp @@ -2408,6 +2408,13 @@ void Darwin::addClangTargetOptions(const llvm::opt::ArgList &DriverArgs, // Enable compatibility mode for NSItemProviderCompletionHandler in // Foundation/NSItemProvider.h. CC1Args.push_back("-fcompatibility-qualified-id-block-type-checking"); + + // Give static local variables in inline functions hidden visibility when + // -fvisibility-inlines-hidden is enabled. + if (!DriverArgs.getLastArgNoClaim( + options::OPT_fvisibility_inlines_hidden_static_local_var, + options::OPT_fno_visibility_inlines_hidden_static_local_var)) + CC1Args.push_back("-fvisibility-inlines-hidden-static-local-var"); } DerivedArgList * diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 1cd392f65009..9143dd6ca257 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -2766,6 +2766,9 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, if (Args.hasArg(OPT_fvisibility_inlines_hidden)) Opts.InlineVisibilityHidden = 1; + if (Args.hasArg(OPT_fvisibility_inlines_hidden_static_local_var)) + Opts.VisibilityInlinesHiddenStaticLocalVar = 1; + if (Args.hasArg(OPT_fvisibility_global_new_delete_hidden)) Opts.GlobalAllocationFunctionVisibilityHidden = 1; diff --git a/clang/test/CodeGenCXX/visibility-inlines-hidden-static-local-var.cpp b/clang/test/CodeGenCXX/visibility-inlines-hidden-static-local-var.cpp new file mode 100644 index 000000000000..57e6dea72e21 --- /dev/null +++ b/clang/test/CodeGenCXX/visibility-inlines-hidden-static-local-var.cpp @@ -0,0 +1,53 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fvisibility-inlines-hidden -fvisibility-inlines-hidden-static-local-var %s -emit-llvm -o - | FileCheck %s + +#define used __attribute__((used)) + +used inline void f1() { + // CHECK: @_ZZ2f1vE6f1_var = linkonce_odr hidden global i32 0 + static int f1_var = 0; +} + +__attribute__((visibility("default"))) +used inline void f2() { + // CHECK: @_ZZ2f2vE6f2_var = linkonce_odr global i32 0 + static int f2_var = 0; +} + +struct S { + used void f3() { + // CHECK: @_ZZN1S2f3EvE6f3_var = linkonce_odr hidden global i32 0 + static int f3_var = 0; + } + + void f6(); + void f7(); +}; + +used void f4() { + // CHECK: @_ZZ2f4vE6f4_var = internal global i32 0 + static int f4_var = 0; +} + +__attribute__((visibility("default"))) +used void f5() { + // CHECK: @_ZZ2f5vE6f5_var = internal global i32 0 + static int f5_var = 0; +} + +used void S::f6() { + // CHECK: @_ZZN1S2f6EvE6f6_var = internal global i32 0 + static int f6_var = 0; +} + +used inline void S::f7() { + // CHECK: @_ZZN1S2f7EvE6f7_var = linkonce_odr hidden global i32 0 + static int f7_var = 0; +} + + +struct __attribute__((visibility("default"))) S2 { + used void f8() { + // CHECK: @_ZZN2S22f8EvE6f8_var = linkonce_odr hidden global i32 0 + static int f8_var = 0; + } +}; diff --git a/clang/test/Driver/darwin-objc-options.m b/clang/test/Driver/darwin-objc-options.m index 6684a5272175..8721fbc1ef1e 100644 --- a/clang/test/Driver/darwin-objc-options.m +++ b/clang/test/Driver/darwin-objc-options.m @@ -46,3 +46,12 @@ // RUN: %clang -target x86_64-linux-gnu -### %s 2>&1 | FileCheck --check-prefix=OTHER_COMPATIBILITY %s // DARWIN_COMPATIBILITY: -fcompatibility-qualified-id-block-type-checking // OTHER_COMPATIBILITY-NOT: -fcompatibility-qualified-id-block-type-checking + +// Add -fvisibility-inlines-hidden-static-local-var on Darwin. +// RUN: %clang -target x86_64-apple-darwin10 -### %s 2>&1 | FileCheck --check-prefix=DARWIN_INLINES_HIDDEN %s +// RUN: %clang -target x86_64-apple-darwin10 -fno-visibility-inlines-hidden-static-local-var -### %s 2>&1 | FileCheck --check-prefix=DARWIN_INLINES_HIDDEN_EXPLICIT_NO %s +// RUN: %clang -target x86_64-linux-gnu -### %s 2>&1 | FileCheck --check-prefix=NO_DARWIN_INLINES_HIDDEN %s +// DARWIN_INLINES_HIDDEN: -fvisibility-inlines-hidden-static-local-var +// DARWIN_INLINES_HIDDEN_EXPLICIT_NO-NOT: -fvisibility-inlines-hidden-static-local-var +// DARWIN_INLINES_HIDDEN_EXPLICIT_NO: -fno-visibility-inlines-hidden-static-local-var +// NO_DARWIN_INLINES_HIDDEN-NOT: -fvisibility-inlines-hidden-static-local-var From 5201b962e8956b75dffd2167e278b8627981c90b Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Wed, 2 Sep 2020 10:36:48 -0400 Subject: [PATCH 18/26] [libc++] Re-apply the workaround for timespec_get not always being available in Apple SDKs This commit re-applies 99f3b231cb21, which was reverted in 814242572731 because it broke the modules build. The modules failure was a circular dependency between the Darwin module and __config. Specifically, the issue was that if <__config> includes a system header, the std_config module depends on the Darwin module. However, the Darwin module already depends on the std_config header because some of its headers include libc++ headers like (they mean to include the C , but libc++ headers are first in the header search path). This is fixed by moving the workaround to only. https://llvm.org/PR47208 rdar://68157284 --- libcxx/include/ctime | 14 +++++++++++++- .../timespec_get.xopen.compile.pass.cpp | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 libcxx/test/libcxx/language.support/timespec_get.xopen.compile.pass.cpp diff --git a/libcxx/include/ctime b/libcxx/include/ctime index f9f2f1659d0e..3aa619daa358 100644 --- a/libcxx/include/ctime +++ b/libcxx/include/ctime @@ -52,6 +52,18 @@ int timespec_get( struct timespec *ts, int base); // C++17 #pragma GCC system_header #endif +// FIXME: +// Apple SDKs don't define ::timespec_get unconditionally in C++ mode. This +// should be fixed in future SDKs, but for the time being we need to avoid +// trying to use that declaration when the SDK doesn't provide it. Note that +// we're detecting this here instead of in <__config> because we can't include +// system headers from <__config>, since it leads to circular module dependencies. +// This is also meant to be a very temporary workaround until the SDKs are fixed. +#include +#if defined(__APPLE__) && defined(_LIBCPP_HAS_TIMESPEC_GET) && (__DARWIN_C_LEVEL < __DARWIN_C_FULL) +# define _LIBCPP_HAS_TIMESPEC_GET_NOT_ACTUALLY_PROVIDED +#endif + _LIBCPP_BEGIN_NAMESPACE_STD using ::clock_t; @@ -72,7 +84,7 @@ using ::gmtime; using ::localtime; #endif using ::strftime; -#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET) +#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET) && !defined(_LIBCPP_HAS_TIMESPEC_GET_NOT_ACTUALLY_PROVIDED) using ::timespec_get; #endif diff --git a/libcxx/test/libcxx/language.support/timespec_get.xopen.compile.pass.cpp b/libcxx/test/libcxx/language.support/timespec_get.xopen.compile.pass.cpp new file mode 100644 index 000000000000..cf4c5957a418 --- /dev/null +++ b/libcxx/test/libcxx/language.support/timespec_get.xopen.compile.pass.cpp @@ -0,0 +1,18 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++03, c++11, c++14 + +// Make sure that can be included even when _XOPEN_SOURCE is defined. +// This used to trigger some bug in Apple SDKs, since timespec_get was not +// defined in but we tried using it from . +// See https://llvm.org/PR47208 for details. + +// ADDITIONAL_COMPILE_FLAGS: -D_XOPEN_SOURCE=500 + +#include From 44cc78da056fbda2693f0489275f8e0ff1f590a1 Mon Sep 17 00:00:00 2001 From: hyd-dev Date: Wed, 2 Sep 2020 12:22:29 -0400 Subject: [PATCH 19/26] [libc++] Fix incorrect usage of __STDC_HOSTED__ D56913 introduced the _LIBCPP_FREESTANDING macro and guarded its definition by: #ifndef __STDC_HOSTED__ # define _LIBCPP_FREESTANDING #endif However, __STDC_HOSTED__ is defined as 0 in freestanding implementations instead of undefined, which means that _LIBCPP_FREESTANDING would never get defined. This patch corrects the above as: #if __STDC_HOSTED__ == 0 # define _LIBCPP_FREESTANDING #endif Differential Revision: https://reviews.llvm.org/D86055 --- libcxx/include/__config | 2 +- libcxx/test/libcxx/libcpp_freestanding.sh.cpp | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 libcxx/test/libcxx/libcpp_freestanding.sh.cpp diff --git a/libcxx/include/__config b/libcxx/include/__config index d7b6a2acaeff..3e64694f284b 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -38,7 +38,7 @@ # define _LIBCPP_ABI_VERSION 1 #endif -#ifndef __STDC_HOSTED__ +#if __STDC_HOSTED__ == 0 # define _LIBCPP_FREESTANDING #endif diff --git a/libcxx/test/libcxx/libcpp_freestanding.sh.cpp b/libcxx/test/libcxx/libcpp_freestanding.sh.cpp new file mode 100644 index 000000000000..5a51f1be4e82 --- /dev/null +++ b/libcxx/test/libcxx/libcpp_freestanding.sh.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// Test that _LIBCPP_FREESTANDING is not defined when -ffreestanding is not passed +// to the compiler but defined when -ffreestanding is passed to the compiler. + +// RUN: %{cxx} %{flags} %{compile_flags} -fsyntax-only %s +// RUN: %{cxx} %{flags} %{compile_flags} -fsyntax-only -ffreestanding -DFREESTANDING %s + +#include <__config> + +#if defined(FREESTANDING) != defined(_LIBCPP_FREESTANDING) +#error _LIBCPP_FREESTANDING should be defined in freestanding mode and not \ + defined in non-freestanding mode +#endif From 4f57a126c4e763e3041c04f0b22e91200506dcc6 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Wed, 2 Sep 2020 12:29:42 -0400 Subject: [PATCH 20/26] [libc++] Remove definition of _LIBCPP_ALIGNOF for GCC in C++03 mode That definition is known to be potentially incorrect, and we don't support GCC in C++03 mode anyway. --- libcxx/include/__config | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libcxx/include/__config b/libcxx/include/__config index 3e64694f284b..17e6bfe207aa 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -398,9 +398,7 @@ #elif defined(_LIBCPP_COMPILER_CLANG) # define _LIBCPP_ALIGNOF(_Tp) _Alignof(_Tp) #else -// This definition is potentially buggy, but it's only taken with GCC in C++03, -// which we barely support anyway. See llvm.org/PR39713 -# define _LIBCPP_ALIGNOF(_Tp) __alignof(_Tp) +# error "We don't know a correct way to implement alignof(T) in C++03 outside of Clang" #endif #define _LIBCPP_PREFERRED_ALIGNOF(_Tp) __alignof(_Tp) From f80866bd4a2a4e8b650aef1f9a88870dd336e20f Mon Sep 17 00:00:00 2001 From: peter klausler Date: Tue, 1 Sep 2020 16:55:43 -0700 Subject: [PATCH 21/26] [flang] Make -fget-symbols-sources output deterministic The DumpSymbolsSources() routine ordered its output by the addresses of the names of the symbols, and was susceptible to variation across environments. Fixed by using a multimap using the values of the names. Differential Revision: https://reviews.llvm.org/D87035 --- flang/lib/Semantics/semantics.cpp | 6 +++--- flang/test/Semantics/getsymbols01.f90 | 6 +++--- flang/test/Semantics/getsymbols02.f90 | 2 +- flang/test/Semantics/getsymbols03-a.f90 | 2 +- flang/test/Semantics/getsymbols04.f90 | 2 +- flang/test/Semantics/getsymbols05.f90 | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/flang/lib/Semantics/semantics.cpp b/flang/lib/Semantics/semantics.cpp index 24d0baa9c2ae..af5b120d9393 100644 --- a/flang/lib/Semantics/semantics.cpp +++ b/flang/lib/Semantics/semantics.cpp @@ -45,17 +45,17 @@ namespace Fortran::semantics { -using NameToSymbolMap = std::map; +using NameToSymbolMap = std::multimap; static void DoDumpSymbols(llvm::raw_ostream &, const Scope &, int indent = 0); static void PutIndent(llvm::raw_ostream &, int indent); static void GetSymbolNames(const Scope &scope, NameToSymbolMap &symbols) { // Finds all symbol names in the scope without collecting duplicates. for (const auto &pair : scope) { - symbols.emplace(pair.second->name().begin(), *pair.second); + symbols.emplace(pair.second->name(), *pair.second); } for (const auto &pair : scope.commonBlocks()) { - symbols.emplace(pair.second->name().begin(), *pair.second); + symbols.emplace(pair.second->name(), *pair.second); } for (const auto &child : scope.children()) { GetSymbolNames(child, symbols); diff --git a/flang/test/Semantics/getsymbols01.f90 b/flang/test/Semantics/getsymbols01.f90 index 8f50304825dc..bdb7bf053823 100644 --- a/flang/test/Semantics/getsymbols01.f90 +++ b/flang/test/Semantics/getsymbols01.f90 @@ -16,10 +16,10 @@ recursive pure function f() result(x) end module ! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s +! CHECK-COUNT-1:f:{{.*}}getsymbols01.f90, 12, 26-27 ! CHECK-COUNT-1:mm1:{{.*}}getsymbols01.f90, 2, 8-11 ! CHECK-COUNT-1:s:{{.*}}getsymbols01.f90, 5, 18-19 -! CHECK-COUNT-1:x:{{.*}}getsymbols01.f90, 5, 21-22 -! CHECK-COUNT-1:y:{{.*}}getsymbols01.f90, 5, 24-25 ! CHECK-COUNT-1:ss:{{.*}}getsymbols01.f90, 9, 19-21 -! CHECK-COUNT-1:f:{{.*}}getsymbols01.f90, 12, 26-27 +! CHECK-COUNT-1:x:{{.*}}getsymbols01.f90, 5, 21-22 ! CHECK-COUNT-1:x:{{.*}}getsymbols01.f90, 13, 24-25 +! CHECK-COUNT-1:y:{{.*}}getsymbols01.f90, 5, 24-25 diff --git a/flang/test/Semantics/getsymbols02.f90 b/flang/test/Semantics/getsymbols02.f90 index 4c8f0710eb23..1eed3e922e82 100644 --- a/flang/test/Semantics/getsymbols02.f90 +++ b/flang/test/Semantics/getsymbols02.f90 @@ -10,5 +10,5 @@ PROGRAM helloworld ! RUN: %f18 -fparse-only %S/Inputs/getsymbols02-a.f90 ! RUN: %f18 -fparse-only %S/Inputs/getsymbols02-b.f90 ! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s -! CHECK: get5: mm2a ! CHECK: callget5: mm2b +! CHECK: get5: mm2a diff --git a/flang/test/Semantics/getsymbols03-a.f90 b/flang/test/Semantics/getsymbols03-a.f90 index c11aee03048c..980d6bc58c1a 100644 --- a/flang/test/Semantics/getsymbols03-a.f90 +++ b/flang/test/Semantics/getsymbols03-a.f90 @@ -8,7 +8,7 @@ program main end program ! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s -! CHECK:mm3:{{.*}}getsymbols03-b.f90, 1, 8-11 ! CHECK:f:{{.*}}getsymbols03-b.f90, 2, 12-13 ! CHECK:main:{{.*}}getsymbols03-a.f90, 4, 9-13 +! CHECK:mm3:{{.*}}getsymbols03-b.f90, 1, 8-11 ! CHECK:x:{{.*}}getsymbols03-a.f90, 6, 13-14 diff --git a/flang/test/Semantics/getsymbols04.f90 b/flang/test/Semantics/getsymbols04.f90 index 4decfc78560a..fc9b177abd90 100644 --- a/flang/test/Semantics/getsymbols04.f90 +++ b/flang/test/Semantics/getsymbols04.f90 @@ -8,5 +8,5 @@ program main ! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s ! CHECK:x:{{.*}}getsymbols04.f90, 3, 14-15 -! CHECK:y:{{.*}}getsymbols04.f90, 4, 14-15 ! CHECK:x:{{.*}}getsymbols04.f90, 5, 11-12 +! CHECK:y:{{.*}}getsymbols04.f90, 4, 14-15 diff --git a/flang/test/Semantics/getsymbols05.f90 b/flang/test/Semantics/getsymbols05.f90 index 30dcb2278e00..624f37a74b76 100644 --- a/flang/test/Semantics/getsymbols05.f90 +++ b/flang/test/Semantics/getsymbols05.f90 @@ -11,5 +11,5 @@ program main ! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s ! CHECK:x:{{.*}}getsymbols05.f90, 3, 14-15 -! CHECK:y:{{.*}}getsymbols05.f90, 4, 14-15 ! CHECK:x:{{.*}}getsymbols05.f90, 6, 16-17 +! CHECK:y:{{.*}}getsymbols05.f90, 4, 14-15 From ecde200209f82b7362277ea59ad84df66c42dd3b Mon Sep 17 00:00:00 2001 From: Dmitry Preobrazhensky Date: Wed, 2 Sep 2020 19:42:18 +0300 Subject: [PATCH 22/26] [AMDGPU][MC] Corrected parser to avoid generation of excessive error messages Summary of changes: - Changed parser to eliminate generation of excessive error messages; - Corrected lit tests to match all expected error messages; - Corrected lit tests to guard against unwanted extra messages (added option "--implicit-check-not=error:"); - Added missing checks and fixed some typos in tests. See bug 46907: https://bugs.llvm.org/show_bug.cgi?id=46907 Reviewers: arsenm, rampitec Differential Revision: https://reviews.llvm.org/D86940 --- .../AMDGPU/AsmParser/AMDGPUAsmParser.cpp | 141 ++-- llvm/lib/Target/AMDGPU/SIDefines.h | 3 +- llvm/test/MC/AMDGPU/add-sub-no-carry.s | 4 +- llvm/test/MC/AMDGPU/atomic-fadd-insts.s | 2 +- llvm/test/MC/AMDGPU/buf-fmt-d16-packed.s | 2 +- llvm/test/MC/AMDGPU/buf-fmt-d16-unpacked.s | 4 +- llvm/test/MC/AMDGPU/dl-insts-err.s | 102 +-- llvm/test/MC/AMDGPU/dpp-err.s | 28 +- llvm/test/MC/AMDGPU/ds-err.s | 16 +- llvm/test/MC/AMDGPU/ds-gfx9.s | 2 +- llvm/test/MC/AMDGPU/ds.s | 10 +- llvm/test/MC/AMDGPU/exp-err.s | 4 +- llvm/test/MC/AMDGPU/exp-gfx10.s | 4 +- llvm/test/MC/AMDGPU/expressions-gfx10.s | 2 +- llvm/test/MC/AMDGPU/expressions-gfx9.s | 2 +- llvm/test/MC/AMDGPU/expressions.s | 10 +- llvm/test/MC/AMDGPU/flat-gfx10.s | 2 +- llvm/test/MC/AMDGPU/flat-gfx9.s | 4 +- llvm/test/MC/AMDGPU/flat-global.s | 106 +-- .../MC/AMDGPU/flat-scratch-instructions.s | 62 +- llvm/test/MC/AMDGPU/flat-scratch.s | 6 +- llvm/test/MC/AMDGPU/flat.s | 188 ++--- llvm/test/MC/AMDGPU/fma-mix.s | 34 +- llvm/test/MC/AMDGPU/gfx10-constant-bus.s | 4 +- llvm/test/MC/AMDGPU/gfx1011_err.s | 36 +- llvm/test/MC/AMDGPU/gfx1030_err.s | 96 +-- llvm/test/MC/AMDGPU/gfx10_asm_all.s | 4 +- llvm/test/MC/AMDGPU/gfx10_asm_dpp16.s | 4 +- llvm/test/MC/AMDGPU/gfx10_asm_dpp8.s | 4 +- llvm/test/MC/AMDGPU/gfx10_asm_err.s | 14 +- llvm/test/MC/AMDGPU/gfx10_asm_mimg_err.s | 2 +- llvm/test/MC/AMDGPU/gfx8_asm_all.s | 2 +- llvm/test/MC/AMDGPU/gfx9-asm-err.s | 2 +- llvm/test/MC/AMDGPU/gfx9-vop2be-literal.s | 2 +- llvm/test/MC/AMDGPU/gfx9_asm_all.s | 2 +- .../AMDGPU/invalid-instructions-spellcheck.s | 4 - llvm/test/MC/AMDGPU/lds_direct-err.s | 2 +- llvm/test/MC/AMDGPU/lds_direct-gfx10.s | 2 +- llvm/test/MC/AMDGPU/literal16-err.s | 2 +- llvm/test/MC/AMDGPU/literals.s | 101 +-- llvm/test/MC/AMDGPU/literalv216-err.s | 7 +- llvm/test/MC/AMDGPU/literalv216.s | 4 +- llvm/test/MC/AMDGPU/mad-mix.s | 36 +- llvm/test/MC/AMDGPU/mai-err.s | 177 ++++- llvm/test/MC/AMDGPU/mai.s | 2 +- llvm/test/MC/AMDGPU/mimg-err.s | 6 +- llvm/test/MC/AMDGPU/mimg.s | 14 +- llvm/test/MC/AMDGPU/mtbuf-gfx10.s | 2 +- llvm/test/MC/AMDGPU/mtbuf.s | 6 +- llvm/test/MC/AMDGPU/mubuf-gfx9.s | 22 +- llvm/test/MC/AMDGPU/mubuf.s | 6 +- llvm/test/MC/AMDGPU/out-of-range-registers.s | 20 +- llvm/test/MC/AMDGPU/reg-syntax-err.s | 42 +- llvm/test/MC/AMDGPU/reg-syntax-extra.s | 74 +- llvm/test/MC/AMDGPU/regression/bug28538.s | 12 +- llvm/test/MC/AMDGPU/smem-err.s | 2 +- llvm/test/MC/AMDGPU/smem.s | 159 +++-- llvm/test/MC/AMDGPU/smrd-err.s | 11 +- llvm/test/MC/AMDGPU/smrd.s | 6 +- llvm/test/MC/AMDGPU/sop1-err.s | 6 +- llvm/test/MC/AMDGPU/sop1.s | 86 ++- llvm/test/MC/AMDGPU/sop2-err.s | 2 +- llvm/test/MC/AMDGPU/sop2.s | 102 ++- llvm/test/MC/AMDGPU/sopc-err.s | 2 +- llvm/test/MC/AMDGPU/sopc.s | 34 +- llvm/test/MC/AMDGPU/sopk-err.s | 67 +- llvm/test/MC/AMDGPU/sopk.s | 8 +- llvm/test/MC/AMDGPU/sopp-err.s | 19 +- llvm/test/MC/AMDGPU/sopp.s | 12 +- llvm/test/MC/AMDGPU/trap.s | 8 +- llvm/test/MC/AMDGPU/vintrp-err.s | 4 +- llvm/test/MC/AMDGPU/vop-err.s | 4 +- llvm/test/MC/AMDGPU/vop1-gfx9-err.s | 6 +- llvm/test/MC/AMDGPU/vop1-gfx9.s | 6 +- llvm/test/MC/AMDGPU/vop1.s | 8 +- llvm/test/MC/AMDGPU/vop2-err.s | 4 +- llvm/test/MC/AMDGPU/vop2.s | 8 +- llvm/test/MC/AMDGPU/vop3-convert.s | 8 +- llvm/test/MC/AMDGPU/vop3-errs.s | 8 +- llvm/test/MC/AMDGPU/vop3-gfx9.s | 281 ++++++-- llvm/test/MC/AMDGPU/vop3-literal.s | 31 +- llvm/test/MC/AMDGPU/vop3-modifiers-err.s | 2 +- llvm/test/MC/AMDGPU/vop3.s | 67 +- llvm/test/MC/AMDGPU/vop3p-err.s | 10 +- llvm/test/MC/AMDGPU/vop_dpp.s | 320 ++++----- llvm/test/MC/AMDGPU/vop_sdwa.s | 648 +++++++++--------- llvm/test/MC/AMDGPU/vopc-errs.s | 6 +- llvm/test/MC/AMDGPU/vopc-vi.s | 4 +- llvm/test/MC/AMDGPU/wave32.s | 4 +- llvm/test/MC/AMDGPU/xdl-insts-err.s | 4 +- llvm/test/MC/AMDGPU/xnack-mask.s | 10 +- 91 files changed, 2026 insertions(+), 1392 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp index 2833875e438c..db74f8a54c0a 100644 --- a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp +++ b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp @@ -1340,7 +1340,6 @@ class AMDGPUAsmParser : public MCTargetAsmParser { const int64_t Width, const SMLoc Loc); - void errorExpTgt(); OperandMatchResultTy parseExpTgtImpl(StringRef Str, uint8_t &Val); SMLoc getFlatOffsetLoc(const OperandVector &Operands) const; SMLoc getSMEMOffsetLoc(const OperandVector &Operands) const; @@ -4705,22 +4704,18 @@ bool AMDGPUAsmParser::ParseInstruction(ParseInstructionInfo &Info, if (getLexer().is(AsmToken::Comma)) Parser.Lex(); - switch (Res) { - case MatchOperand_Success: break; - case MatchOperand_ParseFail: + if (Res != MatchOperand_Success) { + if (!Parser.hasPendingError()) { // FIXME: use real operand location rather than the current location. - Error(getLexer().getLoc(), "failed parsing operand."); - while (!getLexer().is(AsmToken::EndOfStatement)) { - Parser.Lex(); - } - return true; - case MatchOperand_NoMatch: - // FIXME: use real operand location rather than the current location. - Error(getLexer().getLoc(), "not a valid operand."); - while (!getLexer().is(AsmToken::EndOfStatement)) { - Parser.Lex(); - } - return true; + StringRef Msg = + (Res == MatchOperand_ParseFail) ? "failed parsing operand." : + "not a valid operand."; + Error(getLexer().getLoc(), Msg); + } + while (!getLexer().is(AsmToken::EndOfStatement)) { + Parser.Lex(); + } + return true; } } @@ -5004,8 +4999,10 @@ AMDGPUAsmParser::parseSymbolicSplitFormat(StringRef FormatStr, } if (Dfmt == DFMT_UNDEF) { Error(Loc, "duplicate numeric format"); - } else if (Nfmt == NFMT_UNDEF){ + return MatchOperand_ParseFail; + } else if (Nfmt == NFMT_UNDEF) { Error(Loc, "duplicate data format"); + return MatchOperand_ParseFail; } } @@ -5014,8 +5011,10 @@ AMDGPUAsmParser::parseSymbolicSplitFormat(StringRef FormatStr, if (isGFX10()) { auto Ufmt = convertDfmtNfmt2Ufmt(Dfmt, Nfmt); - if (Ufmt == UFMT_UNDEF) + if (Ufmt == UFMT_UNDEF) { Error(FormatLoc, "unsupported format"); + return MatchOperand_ParseFail; + } Format = Ufmt; } else { Format = encodeDfmtNfmt(Dfmt, Nfmt); @@ -5077,7 +5076,9 @@ AMDGPUAsmParser::parseSymbolicOrNumericFormat(int64_t &Format) { if (Res != MatchOperand_Success) return Res; - skipToken(AsmToken::RBrac, "expected a closing square bracket"); + if (!skipToken(AsmToken::RBrac, "expected a closing square bracket")) + return MatchOperand_ParseFail; + return MatchOperand_Success; } @@ -5119,7 +5120,10 @@ AMDGPUAsmParser::parseFORMAT(OperandVector &Operands) { trySkipToken(AsmToken::Comma); if (!FormatFound) { - if (parseSymbolicOrNumericFormat(Format) == MatchOperand_Success) { + Res = parseSymbolicOrNumericFormat(Format); + if (Res == MatchOperand_ParseFail) + return Res; + if (Res == MatchOperand_Success) { auto Size = Operands.size(); AMDGPUOperand &Op = static_cast(*Operands[Size - 2]); assert(Op.isImm() && Op.getImmTy() == AMDGPUOperand::ImmTyFORMAT); @@ -5340,12 +5344,14 @@ AMDGPUAsmParser::parseSWaitCntOps(OperandVector &Operands) { int64_t Waitcnt = getWaitcntBitMask(ISA); SMLoc S = getLoc(); - // If parse failed, do not return error code - // to avoid excessive error messages. if (isToken(AsmToken::Identifier) && peekToken().is(AsmToken::LParen)) { - while (parseCnt(Waitcnt) && !isToken(AsmToken::EndOfStatement)); + while (!isToken(AsmToken::EndOfStatement)) { + if (!parseCnt(Waitcnt)) + return MatchOperand_ParseFail; + } } else { - parseExpr(Waitcnt); + if (!parseExpr(Waitcnt)) + return MatchOperand_ParseFail; } Operands.push_back(AMDGPUOperand::CreateImm(this, Waitcnt, S)); @@ -5419,8 +5425,6 @@ AMDGPUAsmParser::parseHwreg(OperandVector &Operands) { int64_t ImmVal = 0; SMLoc Loc = getLoc(); - // If parse failed, do not return error code - // to avoid excessive error messages. if (trySkipId("hwreg", AsmToken::LParen)) { OperandInfoTy HwReg(ID_UNKNOWN_); int64_t Offset = OFFSET_DEFAULT_; @@ -5428,10 +5432,16 @@ AMDGPUAsmParser::parseHwreg(OperandVector &Operands) { if (parseHwregBody(HwReg, Offset, Width) && validateHwreg(HwReg, Offset, Width, Loc)) { ImmVal = encodeHwreg(HwReg.Id, Offset, Width); + } else { + return MatchOperand_ParseFail; } } else if (parseExpr(ImmVal)) { - if (ImmVal < 0 || !isUInt<16>(ImmVal)) + if (ImmVal < 0 || !isUInt<16>(ImmVal)) { Error(Loc, "invalid immediate: only 16-bit values are legal"); + return MatchOperand_ParseFail; + } + } else { + return MatchOperand_ParseFail; } Operands.push_back(AMDGPUOperand::CreateImm(this, ImmVal, Loc, AMDGPUOperand::ImmTyHwreg)); @@ -5518,8 +5528,6 @@ AMDGPUAsmParser::parseSendMsgOp(OperandVector &Operands) { int64_t ImmVal = 0; SMLoc Loc = getLoc(); - // If parse failed, do not return error code - // to avoid excessive error messages. if (trySkipId("sendmsg", AsmToken::LParen)) { OperandInfoTy Msg(ID_UNKNOWN_); OperandInfoTy Op(OP_NONE_); @@ -5527,10 +5535,16 @@ AMDGPUAsmParser::parseSendMsgOp(OperandVector &Operands) { if (parseSendMsgBody(Msg, Op, Stream) && validateSendMsg(Msg, Op, Stream, Loc)) { ImmVal = encodeMsg(Msg.Id, Op.Id, Stream.Id); + } else { + return MatchOperand_ParseFail; } } else if (parseExpr(ImmVal)) { - if (ImmVal < 0 || !isUInt<16>(ImmVal)) + if (ImmVal < 0 || !isUInt<16>(ImmVal)) { Error(Loc, "invalid immediate: only 16-bit values are legal"); + return MatchOperand_ParseFail; + } + } else { + return MatchOperand_ParseFail; } Operands.push_back(AMDGPUOperand::CreateImm(this, ImmVal, Loc, AMDGPUOperand::ImmTySendMsg)); @@ -5594,7 +5608,7 @@ OperandMatchResultTy AMDGPUAsmParser::parseInterpAttr(OperandVector &Operands) { Parser.Lex(); if (Attr > 63) { Error(S, "out of bounds attr"); - return MatchOperand_Success; + return MatchOperand_ParseFail; } SMLoc SChan = SMLoc::getFromPointer(Chan.data()); @@ -5610,10 +5624,6 @@ OperandMatchResultTy AMDGPUAsmParser::parseInterpAttr(OperandVector &Operands) { // exp //===----------------------------------------------------------------------===// -void AMDGPUAsmParser::errorExpTgt() { - Error(Parser.getTok().getLoc(), "invalid exp target"); -} - OperandMatchResultTy AMDGPUAsmParser::parseExpTgtImpl(StringRef Str, uint8_t &Val) { if (Str == "null") { @@ -5631,8 +5641,10 @@ OperandMatchResultTy AMDGPUAsmParser::parseExpTgtImpl(StringRef Str, if (Str.getAsInteger(10, Val)) return MatchOperand_ParseFail; - if (Val > 7) - errorExpTgt(); + if (Val > 7) { + Error(getLoc(), "invalid exp target"); + return MatchOperand_ParseFail; + } return MatchOperand_Success; } @@ -5642,8 +5654,10 @@ OperandMatchResultTy AMDGPUAsmParser::parseExpTgtImpl(StringRef Str, if (Str.getAsInteger(10, Val)) return MatchOperand_ParseFail; - if (Val > 4 || (Val == 4 && !isGFX10())) - errorExpTgt(); + if (Val > 4 || (Val == 4 && !isGFX10())) { + Error(getLoc(), "invalid exp target"); + return MatchOperand_ParseFail; + } Val += 12; return MatchOperand_Success; @@ -5659,8 +5673,10 @@ OperandMatchResultTy AMDGPUAsmParser::parseExpTgtImpl(StringRef Str, if (Str.getAsInteger(10, Val)) return MatchOperand_ParseFail; - if (Val >= 32) - errorExpTgt(); + if (Val >= 32) { + Error(getLoc(), "invalid exp target"); + return MatchOperand_ParseFail; + } Val += 32; return MatchOperand_Success; @@ -5671,8 +5687,8 @@ OperandMatchResultTy AMDGPUAsmParser::parseExpTgtImpl(StringRef Str, if (Str.getAsInteger(10, Val)) return MatchOperand_ParseFail; - errorExpTgt(); - return MatchOperand_Success; + Error(getLoc(), "invalid exp target"); + return MatchOperand_ParseFail; } return MatchOperand_NoMatch; @@ -6107,12 +6123,12 @@ int64_t AMDGPUAsmParser::parseGPRIdxMacro() { Error(S, (Imm == 0)? "expected a VGPR index mode or a closing parenthesis" : "expected a VGPR index mode"); - break; + return UNDEF; } if (Imm & Mode) { Error(S, "duplicate VGPR index mode"); - break; + return UNDEF; } Imm |= Mode; @@ -6120,7 +6136,7 @@ int64_t AMDGPUAsmParser::parseGPRIdxMacro() { break; if (!skipToken(AsmToken::Comma, "expected a comma or a closing parenthesis")) - break; + return UNDEF; } return Imm; @@ -6129,6 +6145,8 @@ int64_t AMDGPUAsmParser::parseGPRIdxMacro() { OperandMatchResultTy AMDGPUAsmParser::parseGPRIdxMode(OperandVector &Operands) { + using namespace llvm::AMDGPU::VGPRIndexMode; + int64_t Imm = 0; SMLoc S = Parser.getTok().getLoc(); @@ -6139,15 +6157,16 @@ AMDGPUAsmParser::parseGPRIdxMode(OperandVector &Operands) { Parser.Lex(); Parser.Lex(); - // If parse failed, trigger an error but do not return error code - // to avoid excessive error messages. Imm = parseGPRIdxMacro(); + if (Imm == UNDEF) + return MatchOperand_ParseFail; } else { if (getParser().parseAbsoluteExpression(Imm)) - return MatchOperand_NoMatch; + return MatchOperand_ParseFail; if (Imm < 0 || !isUInt<4>(Imm)) { Error(S, "invalid immediate: only 4-bit values are legal"); + return MatchOperand_ParseFail; } } @@ -6173,22 +6192,22 @@ AMDGPUAsmParser::parseSOppBrTarget(OperandVector &Operands) { if (isRegister() || isModifier()) return MatchOperand_NoMatch; - if (parseExpr(Operands)) { + if (!parseExpr(Operands)) + return MatchOperand_ParseFail; - AMDGPUOperand &Opr = ((AMDGPUOperand &)*Operands[Operands.size() - 1]); - assert(Opr.isImm() || Opr.isExpr()); - SMLoc Loc = Opr.getStartLoc(); + AMDGPUOperand &Opr = ((AMDGPUOperand &)*Operands[Operands.size() - 1]); + assert(Opr.isImm() || Opr.isExpr()); + SMLoc Loc = Opr.getStartLoc(); - // Currently we do not support arbitrary expressions as branch targets. - // Only labels and absolute expressions are accepted. - if (Opr.isExpr() && !Opr.isSymbolRefExpr()) { - Error(Loc, "expected an absolute expression or a label"); - } else if (Opr.isImm() && !Opr.isS16Imm()) { - Error(Loc, "expected a 16-bit signed jump offset"); - } + // Currently we do not support arbitrary expressions as branch targets. + // Only labels and absolute expressions are accepted. + if (Opr.isExpr() && !Opr.isSymbolRefExpr()) { + Error(Loc, "expected an absolute expression or a label"); + } else if (Opr.isImm() && !Opr.isS16Imm()) { + Error(Loc, "expected a 16-bit signed jump offset"); } - return MatchOperand_Success; // avoid excessive error messages + return MatchOperand_Success; } //===----------------------------------------------------------------------===// diff --git a/llvm/lib/Target/AMDGPU/SIDefines.h b/llvm/lib/Target/AMDGPU/SIDefines.h index 58d77f3b224b..d6013baf0f36 100644 --- a/llvm/lib/Target/AMDGPU/SIDefines.h +++ b/llvm/lib/Target/AMDGPU/SIDefines.h @@ -217,7 +217,8 @@ enum EncBits : unsigned { SRC1_ENABLE = 1 << ID_SRC1, SRC2_ENABLE = 1 << ID_SRC2, DST_ENABLE = 1 << ID_DST, - ENABLE_MASK = SRC0_ENABLE | SRC1_ENABLE | SRC2_ENABLE | DST_ENABLE + ENABLE_MASK = SRC0_ENABLE | SRC1_ENABLE | SRC2_ENABLE | DST_ENABLE, + UNDEF = 0xFFFF }; } // namespace VGPRIndexMode diff --git a/llvm/test/MC/AMDGPU/add-sub-no-carry.s b/llvm/test/MC/AMDGPU/add-sub-no-carry.s index 8398199a8956..884d1dd85072 100644 --- a/llvm/test/MC/AMDGPU/add-sub-no-carry.s +++ b/llvm/test/MC/AMDGPU/add-sub-no-carry.s @@ -1,7 +1,7 @@ // RUN: llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck -check-prefixes=GFX9 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji %s 2>&1 | FileCheck -check-prefixes=ERR-SICIVI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck -check-prefixes=ERR-SICIVI %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji %s 2>&1 | FileCheck -check-prefixes=ERR-SICIVI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck -check-prefixes=ERR-SICIVI --implicit-check-not=error: %s // FIXME: pre-gfx9 errors should be more useful diff --git a/llvm/test/MC/AMDGPU/atomic-fadd-insts.s b/llvm/test/MC/AMDGPU/atomic-fadd-insts.s index a0a516e4d772..70014c6fafc4 100644 --- a/llvm/test/MC/AMDGPU/atomic-fadd-insts.s +++ b/llvm/test/MC/AMDGPU/atomic-fadd-insts.s @@ -1,5 +1,5 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx908 -show-encoding %s | FileCheck --check-prefix=GFX908 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx908 -show-encoding %s 2>&1 | FileCheck --check-prefix=GFX908-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx908 %s 2>&1 | FileCheck --check-prefix=GFX908-ERR --implicit-check-not=error: %s buffer_atomic_add_f32 v5, off, s[8:11], s3 offset:4095 // GFX908: encoding: [0xff,0x0f,0x34,0xe1,0x00,0x05,0x02,0x03] diff --git a/llvm/test/MC/AMDGPU/buf-fmt-d16-packed.s b/llvm/test/MC/AMDGPU/buf-fmt-d16-packed.s index 196dcada2ebe..86efb1883339 100644 --- a/llvm/test/MC/AMDGPU/buf-fmt-d16-packed.s +++ b/llvm/test/MC/AMDGPU/buf-fmt-d16-packed.s @@ -1,7 +1,7 @@ // RUN: llvm-mc -arch=amdgcn -mcpu=gfx810 -show-encoding %s | FileCheck -check-prefix=GCN -check-prefix=PACKED %s // RUN: llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck -check-prefix=GCN -check-prefix=PACKED %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding 2>&1 %s | FileCheck -check-prefix=UNPACKED-ERR -check-prefix=GCN-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji 2>&1 %s | FileCheck -check-prefix=UNPACKED-ERR -check-prefix=GCN-ERR --implicit-check-not=error: %s //===----------------------------------------------------------------------===// diff --git a/llvm/test/MC/AMDGPU/buf-fmt-d16-unpacked.s b/llvm/test/MC/AMDGPU/buf-fmt-d16-unpacked.s index 15cfb225b8b5..f8e6407c0548 100644 --- a/llvm/test/MC/AMDGPU/buf-fmt-d16-unpacked.s +++ b/llvm/test/MC/AMDGPU/buf-fmt-d16-unpacked.s @@ -1,6 +1,6 @@ // RUN: llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck -check-prefix=GCN -check-prefix=UNPACKED %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx810 -show-encoding 2>&1 %s | FileCheck -check-prefix=PACKED-ERR -check-prefix=GCN-ERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding 2>&1 %s | FileCheck -check-prefix=PACKED-ERR -check-prefix=GCN-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx810 2>&1 %s | FileCheck -check-prefix=PACKED-ERR -check-prefix=GCN-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 2>&1 %s | FileCheck -check-prefix=PACKED-ERR -check-prefix=GCN-ERR --implicit-check-not=error: %s //===----------------------------------------------------------------------===// diff --git a/llvm/test/MC/AMDGPU/dl-insts-err.s b/llvm/test/MC/AMDGPU/dl-insts-err.s index 3f6d4fd86110..efdf079d8b88 100644 --- a/llvm/test/MC/AMDGPU/dl-insts-err.s +++ b/llvm/test/MC/AMDGPU/dl-insts-err.s @@ -1,7 +1,7 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx800 -show-encoding %s 2>&1 | FileCheck %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx906 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=GFX906-GFX908 -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx908 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=GFX906-GFX908 +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx800 %s 2>&1 | FileCheck %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx906 %s 2>&1 | FileCheck %s --check-prefix=GFX906-GFX908 +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx908 %s 2>&1 | FileCheck %s --check-prefix=GFX906-GFX908 // // Test unsupported GPUs. @@ -44,17 +44,17 @@ v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[] v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[,] // GFX906-GFX908: error: unknown token in expression v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel value. v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[0,2] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel value. v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[2,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel value. v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[2,2] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel value. v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[0,-1] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel value. v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[-1,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel value. v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[-1,-1] // GFX906-GFX908: error: expected a closing square bracket v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[0,0,0,0,0] @@ -72,17 +72,17 @@ v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[] v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[,] // GFX906-GFX908: error: unknown token in expression v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel_hi value. v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[0,2] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel_hi value. v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[2,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel_hi value. v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[2,2] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel_hi value. v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[0,-1] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel_hi value. v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[-1,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel_hi value. v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[-1,-1] // GFX906-GFX908: error: expected a closing square bracket v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[0,0,0,0,0] @@ -100,17 +100,17 @@ v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[] v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[,] // GFX906-GFX908: error: unknown token in expression v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid neg_lo value. v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[0,2] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid neg_lo value. v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[2,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid neg_lo value. v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[2,2] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid neg_lo value. v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[0,-1] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid neg_lo value. v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[-1,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid neg_lo value. v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[-1,-1] // GFX906-GFX908: error: expected a closing square bracket v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[0,0,0,0,0] @@ -128,17 +128,17 @@ v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[] v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[,] // GFX906-GFX908: error: unknown token in expression v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid neg_hi value. v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[0,2] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid neg_hi value. v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[2,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid neg_hi value. v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[2,2] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid neg_hi value. v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[0,-1] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid neg_hi value. v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[-1,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid neg_hi value. v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[-1,-1] // GFX906-GFX908: error: expected a closing square bracket v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[0,0,0,0,0] @@ -156,17 +156,17 @@ v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[] v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[,] // GFX906-GFX908: error: unknown token in expression v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel value. v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[0,2] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel value. v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[2,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel value. v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[2,2] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel value. v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[0,-1] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel value. v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[-1,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel value. v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[-1,-1] // GFX906-GFX908: error: expected a closing square bracket v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[0,0,0,0,0] @@ -184,17 +184,17 @@ v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[] v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[,] // GFX906-GFX908: error: unknown token in expression v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel_hi value. v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[0,2] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel_hi value. v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[2,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel_hi value. v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[2,2] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel_hi value. v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[0,-1] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel_hi value. v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[-1,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel_hi value. v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[-1,-1] // GFX906-GFX908: error: expected a closing square bracket v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[0,0,0,0,0] @@ -216,17 +216,17 @@ v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[] v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[,] // GFX906-GFX908: error: unknown token in expression v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel value. v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[0,2] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel value. v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[2,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel value. v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[2,2] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel value. v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[0,-1] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel value. v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[-1,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel value. v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[-1,-1] // GFX906-GFX908: error: expected a closing square bracket v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[0,0,0,0,0] @@ -246,15 +246,15 @@ v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[,] v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[,0] // GFX906-GFX908: error: invalid op_sel_hi value v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[0,2] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel_hi value. v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[2,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel_hi value. v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[2,2] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel_hi value. v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[0,-1] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel_hi value. v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[-1,0] -// GFX906-GFX908: error: failed parsing operand +// GFX906-GFX908: error: invalid op_sel_hi value. v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[-1,-1] // GFX906-GFX908: error: expected a closing square bracket v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[0,0,0,0,0] diff --git a/llvm/test/MC/AMDGPU/dpp-err.s b/llvm/test/MC/AMDGPU/dpp-err.s index a3ab0f38abf7..19d896d82d59 100644 --- a/llvm/test/MC/AMDGPU/dpp-err.s +++ b/llvm/test/MC/AMDGPU/dpp-err.s @@ -1,38 +1,38 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding < %s 2>&1 | FileCheck -check-prefix=GFX89 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding < %s 2>&1 | FileCheck -check-prefix=GFX89 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding < %s 2>&1 | FileCheck -check-prefix=GFX10 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding < %s 2>&1 | FileCheck -check-prefix=GFX89-ERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding < %s 2>&1 | FileCheck -check-prefix=GFX89-ERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding < %s 2>&1 | FileCheck -check-prefix=GFX10-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck -check-prefix=GFX89 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck -check-prefix=GFX89 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s | FileCheck -check-prefix=GFX10 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=GFX89-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefix=GFX89-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck -check-prefix=GFX10-ERR --implicit-check-not=error: %s v_mov_b32_dpp v0, v1 row_share:1 row_mask:0x1 bank_mask:0x1 -// GFX89-ERR: not a valid operand. +// GFX89-ERR: error: not a valid operand. // GFX10: v_mov_b32_dpp v0, v1 row_share:1 row_mask:0x1 bank_mask:0x1 ; encoding: [0xfa,0x02,0x00,0x7e,0x01,0x51,0x01,0x11] v_mov_b32_dpp v0, v1 row_xmask:1 row_mask:0x1 bank_mask:0x1 -// GFX89-ERR: not a valid operand. +// GFX89-ERR: error: not a valid operand. // GFX10: v_mov_b32_dpp v0, v1 row_xmask:1 row_mask:0x1 bank_mask:0x1 ; encoding: [0xfa,0x02,0x00,0x7e,0x01,0x61,0x01,0x11] v_mov_b32_dpp v0, v1 wave_shl:1 row_mask:0x1 bank_mask:0x1 // GFX89: v0, v1 wave_shl:1 row_mask:0x1 bank_mask:0x1 ; encoding: [0xfa,0x02,0x00,0x7e,0x01,0x30,0x01,0x11] -// GFX10-ERR: not a valid operand. +// GFX10-ERR: error: not a valid operand. v_mov_b32_dpp v0, v1 wave_shr:1 row_mask:0x1 bank_mask:0x1 // GFX89: v0, v1 wave_shr:1 row_mask:0x1 bank_mask:0x1 ; encoding: [0xfa,0x02,0x00,0x7e,0x01,0x38,0x01,0x11] -// GFX10-ERR: not a valid operand. +// GFX10-ERR: error: not a valid operand. v_mov_b32_dpp v0, v1 wave_rol:1 row_mask:0x1 bank_mask:0x1 // GFX89: v0, v1 wave_rol:1 row_mask:0x1 bank_mask:0x1 ; encoding: [0xfa,0x02,0x00,0x7e,0x01,0x34,0x01,0x11] -// GFX10-ERR: not a valid operand. +// GFX10-ERR: error: not a valid operand. v_mov_b32_dpp v0, v1 wave_ror:1 row_mask:0x1 bank_mask:0x1 // GFX89: v0, v1 wave_ror:1 row_mask:0x1 bank_mask:0x1 ; encoding: [0xfa,0x02,0x00,0x7e,0x01,0x3c,0x01,0x11] -// GFX10-ERR: not a valid operand. +// GFX10-ERR: error: not a valid operand. v_mov_b32_dpp v0, v1 row_bcast:15 row_mask:0x1 bank_mask:0x1 // GFX89: v0, v1 row_bcast:15 row_mask:0x1 bank_mask:0x1 ; encoding: [0xfa,0x02,0x00,0x7e,0x01,0x42,0x01,0x11] -// GFX10-ERR: not a valid operand. +// GFX10-ERR: error: not a valid operand. v_mov_b32_dpp v0, v1 row_bcast:31 row_mask:0x1 bank_mask:0x1 // GFX89: v0, v1 row_bcast:31 row_mask:0x1 bank_mask:0x1 ; encoding: [0xfa,0x02,0x00,0x7e,0x01,0x43,0x01,0x11] -// GFX10-ERR: not a valid operand. +// GFX10-ERR: error: not a valid operand. diff --git a/llvm/test/MC/AMDGPU/ds-err.s b/llvm/test/MC/AMDGPU/ds-err.s index 7ed4080246a0..507bcbc1c4da 100644 --- a/llvm/test/MC/AMDGPU/ds-err.s +++ b/llvm/test/MC/AMDGPU/ds-err.s @@ -1,5 +1,5 @@ -// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck --implicit-check-not=error: %s // offset too big // CHECK: error: invalid operand for instruction @@ -18,19 +18,19 @@ ds_write2_b32 v2, v4, v6 offset0:4 offset0:8 ds_write2_b32 v2, v4, v6 offset1:4 offset1:8 // offset0 too big -// CHECK: invalid operand for instruction +// CHECK: error: invalid operand for instruction ds_write2_b32 v2, v4, v6 offset0:1000000000 // offset0 too big -// CHECK: invalid operand for instruction +// CHECK: error: invalid operand for instruction ds_write2_b32 v2, v4, v6 offset0:0x100 // offset1 too big -// CHECK: invalid operand for instruction +// CHECK: error: invalid operand for instruction ds_write2_b32 v2, v4, v6 offset1:1000000000 // offset1 too big -// CHECK: invalid operand for instruction +// CHECK: error: invalid operand for instruction ds_write2_b32 v2, v4, v6 offset1:0x100 //===----------------------------------------------------------------------===// @@ -40,7 +40,7 @@ ds_write2_b32 v2, v4, v6 offset1:0x100 // CHECK: error: expected a colon ds_swizzle_b32 v8, v2 offset -// CHECK: error: failed parsing operand +// CHECK: error: unknown token in expression ds_swizzle_b32 v8, v2 offset: // CHECK: error: expected a colon @@ -121,5 +121,5 @@ ds_swizzle_b32 v8, v2 offset:swizzle(BITMASK_PERM, "ppii") // CHECK: error: expected a 5-character mask ds_swizzle_b32 v8, v2 offset:swizzle(BITMASK_PERM, "pppiii") -// CHECK: invalid mask +// CHECK: error: invalid mask ds_swizzle_b32 v8, v2 offset:swizzle(BITMASK_PERM, "pppi2") diff --git a/llvm/test/MC/AMDGPU/ds-gfx9.s b/llvm/test/MC/AMDGPU/ds-gfx9.s index 810ccb018e85..2ed2f953b0ca 100644 --- a/llvm/test/MC/AMDGPU/ds-gfx9.s +++ b/llvm/test/MC/AMDGPU/ds-gfx9.s @@ -1,5 +1,5 @@ // RUN: llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck -check-prefix=GFX9 -check-prefix=GCN %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding 2>&1 %s | FileCheck -check-prefix=VI-ERR -check-prefix=GCNERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga 2>&1 %s | FileCheck -check-prefix=VI-ERR -check-prefix=GCNERR --implicit-check-not=error: %s ds_read_u8_d16 v8, v2 // GFX9: ds_read_u8_d16 v8, v2 ; encoding: [0x00,0x00,0xac,0xd8,0x02,0x00,0x00,0x08] diff --git a/llvm/test/MC/AMDGPU/ds.s b/llvm/test/MC/AMDGPU/ds.s index 70f52972a81c..25c3cdd38830 100644 --- a/llvm/test/MC/AMDGPU/ds.s +++ b/llvm/test/MC/AMDGPU/ds.s @@ -3,9 +3,9 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s | FileCheck %s --check-prefix=CI --check-prefix=SICI // RUN: llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck %s --check-prefix=VI -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOCI --check-prefix=NOSICI +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck %s --check-prefix=NOCI --check-prefix=NOSICI --implicit-check-not=error: //===----------------------------------------------------------------------===// // Checks for 16-bit Offsets @@ -16,11 +16,11 @@ ds_add_u32 v2, v4 offset:16 // VI: ds_add_u32 v2, v4 offset:16 ; encoding: [0x10,0x00,0x00,0xd8,0x02,0x04,0x00,0x00] ds_add_src2_f32 v255 offset:65535 -// NOSICI: error +// NOSICI: error: not a valid operand. // VI: ds_add_src2_f32 v255 offset:65535 ; encoding: [0xff,0xff,0x2a,0xd9,0xff,0x00,0x00,0x00] ds_add_src2_f32 v0 offset:4 gds -// NOSICI: error +// NOSICI: error: not a valid operand. // VI: ds_add_src2_f32 v0 offset:4 gds ; encoding: [0x04,0x00,0x2b,0xd9,0x00,0x00,0x00,0x00] //===----------------------------------------------------------------------===// diff --git a/llvm/test/MC/AMDGPU/exp-err.s b/llvm/test/MC/AMDGPU/exp-err.s index 22d3edf0e031..b3494a11fa08 100644 --- a/llvm/test/MC/AMDGPU/exp-err.s +++ b/llvm/test/MC/AMDGPU/exp-err.s @@ -1,5 +1,5 @@ -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck -check-prefix=GCN %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck -check-prefix=GCN %s +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck -check-prefix=GCN --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=GCN --implicit-check-not=error: %s exp mrt8 v3, v2, v1, v0 // GCN: :5: error: invalid exp target diff --git a/llvm/test/MC/AMDGPU/exp-gfx10.s b/llvm/test/MC/AMDGPU/exp-gfx10.s index e207c5f0ede3..2a02cef542ee 100644 --- a/llvm/test/MC/AMDGPU/exp-gfx10.s +++ b/llvm/test/MC/AMDGPU/exp-gfx10.s @@ -1,5 +1,5 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=verde -show-encoding %s 2>&1 | FileCheck -check-prefix=SI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck -check-prefix=VI %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=verde %s 2>&1 | FileCheck -check-prefix=SI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=VI --implicit-check-not=error: %s // RUN: llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s | FileCheck -check-prefix=GFX10 %s exp prim v1, off, off, off diff --git a/llvm/test/MC/AMDGPU/expressions-gfx10.s b/llvm/test/MC/AMDGPU/expressions-gfx10.s index b3f051b819b7..8c413879a3c0 100644 --- a/llvm/test/MC/AMDGPU/expressions-gfx10.s +++ b/llvm/test/MC/AMDGPU/expressions-gfx10.s @@ -1,5 +1,5 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 -show-encoding %s | FileCheck %s --check-prefix=GFX10 -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 %s 2>&1 | FileCheck -check-prefix=NOGFX10 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 %s 2>&1 | FileCheck -check-prefix=NOGFX10 --implicit-check-not=error: %s i1=1 diff --git a/llvm/test/MC/AMDGPU/expressions-gfx9.s b/llvm/test/MC/AMDGPU/expressions-gfx9.s index a52887596af6..5419c8ed5cb9 100644 --- a/llvm/test/MC/AMDGPU/expressions-gfx9.s +++ b/llvm/test/MC/AMDGPU/expressions-gfx9.s @@ -1,5 +1,5 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck %s --check-prefix=GFX9 -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGFX9 +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck %s --check-prefix=NOGFX9 --implicit-check-not=error: //===----------------------------------------------------------------------===// // Relocatable expressions cannot be used with SDWA modifiers. diff --git a/llvm/test/MC/AMDGPU/expressions.s b/llvm/test/MC/AMDGPU/expressions.s index 37fe08a52d1b..57f47d8f0345 100644 --- a/llvm/test/MC/AMDGPU/expressions.s +++ b/llvm/test/MC/AMDGPU/expressions.s @@ -1,5 +1,5 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck %s --check-prefix=VI -// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOVI +// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji %s 2>&1 | FileCheck %s --check-prefix=NOVI --implicit-check-not=error: //===----------------------------------------------------------------------===// // Floating-point expressions are not supported @@ -52,10 +52,10 @@ v_mad_f16 v5, v1, v2, |hm1| // Only primary expressions are allowed v_ceil_f32 v1, |1+i1| -// NOVI: failed parsing operand +// NOVI: error: expected vertical bar v_ceil_f32 v1, |i1+1| -// NOVI: failed parsing operand +// NOVI: error: expected vertical bar //===----------------------------------------------------------------------===// // Constant expressions may be used with 'abs' and 'neg' modifiers. @@ -327,8 +327,8 @@ v_sin_f32 v0, -[ttmp0] s1000=1 v_sin_f32 v0, -s1000 -// NOVI: failed parsing operand +// NOVI: error: not a valid operand. xnack_mask_lo=1 v_sin_f32 v0, xnack_mask_lo -// NOVI: failed parsing operand +// NOVI: error: not a valid operand. diff --git a/llvm/test/MC/AMDGPU/flat-gfx10.s b/llvm/test/MC/AMDGPU/flat-gfx10.s index bf728d1618be..90229630cfe7 100644 --- a/llvm/test/MC/AMDGPU/flat-gfx10.s +++ b/llvm/test/MC/AMDGPU/flat-gfx10.s @@ -1,5 +1,5 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s | FileCheck --check-prefixes=GFX10,W32 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GFX10-ERR,W32-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck --check-prefixes=GFX10-ERR,W32-ERR --implicit-check-not=error: %s flat_load_dword v1, v[3:4] // GFX10: encoding: [0x00,0x00,0x30,0xdc,0x03,0x00,0x7d,0x01] diff --git a/llvm/test/MC/AMDGPU/flat-gfx9.s b/llvm/test/MC/AMDGPU/flat-gfx9.s index bb6839a9b13f..f0aff08fe6db 100644 --- a/llvm/test/MC/AMDGPU/flat-gfx9.s +++ b/llvm/test/MC/AMDGPU/flat-gfx9.s @@ -1,8 +1,8 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck -check-prefix=GFX9 -check-prefix=GCN %s // RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck -check-prefix=VI -check-prefix=GCN %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding 2>&1 %s | FileCheck -check-prefix=GFX9-ERR -check-prefix=GCNERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding 2>&1 %s | FileCheck -check-prefix=VI-ERR -check-prefix=GCNERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 2>&1 %s | FileCheck -check-prefix=GFX9-ERR -check-prefix=GCNERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga 2>&1 %s | FileCheck -check-prefix=VI-ERR -check-prefix=GCNERR --implicit-check-not=error: %s flat_load_dword v1, v[3:4] offset:0 diff --git a/llvm/test/MC/AMDGPU/flat-global.s b/llvm/test/MC/AMDGPU/flat-global.s index b771073407fe..7a1d3333fb73 100644 --- a/llvm/test/MC/AMDGPU/flat-global.s +++ b/llvm/test/MC/AMDGPU/flat-global.s @@ -1,14 +1,14 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck -check-prefix=GFX9 -check-prefix=GCN %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding 2>&1 %s | FileCheck -check-prefix=GFX9-ERR -check-prefix=GCNERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding 2>&1 %s | FileCheck -check-prefix=VI-ERR -check-prefix=GCNERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 2>&1 %s | FileCheck -check-prefix=GFX9-ERR -check-prefix=GCNERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga 2>&1 %s | FileCheck -check-prefix=VI-ERR -check-prefix=GCNERR --implicit-check-not=error: %s // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s | FileCheck --check-prefixes=GFX10 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GFX10-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck --check-prefixes=GFX10-ERR --implicit-check-not=error: %s global_load_ubyte v1, v[3:4], off // GFX10: encoding: [0x00,0x80,0x20,0xdc,0x03,0x00,0x7d,0x01] // GFX9: global_load_ubyte v1, v[3:4], off ; encoding: [0x00,0x80,0x40,0xdc,0x03,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_load_ubyte v1, v[3:4], off dlc // GFX10: encoding: [0x00,0x90,0x20,0xdc,0x03,0x00,0x7d,0x01] @@ -18,7 +18,7 @@ global_load_ubyte v1, v[3:4], off dlc global_load_sbyte v1, v[3:4], off // GFX10: encoding: [0x00,0x80,0x24,0xdc,0x03,0x00,0x7d,0x01] // GFX9: global_load_sbyte v1, v[3:4], off ; encoding: [0x00,0x80,0x44,0xdc,0x03,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_load_sbyte v1, v[3:4], off dlc // GFX10: encoding: [0x00,0x90,0x24,0xdc,0x03,0x00,0x7d,0x01] @@ -28,7 +28,7 @@ global_load_sbyte v1, v[3:4], off dlc global_load_ushort v1, v[3:4], off // GFX10: encoding: [0x00,0x80,0x28,0xdc,0x03,0x00,0x7d,0x01] // GFX9: global_load_ushort v1, v[3:4], off ; encoding: [0x00,0x80,0x48,0xdc,0x03,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_load_ushort v1, v[3:4], off dlc // GFX10: encoding: [0x00,0x90,0x28,0xdc,0x03,0x00,0x7d,0x01] @@ -38,7 +38,7 @@ global_load_ushort v1, v[3:4], off dlc global_load_sshort v1, v[3:4], off // GFX10: encoding: [0x00,0x80,0x2c,0xdc,0x03,0x00,0x7d,0x01] // GFX9: global_load_sshort v1, v[3:4], off ; encoding: [0x00,0x80,0x4c,0xdc,0x03,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_load_sshort v1, v[3:4], off dlc // GFX10: encoding: [0x00,0x90,0x2c,0xdc,0x03,0x00,0x7d,0x01] @@ -48,7 +48,7 @@ global_load_sshort v1, v[3:4], off dlc global_load_dword v1, v[3:4], off // GFX10: encoding: [0x00,0x80,0x30,0xdc,0x03,0x00,0x7d,0x01] // GFX9: global_load_dword v1, v[3:4], off ; encoding: [0x00,0x80,0x50,0xdc,0x03,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_load_dword v1, v[3:4], off dlc // GFX10: encoding: [0x00,0x90,0x30,0xdc,0x03,0x00,0x7d,0x01] @@ -58,7 +58,7 @@ global_load_dword v1, v[3:4], off dlc global_load_dwordx2 v[1:2], v[3:4], off // GFX10: encoding: [0x00,0x80,0x34,0xdc,0x03,0x00,0x7d,0x01] // GFX9: global_load_dwordx2 v[1:2], v[3:4], off ; encoding: [0x00,0x80,0x54,0xdc,0x03,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_load_dwordx2 v[1:2], v[3:4], off dlc // GFX10: encoding: [0x00,0x90,0x34,0xdc,0x03,0x00,0x7d,0x01] @@ -68,7 +68,7 @@ global_load_dwordx2 v[1:2], v[3:4], off dlc global_load_dwordx3 v[1:3], v[3:4], off // GFX10: encoding: [0x00,0x80,0x3c,0xdc,0x03,0x00,0x7d,0x01] // GFX9: global_load_dwordx3 v[1:3], v[3:4], off ; encoding: [0x00,0x80,0x58,0xdc,0x03,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_load_dwordx3 v[1:3], v[3:4], off dlc // GFX10: encoding: [0x00,0x90,0x3c,0xdc,0x03,0x00,0x7d,0x01] @@ -78,7 +78,7 @@ global_load_dwordx3 v[1:3], v[3:4], off dlc global_load_dwordx4 v[1:4], v[3:4], off // GFX10: encoding: [0x00,0x80,0x38,0xdc,0x03,0x00,0x7d,0x01] // GFX9: global_load_dwordx4 v[1:4], v[3:4], off ; encoding: [0x00,0x80,0x5c,0xdc,0x03,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_load_dwordx4 v[1:4], v[3:4], off dlc // GFX10: encoding: [0x00,0x90,0x38,0xdc,0x03,0x00,0x7d,0x01] @@ -119,7 +119,7 @@ global_load_dword v1, v[3:4] off, offset:-4097 global_store_byte v[3:4], v1, off // GFX10: encoding: [0x00,0x80,0x60,0xdc,0x03,0x01,0x7d,0x00] // GFX9: global_store_byte v[3:4], v1, off ; encoding: [0x00,0x80,0x60,0xdc,0x03,0x01,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_store_byte v[3:4], v1, off dlc // GFX10: encoding: [0x00,0x90,0x60,0xdc,0x03,0x01,0x7d,0x00] @@ -129,7 +129,7 @@ global_store_byte v[3:4], v1, off dlc global_store_short v[3:4], v1, off // GFX10: encoding: [0x00,0x80,0x68,0xdc,0x03,0x01,0x7d,0x00] // GFX9: global_store_short v[3:4], v1, off ; encoding: [0x00,0x80,0x68,0xdc,0x03,0x01,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_store_short v[3:4], v1, off dlc // GFX10: encoding: [0x00,0x90,0x68,0xdc,0x03,0x01,0x7d,0x00] @@ -139,7 +139,7 @@ global_store_short v[3:4], v1, off dlc global_store_dword v[3:4], v1, off // GFX10: encoding: [0x00,0x80,0x70,0xdc,0x03,0x01,0x7d,0x00] // GFX9: global_store_dword v[3:4], v1, off ; encoding: [0x00,0x80,0x70,0xdc,0x03,0x01,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_store_dword v[3:4], v1, off dlc // GFX10: encoding: [0x00,0x90,0x70,0xdc,0x03,0x01,0x7d,0x00] @@ -149,7 +149,7 @@ global_store_dword v[3:4], v1, off dlc global_store_dwordx2 v[3:4], v[1:2], off // GFX10: encoding: [0x00,0x80,0x74,0xdc,0x03,0x01,0x7d,0x00] // GFX9: global_store_dwordx2 v[3:4], v[1:2], off ; encoding: [0x00,0x80,0x74,0xdc,0x03,0x01,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_store_dwordx2 v[3:4], v[1:2], off dlc // GFX10: encoding: [0x00,0x90,0x74,0xdc,0x03,0x01,0x7d,0x00] @@ -159,7 +159,7 @@ global_store_dwordx2 v[3:4], v[1:2], off dlc global_store_dwordx3 v[3:4], v[1:3], off // GFX10: encoding: [0x00,0x80,0x7c,0xdc,0x03,0x01,0x7d,0x00] // GFX9: global_store_dwordx3 v[3:4], v[1:3], off ; encoding: [0x00,0x80,0x78,0xdc,0x03,0x01,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_store_dwordx3 v[3:4], v[1:3], off dlc // GFX10: encoding: [0x00,0x90,0x7c,0xdc,0x03,0x01,0x7d,0x00] @@ -169,7 +169,7 @@ global_store_dwordx3 v[3:4], v[1:3], off dlc global_store_dwordx4 v[3:4], v[1:4], off // GFX10: encoding: [0x00,0x80,0x78,0xdc,0x03,0x01,0x7d,0x00] // GFX9: global_store_dwordx4 v[3:4], v[1:4], off ; encoding: [0x00,0x80,0x7c,0xdc,0x03,0x01,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_store_dwordx4 v[3:4], v[1:4], off dlc // GFX10: encoding: [0x00,0x90,0x78,0xdc,0x03,0x01,0x7d,0x00] @@ -179,32 +179,32 @@ global_store_dwordx4 v[3:4], v[1:4], off dlc global_store_dword v[3:4], v1, off offset:12 // GFX10: encoding: [0x0c,0x80,0x70,0xdc,0x03,0x01,0x7d,0x00] // GFX9: global_store_dword v[3:4], v1, off offset:12 ; encoding: [0x0c,0x80,0x70,0xdc,0x03,0x01,0x7f,0x00] -// VI-ERR: [[@LINE-3]]:36: error: not a valid operand +// VI-ERR: :36: error: not a valid operand global_load_dword v1, v3, s[2:3] // GFX10: encoding: [0x00,0x80,0x30,0xdc,0x03,0x00,0x02,0x01] // GFX9: global_load_dword v1, v3, s[2:3] ; encoding: [0x00,0x80,0x50,0xdc,0x03,0x00,0x02,0x01] -// VI-ERR: [[@LINE-3]]:1: error: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_load_dword v1, v3, s[2:3] offset:24 // GFX10: encoding: [0x18,0x80,0x30,0xdc,0x03,0x00,0x02,0x01] // GFX9: global_load_dword v1, v3, s[2:3] offset:24 ; encoding: [0x18,0x80,0x50,0xdc,0x03,0x00,0x02,0x01] -// VI-ERR: [[@LINE-3]]:34: error: not a valid operand. +// VI-ERR: :34: error: not a valid operand. global_load_dword v1, v3, s[2:3] offset:-8 // GFX10: encoding: [0xf8,0x8f,0x30,0xdc,0x03,0x00,0x02,0x01] // GFX9: global_load_dword v1, v3, s[2:3] offset:-8 ; encoding: [0xf8,0x9f,0x50,0xdc,0x03,0x00,0x02,0x01] -// VI-ERR: [[@LINE-3]]:34: error: not a valid operand. +// VI-ERR: :34: error: not a valid operand. global_store_dword v3, v1, s[2:3] // GFX10: encoding: [0x00,0x80,0x70,0xdc,0x03,0x01,0x02,0x00] // GFX9: global_store_dword v3, v1, s[2:3] ; encoding: [0x00,0x80,0x70,0xdc,0x03,0x01,0x02,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_store_dword v3, v1, s[2:3] offset:24 // GFX10: encoding: [0x18,0x80,0x70,0xdc,0x03,0x01,0x02,0x00] // GFX9: global_store_dword v3, v1, s[2:3] offset:24 ; encoding: [0x18,0x80,0x70,0xdc,0x03,0x01,0x02,0x00] -// VI-ERR: [[@LINE-3]]:35: error: not a valid operand. +// VI-ERR: :35: error: not a valid operand. global_store_dword v3, v1, s[2:3] offset:-8 // GFX10: encoding: [0xf8,0x8f,0x70,0xdc,0x03,0x01,0x02,0x00] @@ -215,7 +215,7 @@ global_store_dword v3, v1, s[2:3] offset:-8 global_store_dword v3, v1, exec // GFX10: encoding: [0x00,0x80,0x70,0xdc,0x03,0x01,0x7e,0x00] // GFX9: global_store_dword v3, v1, exec ; encoding: [0x00,0x80,0x70,0xdc,0x03,0x01,0x7e,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_load_dword v1, v[3:4], s2 // GFX10-ERR: error: invalid operand for instruction @@ -250,107 +250,107 @@ global_atomic_swap_x2 v[3:4], v[5:6], off global_atomic_add v[3:4], v5, off // GFX10: encoding: [0x00,0x80,0xc8,0xdc,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_add v[3:4], v5, off ; encoding: [0x00,0x80,0x08,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_sub v[3:4], v5, off // GFX10: encoding: [0x00,0x80,0xcc,0xdc,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_sub v[3:4], v5, off ; encoding: [0x00,0x80,0x0c,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_smin v[3:4], v5, off // GFX10: encoding: [0x00,0x80,0xd4,0xdc,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_smin v[3:4], v5, off ; encoding: [0x00,0x80,0x10,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_umin v[3:4], v5, off // GFX10: encoding: [0x00,0x80,0xd8,0xdc,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_umin v[3:4], v5, off ; encoding: [0x00,0x80,0x14,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_smax v[3:4], v5, off // GFX10: encoding: [0x00,0x80,0xdc,0xdc,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_smax v[3:4], v5, off ; encoding: [0x00,0x80,0x18,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_umax v[3:4], v5, off // GFX10: encoding: [0x00,0x80,0xe0,0xdc,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_umax v[3:4], v5, off ; encoding: [0x00,0x80,0x1c,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_and v[3:4], v5, off // GFX10: encoding: [0x00,0x80,0xe4,0xdc,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_and v[3:4], v5, off ; encoding: [0x00,0x80,0x20,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_or v[3:4], v5, off // GFX10: encoding: [0x00,0x80,0xe8,0xdc,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_or v[3:4], v5, off ; encoding: [0x00,0x80,0x24,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_xor v[3:4], v5, off // GFX10: encoding: [0x00,0x80,0xec,0xdc,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_xor v[3:4], v5, off ; encoding: [0x00,0x80,0x28,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_inc v[3:4], v5, off // GFX10: encoding: [0x00,0x80,0xf0,0xdc,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_inc v[3:4], v5, off ; encoding: [0x00,0x80,0x2c,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_dec v[3:4], v5, off // GFX10: encoding: [0x00,0x80,0xf4,0xdc,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_dec v[3:4], v5, off ; encoding: [0x00,0x80,0x30,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_add_x2 v[3:4], v[5:6], off // GFX10: encoding: [0x00,0x80,0x48,0xdd,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_add_x2 v[3:4], v[5:6], off ; encoding: [0x00,0x80,0x88,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_sub_x2 v[3:4], v[5:6], off // GFX10: encoding: [0x00,0x80,0x4c,0xdd,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_sub_x2 v[3:4], v[5:6], off ; encoding: [0x00,0x80,0x8c,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_smin_x2 v[3:4], v[5:6], off // GFX10: encoding: [0x00,0x80,0x54,0xdd,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_smin_x2 v[3:4], v[5:6], off ; encoding: [0x00,0x80,0x90,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_umin_x2 v[3:4], v[5:6], off // GFX10: encoding: [0x00,0x80,0x58,0xdd,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_umin_x2 v[3:4], v[5:6], off ; encoding: [0x00,0x80,0x94,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_smax_x2 v[3:4], v[5:6], off // GFX10: encoding: [0x00,0x80,0x5c,0xdd,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_smax_x2 v[3:4], v[5:6], off ; encoding: [0x00,0x80,0x98,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_umax_x2 v[3:4], v[5:6], off // GFX10: encoding: [0x00,0x80,0x60,0xdd,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_umax_x2 v[3:4], v[5:6], off ; encoding: [0x00,0x80,0x9c,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_and_x2 v[3:4], v[5:6], off // GFX10: encoding: [0x00,0x80,0x64,0xdd,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_and_x2 v[3:4], v[5:6], off ; encoding: [0x00,0x80,0xa0,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_or_x2 v[3:4], v[5:6], off // GFX10: encoding: [0x00,0x80,0x68,0xdd,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_or_x2 v[3:4], v[5:6], off ; encoding: [0x00,0x80,0xa4,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_xor_x2 v[3:4], v[5:6], off // GFX10: encoding: [0x00,0x80,0x6c,0xdd,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_xor_x2 v[3:4], v[5:6], off ; encoding: [0x00,0x80,0xa8,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_inc_x2 v[3:4], v[5:6], off // GFX10: encoding: [0x00,0x80,0x70,0xdd,0x03,0x05,0x7d,0x00] // GFX9: global_atomic_inc_x2 v[3:4], v[5:6], off ; encoding: [0x00,0x80,0xac,0xdd,0x03,0x05,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_dec_x2 v[3:4], v[5:6], off // GFX10: encoding: [0x00,0x80,0x74,0xdd,0x03,0x05,0x7d,0x00] @@ -490,42 +490,42 @@ global_atomic_dec_x2 v[3:4], v[5:6], off offset:-16 global_load_ubyte_d16 v1, v[3:4], off // GFX10: encoding: [0x00,0x80,0x80,0xdc,0x03,0x00,0x7d,0x01] // GFX9: global_load_ubyte_d16 v1, v[3:4], off ; encoding: [0x00,0x80,0x80,0xdc,0x03,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_load_ubyte_d16_hi v1, v[3:4], off // GFX10: encoding: [0x00,0x80,0x84,0xdc,0x03,0x00,0x7d,0x01] // GFX9: global_load_ubyte_d16_hi v1, v[3:4], off ; encoding: [0x00,0x80,0x84,0xdc,0x03,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_load_sbyte_d16 v1, v[3:4], off // GFX10: encoding: [0x00,0x80,0x88,0xdc,0x03,0x00,0x7d,0x01] // GFX9: global_load_sbyte_d16 v1, v[3:4], off ; encoding: [0x00,0x80,0x88,0xdc,0x03,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_load_sbyte_d16_hi v1, v[3:4], off // GFX10: encoding: [0x00,0x80,0x8c,0xdc,0x03,0x00,0x7d,0x01] // GFX9: global_load_sbyte_d16_hi v1, v[3:4], off ; encoding: [0x00,0x80,0x8c,0xdc,0x03,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_load_short_d16 v1, v[3:4], off // GFX10: encoding: [0x00,0x80,0x90,0xdc,0x03,0x00,0x7d,0x01] // GFX9: global_load_short_d16 v1, v[3:4], off ; encoding: [0x00,0x80,0x90,0xdc,0x03,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_load_short_d16_hi v1, v[3:4], off // GFX10: encoding: [0x00,0x80,0x94,0xdc,0x03,0x00,0x7d,0x01] // GFX9: global_load_short_d16_hi v1, v[3:4], off ; encoding: [0x00,0x80,0x94,0xdc,0x03,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_store_byte_d16_hi v[3:4], v1, off // GFX10: encoding: [0x00,0x80,0x64,0xdc,0x03,0x01,0x7d,0x00] // GFX9: global_store_byte_d16_hi v[3:4], v1, off ; encoding: [0x00,0x80,0x64,0xdc,0x03,0x01,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_store_short_d16_hi v[3:4], v1, off // GFX10: encoding: [0x00,0x80,0x6c,0xdc,0x03,0x01,0x7d,0x00] // GFX9: global_store_short_d16_hi v[3:4], v1, off ; encoding: [0x00,0x80,0x6c,0xdc,0x03,0x01,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU global_atomic_add v0, v[1:2], v2, off glc slc // GFX10: global_atomic_add v0, v[1:2], v2, off glc slc ; encoding: [0x00,0x80,0xcb,0xdc,0x01,0x02,0x7d,0x00] diff --git a/llvm/test/MC/AMDGPU/flat-scratch-instructions.s b/llvm/test/MC/AMDGPU/flat-scratch-instructions.s index c0e1670a6bd4..fb795105419c 100644 --- a/llvm/test/MC/AMDGPU/flat-scratch-instructions.s +++ b/llvm/test/MC/AMDGPU/flat-scratch-instructions.s @@ -1,14 +1,14 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck -check-prefix=GFX9 -check-prefix=GCN %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding 2>&1 %s | FileCheck -check-prefix=GFX9-ERR -check-prefix=GCNERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding 2>&1 %s | FileCheck -check-prefix=VI-ERR -check-prefix=GCNERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 2>&1 %s | FileCheck -check-prefix=GFX9-ERR -check-prefix=GCNERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga 2>&1 %s | FileCheck -check-prefix=VI-ERR -check-prefix=GCNERR --implicit-check-not=error: %s // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s | FileCheck --check-prefixes=GFX10,W32 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GFX10-ERR,W32-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck --check-prefixes=GFX10-ERR,W32-ERR --implicit-check-not=error: %s scratch_load_ubyte v1, v2, off // GFX10: encoding: [0x00,0x40,0x20,0xdc,0x02,0x00,0x7d,0x01] // GFX9: scratch_load_ubyte v1, v2, off ; encoding: [0x00,0x40,0x40,0xdc,0x02,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_load_ubyte v1, v2, off dlc // GFX10: encoding: [0x00,0x50,0x20,0xdc,0x02,0x00,0x7d,0x01] @@ -18,7 +18,7 @@ scratch_load_ubyte v1, v2, off dlc scratch_load_sbyte v1, v2, off // GFX10: encoding: [0x00,0x40,0x24,0xdc,0x02,0x00,0x7d,0x01] // GFX9: scratch_load_sbyte v1, v2, off ; encoding: [0x00,0x40,0x44,0xdc,0x02,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_load_sbyte v1, v2, off dlc // GFX10: encoding: [0x00,0x50,0x24,0xdc,0x02,0x00,0x7d,0x01] @@ -28,7 +28,7 @@ scratch_load_sbyte v1, v2, off dlc scratch_load_ushort v1, v2, off // GFX10: encoding: [0x00,0x40,0x28,0xdc,0x02,0x00,0x7d,0x01] // GFX9: scratch_load_ushort v1, v2, off ; encoding: [0x00,0x40,0x48,0xdc,0x02,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_load_ushort v1, v2, off dlc // GFX10: encoding: [0x00,0x50,0x28,0xdc,0x02,0x00,0x7d,0x01] @@ -38,7 +38,7 @@ scratch_load_ushort v1, v2, off dlc scratch_load_sshort v1, v2, off // GFX10: encoding: [0x00,0x40,0x2c,0xdc,0x02,0x00,0x7d,0x01] // GFX9: scratch_load_sshort v1, v2, off ; encoding: [0x00,0x40,0x4c,0xdc,0x02,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_load_sshort v1, v2, off dlc // GFX10: encoding: [0x00,0x50,0x2c,0xdc,0x02,0x00,0x7d,0x01] @@ -48,7 +48,7 @@ scratch_load_sshort v1, v2, off dlc scratch_load_dword v1, v2, off // GFX10: encoding: [0x00,0x40,0x30,0xdc,0x02,0x00,0x7d,0x01] // GFX9: scratch_load_dword v1, v2, off ; encoding: [0x00,0x40,0x50,0xdc,0x02,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_load_dword v1, v2, off dlc // GFX10: encoding: [0x00,0x50,0x30,0xdc,0x02,0x00,0x7d,0x01] @@ -58,7 +58,7 @@ scratch_load_dword v1, v2, off dlc scratch_load_dwordx2 v[1:2], v3, off // GFX10: encoding: [0x00,0x40,0x34,0xdc,0x03,0x00,0x7d,0x01] // GFX9: scratch_load_dwordx2 v[1:2], v3, off ; encoding: [0x00,0x40,0x54,0xdc,0x03,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_load_dwordx2 v[1:2], v3, off dlc // GFX10: encoding: [0x00,0x50,0x34,0xdc,0x03,0x00,0x7d,0x01] @@ -68,7 +68,7 @@ scratch_load_dwordx2 v[1:2], v3, off dlc scratch_load_dwordx3 v[1:3], v4, off // GFX10: encoding: [0x00,0x40,0x3c,0xdc,0x04,0x00,0x7d,0x01] // GFX9: scratch_load_dwordx3 v[1:3], v4, off ; encoding: [0x00,0x40,0x58,0xdc,0x04,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_load_dwordx3 v[1:3], v4, off dlc // GFX10: encoding: [0x00,0x50,0x3c,0xdc,0x04,0x00,0x7d,0x01] @@ -78,7 +78,7 @@ scratch_load_dwordx3 v[1:3], v4, off dlc scratch_load_dwordx4 v[1:4], v5, off // GFX10: encoding: [0x00,0x40,0x38,0xdc,0x05,0x00,0x7d,0x01] // GFX9: scratch_load_dwordx4 v[1:4], v5, off ; encoding: [0x00,0x40,0x5c,0xdc,0x05,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_load_dwordx4 v[1:4], v5, off dlc // GFX10: encoding: [0x00,0x50,0x38,0xdc,0x05,0x00,0x7d,0x01] @@ -138,7 +138,7 @@ scratch_load_dword v255, off, s0 offset:2048 scratch_store_byte v1, v2, off // GFX10: encoding: [0x00,0x40,0x60,0xdc,0x01,0x02,0x7d,0x00] // GFX9: scratch_store_byte v1, v2, off ; encoding: [0x00,0x40,0x60,0xdc,0x01,0x02,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_store_byte v1, v2, off dlc // GFX10: encoding: [0x00,0x50,0x60,0xdc,0x01,0x02,0x7d,0x00] @@ -148,7 +148,7 @@ scratch_store_byte v1, v2, off dlc scratch_store_short v1, v2, off // GFX10: encoding: [0x00,0x40,0x68,0xdc,0x01,0x02,0x7d,0x00] // GFX9: scratch_store_short v1, v2, off ; encoding: [0x00,0x40,0x68,0xdc,0x01,0x02,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_store_short v1, v2, off dlc // GFX10: encoding: [0x00,0x50,0x68,0xdc,0x01,0x02,0x7d,0x00] @@ -158,7 +158,7 @@ scratch_store_short v1, v2, off dlc scratch_store_dword v1, v2, off // GFX10: encoding: [0x00,0x40,0x70,0xdc,0x01,0x02,0x7d,0x00] // GFX9: scratch_store_dword v1, v2, off ; encoding: [0x00,0x40,0x70,0xdc,0x01,0x02,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_store_dword v1, v2, off dlc // GFX10: encoding: [0x00,0x50,0x70,0xdc,0x01,0x02,0x7d,0x00] @@ -168,7 +168,7 @@ scratch_store_dword v1, v2, off dlc scratch_store_dwordx2 v1, v[2:3], off // GFX10: encoding: [0x00,0x40,0x74,0xdc,0x01,0x02,0x7d,0x00] // GFX9: scratch_store_dwordx2 v1, v[2:3], off ; encoding: [0x00,0x40,0x74,0xdc,0x01,0x02,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_store_dwordx2 v1, v[2:3], off dlc // GFX10: encoding: [0x00,0x50,0x74,0xdc,0x01,0x02,0x7d,0x00] @@ -178,7 +178,7 @@ scratch_store_dwordx2 v1, v[2:3], off dlc scratch_store_dwordx3 v1, v[2:4], off // GFX10: encoding: [0x00,0x40,0x7c,0xdc,0x01,0x02,0x7d,0x00] // GFX9: scratch_store_dwordx3 v1, v[2:4], off ; encoding: [0x00,0x40,0x78,0xdc,0x01,0x02,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_store_dwordx3 v1, v[2:4], off dlc // GFX10: encoding: [0x00,0x50,0x7c,0xdc,0x01,0x02,0x7d,0x00] @@ -188,7 +188,7 @@ scratch_store_dwordx3 v1, v[2:4], off dlc scratch_store_dwordx4 v1, v[2:5], off // GFX10: encoding: [0x00,0x40,0x78,0xdc,0x01,0x02,0x7d,0x00] // GFX9: scratch_store_dwordx4 v1, v[2:5], off ; encoding: [0x00,0x40,0x7c,0xdc,0x01,0x02,0x7f,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_store_dwordx4 v1, v[2:5], off dlc // GFX10: encoding: [0x00,0x50,0x78,0xdc,0x01,0x02,0x7d,0x00] @@ -203,7 +203,7 @@ scratch_store_dword v1, v2, off offset:12 scratch_load_dword v1, off, s1 // GFX10: encoding: [0x00,0x40,0x30,0xdc,0x00,0x00,0x01,0x01] // GFX9: scratch_load_dword v1, off, s1 ; encoding: [0x00,0x40,0x50,0xdc,0x00,0x00,0x01,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_load_dword v1, off, s1 offset:32 // GFX10: encoding: [0x20,0x40,0x30,0xdc,0x00,0x00,0x01,0x01] @@ -213,7 +213,7 @@ scratch_load_dword v1, off, s1 offset:32 scratch_store_dword off, v2, s1 // GFX10: encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x01,0x00] // GFX9: scratch_store_dword off, v2, s1 ; encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x01,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_store_dword off, v2, s1 offset:12 // GFX10: encoding: [0x0c,0x40,0x70,0xdc,0x00,0x02,0x01,0x00] @@ -254,59 +254,59 @@ scratch_store_dword off, v2, exec_hi scratch_load_dword v1, off, exec_lo // GFX10: encoding: [0x00,0x40,0x30,0xdc,0x00,0x00,0x7e,0x01] // GFX9: scratch_load_dword v1, off, exec_lo ; encoding: [0x00,0x40,0x50,0xdc,0x00,0x00,0x7e,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_store_dword off, v2, exec_lo // GFX10: encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7e,0x00] // GFX9: scratch_store_dword off, v2, exec_lo ; encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7e,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_load_dword v1, off, m0 // GFX10: encoding: [0x00,0x40,0x30,0xdc,0x00,0x00,0x7c,0x01] // GFX9: scratch_load_dword v1, off, m0 ; encoding: [0x00,0x40,0x50,0xdc,0x00,0x00,0x7c,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_store_dword off, v2, m0 // GFX10: encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7c,0x00] // GFX9: scratch_store_dword off, v2, m0 ; encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7c,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_load_ubyte_d16 v1, v2, off // GFX10: encoding: [0x00,0x40,0x80,0xdc,0x02,0x00,0x7d,0x01] // GFX9: scratch_load_ubyte_d16 v1, v2, off ; encoding: [0x00,0x40,0x80,0xdc,0x02,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_load_ubyte_d16_hi v1, v2, off // GFX10: encoding: [0x00,0x40,0x84,0xdc,0x02,0x00,0x7d,0x01] // GFX9: scratch_load_ubyte_d16_hi v1, v2, off ; encoding: [0x00,0x40,0x84,0xdc,0x02,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_load_sbyte_d16 v1, v2, off // GFX10: encoding: [0x00,0x40,0x88,0xdc,0x02,0x00,0x7d,0x01] // GFX9: scratch_load_sbyte_d16 v1, v2, off ; encoding: [0x00,0x40,0x88,0xdc,0x02,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_load_sbyte_d16_hi v1, v2, off // GFX10: encoding: [0x00,0x40,0x8c,0xdc,0x02,0x00,0x7d,0x01] // GFX9: scratch_load_sbyte_d16_hi v1, v2, off ; encoding: [0x00,0x40,0x8c,0xdc,0x02,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_load_short_d16 v1, v2, off // GFX10: encoding: [0x00,0x40,0x90,0xdc,0x02,0x00,0x7d,0x01] // GFX9: scratch_load_short_d16 v1, v2, off ; encoding: [0x00,0x40,0x90,0xdc,0x02,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_load_short_d16_hi v1, v2, off // GFX10: encoding: [0x00,0x40,0x94,0xdc,0x02,0x00,0x7d,0x01] // GFX9: scratch_load_short_d16_hi v1, v2, off ; encoding: [0x00,0x40,0x94,0xdc,0x02,0x00,0x7f,0x01] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_store_byte_d16_hi off, v2, s1 // GFX10: encoding: [0x00,0x40,0x64,0xdc,0x00,0x02,0x01,0x00] // GFX9: scratch_store_byte_d16_hi off, v2, s1 ; encoding: [0x00,0x40,0x64,0xdc,0x00,0x02,0x01,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU scratch_store_short_d16_hi off, v2, s1 // GFX10: encoding: [0x00,0x40,0x6c,0xdc,0x00,0x02,0x01,0x00] // GFX9: scratch_store_short_d16_hi off, v2, s1 ; encoding: [0x00,0x40,0x6c,0xdc,0x00,0x02,0x01,0x00] -// VI-ERR: instruction not supported on this GPU +// VI-ERR: error: instruction not supported on this GPU diff --git a/llvm/test/MC/AMDGPU/flat-scratch.s b/llvm/test/MC/AMDGPU/flat-scratch.s index e87f59dafeea..eea2f0d07f3e 100644 --- a/llvm/test/MC/AMDGPU/flat-scratch.s +++ b/llvm/test/MC/AMDGPU/flat-scratch.s @@ -1,6 +1,6 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck -check-prefix=NOSI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=hawaii -show-encoding %s 2>&1 | FileCheck -check-prefix=NOCI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck -check-prefix=NOVI %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefix=NOSI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=hawaii %s 2>&1 | FileCheck -check-prefix=NOCI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=NOVI --implicit-check-not=error: %s // RUN: not llvm-mc -arch=amdgcn -mcpu=hawaii -show-encoding %s | FileCheck -check-prefix=CI %s // RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck -check-prefix=VI %s diff --git a/llvm/test/MC/AMDGPU/flat.s b/llvm/test/MC/AMDGPU/flat.s index 8351233e466b..bfb71c9ebf4d 100644 --- a/llvm/test/MC/AMDGPU/flat.s +++ b/llvm/test/MC/AMDGPU/flat.s @@ -7,44 +7,44 @@ // error: instruction not supported on this GPU // -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOVI -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck %s --check-prefix=NOVI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=NOSI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s --check-prefix=NOSI --implicit-check-not=error: //===----------------------------------------------------------------------===// // Operands //===----------------------------------------------------------------------===// flat_load_dword v1, v[3:4] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_load_dword v1, v[3:4] ; encoding: [0x00,0x00,0x30,0xdc,0x03,0x00,0x00,0x01] // VI: flat_load_dword v1, v[3:4] ; encoding: [0x00,0x00,0x50,0xdc,0x03,0x00,0x00,0x01] flat_load_dword v1, v[3:4] glc -// NOSI: error: +// NOSI: error: invalid operand for instruction // CI: flat_load_dword v1, v[3:4] glc ; encoding: [0x00,0x00,0x31,0xdc,0x03,0x00,0x00,0x01] // VI: flat_load_dword v1, v[3:4] glc ; encoding: [0x00,0x00,0x51,0xdc,0x03,0x00,0x00,0x01] flat_load_dword v1, v[3:4] glc slc -// NOSI: error: +// NOSI: error: invalid operand for instruction // CI: flat_load_dword v1, v[3:4] glc slc ; encoding: [0x00,0x00,0x33,0xdc,0x03,0x00,0x00,0x01] // VI: flat_load_dword v1, v[3:4] glc slc ; encoding: [0x00,0x00,0x53,0xdc,0x03,0x00,0x00,0x01] flat_store_dword v[3:4], v1 -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CIVI: flat_store_dword v[3:4], v1 ; encoding: [0x00,0x00,0x70,0xdc,0x03,0x01,0x00,0x00] flat_store_dword v[3:4], v1 glc -// NOSI: error: +// NOSI: error: invalid operand for instruction // CIVI: flat_store_dword v[3:4], v1 glc ; encoding: [0x00,0x00,0x71,0xdc,0x03,0x01,0x00,0x00] flat_store_dword v[3:4], v1 glc slc -// NOSI: error: +// NOSI: error: invalid operand for instruction // CIVI: flat_store_dword v[3:4], v1 glc slc ; encoding: [0x00,0x00,0x73,0xdc,0x03,0x01,0x00,0x00] flat_store_dword v[3:4], v1 slc -// NOSI: error: +// NOSI: error: invalid operand for instruction // CIVI: flat_store_dword v[3:4], v1 slc ; encoding: [0x00,0x00,0x72,0xdc,0x03,0x01,0x00,0x00] // FIXME: For atomic instructions, glc must be placed immediately following @@ -53,12 +53,12 @@ flat_store_dword v[3:4], v1 slc // flat_atomic_add v1, v[3:4], v5 slc glc flat_atomic_add v1, v[3:4], v5 offset:0 glc slc -// NOSI: error: +// NOSI: error: not a valid operand. // CI: flat_atomic_add v1, v[3:4], v5 glc slc ; encoding: [0x00,0x00,0xcb,0xdc,0x03,0x05,0x00,0x01] // VI: flat_atomic_add v1, v[3:4], v5 glc slc ; encoding: [0x00,0x00,0x0b,0xdd,0x03,0x05,0x00,0x01] flat_atomic_add v[3:4], v5 slc -// NOSI: error: +// NOSI: error: invalid operand for instruction // CI: flat_atomic_add v[3:4], v5 slc ; encoding: [0x00,0x00,0xca,0xdc,0x03,0x05,0x00,0x00] // VI: flat_atomic_add v[3:4], v5 slc ; encoding: [0x00,0x00,0x0a,0xdd,0x03,0x05,0x00,0x00] @@ -67,367 +67,367 @@ flat_atomic_add v[3:4], v5 slc //===----------------------------------------------------------------------===// flat_load_ubyte v1, v[3:4] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_load_ubyte v1, v[3:4] ; encoding: [0x00,0x00,0x20,0xdc,0x03,0x00,0x00,0x01] // VI: flat_load_ubyte v1, v[3:4] ; encoding: [0x00,0x00,0x40,0xdc,0x03,0x00,0x00,0x01] flat_load_sbyte v1, v[3:4] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_load_sbyte v1, v[3:4] ; encoding: [0x00,0x00,0x24,0xdc,0x03,0x00,0x00,0x01] // VI: flat_load_sbyte v1, v[3:4] ; encoding: [0x00,0x00,0x44,0xdc,0x03,0x00,0x00,0x01] flat_load_ushort v1, v[3:4] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_load_ushort v1, v[3:4] ; encoding: [0x00,0x00,0x28,0xdc,0x03,0x00,0x00,0x01] // VI: flat_load_ushort v1, v[3:4] ; encoding: [0x00,0x00,0x48,0xdc,0x03,0x00,0x00,0x01] flat_load_sshort v1, v[3:4] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_load_sshort v1, v[3:4] ; encoding: [0x00,0x00,0x2c,0xdc,0x03,0x00,0x00,0x01] // VI: flat_load_sshort v1, v[3:4] ; encoding: [0x00,0x00,0x4c,0xdc,0x03,0x00,0x00,0x01] flat_load_dword v1, v[3:4] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_load_dword v1, v[3:4] ; encoding: [0x00,0x00,0x30,0xdc,0x03,0x00,0x00,0x01] // VI: flat_load_dword v1, v[3:4] ; encoding: [0x00,0x00,0x50,0xdc,0x03,0x00,0x00,0x01] flat_load_dwordx2 v[1:2], v[3:4] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_load_dwordx2 v[1:2], v[3:4] ; encoding: [0x00,0x00,0x34,0xdc,0x03,0x00,0x00,0x01] // VI: flat_load_dwordx2 v[1:2], v[3:4] ; encoding: [0x00,0x00,0x54,0xdc,0x03,0x00,0x00,0x01] flat_load_dwordx4 v[5:8], v[3:4] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_load_dwordx4 v[5:8], v[3:4] ; encoding: [0x00,0x00,0x38,0xdc,0x03,0x00,0x00,0x05] // VI: flat_load_dwordx4 v[5:8], v[3:4] ; encoding: [0x00,0x00,0x5c,0xdc,0x03,0x00,0x00,0x05] flat_load_dwordx3 v[5:7], v[3:4] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_load_dwordx3 v[5:7], v[3:4] ; encoding: [0x00,0x00,0x3c,0xdc,0x03,0x00,0x00,0x05] // VI: flat_load_dwordx3 v[5:7], v[3:4] ; encoding: [0x00,0x00,0x58,0xdc,0x03,0x00,0x00,0x05] flat_store_byte v[3:4], v1 -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CIVI: flat_store_byte v[3:4], v1 ; encoding: [0x00,0x00,0x60,0xdc,0x03,0x01,0x00,0x00] flat_store_short v[3:4], v1 -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CIVI: flat_store_short v[3:4], v1 ; encoding: [0x00,0x00,0x68,0xdc,0x03,0x01,0x00,0x00] flat_store_dword v[3:4], v1 -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CIVI: flat_store_dword v[3:4], v1 ; encoding: [0x00,0x00,0x70,0xdc,0x03,0x01,0x00,0x00] flat_store_dwordx2 v[3:4], v[1:2] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CIVI: flat_store_dwordx2 v[3:4], v[1:2] ; encoding: [0x00,0x00,0x74,0xdc,0x03,0x01,0x00,0x00] flat_store_dwordx4 v[3:4], v[5:8] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_store_dwordx4 v[3:4], v[5:8] ; encoding: [0x00,0x00,0x78,0xdc,0x03,0x05,0x00,0x00] // VI: flat_store_dwordx4 v[3:4], v[5:8] ; encoding: [0x00,0x00,0x7c,0xdc,0x03,0x05,0x00,0x00] flat_store_dwordx3 v[3:4], v[5:7] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_store_dwordx3 v[3:4], v[5:7] ; encoding: [0x00,0x00,0x7c,0xdc,0x03,0x05,0x00,0x00] // VI: flat_store_dwordx3 v[3:4], v[5:7] ; encoding: [0x00,0x00,0x78,0xdc,0x03,0x05,0x00,0x00] flat_atomic_swap v[3:4], v5 -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_swap v[3:4], v5 ; encoding: [0x00,0x00,0xc0,0xdc,0x03,0x05,0x00,0x00] // VI: flat_atomic_swap v[3:4], v5 ; encoding: [0x00,0x00,0x00,0xdd,0x03,0x05,0x00,0x00] flat_atomic_swap v1, v[3:4], v5 glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_swap v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0xc1,0xdc,0x03,0x05,0x00,0x01] // VI: flat_atomic_swap v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0x01,0xdd,0x03,0x05,0x00,0x01] flat_atomic_cmpswap v[3:4], v[5:6] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_cmpswap v[3:4], v[5:6] ; encoding: [0x00,0x00,0xc4,0xdc,0x03,0x05,0x00,0x00] // VI: flat_atomic_cmpswap v[3:4], v[5:6] ; encoding: [0x00,0x00,0x04,0xdd,0x03,0x05,0x00,0x00] flat_atomic_cmpswap v1, v[3:4], v[5:6] glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_cmpswap v1, v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0xc5,0xdc,0x03,0x05,0x00,0x01] // VI: flat_atomic_cmpswap v1, v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x05,0xdd,0x03,0x05,0x00,0x01] flat_atomic_add v[3:4], v5 -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_add v[3:4], v5 ; encoding: [0x00,0x00,0xc8,0xdc,0x03,0x05,0x00,0x00] // VI: flat_atomic_add v[3:4], v5 ; encoding: [0x00,0x00,0x08,0xdd,0x03,0x05,0x00,0x00] flat_atomic_add v1, v[3:4], v5 glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_add v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0xc9,0xdc,0x03,0x05,0x00,0x01] // VI: flat_atomic_add v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0x09,0xdd,0x03,0x05,0x00,0x01] flat_atomic_sub v[3:4], v5 -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_sub v[3:4], v5 ; encoding: [0x00,0x00,0xcc,0xdc,0x03,0x05,0x00,0x00] // VI: flat_atomic_sub v[3:4], v5 ; encoding: [0x00,0x00,0x0c,0xdd,0x03,0x05,0x00,0x00] flat_atomic_sub v1, v[3:4], v5 glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_sub v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0xcd,0xdc,0x03,0x05,0x00,0x01] // VI: flat_atomic_sub v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0x0d,0xdd,0x03,0x05,0x00,0x01] flat_atomic_smin v[3:4], v5 -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_smin v[3:4], v5 ; encoding: [0x00,0x00,0xd4,0xdc,0x03,0x05,0x00,0x00] // VI: flat_atomic_smin v[3:4], v5 ; encoding: [0x00,0x00,0x10,0xdd,0x03,0x05,0x00,0x00] flat_atomic_smin v1, v[3:4], v5 glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_smin v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0xd5,0xdc,0x03,0x05,0x00,0x01] // VI: flat_atomic_smin v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0x11,0xdd,0x03,0x05,0x00,0x01] flat_atomic_umin v[3:4], v5 -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_umin v[3:4], v5 ; encoding: [0x00,0x00,0xd8,0xdc,0x03,0x05,0x00,0x00] // VI: flat_atomic_umin v[3:4], v5 ; encoding: [0x00,0x00,0x14,0xdd,0x03,0x05,0x00,0x00] flat_atomic_umin v1, v[3:4], v5 glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_umin v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0xd9,0xdc,0x03,0x05,0x00,0x01] // VI: flat_atomic_umin v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0x15,0xdd,0x03,0x05,0x00,0x01] flat_atomic_smax v[3:4], v5, -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_smax v[3:4], v5 ; encoding: [0x00,0x00,0xdc,0xdc,0x03,0x05,0x00,0x00] // VI: flat_atomic_smax v[3:4], v5 ; encoding: [0x00,0x00,0x18,0xdd,0x03,0x05,0x00,0x00] flat_atomic_smax v1, v[3:4], v5 glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_smax v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0xdd,0xdc,0x03,0x05,0x00,0x01] // VI: flat_atomic_smax v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0x19,0xdd,0x03,0x05,0x00,0x01] flat_atomic_umax v[3:4], v5 -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_umax v[3:4], v5 ; encoding: [0x00,0x00,0xe0,0xdc,0x03,0x05,0x00,0x00] // VI: flat_atomic_umax v[3:4], v5 ; encoding: [0x00,0x00,0x1c,0xdd,0x03,0x05,0x00,0x00] flat_atomic_umax v1, v[3:4], v5 glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_umax v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0xe1,0xdc,0x03,0x05,0x00,0x01] // VI: flat_atomic_umax v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0x1d,0xdd,0x03,0x05,0x00,0x01] flat_atomic_and v[3:4], v5 -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_and v[3:4], v5 ; encoding: [0x00,0x00,0xe4,0xdc,0x03,0x05,0x00,0x00] // VI: flat_atomic_and v[3:4], v5 ; encoding: [0x00,0x00,0x20,0xdd,0x03,0x05,0x00,0x00] flat_atomic_and v1, v[3:4], v5 glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_and v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0xe5,0xdc,0x03,0x05,0x00,0x01] // VI: flat_atomic_and v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0x21,0xdd,0x03,0x05,0x00,0x01] flat_atomic_or v[3:4], v5 -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_or v[3:4], v5 ; encoding: [0x00,0x00,0xe8,0xdc,0x03,0x05,0x00,0x00] // VI: flat_atomic_or v[3:4], v5 ; encoding: [0x00,0x00,0x24,0xdd,0x03,0x05,0x00,0x00] flat_atomic_or v1, v[3:4], v5 glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_or v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0xe9,0xdc,0x03,0x05,0x00,0x01] // VI: flat_atomic_or v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0x25,0xdd,0x03,0x05,0x00,0x01] flat_atomic_xor v[3:4], v5 -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_xor v[3:4], v5 ; encoding: [0x00,0x00,0xec,0xdc,0x03,0x05,0x00,0x00] // VI: flat_atomic_xor v[3:4], v5 ; encoding: [0x00,0x00,0x28,0xdd,0x03,0x05,0x00,0x00] flat_atomic_xor v1, v[3:4], v5 glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_xor v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0xed,0xdc,0x03,0x05,0x00,0x01] // VI: flat_atomic_xor v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0x29,0xdd,0x03,0x05,0x00,0x01] flat_atomic_inc v[3:4], v5 -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_inc v[3:4], v5 ; encoding: [0x00,0x00,0xf0,0xdc,0x03,0x05,0x00,0x00] // VI: flat_atomic_inc v[3:4], v5 ; encoding: [0x00,0x00,0x2c,0xdd,0x03,0x05,0x00,0x00] flat_atomic_inc v1, v[3:4], v5 glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_inc v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0xf1,0xdc,0x03,0x05,0x00,0x01] // VI: flat_atomic_inc v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0x2d,0xdd,0x03,0x05,0x00,0x01] flat_atomic_dec v[3:4], v5 -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_dec v[3:4], v5 ; encoding: [0x00,0x00,0xf4,0xdc,0x03,0x05,0x00,0x00] // VI: flat_atomic_dec v[3:4], v5 ; encoding: [0x00,0x00,0x30,0xdd,0x03,0x05,0x00,0x00] flat_atomic_dec v1, v[3:4], v5 glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_dec v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0xf5,0xdc,0x03,0x05,0x00,0x01] // VI: flat_atomic_dec v1, v[3:4], v5 glc ; encoding: [0x00,0x00,0x31,0xdd,0x03,0x05,0x00,0x01] flat_atomic_fcmpswap v[3:4], v[5:6] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_fcmpswap v[3:4], v[5:6] ; encoding: [0x00,0x00,0xf8,0xdc,0x03,0x05,0x00,0x00] -// NOVI: error: +// NOVI: error: instruction not supported on this GPU flat_atomic_fcmpswap v1, v[3:4], v[5:6] glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_fcmpswap v1, v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0xf9,0xdc,0x03,0x05,0x00,0x01] -// NOVI: error: +// NOVI: error: instruction not supported on this GPU flat_atomic_swap_x2 v[3:4], v[5:6] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_swap_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x40,0xdd,0x03,0x05,0x00,0x00] // VI: flat_atomic_swap_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x80,0xdd,0x03,0x05,0x00,0x00] flat_atomic_swap_x2 v[1:2], v[3:4], v[5:6] glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_swap_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x41,0xdd,0x03,0x05,0x00,0x01] // VI: flat_atomic_swap_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x81,0xdd,0x03,0x05,0x00,0x01] flat_atomic_cmpswap_x2 v[3:4], v[5:8] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_cmpswap_x2 v[3:4], v[5:8] ; encoding: [0x00,0x00,0x44,0xdd,0x03,0x05,0x00,0x00] // VI: flat_atomic_cmpswap_x2 v[3:4], v[5:8] ; encoding: [0x00,0x00,0x84,0xdd,0x03,0x05,0x00,0x00] flat_atomic_cmpswap_x2 v[1:2], v[3:4], v[5:8] glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_cmpswap_x2 v[1:2], v[3:4], v[5:8] glc ; encoding: [0x00,0x00,0x45,0xdd,0x03,0x05,0x00,0x01] // VI: flat_atomic_cmpswap_x2 v[1:2], v[3:4], v[5:8] glc ; encoding: [0x00,0x00,0x85,0xdd,0x03,0x05,0x00,0x01] flat_atomic_add_x2 v[3:4], v[5:6] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_add_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x48,0xdd,0x03,0x05,0x00,0x00] // VI: flat_atomic_add_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x88,0xdd,0x03,0x05,0x00,0x00] flat_atomic_add_x2 v[1:2], v[3:4], v[5:6] glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_add_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x49,0xdd,0x03,0x05,0x00,0x01] // VI: flat_atomic_add_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x89,0xdd,0x03,0x05,0x00,0x01] flat_atomic_sub_x2 v[3:4], v[5:6] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_sub_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x4c,0xdd,0x03,0x05,0x00,0x00] // VI: flat_atomic_sub_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x8c,0xdd,0x03,0x05,0x00,0x00] flat_atomic_sub_x2 v[1:2], v[3:4], v[5:6] glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_sub_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x4d,0xdd,0x03,0x05,0x00,0x01] // VI: flat_atomic_sub_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x8d,0xdd,0x03,0x05,0x00,0x01] flat_atomic_smin_x2 v[3:4], v[5:6] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_smin_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x54,0xdd,0x03,0x05,0x00,0x00] // VI: flat_atomic_smin_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x90,0xdd,0x03,0x05,0x00,0x00] flat_atomic_smin_x2 v[1:2], v[3:4], v[5:6] glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_smin_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x55,0xdd,0x03,0x05,0x00,0x01] // VI: flat_atomic_smin_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x91,0xdd,0x03,0x05,0x00,0x01] flat_atomic_umin_x2 v[3:4], v[5:6] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_umin_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x58,0xdd,0x03,0x05,0x00,0x00] // VI: flat_atomic_umin_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x94,0xdd,0x03,0x05,0x00,0x00] flat_atomic_umin_x2 v[1:2], v[3:4], v[5:6] glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_umin_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x59,0xdd,0x03,0x05,0x00,0x01] // VI: flat_atomic_umin_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x95,0xdd,0x03,0x05,0x00,0x01] flat_atomic_smax_x2 v[3:4], v[5:6] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_smax_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x5c,0xdd,0x03,0x05,0x00,0x00] // VI: flat_atomic_smax_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x98,0xdd,0x03,0x05,0x00,0x00] flat_atomic_smax_x2 v[1:2], v[3:4], v[5:6] glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_smax_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x5d,0xdd,0x03,0x05,0x00,0x01] // VI: flat_atomic_smax_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x99,0xdd,0x03,0x05,0x00,0x01] flat_atomic_umax_x2 v[3:4], v[5:6] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_umax_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x60,0xdd,0x03,0x05,0x00,0x00] // VI: flat_atomic_umax_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x9c,0xdd,0x03,0x05,0x00,0x00] flat_atomic_umax_x2 v[1:2], v[3:4], v[5:6] glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_umax_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x61,0xdd,0x03,0x05,0x00,0x01] // VI: flat_atomic_umax_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x9d,0xdd,0x03,0x05,0x00,0x01] flat_atomic_and_x2 v[3:4], v[5:6] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_and_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x64,0xdd,0x03,0x05,0x00,0x00] // VI: flat_atomic_and_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0xa0,0xdd,0x03,0x05,0x00,0x00] flat_atomic_and_x2 v[1:2], v[3:4], v[5:6] glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_and_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x65,0xdd,0x03,0x05,0x00,0x01] // VI: flat_atomic_and_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0xa1,0xdd,0x03,0x05,0x00,0x01] flat_atomic_or_x2 v[3:4], v[5:6] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_or_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x68,0xdd,0x03,0x05,0x00,0x00] // VI: flat_atomic_or_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0xa4,0xdd,0x03,0x05,0x00,0x00] flat_atomic_or_x2 v[1:2], v[3:4], v[5:6] glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_or_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x69,0xdd,0x03,0x05,0x00,0x01] // VI: flat_atomic_or_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0xa5,0xdd,0x03,0x05,0x00,0x01] flat_atomic_xor_x2 v[3:4], v[5:6] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_xor_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x6c,0xdd,0x03,0x05,0x00,0x00] // VI: flat_atomic_xor_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0xa8,0xdd,0x03,0x05,0x00,0x00] flat_atomic_xor_x2 v[1:2], v[3:4], v[5:6] glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_xor_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x6d,0xdd,0x03,0x05,0x00,0x01] // VI: flat_atomic_xor_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0xa9,0xdd,0x03,0x05,0x00,0x01] flat_atomic_inc_x2 v[3:4], v[5:6] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_inc_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x70,0xdd,0x03,0x05,0x00,0x00] // VI: flat_atomic_inc_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0xac,0xdd,0x03,0x05,0x00,0x00] flat_atomic_inc_x2 v[1:2], v[3:4], v[5:6] glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_inc_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x71,0xdd,0x03,0x05,0x00,0x01] // VI: flat_atomic_inc_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0xad,0xdd,0x03,0x05,0x00,0x01] flat_atomic_dec_x2 v[3:4], v[5:6] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_dec_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x74,0xdd,0x03,0x05,0x00,0x00] // VI: flat_atomic_dec_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0xb0,0xdd,0x03,0x05,0x00,0x00] flat_atomic_dec_x2 v[1:2], v[3:4], v[5:6] glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_dec_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x75,0xdd,0x03,0x05,0x00,0x01] // VI: flat_atomic_dec_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0xb1,0xdd,0x03,0x05,0x00,0x01] flat_atomic_fcmpswap_x2 v[3:4], v[5:8] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_fcmpswap_x2 v[3:4], v[5:8] ; encoding: [0x00,0x00,0x78,0xdd,0x03,0x05,0x00,0x00] -// NOVI: error: +// NOVI: error: instruction not supported on this GPU flat_atomic_fcmpswap_x2 v[1:2], v[3:4], v[5:8] glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_fcmpswap_x2 v[1:2], v[3:4], v[5:8] glc ; encoding: [0x00,0x00,0x79,0xdd,0x03,0x05,0x00,0x01] -// NOVI: error: +// NOVI: error: instruction not supported on this GPU flat_atomic_fmin_x2 v[3:4], v[5:6] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_fmin_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x7c,0xdd,0x03,0x05,0x00,0x00] -// NOVI: error: +// NOVI: error: instruction not supported on this GPU flat_atomic_fmin_x2 v[1:2], v[3:4], v[5:6] glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_fmin_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x7d,0xdd,0x03,0x05,0x00,0x01] -// NOVI: error: +// NOVI: error: instruction not supported on this GPU flat_atomic_fmax_x2 v[3:4], v[5:6] -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_fmax_x2 v[3:4], v[5:6] ; encoding: [0x00,0x00,0x80,0xdd,0x03,0x05,0x00,0x00] -// NOVI: error: +// NOVI: error: instruction not supported on this GPU flat_atomic_fmax_x2 v[1:2], v[3:4], v[5:6] glc -// NOSI: error: +// NOSI: error: instruction not supported on this GPU // CI: flat_atomic_fmax_x2 v[1:2], v[3:4], v[5:6] glc ; encoding: [0x00,0x00,0x81,0xdd,0x03,0x05,0x00,0x01] -// NOVI: error: +// NOVI: error: instruction not supported on this GPU diff --git a/llvm/test/MC/AMDGPU/fma-mix.s b/llvm/test/MC/AMDGPU/fma-mix.s index 9d4c762bef55..3f510090ee58 100644 --- a/llvm/test/MC/AMDGPU/fma-mix.s +++ b/llvm/test/MC/AMDGPU/fma-mix.s @@ -1,6 +1,6 @@ // RUN: llvm-mc -arch=amdgcn -mcpu=gfx904 -show-encoding %s | FileCheck -check-prefix=GFX9-FMAMIX %s // RUN: llvm-mc -arch=amdgcn -mcpu=gfx906 -show-encoding %s | FileCheck -check-prefix=GFX9-FMAMIX %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX9-MADMIX-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefix=GFX9-MADMIX-ERR --implicit-check-not=error: %s v_fma_mix_f32 v0, v1, v2, v3 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x04] @@ -20,45 +20,57 @@ v_fma_mixhi_f16 v0, v1, v2, v3 v_fma_mix_f32 v0, abs(v1), v2, v3 // GFX9-FMAMIX: v_fma_mix_f32 v0, |v1|, v2, v3 ; encoding: [0x00,0x01,0xa0,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-MADMIX-ERR: error: not a valid operand. -// FIXME: Better error -// GFX9-MADMIX-ERR: error: invalid operand for instruction +// FIXME: Improve error messages v_fma_mix_f32 v0, v1, abs(v2), v3 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, |v2|, v3 ; encoding: [0x00,0x02,0xa0,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mix_f32 v0, v1, v2, abs(v3) // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, |v3| ; encoding: [0x00,0x04,0xa0,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mix_f32 v0, -v1, v2, v3 // GFX9-FMAMIX: v_fma_mix_f32 v0, -v1, v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x24] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mix_f32 v0, v1, -v2, v3 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, -v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x44] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mix_f32 v0, v1, v2, -v3 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, -v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x84] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mix_f32 v0, -abs(v1), v2, v3 // GFX9-FMAMIX: v_fma_mix_f32 v0, -|v1|, v2, v3 ; encoding: [0x00,0x01,0xa0,0xd3,0x01,0x05,0x0e,0x24] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mix_f32 v0, v1, -abs(v2), v3 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, -|v2|, v3 ; encoding: [0x00,0x02,0xa0,0xd3,0x01,0x05,0x0e,0x44] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mix_f32 v0, v1, v2, -abs(v3) // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, -|v3| ; encoding: [0x00,0x04,0xa0,0xd3,0x01,0x05,0x0e,0x84] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mixlo_f16 v0, abs(v1), -v2, abs(v3) // GFX9-FMAMIX: v_fma_mixlo_f16 v0, |v1|, -v2, |v3| ; encoding: [0x00,0x05,0xa1,0xd3,0x01,0x05,0x0e,0x44] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mixhi_f16 v0, -v1, abs(v2), -abs(v3) // GFX9-FMAMIX: v_fma_mixhi_f16 v0, -v1, |v2|, -|v3| ; encoding: [0x00,0x06,0xa2,0xd3,0x01,0x05,0x0e,0xa4] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mixlo_f16 v0, v1, v2, v3 clamp // GFX9-FMAMIX: v_fma_mixlo_f16 v0, v1, v2, v3 clamp ; encoding: [0x00,0x80,0xa1,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-MADMIX-ERR: error: invalid operand for instruction v_fma_mixhi_f16 v0, v1, v2, v3 clamp // GFX9-FMAMIX: v_fma_mixhi_f16 v0, v1, v2, v3 clamp ; encoding: [0x00,0x80,0xa2,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-MADMIX-ERR: error: invalid operand for instruction // // op_sel with non-packed instructions @@ -66,38 +78,50 @@ v_fma_mixhi_f16 v0, v1, v2, v3 clamp v_fma_mix_f32 v0, v1, v2, v3 op_sel:[0,0,0] // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x04] -// FIXME: Better error -// GFX-MADMIX-ERR: error: unknown token in expression +// GFX9-MADMIX-ERR: error: not a valid operand. + +// FIXME: Improve error messages v_fma_mix_f32 v0, v1, v2, v3 op_sel:[1,0,0] // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel:[1,0,0] ; encoding: [0x00,0x08,0xa0,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mix_f32 v0, v1, v2, v3 op_sel:[0,1,0] // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel:[0,1,0] ; encoding: [0x00,0x10,0xa0,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mix_f32 v0, v1, v2, v3 op_sel:[0,0,1] // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel:[0,0,1] ; encoding: [0x00,0x20,0xa0,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mix_f32 v0, v1, v2, v3 op_sel:[1,1,1] // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel:[1,1,1] ; encoding: [0x00,0x38,0xa0,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mix_f32 v0, v1, v2, v3 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-MADMIX-ERR: error: instruction not supported on this GPU v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[1,0,0] // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[1,0,0] ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x0c] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[0,1,0] // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[0,1,0] ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x14] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[0,0,1] // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[0,0,1] ; encoding: [0x00,0x40,0xa0,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[1,1,1] // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[1,1,1] ; encoding: [0x00,0x40,0xa0,0xd3,0x01,0x05,0x0e,0x1c] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mixlo_f16 v0, v1, v2, v3 op_sel_hi:[1,0,1] clamp // GFX9-FMAMIX: v_fma_mixlo_f16 v0, v1, v2, v3 op_sel_hi:[1,0,1] clamp ; encoding: [0x00,0xc0,0xa1,0xd3,0x01,0x05,0x0e,0x0c] +// GFX9-MADMIX-ERR: error: not a valid operand. v_fma_mixhi_f16 v0, v1, v2, v3 op_sel_hi:[1,0,1] clamp // GFX9-FMAMIX: v_fma_mixhi_f16 v0, v1, v2, v3 op_sel_hi:[1,0,1] clamp ; encoding: [0x00,0xc0,0xa2,0xd3,0x01,0x05,0x0e,0x0c] +// GFX9-MADMIX-ERR: error: not a valid operand. diff --git a/llvm/test/MC/AMDGPU/gfx10-constant-bus.s b/llvm/test/MC/AMDGPU/gfx10-constant-bus.s index d2034ae1354b..37e853c87be7 100644 --- a/llvm/test/MC/AMDGPU/gfx10-constant-bus.s +++ b/llvm/test/MC/AMDGPU/gfx10-constant-bus.s @@ -1,5 +1,5 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX10 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX10-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s | FileCheck -check-prefix=GFX10 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck -check-prefix=GFX10-ERR --implicit-check-not=error: %s //----------------------------------------------------------------------------------------- // On GFX10 we can use two scalar operands (except for 64-bit shift instructions) diff --git a/llvm/test/MC/AMDGPU/gfx1011_err.s b/llvm/test/MC/AMDGPU/gfx1011_err.s index e99716018c05..81c8c6254c03 100644 --- a/llvm/test/MC/AMDGPU/gfx1011_err.s +++ b/llvm/test/MC/AMDGPU/gfx1011_err.s @@ -1,50 +1,50 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1011 -show-encoding %s 2>&1 | FileCheck --check-prefix=GFX10 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1012 -show-encoding %s 2>&1 | FileCheck --check-prefix=GFX10 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1011 %s 2>&1 | FileCheck --check-prefix=GFX10 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1012 %s 2>&1 | FileCheck --check-prefix=GFX10 --implicit-check-not=error: %s v_dot8c_i32_i4 v5, v1, v2 -// GFX10: error: +// GFX10: error: instruction not supported on this GPU v_dot8c_i32_i4 v5, v1, v2 quad_perm:[0,1,2,3] row_mask:0x0 bank_mask:0x0 -// GFX10: error: +// GFX10: error: not a valid operand. v_dot8c_i32_i4 v5, v1, v2 quad_perm:[0,1,2,3] row_mask:0x0 bank_mask:0x0 fi:1 -// GFX10: error: +// GFX10: error: not a valid operand. v_dot8c_i32_i4 v5, v1, v2 dpp8:[7,6,5,4,3,2,1,0] -// GFX10: error: +// GFX10: error: not a valid operand. v_dot8c_i32_i4 v5, v1, v2 dpp8:[7,6,5,4,3,2,1,0] fi:1 -// GFX10: error: +// GFX10: error: not a valid operand. s_getreg_b32 s2, hwreg(HW_REG_SHADER_CYCLES) -// GFX10: error: +// GFX10: error: specified hardware register is not supported on this GPU v_fma_legacy_f32 v0, v1, v2, v3 -// GFX10: error: +// GFX10: error: instruction not supported on this GPU image_bvh_intersect_ray v[4:7], v[9:24], s[4:7] -// GFX10: error: +// GFX10: error: invalid instruction image_bvh_intersect_ray v[4:7], v[9:16], s[4:7] a16 -// GFX10: error: +// GFX10: error: invalid instruction image_bvh64_intersect_ray v[4:7], v[9:24], s[4:7] -// GFX10: error: +// GFX10: error: invalid instruction image_bvh64_intersect_ray v[4:7], v[9:24], s[4:7] a16 -// GFX10: error: +// GFX10: error: invalid instruction image_msaa_load v[1:4], v5, s[8:15] dmask:0xf dim:SQ_RSRC_IMG_1D -// GFX10: error: +// GFX10: error: not a valid operand. image_msaa_load v[1:4], v5, s[8:15] dmask:0xf dim:SQ_RSRC_IMG_1D glc -// GFX10: error: +// GFX10: error: not a valid operand. image_msaa_load v5, v[1:2], s[8:15] dmask:0x1 dim:SQ_RSRC_IMG_2D d16 -// GFX10: error: +// GFX10: error: not a valid operand. image_msaa_load v[1:4], v5, s[8:15] dmask:0xf dim:SQ_RSRC_IMG_1D -// GFX10: error: +// GFX10: error: not a valid operand. image_msaa_load v14, [v204,v11,v14,v19], s[40:47] dmask:0x1 dim:SQ_RSRC_IMG_2D_MSAA_ARRAY -// GFX10: error: +// GFX10: error: not a valid operand. diff --git a/llvm/test/MC/AMDGPU/gfx1030_err.s b/llvm/test/MC/AMDGPU/gfx1030_err.s index 29d906ec838b..b8e1afdfdb5b 100644 --- a/llvm/test/MC/AMDGPU/gfx1030_err.s +++ b/llvm/test/MC/AMDGPU/gfx1030_err.s @@ -1,140 +1,140 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1030 -show-encoding %s 2>&1 | FileCheck --check-prefix=GFX10 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1031 -show-encoding %s 2>&1 | FileCheck --check-prefix=GFX10 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1030 %s 2>&1 | FileCheck --check-prefix=GFX10 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1031 %s 2>&1 | FileCheck --check-prefix=GFX10 --implicit-check-not=error: %s v_dot8c_i32_i4 v5, v1, v2 -// GFX10: error: +// GFX10: error: instruction not supported on this GPU v_dot8c_i32_i4 v5, v1, v2 quad_perm:[0,1,2,3] row_mask:0x0 bank_mask:0x0 -// GFX10: error: +// GFX10: error: not a valid operand. v_dot8c_i32_i4 v5, v1, v2 quad_perm:[0,1,2,3] row_mask:0x0 bank_mask:0x0 fi:1 -// GFX10: error: +// GFX10: error: not a valid operand. v_dot8c_i32_i4 v5, v1, v2 dpp8:[7,6,5,4,3,2,1,0] -// GFX10: error: +// GFX10: error: not a valid operand. v_dot8c_i32_i4 v5, v1, v2 dpp8:[7,6,5,4,3,2,1,0] fi:1 -// GFX10: error: +// GFX10: error: not a valid operand. s_get_waveid_in_workgroup s0 -// GFX10: error: +// GFX10: error: instruction not supported on this GPU s_memtime s[0:1] -// GFX10: error: +// GFX10: error: instruction not supported on this GPU s_getreg_b32 s2, hwreg(HW_REG_XNACK_MASK) -// GFX10: error: +// GFX10: error: specified hardware register is not supported on this GPU v_mac_f32 v0, v1, v2 -// GFX10: error: +// GFX10: error: instruction not supported on this GPU v_mad_f32 v0, v1, v2, v3 -// GFX10: error: +// GFX10: error: instruction not supported on this GPU v_madak_f32 v0, v1, v2, 1 -// GFX10: error: +// GFX10: error: instruction not supported on this GPU v_madmk_f32 v0, v1, 1, v2 -// GFX10: error: +// GFX10: error: instruction not supported on this GPU v_mad_legacy_f32 v0, v1, v2, v3 -// GFX10: error: +// GFX10: error: instruction not supported on this GPU v_mac_legacy_f32 v0, v1, v2 -// GFX10: error: +// GFX10: error: instruction not supported on this GPU ds_add_src2_u32 v1 offset:65535 gds -// GFX10: error: +// GFX10: error: not a valid operand. ds_add_src2_u32 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_add_src2_f32 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_sub_src2_u32 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_rsub_src2_u32 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_inc_src2_u32 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_dec_src2_u32 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_min_src2_i32 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_max_src2_i32 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_min_src2_u32 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_max_src2_u32 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_and_src2_b32 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_or_src2_b32 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_xor_src2_b32 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_min_src2_f32 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_max_src2_f32 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_add_src2_u64 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_sub_src2_u64 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_rsub_src2_u64 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_inc_src2_u64 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_dec_src2_u64 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_min_src2_i64 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_max_src2_i64 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_min_src2_u64 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_max_src2_u64 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_and_src2_b64 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_or_src2_b64 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_xor_src2_b64 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_min_src2_f64 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_max_src2_f64 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_write_src2_b32 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. ds_write_src2_b64 v1 offset:65535 -// GFX10: error: +// GFX10: error: not a valid operand. diff --git a/llvm/test/MC/AMDGPU/gfx10_asm_all.s b/llvm/test/MC/AMDGPU/gfx10_asm_all.s index d1bbde653941..59c49220111c 100644 --- a/llvm/test/MC/AMDGPU/gfx10_asm_all.s +++ b/llvm/test/MC/AMDGPU/gfx10_asm_all.s @@ -1,7 +1,7 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=+WavefrontSize32,-WavefrontSize64 -show-encoding %s | FileCheck --check-prefixes=GFX10,W32 %s // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 -show-encoding %s | FileCheck --check-prefixes=GFX10,W64 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=+WavefrontSize32,-WavefrontSize64 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GFX10-ERR,W32-ERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GFX10-ERR,W64-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=+WavefrontSize32,-WavefrontSize64 %s 2>&1 | FileCheck --check-prefixes=GFX10-ERR,W32-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 %s 2>&1 | FileCheck --check-prefixes=GFX10-ERR,W64-ERR --implicit-check-not=error: %s //===----------------------------------------------------------------------===// // ENC_DS. diff --git a/llvm/test/MC/AMDGPU/gfx10_asm_dpp16.s b/llvm/test/MC/AMDGPU/gfx10_asm_dpp16.s index ce3cef52e899..01159c365ebc 100644 --- a/llvm/test/MC/AMDGPU/gfx10_asm_dpp16.s +++ b/llvm/test/MC/AMDGPU/gfx10_asm_dpp16.s @@ -1,7 +1,7 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=+WavefrontSize32,-WavefrontSize64 -show-encoding %s | FileCheck --check-prefixes=GFX10,W32 %s // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 -show-encoding %s | FileCheck --check-prefixes=GFX10,W64 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=+WavefrontSize32,-WavefrontSize64 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GFX10-ERR,W32-ERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GFX10-ERR,W64-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=+WavefrontSize32,-WavefrontSize64 %s 2>&1 | FileCheck --check-prefixes=GFX10-ERR,W32-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 %s 2>&1 | FileCheck --check-prefixes=GFX10-ERR,W64-ERR --implicit-check-not=error: %s v_mov_b32_dpp v5, v1 quad_perm:[3,2,1,0] row_mask:0x0 bank_mask:0x0 // GFX10: [0xfa,0x02,0x0a,0x7e,0x01,0x1b,0x00,0x00] diff --git a/llvm/test/MC/AMDGPU/gfx10_asm_dpp8.s b/llvm/test/MC/AMDGPU/gfx10_asm_dpp8.s index b8ede28ec076..e6985532bd1a 100644 --- a/llvm/test/MC/AMDGPU/gfx10_asm_dpp8.s +++ b/llvm/test/MC/AMDGPU/gfx10_asm_dpp8.s @@ -1,7 +1,7 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=+WavefrontSize32,-WavefrontSize64 -show-encoding %s | FileCheck --check-prefixes=GFX10,W32 %s // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 -show-encoding %s | FileCheck --check-prefixes=GFX10,W64 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=+WavefrontSize32,-WavefrontSize64 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GFX10-ERR,W32-ERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GFX10-ERR,W64-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=+WavefrontSize32,-WavefrontSize64 %s 2>&1 | FileCheck --check-prefixes=GFX10-ERR,W32-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 %s 2>&1 | FileCheck --check-prefixes=GFX10-ERR,W64-ERR --implicit-check-not=error: %s v_mov_b32_dpp v5, v1 dpp8:[0,1,2,3,4,5,6,7] // GFX10: encoding: [0xe9,0x02,0x0a,0x7e,0x01,0x88,0xc6,0xfa] diff --git a/llvm/test/MC/AMDGPU/gfx10_asm_err.s b/llvm/test/MC/AMDGPU/gfx10_asm_err.s index 251dde827b71..978ec345f2b0 100644 --- a/llvm/test/MC/AMDGPU/gfx10_asm_err.s +++ b/llvm/test/MC/AMDGPU/gfx10_asm_err.s @@ -1,9 +1,9 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx601 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GFX6-7,GFX6-8,GFX6-9 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx701 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GFX6-7,GFX6-8,GFX6-9 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx801 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GFX6-8,GFX6-9 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GFX6-9 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=+WavefrontSize32,-WavefrontSize64 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GFX10 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GFX10 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx601 %s 2>&1 | FileCheck --check-prefixes=GFX6-7,GFX6-8,GFX6-9 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx701 %s 2>&1 | FileCheck --check-prefixes=GFX6-7,GFX6-8,GFX6-9 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx801 %s 2>&1 | FileCheck --check-prefixes=GFX6-8,GFX6-9 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck --check-prefixes=GFX6-9 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=+WavefrontSize32,-WavefrontSize64 %s 2>&1 | FileCheck --check-prefixes=GFX10 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 %s 2>&1 | FileCheck --check-prefixes=GFX10 --implicit-check-not=error: %s //===----------------------------------------------------------------------===// // ENC_DS. @@ -124,6 +124,7 @@ s_bitreplicate_b64_b32 s[0:1], s2 s_set_gpr_idx_idx s0 // GFX10: error: instruction not supported on this GPU +// GFX6-7: error: instruction not supported on this GPU // GFX6, GFX7, GFX8, GFX9. @@ -167,6 +168,7 @@ s_pack_hh_b32_b16 s0, s1, s2 s_rfe_restore_b64 s[0:1], s2 // GFX10: error: instruction not supported on this GPU +// GFX6-7: error: instruction not supported on this GPU // GFX6, GFX7, GFX8, GFX9. diff --git a/llvm/test/MC/AMDGPU/gfx10_asm_mimg_err.s b/llvm/test/MC/AMDGPU/gfx10_asm_mimg_err.s index 3a33ed4b8a60..f99a29536236 100644 --- a/llvm/test/MC/AMDGPU/gfx10_asm_mimg_err.s +++ b/llvm/test/MC/AMDGPU/gfx10_asm_mimg_err.s @@ -1,4 +1,4 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck --check-prefixes=NOGFX10 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck --check-prefixes=NOGFX10 --implicit-check-not=error: %s ; TODO: more helpful error message for missing dim operand image_load v[0:3], v0, s[0:7] dmask:0xf unorm diff --git a/llvm/test/MC/AMDGPU/gfx8_asm_all.s b/llvm/test/MC/AMDGPU/gfx8_asm_all.s index 1610bfa7d92a..1362a4f871b2 100644 --- a/llvm/test/MC/AMDGPU/gfx8_asm_all.s +++ b/llvm/test/MC/AMDGPU/gfx8_asm_all.s @@ -1,5 +1,5 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=CHECK-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=CHECK-ERR --implicit-check-not=error: %s ds_add_u32 v1, v2 offset:65535 // CHECK: [0xff,0xff,0x00,0xd8,0x01,0x02,0x00,0x00] diff --git a/llvm/test/MC/AMDGPU/gfx9-asm-err.s b/llvm/test/MC/AMDGPU/gfx9-asm-err.s index ff63cdf2a35a..de0930cf952a 100644 --- a/llvm/test/MC/AMDGPU/gfx9-asm-err.s +++ b/llvm/test/MC/AMDGPU/gfx9-asm-err.s @@ -1,4 +1,4 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX9ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefix=GFX9ERR --implicit-check-not=error: %s v_cvt_f16_u16_e64 v5, 0.5 // GFX9ERR: error: invalid literal operand diff --git a/llvm/test/MC/AMDGPU/gfx9-vop2be-literal.s b/llvm/test/MC/AMDGPU/gfx9-vop2be-literal.s index f996c4e3c0a7..d1c7a759385a 100644 --- a/llvm/test/MC/AMDGPU/gfx9-vop2be-literal.s +++ b/llvm/test/MC/AMDGPU/gfx9-vop2be-literal.s @@ -1,4 +1,4 @@ -# RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding < %s 2>&1 | FileCheck -check-prefix=GFX9-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefix=GFX9-ERR --implicit-check-not=error: %s v_addc_co_u32_e32 v3, vcc, 12345, v3, vcc // GFX9-ERR: error: invalid operand (violates constant bus restrictions) diff --git a/llvm/test/MC/AMDGPU/gfx9_asm_all.s b/llvm/test/MC/AMDGPU/gfx9_asm_all.s index b3b8bf86a131..93050e4c292b 100644 --- a/llvm/test/MC/AMDGPU/gfx9_asm_all.s +++ b/llvm/test/MC/AMDGPU/gfx9_asm_all.s @@ -1,6 +1,6 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck %s // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -mattr=+d16-preserves-unused-bits -show-encoding %s | FileCheck %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -mattr=+d16-preserves-unused-bits %s 2>&1 | FileCheck -check-prefix=CHECK-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -mattr=+d16-preserves-unused-bits %s 2>&1 | FileCheck -check-prefix=CHECK-ERR --implicit-check-not=error: %s ds_add_u32 v1, v2 offset:65535 // CHECK: [0xff,0xff,0x00,0xd8,0x01,0x02,0x00,0x00] diff --git a/llvm/test/MC/AMDGPU/invalid-instructions-spellcheck.s b/llvm/test/MC/AMDGPU/invalid-instructions-spellcheck.s index 546ed25a60eb..14800de71cbd 100644 --- a/llvm/test/MC/AMDGPU/invalid-instructions-spellcheck.s +++ b/llvm/test/MC/AMDGPU/invalid-instructions-spellcheck.s @@ -10,10 +10,6 @@ v2, v4, v6 # CHECK-NEXT: v2, v4, v6 # CHECK-NEXT: ^ -# CHECK: error: failed parsing operand -# CHECK-NEXT: v2, v4, v6 -# CHECK-NEXT: ^ - # We don't want to see a suggestion here; the edit distance is too large to # give sensible suggestions: diff --git a/llvm/test/MC/AMDGPU/lds_direct-err.s b/llvm/test/MC/AMDGPU/lds_direct-err.s index 578461bc35ad..3e5bfe48ca0a 100644 --- a/llvm/test/MC/AMDGPU/lds_direct-err.s +++ b/llvm/test/MC/AMDGPU/lds_direct-err.s @@ -1,4 +1,4 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck %s --check-prefix=NOGFX9 +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck %s --check-prefix=NOGFX9 --implicit-check-not=error: //---------------------------------------------------------------------------// // lds_direct may be used only with vector ALU instructions diff --git a/llvm/test/MC/AMDGPU/lds_direct-gfx10.s b/llvm/test/MC/AMDGPU/lds_direct-gfx10.s index f3174553e579..61e4de3e4691 100644 --- a/llvm/test/MC/AMDGPU/lds_direct-gfx10.s +++ b/llvm/test/MC/AMDGPU/lds_direct-gfx10.s @@ -1,5 +1,5 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s | FileCheck %s --check-prefix=GFX10 -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGFX10 +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck %s --check-prefix=NOGFX10 --implicit-check-not=error: v_readfirstlane_b32 s0, lds_direct // GFX10: v_readfirstlane_b32 s0, src_lds_direct ; encoding: [0xfe,0x04,0x00,0x7e] diff --git a/llvm/test/MC/AMDGPU/literal16-err.s b/llvm/test/MC/AMDGPU/literal16-err.s index f9b3d40f84d9..6a2f1eb23a47 100644 --- a/llvm/test/MC/AMDGPU/literal16-err.s +++ b/llvm/test/MC/AMDGPU/literal16-err.s @@ -1,4 +1,4 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck -check-prefix=NOVI %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=NOVI --implicit-check-not=error: %s v_add_f16 v1, 0xfffff, v2 // NOVI: error: invalid operand for instruction diff --git a/llvm/test/MC/AMDGPU/literals.s b/llvm/test/MC/AMDGPU/literals.s index dd9d2903a1ae..b666b7d1cb78 100644 --- a/llvm/test/MC/AMDGPU/literals.s +++ b/llvm/test/MC/AMDGPU/literals.s @@ -4,11 +4,11 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=CIVI --check-prefix=GFX89 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=CIVI --check-prefix=GFX89 --check-prefix=GFX9 -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGCN --check-prefix=NOSI --check-prefix=NOSICI --check-prefix=NOSICIVI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGCN --check-prefix=NOSI --check-prefix=NOSICI --check-prefix=NOSICIVI -// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGCN --check-prefix=NOSICI --check-prefix=NOCIVI --check-prefix=NOSICIVI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGCN --check-prefix=NOSICIVI --check-prefix=NOVI --check-prefix=NOGFX89 -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGCN --check-prefix=NOGFX89 --check-prefix=NOGFX9 +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=NOGCN --check-prefix=NOSI --check-prefix=NOSICI --check-prefix=NOSICIVI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s --check-prefix=NOGCN --check-prefix=NOSI --check-prefix=NOSICI --check-prefix=NOSICIVI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck %s --check-prefix=NOGCN --check-prefix=NOSICI --check-prefix=NOCIVI --check-prefix=NOSICIVI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck %s --check-prefix=NOGCN --check-prefix=NOSICIVI --check-prefix=NOVI --check-prefix=NOGFX89 --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck %s --check-prefix=NOGCN --check-prefix=NOGFX89 --check-prefix=NOGFX9 --implicit-check-not=error: //---------------------------------------------------------------------------// // fp literal, expected fp operand @@ -640,132 +640,133 @@ v_ceil_f32_sdwa v5, |execz| dst_sel:DWORD src0_sel:DWORD // named inline values: shared_base, shared_limit, private_base, etc //---------------------------------------------------------------------------// -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: buffer_atomic_add v0, off, s[0:3], src_shared_base offset:4095 ; encoding: [0xff,0x0f,0x08,0xe1,0x00,0x00,0x00,0xeb] buffer_atomic_add v0, off, s[0:3], src_shared_base offset:4095 -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: s_add_i32 s0, src_shared_base, s0 ; encoding: [0xeb,0x00,0x00,0x81] s_add_i32 s0, src_shared_base, s0 -// NOSICIVI: error: failed parsing operand. + + + + + + +// NOSICIVI: error: not a valid operand // GFX9: s_add_i32 s0, src_shared_limit, s0 ; encoding: [0xec,0x00,0x00,0x81] s_add_i32 s0, src_shared_limit, s0 -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: s_add_i32 s0, src_private_base, s0 ; encoding: [0xed,0x00,0x00,0x81] s_add_i32 s0, src_private_base, s0 -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: s_add_i32 s0, src_private_limit, s0 ; encoding: [0xee,0x00,0x00,0x81] s_add_i32 s0, src_private_limit, s0 -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: s_add_i32 s0, src_pops_exiting_wave_id, s0 ; encoding: [0xef,0x00,0x00,0x81] s_add_i32 s0, src_pops_exiting_wave_id, s0 -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: s_and_b64 s[0:1], s[0:1], src_shared_base ; encoding: [0x00,0xeb,0x80,0x86] s_and_b64 s[0:1], s[0:1], src_shared_base -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: s_and_b64 s[0:1], s[0:1], src_shared_limit ; encoding: [0x00,0xec,0x80,0x86] s_and_b64 s[0:1], s[0:1], src_shared_limit -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: s_and_b64 s[0:1], s[0:1], src_private_base ; encoding: [0x00,0xed,0x80,0x86] s_and_b64 s[0:1], s[0:1], src_private_base -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: s_and_b64 s[0:1], s[0:1], src_private_limit ; encoding: [0x00,0xee,0x80,0x86] s_and_b64 s[0:1], s[0:1], src_private_limit -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: s_and_b64 s[0:1], s[0:1], src_pops_exiting_wave_id ; encoding: [0x00,0xef,0x80,0x86] s_and_b64 s[0:1], s[0:1], src_pops_exiting_wave_id -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_add_u16_e32 v0, src_shared_base, v0 ; encoding: [0xeb,0x00,0x00,0x4c] v_add_u16 v0, src_shared_base, v0 -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_add_u16_sdwa v0, src_shared_base, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x00,0x00,0x4c,0xeb,0x06,0x86,0x06] v_add_u16_sdwa v0, src_shared_base, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_add_u16_sdwa v0, v0, src_shared_base dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0xd6,0x01,0x4c,0x00,0x06,0x06,0x86] v_add_u16_sdwa v0, v0, src_shared_base dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_add_u32_e32 v0, src_shared_base, v0 ; encoding: [0xeb,0x00,0x00,0x68] v_add_u32 v0, src_shared_base, v0 -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_add_u32_e64 v0, src_shared_base, v0 ; encoding: [0x00,0x00,0x34,0xd1,0xeb,0x00,0x02,0x00] v_add_u32_e64 v0, src_shared_base, v0 -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_cmp_eq_i64_e32 vcc, src_shared_base, v[0:1] ; encoding: [0xeb,0x00,0xc4,0x7d] v_cmp_eq_i64 vcc, src_shared_base, v[0:1] -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_max_f16_e32 v0, src_shared_base, v0 ; encoding: [0xeb,0x00,0x00,0x5a] v_max_f16 v0, src_shared_base, v0 -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_max_f32_e32 v0, src_shared_base, v0 ; encoding: [0xeb,0x00,0x00,0x16] v_max_f32 v0, src_shared_base, v0 -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_max_f64 v[0:1], src_shared_base, v[0:1] ; encoding: [0x00,0x00,0x83,0xd2,0xeb,0x00,0x02,0x00] v_max_f64 v[0:1], src_shared_base, v[0:1] -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_pk_add_f16 v0, src_shared_base, v0 ; encoding: [0x00,0x00,0x8f,0xd3,0xeb,0x00,0x02,0x18] v_pk_add_f16 v0, src_shared_base, v0 -// NOSICI: error: not a valid operand -// NOVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_ceil_f16_e64 v0, -src_shared_base ; encoding: [0x00,0x00,0x85,0xd1,0xeb,0x00,0x00,0x20] v_ceil_f16 v0, neg(src_shared_base) -// NOSICI: error: not a valid operand -// NOVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_ceil_f16_e64 v0, |src_shared_base| ; encoding: [0x00,0x01,0x85,0xd1,0xeb,0x00,0x00,0x00] v_ceil_f16 v0, abs(src_shared_base) -// NOSOCIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_ceil_f64_e64 v[5:6], |src_shared_base| ; encoding: [0x05,0x01,0x58,0xd1,0xeb,0x00,0x00,0x00] v_ceil_f64 v[5:6], |src_shared_base| -// NOSI: error: not a valid operand -// NOCIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_ceil_f64_e64 v[5:6], -src_shared_base ; encoding: [0x05,0x00,0x58,0xd1,0xeb,0x00,0x00,0x20] v_ceil_f64 v[5:6], -src_shared_base -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_ceil_f32_e64 v0, -src_shared_base ; encoding: [0x00,0x00,0x5d,0xd1,0xeb,0x00,0x00,0x20] v_ceil_f32 v0, -src_shared_base -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_ceil_f32_e64 v0, |src_shared_base| ; encoding: [0x00,0x01,0x5d,0xd1,0xeb,0x00,0x00,0x00] v_ceil_f32 v0, |src_shared_base| -// NOSICI: error: not a valid operand. -// NOVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_ceil_f16_sdwa v5, |src_shared_base| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x8a,0x0a,0x7e,0xeb,0x16,0xa6,0x00] v_ceil_f16_sdwa v5, |src_shared_base| dst_sel:DWORD dst_unused:UNUSED_PRESERVE -// NOSICI: error: not a valid operand. -// NOVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_ceil_f16_sdwa v5, -src_shared_base dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x8a,0x0a,0x7e,0xeb,0x16,0x96,0x00] v_ceil_f16_sdwa v5, -src_shared_base dst_sel:DWORD dst_unused:UNUSED_PRESERVE -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_ceil_f32_sdwa v5, src_shared_base dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x3a,0x0a,0x7e,0xeb,0x16,0x86,0x00] v_ceil_f32_sdwa v5, src_shared_base dst_sel:DWORD src0_sel:DWORD -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // GFX9: v_ceil_f32_sdwa v5, |src_shared_base| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x3a,0x0a,0x7e,0xeb,0x16,0xa6,0x00] v_ceil_f32_sdwa v5, |src_shared_base| dst_sel:DWORD src0_sel:DWORD @@ -773,7 +774,7 @@ v_ceil_f32_sdwa v5, |src_shared_base| dst_sel:DWORD src0_sel:DWORD // named inline values compete with other scalars for constant bus access //---------------------------------------------------------------------------// -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // NOGFX9: error: invalid operand (violates constant bus restrictions) v_add_u32 v0, private_base, s0 @@ -782,17 +783,17 @@ v_add_u32 v0, private_base, s0 v_add_u32 v0, scc, s0 // v_div_fmas implicitly reads VCC -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // NOGFX9: error: invalid operand (violates constant bus restrictions) v_div_fmas_f32 v0, shared_base, v0, v1 // v_div_fmas implicitly reads VCC -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // NOGFX9: error: invalid operand (violates constant bus restrictions) v_div_fmas_f32 v0, v0, shared_limit, v1 // v_div_fmas implicitly reads VCC -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // NOGFX9: error: invalid operand (violates constant bus restrictions) v_div_fmas_f32 v0, v0, v1, private_limit @@ -809,29 +810,29 @@ v_div_fmas_f32 v0, v0, scc, v1 v_div_fmas_f32 v0, v0, v1, vccz // v_addc_co_u32 implicitly reads VCC (VOP2) -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // NOGFX9: error: invalid operand (violates constant bus restrictions) v_addc_co_u32 v0, vcc, shared_base, v0, vcc -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // NOGFX9: error: invalid operand (violates constant bus restrictions) v_madak_f32 v0, shared_base, v0, 0x11213141 // NOGCN: error: invalid operand (violates constant bus restrictions) v_madak_f32 v0, scc, v0, 0x11213141 -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // NOGFX9: error: invalid operand (violates constant bus restrictions) v_cmp_eq_f32 s[0:1], private_base, private_limit -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // NOGFX9: error: invalid operand (violates constant bus restrictions) v_cmp_eq_f32 s[0:1], private_base, s0 // NOGCN: error: invalid operand (violates constant bus restrictions) v_cmp_eq_f32 s[0:1], execz, s0 -// NOSICIVI: error: failed parsing operand. +// NOSICIVI: error: not a valid operand // NOGFX9: error: invalid operand (violates constant bus restrictions) v_pk_add_f16 v255, private_base, private_limit diff --git a/llvm/test/MC/AMDGPU/literalv216-err.s b/llvm/test/MC/AMDGPU/literalv216-err.s index 3a1c49b136fd..eefe1b343c3a 100644 --- a/llvm/test/MC/AMDGPU/literalv216-err.s +++ b/llvm/test/MC/AMDGPU/literalv216-err.s @@ -1,5 +1,5 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX9 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX10 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefix=GFX9 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck -check-prefix=GFX10 --implicit-check-not=error: %s v_pk_add_f16 v1, -17, v2 // GFX9: error: invalid literal operand @@ -38,12 +38,9 @@ v_pk_mad_i16 v5, 0x3c00, 0x4000, 2 v_pk_mad_i16 v5, 0x3c00, 3, 2 // GFX9: error: invalid literal operand -// GFX10-NOT: error: v_pk_mad_i16 v5, 3, 0x3c00, 2 // GFX9: error: invalid literal operand -// GFX10-NOT: error: v_pk_mad_i16 v5, 3, 2, 0x3c00 // GFX9: error: invalid literal operand -// GFX10-NOT: error: diff --git a/llvm/test/MC/AMDGPU/literalv216.s b/llvm/test/MC/AMDGPU/literalv216.s index 9bcc1341774a..ac05c280f049 100644 --- a/llvm/test/MC/AMDGPU/literalv216.s +++ b/llvm/test/MC/AMDGPU/literalv216.s @@ -1,8 +1,8 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck %s --check-prefix=GFX9 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s | FileCheck %s --check-prefix=GFX10 -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck %s -check-prefix=NOGFX9 -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck %s -check-prefix=NOGFX10 +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck %s -check-prefix=NOGFX9 --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck %s -check-prefix=NOGFX10 --implicit-check-not=error: //===----------------------------------------------------------------------===// // Inline constants diff --git a/llvm/test/MC/AMDGPU/mad-mix.s b/llvm/test/MC/AMDGPU/mad-mix.s index 539de050f4d7..0a261a922725 100644 --- a/llvm/test/MC/AMDGPU/mad-mix.s +++ b/llvm/test/MC/AMDGPU/mad-mix.s @@ -1,6 +1,6 @@ // RUN: llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck -check-prefix=GFX9-MADMIX %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx904 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX9-FMAMIX-ERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx906 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX9-FMAMIX-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx904 %s 2>&1 | FileCheck -check-prefix=GFX9-FMAMIX-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx906 %s 2>&1 | FileCheck -check-prefix=GFX9-FMAMIX-ERR --implicit-check-not=error: %s v_mad_mix_f32 v0, v1, v2, v3 // GFX9-MADMIX: v_mad_mix_f32 v0, v1, v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x04] @@ -20,45 +20,57 @@ v_mad_mixhi_f16 v0, v1, v2, v3 v_mad_mix_f32 v0, abs(v1), v2, v3 // GFX9-MADMIX: v_mad_mix_f32 v0, |v1|, v2, v3 ; encoding: [0x00,0x01,0xa0,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-FMAMIX-ERR: error: not a valid operand. -// FIXME: Better error -// GFX9-FMAMIX-ERR: error: invalid operand for instruction +// FIXME: Improve diagnistics v_mad_mix_f32 v0, v1, abs(v2), v3 // GFX9-MADMIX: v_mad_mix_f32 v0, v1, |v2|, v3 ; encoding: [0x00,0x02,0xa0,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mix_f32 v0, v1, v2, abs(v3) // GFX9-MADMIX: v_mad_mix_f32 v0, v1, v2, |v3| ; encoding: [0x00,0x04,0xa0,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mix_f32 v0, -v1, v2, v3 // GFX9-MADMIX: v_mad_mix_f32 v0, -v1, v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x24] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mix_f32 v0, v1, -v2, v3 // GFX9-MADMIX: v_mad_mix_f32 v0, v1, -v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x44] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mix_f32 v0, v1, v2, -v3 // GFX9-MADMIX: v_mad_mix_f32 v0, v1, v2, -v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x84] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mix_f32 v0, -abs(v1), v2, v3 // GFX9-MADMIX: v_mad_mix_f32 v0, -|v1|, v2, v3 ; encoding: [0x00,0x01,0xa0,0xd3,0x01,0x05,0x0e,0x24] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mix_f32 v0, v1, -abs(v2), v3 // GFX9-MADMIX: v_mad_mix_f32 v0, v1, -|v2|, v3 ; encoding: [0x00,0x02,0xa0,0xd3,0x01,0x05,0x0e,0x44] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mix_f32 v0, v1, v2, -abs(v3) // GFX9-MADMIX: v_mad_mix_f32 v0, v1, v2, -|v3| ; encoding: [0x00,0x04,0xa0,0xd3,0x01,0x05,0x0e,0x84] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mixlo_f16 v0, abs(v1), -v2, abs(v3) // GFX9-MADMIX: v_mad_mixlo_f16 v0, |v1|, -v2, |v3| ; encoding: [0x00,0x05,0xa1,0xd3,0x01,0x05,0x0e,0x44] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mixhi_f16 v0, -v1, abs(v2), -abs(v3) // GFX9-MADMIX: v_mad_mixhi_f16 v0, -v1, |v2|, -|v3| ; encoding: [0x00,0x06,0xa2,0xd3,0x01,0x05,0x0e,0xa4] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mixlo_f16 v0, v1, v2, v3 clamp // GFX9-MADMIX: v_mad_mixlo_f16 v0, v1, v2, v3 clamp ; encoding: [0x00,0x80,0xa1,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-FMAMIX-ERR: error: invalid operand for instruction v_mad_mixhi_f16 v0, v1, v2, v3 clamp // GFX9-MADMIX: v_mad_mixhi_f16 v0, v1, v2, v3 clamp ; encoding: [0x00,0x80,0xa2,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-FMAMIX-ERR: error: invalid operand for instruction // // op_sel with non-packed instructions @@ -66,38 +78,50 @@ v_mad_mixhi_f16 v0, v1, v2, v3 clamp v_mad_mix_f32 v0, v1, v2, v3 op_sel:[0,0,0] // GFX9-MADMIX: v_mad_mix_f32 v0, v1, v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x04] -// FIXME: Better error -// GFX-FMAMIX-ERR: error: unknown token in expression +// GFX9-FMAMIX-ERR: error: not a valid operand. + +// FIXME: Improve diagnistics v_mad_mix_f32 v0, v1, v2, v3 op_sel:[1,0,0] // GFX9-MADMIX: v_mad_mix_f32 v0, v1, v2, v3 op_sel:[1,0,0] ; encoding: [0x00,0x08,0xa0,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mix_f32 v0, v1, v2, v3 op_sel:[0,1,0] // GFX9-MADMIX: v_mad_mix_f32 v0, v1, v2, v3 op_sel:[0,1,0] ; encoding: [0x00,0x10,0xa0,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mix_f32 v0, v1, v2, v3 op_sel:[0,0,1] // GFX9-MADMIX: v_mad_mix_f32 v0, v1, v2, v3 op_sel:[0,0,1] ; encoding: [0x00,0x20,0xa0,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mix_f32 v0, v1, v2, v3 op_sel:[1,1,1] // GFX9-MADMIX: v_mad_mix_f32 v0, v1, v2, v3 op_sel:[1,1,1] ; encoding: [0x00,0x38,0xa0,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mix_f32 v0, v1, v2, v3 // GFX9-MADMIX: v_mad_mix_f32 v0, v1, v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-FMAMIX-ERR: error: instruction not supported on this GPU v_mad_mix_f32 v0, v1, v2, v3 op_sel_hi:[1,0,0] // GFX9-MADMIX: v_mad_mix_f32 v0, v1, v2, v3 op_sel_hi:[1,0,0] ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x0c] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mix_f32 v0, v1, v2, v3 op_sel_hi:[0,1,0] // GFX9-MADMIX: v_mad_mix_f32 v0, v1, v2, v3 op_sel_hi:[0,1,0] ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x14] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mix_f32 v0, v1, v2, v3 op_sel_hi:[0,0,1] // GFX9-MADMIX: v_mad_mix_f32 v0, v1, v2, v3 op_sel_hi:[0,0,1] ; encoding: [0x00,0x40,0xa0,0xd3,0x01,0x05,0x0e,0x04] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mix_f32 v0, v1, v2, v3 op_sel_hi:[1,1,1] // GFX9-MADMIX: v_mad_mix_f32 v0, v1, v2, v3 op_sel_hi:[1,1,1] ; encoding: [0x00,0x40,0xa0,0xd3,0x01,0x05,0x0e,0x1c] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mixlo_f16 v0, v1, v2, v3 op_sel_hi:[1,0,1] clamp // GFX9-MADMIX: v_mad_mixlo_f16 v0, v1, v2, v3 op_sel_hi:[1,0,1] clamp ; encoding: [0x00,0xc0,0xa1,0xd3,0x01,0x05,0x0e,0x0c] +// GFX9-FMAMIX-ERR: error: not a valid operand. v_mad_mixhi_f16 v0, v1, v2, v3 op_sel_hi:[1,0,1] clamp // GFX9-MADMIX: v_mad_mixhi_f16 v0, v1, v2, v3 op_sel_hi:[1,0,1] clamp ; encoding: [0x00,0xc0,0xa2,0xd3,0x01,0x05,0x0e,0x0c] +// GFX9-FMAMIX-ERR: error: not a valid operand. diff --git a/llvm/test/MC/AMDGPU/mai-err.s b/llvm/test/MC/AMDGPU/mai-err.s index 9b9b733428e4..6f3361c0c9f3 100644 --- a/llvm/test/MC/AMDGPU/mai-err.s +++ b/llvm/test/MC/AMDGPU/mai-err.s @@ -1,527 +1,700 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx908 %s 2>&1 | FileCheck -check-prefix=GFX908 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefix=GFX900 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx908 %s 2>&1 | FileCheck -check-prefix=GFX908 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefix=GFX900 --implicit-check-not=error: %s v_accvgpr_read_b32 v0, v0 // GFX908: error: invalid operand for instruction +// GFX900: error: invalid operand for instruction v_accvgpr_read_b32 a0, a0 // GFX908: error: invalid operand for instruction +// GFX900: error: invalid operand for instruction v_accvgpr_read_b32 v0, 1 // GFX908: error: invalid operand for instruction +// GFX900: error: invalid operand for instruction v_accvgpr_read_b32 v0, s0 // GFX908: error: invalid operand for instruction +// GFX900: error: invalid operand for instruction v_accvgpr_read_b32 v0, a0 // GFX900: error: instruction not supported on this GPU v_accvgpr_write_b32 v0, v0 // GFX908: error: invalid operand for instruction +// GFX900: error: invalid operand for instruction v_accvgpr_write_b32 a0, a0 // GFX908: error: invalid operand for instruction +// GFX900: error: invalid operand for instruction v_accvgpr_write_b32 a0, s0 // GFX908: error: invalid operand for instruction +// GFX900: error: invalid operand for instruction v_accvgpr_write_b32 a0, 65 // GFX908: error: invalid operand for instruction +// GFX900: error: invalid operand for instruction v_accvgpr_write_b32 a0, v0 // GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x1f32 v[0:31], v0, v1, a[1:32] // GFX908: error: invalid operand for instruction +// GFX900: error: invalid operand for instruction v_mfma_f32_32x32x1f32 a[0:31], v0, v1, v[1:32] // GFX908: error: invalid operand for instruction +// GFX900: error: invalid operand for instruction v_mfma_f32_32x32x1f32 a[0:31], s0, v1, a[1:32] // GFX908: error: invalid operand for instruction +// GFX900: error: invalid operand for instruction v_mfma_f32_32x32x1f32 a[0:31], 1, v1, a[1:32] // GFX908: error: invalid operand for instruction +// GFX900: error: invalid operand for instruction v_mfma_f32_32x32x1f32 a[0:31], v0, v1, 65 // GFX908: error: invalid operand for instruction +// GFX900: error: invalid operand for instruction v_mfma_f32_32x32x1f32 a[0:31], v0, v1, 0 // GFX900: error: instruction not supported on this GPU +// GFX908: error: invalid literal operand v_mfma_f32_32x32x1f32 a[0:31], v0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x1f32 a[0:31], v0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x1f32 a[0:31], v0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x1f32 a[0:31], v0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x1f32 a[0:31], a0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x1f32 a[0:31], a0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x1f32 a[0:31], a0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x1f32 a[0:31], a0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x1f32 a[0:15], v0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x1f32 a[0:15], v0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x1f32 a[0:15], v0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x1f32 a[0:15], v0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x1f32 a[0:15], a0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x1f32 a[0:15], a0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x1f32 a[0:15], a0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x1f32 a[0:15], a0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_4x4x1f32 a[0:3], v0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_4x4x1f32 a[0:3], v0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_4x4x1f32 a[0:3], v0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_4x4x1f32 a[0:3], v0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_4x4x1f32 a[0:3], a0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_4x4x1f32 a[0:3], a0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_4x4x1f32 a[0:3], a0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_4x4x1f32 a[0:3], a0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x2f32 a[0:15], v0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x2f32 a[0:15], v0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x2f32 a[0:15], v0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x2f32 a[0:15], v0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x2f32 a[0:15], a0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x2f32 a[0:15], a0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x2f32 a[0:15], a0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x2f32 a[0:15], a0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x4f32 a[0:3], v0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x4f32 a[0:3], v0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x4f32 a[0:3], v0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x4f32 a[0:3], v0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x4f32 a[0:3], a0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x4f32 a[0:3], a0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x4f32 a[0:3], a0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x4f32 a[0:3], a0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x4f16 a[0:31], v[0:1], v[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x4f16 a[0:31], v[0:1], v[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x4f16 a[0:31], v[0:1], a[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x4f16 a[0:31], v[0:1], a[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x4f16 a[0:31], a[0:1], v[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x4f16 a[0:31], a[0:1], v[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x4f16 a[0:31], a[0:1], a[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x4f16 a[0:31], a[0:1], a[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x4f16 a[0:15], v[0:1], v[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x4f16 a[0:15], v[0:1], v[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x4f16 a[0:15], v[0:1], a[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x4f16 a[0:15], v[0:1], a[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x4f16 a[0:15], a[0:1], v[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x4f16 a[0:15], a[0:1], v[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x4f16 a[0:15], a[0:1], a[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x4f16 a[0:15], a[0:1], a[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_4x4x4f16 a[0:3], v[0:1], v[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_4x4x4f16 a[0:3], v[0:1], v[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_4x4x4f16 a[0:3], v[0:1], a[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_4x4x4f16 a[0:3], v[0:1], a[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_4x4x4f16 a[0:3], a[0:1], v[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_4x4x4f16 a[0:3], a[0:1], v[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_4x4x4f16 a[0:3], a[0:1], a[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_4x4x4f16 a[0:3], a[0:1], a[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x8f16 a[0:15], v[0:1], v[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x8f16 a[0:15], v[0:1], v[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x8f16 a[0:15], v[0:1], a[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x8f16 a[0:15], v[0:1], a[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x8f16 a[0:15], a[0:1], v[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x8f16 a[0:15], a[0:1], v[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x8f16 a[0:15], a[0:1], a[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x8f16 a[0:15], a[0:1], a[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x16f16 a[0:3], v[0:1], v[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x16f16 a[0:3], v[0:1], v[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x16f16 a[0:3], v[0:1], a[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x16f16 a[0:3], v[0:1], a[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x16f16 a[0:3], a[0:1], v[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x16f16 a[0:3], a[0:1], v[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x16f16 a[0:3], a[0:1], a[1:2], -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x16f16 a[0:3], a[0:1], a[1:2], -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_32x32x4i8 a[0:31], v0, v1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_32x32x4i8 a[0:31], v0, v1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_32x32x4i8 a[0:31], v0, a1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_32x32x4i8 a[0:31], v0, a1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_32x32x4i8 a[0:31], a0, v1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_32x32x4i8 a[0:31], a0, v1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_32x32x4i8 a[0:31], a0, a1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_32x32x4i8 a[0:31], a0, a1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_16x16x4i8 a[0:15], v0, v1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_16x16x4i8 a[0:15], v0, v1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_16x16x4i8 a[0:15], v0, a1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_16x16x4i8 a[0:15], v0, a1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_16x16x4i8 a[0:15], a0, v1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_16x16x4i8 a[0:15], a0, v1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_16x16x4i8 a[0:15], a0, a1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_16x16x4i8 a[0:15], a0, a1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_4x4x4i8 a[0:3], v0, v1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_4x4x4i8 a[0:3], v0, v1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_4x4x4i8 a[0:3], v0, a1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_4x4x4i8 a[0:3], v0, a1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_4x4x4i8 a[0:3], a0, v1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_4x4x4i8 a[0:3], a0, v1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_4x4x4i8 a[0:3], a0, a1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_4x4x4i8 a[0:3], a0, a1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_32x32x8i8 a[0:15], v0, v1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_32x32x8i8 a[0:15], v0, v1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_32x32x8i8 a[0:15], v0, a1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_32x32x8i8 a[0:15], v0, a1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_32x32x8i8 a[0:15], a0, v1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_32x32x8i8 a[0:15], a0, v1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_32x32x8i8 a[0:15], a0, a1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_32x32x8i8 a[0:15], a0, a1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_16x16x16i8 a[0:3], v0, v1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_16x16x16i8 a[0:3], v0, v1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_16x16x16i8 a[0:3], v0, a1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_16x16x16i8 a[0:3], v0, a1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_16x16x16i8 a[0:3], a0, v1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_i32_16x16x16i8 a[0:3], a0, v1, 2 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_i32_16x16x16i8 a[0:3], a0, a1, 2 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x2bf16 a[0:31], v0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x2bf16 a[0:31], v0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x2bf16 a[0:31], v0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x2bf16 a[0:31], v0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x2bf16 a[0:31], a0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x2bf16 a[0:31], a0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x2bf16 a[0:31], a0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x2bf16 a[0:31], a0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x2bf16 a[0:15], v0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x2bf16 a[0:15], v0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x2bf16 a[0:15], v0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x2bf16 a[0:15], v0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x2bf16 a[0:15], a0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x2bf16 a[0:15], a0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x2bf16 a[0:15], a0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x2bf16 a[0:15], a0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_4x4x2bf16 a[0:3], v0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_4x4x2bf16 a[0:3], v0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_4x4x2bf16 a[0:3], v0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_4x4x2bf16 a[0:3], v0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_4x4x2bf16 a[0:3], a0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_4x4x2bf16 a[0:3], a0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_4x4x2bf16 a[0:3], a0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_4x4x2bf16 a[0:3], a0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x4bf16 a[0:15], v0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x4bf16 a[0:15], v0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x4bf16 a[0:15], v0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x4bf16 a[0:15], v0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x4bf16 a[0:15], a0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x4bf16 a[0:15], a0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_32x32x4bf16 a[0:15], a0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_32x32x4bf16 a[0:15], a0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x8bf16 a[0:3], v0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x8bf16 a[0:3], v0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x8bf16 a[0:3], v0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x8bf16 a[0:3], v0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x8bf16 a[0:3], a0, v1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x8bf16 a[0:3], a0, v1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. v_mfma_f32_16x16x8bf16 a[0:3], a0, a1, -2.0 // GFX908: error: invalid literal operand +// GFX900: error: instruction not supported on this GPU v_mfma_f32_16x16x8bf16 a[0:3], a0, a1, -2.0 cbsz:3 abid:2 blgp:7 // GFX908: error: invalid literal operand +// GFX900: error: not a valid operand. diff --git a/llvm/test/MC/AMDGPU/mai.s b/llvm/test/MC/AMDGPU/mai.s index 09eddb0d258c..c02139a616fc 100644 --- a/llvm/test/MC/AMDGPU/mai.s +++ b/llvm/test/MC/AMDGPU/mai.s @@ -1,5 +1,5 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx908 -show-encoding %s | FileCheck -check-prefix=GFX908 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx908 -show-encoding %s 2>&1 | FileCheck -check-prefix=NOGFX908 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx908 %s 2>&1 | FileCheck -check-prefix=NOGFX908 --implicit-check-not=error: %s v_accvgpr_read_b32 v2, a0 // GFX908: v_accvgpr_read_b32 v2, a0 ; encoding: [0x02,0x00,0xd8,0xd3,0x00,0x01,0x00,0x08] diff --git a/llvm/test/MC/AMDGPU/mimg-err.s b/llvm/test/MC/AMDGPU/mimg-err.s index 822ffdd65351..9c8a9c8abf64 100644 --- a/llvm/test/MC/AMDGPU/mimg-err.s +++ b/llvm/test/MC/AMDGPU/mimg-err.s @@ -1,6 +1,6 @@ -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGCN -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGCN -// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGCN +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=NOGCN --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s --check-prefix=NOGCN --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji %s 2>&1 | FileCheck %s --check-prefix=NOGCN --implicit-check-not=error: //===----------------------------------------------------------------------===// // Image Load/Store diff --git a/llvm/test/MC/AMDGPU/mimg.s b/llvm/test/MC/AMDGPU/mimg.s index 83835270a1d4..403ee7d62cc0 100644 --- a/llvm/test/MC/AMDGPU/mimg.s +++ b/llvm/test/MC/AMDGPU/mimg.s @@ -5,12 +5,12 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx810 -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=SICIVI --check-prefix=VI --check-prefix=GFX89 --check-prefix=GFX8_1 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=GFX9 --check-prefix=GFX89 -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOVI --check-prefix=NOGFX8_0 -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx810 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOVI --check-prefix=NOGFX8_1 -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGFX9 +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck %s --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji %s 2>&1 | FileCheck %s --check-prefix=NOVI --check-prefix=NOGFX8_0 --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx810 %s 2>&1 | FileCheck %s --check-prefix=NOVI --check-prefix=NOGFX8_1 --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck %s --check-prefix=NOGFX9 --implicit-check-not=error: //===----------------------------------------------------------------------===// // Image Load/Store @@ -201,7 +201,7 @@ image_store v[5:8], v[1:2], s[8:15] dmask:0xf unorm a16 // NOSICI: error: a16 modifier is not supported on this GPU // NOVI: error: a16 modifier is not supported on this GPU -/===----------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // Image Load/Store: a16 & d16 //===----------------------------------------------------------------------===// diff --git a/llvm/test/MC/AMDGPU/mtbuf-gfx10.s b/llvm/test/MC/AMDGPU/mtbuf-gfx10.s index 8ea86e7de965..2fdad57b1929 100644 --- a/llvm/test/MC/AMDGPU/mtbuf-gfx10.s +++ b/llvm/test/MC/AMDGPU/mtbuf-gfx10.s @@ -1,5 +1,5 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s | FileCheck -check-prefix=GCN -check-prefix=GFX10 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX10-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck -check-prefix=GFX10-ERR --implicit-check-not=error: %s //===----------------------------------------------------------------------===// // Positive tests for legacy format syntax. diff --git a/llvm/test/MC/AMDGPU/mtbuf.s b/llvm/test/MC/AMDGPU/mtbuf.s index f7fdd29bb83b..0653b591d69d 100644 --- a/llvm/test/MC/AMDGPU/mtbuf.s +++ b/llvm/test/MC/AMDGPU/mtbuf.s @@ -2,9 +2,9 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s | FileCheck -check-prefix=GCN -check-prefix=CI -check-prefix=SICI %s // RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck -check-prefix=GCN -check-prefix=VI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck -check-prefixes=GCN-ERR,SICI-ERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck -check-prefixes=GCN-ERR,SICI-ERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck -check-prefixes=GCN-ERR,VI-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefixes=GCN-ERR,SICI-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck -check-prefixes=GCN-ERR,SICI-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefixes=GCN-ERR,VI-ERR --implicit-check-not=error: %s //===----------------------------------------------------------------------===// // Positive tests for legacy dfmt/nfmt syntax. diff --git a/llvm/test/MC/AMDGPU/mubuf-gfx9.s b/llvm/test/MC/AMDGPU/mubuf-gfx9.s index d9c3fc39cfd8..10909c63aff7 100644 --- a/llvm/test/MC/AMDGPU/mubuf-gfx9.s +++ b/llvm/test/MC/AMDGPU/mubuf-gfx9.s @@ -1,5 +1,5 @@ // RUN: llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck -check-prefix=GFX9 -check-prefix=GCN %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding 2>&1 %s | FileCheck -check-prefix=VI-ERR -check-prefix=GCNERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga 2>&1 %s | FileCheck -check-prefix=VI-ERR -check-prefix=GCNERR --implicit-check-not=error: %s buffer_load_ubyte_d16 v1, off, s[4:7], s1 // VI-ERR: error: instruction not supported on this GPU @@ -39,23 +39,23 @@ buffer_load_format_d16_hi_x v5, off, s[8:11], s3 buffer_load_format_d16_hi_x v5, off, s[8:11], s3 offset:4095 // GFX9: buffer_load_format_d16_hi_x v5, off, s[8:11], s3 offset:4095 ; encoding: [0xff,0x0f,0x98,0xe0,0x00,0x05,0x02,0x03] -// VI-ERR: error +// VI-ERR: error: not a valid operand. buffer_load_format_d16_hi_x v5, v0, s[8:11], s3 idxen offset:4095 // GFX9: buffer_load_format_d16_hi_x v5, v0, s[8:11], s3 idxen offset:4095 ; encoding: [0xff,0x2f,0x98,0xe0,0x00,0x05,0x02,0x03] -// VI-ERR: error +// VI-ERR: error: not a valid operand. buffer_load_format_d16_hi_x v5, v0, s[8:11], s3 offen offset:4095 // GFX9: buffer_load_format_d16_hi_x v5, v0, s[8:11], s3 offen offset:4095 ; encoding: [0xff,0x1f,0x98,0xe0,0x00,0x05,0x02,0x03] -// VI-ERR: error +// VI-ERR: error: not a valid operand. buffer_load_format_d16_hi_x v5, off, s[8:11], s3 offset:4095 glc // GFX9: buffer_load_format_d16_hi_x v5, off, s[8:11], s3 offset:4095 glc ; encoding: [0xff,0x4f,0x98,0xe0,0x00,0x05,0x02,0x03] -// VI-ERR: error +// VI-ERR: error: not a valid operand. buffer_load_format_d16_hi_x v5, off, s[8:11], s3 offset:4095 slc // GFX9: buffer_load_format_d16_hi_x v5, off, s[8:11], s3 offset:4095 slc ; encoding: [0xff,0x0f,0x9a,0xe0,0x00,0x05,0x02,0x03] -// VI-ERR: error +// VI-ERR: error: not a valid operand. buffer_store_format_d16_hi_x v255, off, s[12:15], s4 // GFX9: buffer_store_format_d16_hi_x v255, off, s[12:15], s4 ; encoding: [0x00,0x00,0x9c,0xe0,0x00,0xff,0x03,0x04] @@ -63,20 +63,20 @@ buffer_store_format_d16_hi_x v255, off, s[12:15], s4 buffer_store_format_d16_hi_x v255, off, s[12:15], s4 offset:4095 // GFX9: buffer_store_format_d16_hi_x v255, off, s[12:15], s4 offset:4095 ; encoding: [0xff,0x0f,0x9c,0xe0,0x00,0xff,0x03,0x04] -// VI-ERR: error +// VI-ERR: error: not a valid operand. buffer_store_format_d16_hi_x v1, v0, s[12:15], s4 idxen offset:4095 // GFX9: buffer_store_format_d16_hi_x v1, v0, s[12:15], s4 idxen offset:4095 ; encoding: [0xff,0x2f,0x9c,0xe0,0x00,0x01,0x03,0x04] -// VI-ERR: error +// VI-ERR: error: not a valid operand. buffer_store_format_d16_hi_x v1, v0, s[12:15], s4 offen offset:4095 // GFX9: buffer_store_format_d16_hi_x v1, v0, s[12:15], s4 offen offset:4095 ; encoding: [0xff,0x1f,0x9c,0xe0,0x00,0x01,0x03,0x04] -// VI-ERR: error +// VI-ERR: error: not a valid operand. buffer_store_format_d16_hi_x v1, off, s[12:15], s4 offset:4095 glc // GFX9: buffer_store_format_d16_hi_x v1, off, s[12:15], s4 offset:4095 glc ; encoding: [0xff,0x4f,0x9c,0xe0,0x00,0x01,0x03,0x04] -// VI-ERR: error +// VI-ERR: error: not a valid operand. buffer_store_format_d16_hi_x v1, off, s[12:15], s4 offset:4095 slc // GFX9: buffer_store_format_d16_hi_x v1, off, s[12:15], s4 offset:4095 slc ; encoding: [0xff,0x0f,0x9e,0xe0,0x00,0x01,0x03,0x04] -// VI-ERR: error +// VI-ERR: error: not a valid operand. diff --git a/llvm/test/MC/AMDGPU/mubuf.s b/llvm/test/MC/AMDGPU/mubuf.s index 6c0fdb140828..a07a0a2aab18 100644 --- a/llvm/test/MC/AMDGPU/mubuf.s +++ b/llvm/test/MC/AMDGPU/mubuf.s @@ -2,9 +2,9 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s | FileCheck -check-prefix=GCN -check-prefix=CI -check-prefix=SICI %s // RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck -check-prefix=GCN -check-prefix=VI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefix=NOSI -check-prefix=NOSICIVI -check-prefix=NOSICI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck -check-prefix=NOCI -check-prefix=NOSICIVI -check-prefix=NOSICI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=NOVI -check-prefix=NOSICIVI %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefix=NOSI -check-prefix=NOSICIVI -check-prefix=NOSICI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck -check-prefix=NOCI -check-prefix=NOSICIVI -check-prefix=NOSICI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=NOVI -check-prefix=NOSICIVI --implicit-check-not=error: %s //===----------------------------------------------------------------------===// // Test for different operand combinations diff --git a/llvm/test/MC/AMDGPU/out-of-range-registers.s b/llvm/test/MC/AMDGPU/out-of-range-registers.s index 53e0f65f0cb1..c7cd03470f9f 100644 --- a/llvm/test/MC/AMDGPU/out-of-range-registers.s +++ b/llvm/test/MC/AMDGPU/out-of-range-registers.s @@ -1,12 +1,12 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck -check-prefixes=GCN-ERR,SICIVI9-ERR,SIVICI-ERR,SI-ERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck -check-prefixes=GCN-ERR,SICIVI9-ERR,SIVICI-ERR,CIVI9-ERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck -check-prefixes=GCN-ERR,GFX9-ERR,SICIVI9-ERR,CIVI9-ERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck -check-prefixes=GCN-ERR,GFX10-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefixes=GCN-ERR,SICIVI9-ERR,SIVICI-ERR,SI-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefixes=GCN-ERR,SICIVI9-ERR,SIVICI-ERR,CIVI9-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefixes=GCN-ERR,GFX9-ERR,SICIVI9-ERR,CIVI9-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck -check-prefixes=GCN-ERR,GFX10-ERR --implicit-check-not=error: %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck -check-prefix=SIVICI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck -check-prefix=SIVICI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX9 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX10 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s | FileCheck -check-prefix=SIVICI %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck -check-prefix=SIVICI %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck -check-prefix=GFX9 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s | FileCheck -check-prefix=GFX10 %s s_add_i32 s106, s0, s1 // GCN-ERR: error: not a valid operand @@ -84,21 +84,25 @@ s_mov_b32 ttmp12, 0 // SICIVI: error: not a valid operand // GFX9: s_mov_b32 ttmp12, 0 ; encoding: // GFX10: s_mov_b32 ttmp12, 0 ; encoding: +// SIVICI-ERR: error: not a valid operand. s_mov_b32 ttmp15, 0 // SICIVI: error: not a valid operand // GFX9: s_mov_b32 ttmp15, 0 ; encoding: // GFX10: s_mov_b32 ttmp15, 0 ; encoding: +// SIVICI-ERR: error: not a valid operand. s_mov_b32 flat_scratch_lo, 0 // SI-ERR: error: not a valid operand // CIVI9: s_mov_b32 flat_scratch_lo, 0 ; encoding: // GFX10-ERR: error: not a valid operand +// GFX9: s_mov_b32 flat_scratch_lo, 0 ; encoding: [0x80,0x00,0xe6,0xbe] s_mov_b32 flat_scratch_hi, 0 // SI-ERR: error: not a valid operand // CIVI9: s_mov_b32 flat_scratch_hi, 0 ; encoding: // GFX10-ERR: error: not a valid operand +// GFX9: s_mov_b32 flat_scratch_hi, 0 ; encoding: [0x80,0x00,0xe7,0xbe] s_mov_b32 tma_lo, 0 // SIVICI: s_mov_b32 tma_lo, 0 ; encoding: diff --git a/llvm/test/MC/AMDGPU/reg-syntax-err.s b/llvm/test/MC/AMDGPU/reg-syntax-err.s index 8d58630ce888..dce9375a4711 100644 --- a/llvm/test/MC/AMDGPU/reg-syntax-err.s +++ b/llvm/test/MC/AMDGPU/reg-syntax-err.s @@ -1,73 +1,73 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=NOVI %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=NOVI --implicit-check-not=error: %s s_mov_b32 s1, s 1 // NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction s_mov_b32 s1, s[0 1 -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. s_mov_b32 s1, s[0:0 1 -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. s_mov_b32 s1, [s[0 1 -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. s_mov_b32 s1, [s[0:1] 1 -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. s_mov_b32 s1, [s0, 1 -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. s_mov_b32 s1, s999 1 -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. s_mov_b32 s1, s[1:2] 1 -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. s_mov_b32 s1, s[0:2] 1 // NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction s_mov_b32 s1, xnack_mask_lo 1 -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. s_mov_b32 s1, s s0 // NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction s_mov_b32 s1, s[0 s0 -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. s_mov_b32 s1, s[0:0 s0 -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. s_mov_b32 s1, [s[0 s0 -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. s_mov_b32 s1, [s[0:1] s0 -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. s_mov_b32 s1, [s0, s0 -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. s_mov_b32 s1, s999 s0 -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. s_mov_b32 s1, s[1:2] s0 -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. s_mov_b32 s1, s[0:2] vcc_lo // NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction s_mov_b32 s1, xnack_mask_lo s1 -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. exp mrt0 v1, v2, v3, v4000 off -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. v_add_f64 v[0:1], v[0:1], v[0xF00000001:0x2] -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. v_add_f64 v[0:1], v[0:1], v[0x1:0xF00000002] -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. s_mov_b32 s1, s[0:-1] -// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: failed parsing operand +// NOVI: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand. diff --git a/llvm/test/MC/AMDGPU/reg-syntax-extra.s b/llvm/test/MC/AMDGPU/reg-syntax-extra.s index 4e8216c88d67..528247f56239 100644 --- a/llvm/test/MC/AMDGPU/reg-syntax-extra.s +++ b/llvm/test/MC/AMDGPU/reg-syntax-extra.s @@ -1,48 +1,61 @@ // RUN: not llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s // RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck --check-prefix=NOSICI --check-prefix=NOSICIVI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=VI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=GFX10 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=VI %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=GFX10 %s + +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck --check-prefix=NOSICI --check-prefix=NOSICIVI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji %s 2>&1 | FileCheck --check-prefix=NOGCN --check-prefix=NOVI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck --check-prefix=NOGCN --check-prefix=NOGFX10 --implicit-check-not=error: %s s_mov_b32 [ttmp5], [ttmp3] // SICI: s_mov_b32 ttmp5, ttmp3 ; encoding: [0x73,0x03,0xf5,0xbe] // VI: s_mov_b32 ttmp5, ttmp3 ; encoding: [0x73,0x00,0xf5,0xbe] +// GFX10: s_mov_b32 ttmp5, ttmp3 ; encoding: [0x6f,0x03,0xf1,0xbe] s_mov_b64 [ttmp4,ttmp5], [ttmp2,ttmp3] // SICI: s_mov_b64 ttmp[4:5], ttmp[2:3] ; encoding: [0x72,0x04,0xf4,0xbe] // VI: s_mov_b64 ttmp[4:5], ttmp[2:3] ; encoding: [0x72,0x01,0xf4,0xbe] +// GFX10: s_mov_b64 ttmp[4:5], ttmp[2:3] ; encoding: [0x6e,0x04,0xf0,0xbe] s_mov_b64 ttmp[4:5], ttmp[2:3] // SICI: s_mov_b64 ttmp[4:5], ttmp[2:3] ; encoding: [0x72,0x04,0xf4,0xbe] // VI: s_mov_b64 ttmp[4:5], ttmp[2:3] ; encoding: [0x72,0x01,0xf4,0xbe] +// GFX10: s_mov_b64 ttmp[4:5], ttmp[2:3] ; encoding: [0x6e,0x04,0xf0,0xbe] s_mov_b64 [s6,s7], s[8:9] // SICI: s_mov_b64 s[6:7], s[8:9] ; encoding: [0x08,0x04,0x86,0xbe] // VI: s_mov_b64 s[6:7], s[8:9] ; encoding: [0x08,0x01,0x86,0xbe] +// GFX10: s_mov_b64 s[6:7], s[8:9] ; encoding: [0x08,0x04,0x86,0xbe] s_mov_b64 s[6:7], [s8,s9] // SICI: s_mov_b64 s[6:7], s[8:9] ; encoding: [0x08,0x04,0x86,0xbe] // VI: s_mov_b64 s[6:7], s[8:9] ; encoding: [0x08,0x01,0x86,0xbe] +// GFX10: s_mov_b64 s[6:7], s[8:9] ; encoding: [0x08,0x04,0x86,0xbe] s_mov_b64 [exec_lo,exec_hi], s[2:3] // SICI: s_mov_b64 exec, s[2:3] ; encoding: [0x02,0x04,0xfe,0xbe] // VI: s_mov_b64 exec, s[2:3] ; encoding: [0x02,0x01,0xfe,0xbe] +// GFX10: s_mov_b64 exec, s[2:3] ; encoding: [0x02,0x04,0xfe,0xbe] s_mov_b64 [flat_scratch_lo,flat_scratch_hi], s[2:3] -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI: s_mov_b64 flat_scratch, s[2:3] ; encoding: [0x02,0x01,0xe6,0xbe] +// NOGFX10: error: not a valid operand. s_mov_b64 [vcc_lo,vcc_hi], s[2:3] // SICI: s_mov_b64 vcc, s[2:3] ; encoding: [0x02,0x04,0xea,0xbe] // VI: s_mov_b64 vcc, s[2:3] ; encoding: [0x02,0x01,0xea,0xbe] +// GFX10: s_mov_b64 vcc, s[2:3] ; encoding: [0x02,0x04,0xea,0xbe] s_mov_b64 [tba_lo,tba_hi], s[2:3] // SICI: s_mov_b64 tba, s[2:3] ; encoding: [0x02,0x04,0xec,0xbe] // VI: s_mov_b64 tba, s[2:3] ; encoding: [0x02,0x01,0xec,0xbe] +// NOGFX10: error: not a valid operand. s_mov_b64 [tma_lo,tma_hi], s[2:3] // SICI: s_mov_b64 tma, s[2:3] ; encoding: [0x02,0x04,0xee,0xbe] // VI: s_mov_b64 tma, s[2:3] ; encoding: [0x02,0x01,0xee,0xbe] +// NOGFX10: error: not a valid operand. v_mov_b32_e32 [v1], [v2] // GCN: v_mov_b32_e32 v1, v2 ; encoding: [0x02,0x03,0x02,0x7e] @@ -50,80 +63,109 @@ v_mov_b32_e32 [v1], [v2] v_rcp_f64 [v1,v2], [v2,v3] // SICI: v_rcp_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x5f,0x02,0x7e] // VI: v_rcp_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x4b,0x02,0x7e] +// GFX10: v_rcp_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x5f,0x02,0x7e] buffer_load_dwordx4 [v1,v2,v3,v4], off, [s4,s5,s6,s7], s1 // SICI: buffer_load_dwordx4 v[1:4], off, s[4:7], s1 ; encoding: [0x00,0x00,0x38,0xe0,0x00,0x01,0x01,0x01] // VI: buffer_load_dwordx4 v[1:4], off, s[4:7], s1 ; encoding: [0x00,0x00,0x5c,0xe0,0x00,0x01,0x01,0x01] +// GFX10: buffer_load_dwordx4 v[1:4], off, s[4:7], s1 ; encoding: [0x00,0x00,0x38,0xe0,0x00,0x01,0x01,0x01] buffer_load_dword v1, off, [ttmp4,ttmp5,ttmp6,ttmp7], s1 // SICI: buffer_load_dword v1, off, ttmp[4:7], s1 ; encoding: [0x00,0x00,0x30,0xe0,0x00,0x01,0x1d,0x01] // VI: buffer_load_dword v1, off, ttmp[4:7], s1 ; encoding: [0x00,0x00,0x50,0xe0,0x00,0x01,0x1d,0x01] +// GFX10: buffer_load_dword v1, off, ttmp[4:7], s1 ; encoding: [0x00,0x00,0x30,0xe0,0x00,0x01,0x1c,0x01] buffer_store_format_xyzw v[1:4], off, [ttmp4,ttmp5,ttmp6,ttmp7], ttmp1 // SICI: buffer_store_format_xyzw v[1:4], off, ttmp[4:7], ttmp1 ; encoding: [0x00,0x00,0x1c,0xe0,0x00,0x01,0x1d,0x71] // VI: buffer_store_format_xyzw v[1:4], off, ttmp[4:7], ttmp1 ; encoding: [0x00,0x00,0x1c,0xe0,0x00,0x01,0x1d,0x71] +// GFX10: buffer_store_format_xyzw v[1:4], off, ttmp[4:7], ttmp1 ; encoding: [0x00,0x00,0x1c,0xe0,0x00,0x01,0x1c,0x6d] buffer_load_ubyte v1, off, [ttmp4,ttmp5,ttmp6,ttmp7], ttmp1 // SICI: buffer_load_ubyte v1, off, ttmp[4:7], ttmp1 ; encoding: [0x00,0x00,0x20,0xe0,0x00,0x01,0x1d,0x71] // VI: buffer_load_ubyte v1, off, ttmp[4:7], ttmp1 ; encoding: [0x00,0x00,0x40,0xe0,0x00,0x01,0x1d,0x71] +// GFX10: buffer_load_ubyte v1, off, ttmp[4:7], ttmp1 ; encoding: [0x00,0x00,0x20,0xe0,0x00,0x01,0x1c,0x6d] buffer_store_dwordx4 v[1:4], off, [ttmp4,ttmp5,ttmp6,ttmp7], ttmp1 // SICI: buffer_store_dwordx4 v[1:4], off, ttmp[4:7], ttmp1 ; encoding: [0x00,0x00,0x78,0xe0,0x00,0x01,0x1d,0x71] // VI: buffer_store_dwordx4 v[1:4], off, ttmp[4:7], ttmp1 ; encoding: [0x00,0x00,0x7c,0xe0,0x00,0x01,0x1d,0x71] +// GFX10: buffer_store_dwordx4 v[1:4], off, ttmp[4:7], ttmp1 ; encoding: [0x00,0x00,0x78,0xe0,0x00,0x01,0x1c,0x6d] s_load_dwordx4 [ttmp4,ttmp5,ttmp6,ttmp7], [ttmp2,ttmp3], ttmp4 // SICI: s_load_dwordx4 ttmp[4:7], ttmp[2:3], ttmp4 ; encoding: [0x74,0x72,0xba,0xc0] // VI: s_load_dwordx4 ttmp[4:7], ttmp[2:3], ttmp4 ; encoding: [0x39,0x1d,0x08,0xc0,0x74,0x00,0x00,0x00] +// GFX10: s_load_dwordx4 ttmp[4:7], ttmp[2:3], ttmp4 ; encoding: [0x37,0x1c,0x08,0xf4,0x00,0x00,0x00,0xe0] s_buffer_load_dword ttmp1, [ttmp4,ttmp5,ttmp6,ttmp7], ttmp4 // SICI: s_buffer_load_dword ttmp1, ttmp[4:7], ttmp4 ; encoding: [0x74,0xf4,0x38,0xc2] // VI: s_buffer_load_dword ttmp1, ttmp[4:7], ttmp4 ; encoding: [0x7a,0x1c,0x20,0xc0,0x74,0x00,0x00,0x00] +// GFX10: s_buffer_load_dword ttmp1, ttmp[4:7], ttmp4 ; encoding: [0x78,0x1b,0x20,0xf4,0x00,0x00,0x00,0xe0] s_buffer_load_dwordx4 [ttmp8,ttmp9,ttmp10,ttmp11], [ttmp4,ttmp5,ttmp6,ttmp7], ttmp4 // SICI: s_buffer_load_dwordx4 ttmp[8:11], ttmp[4:7], ttmp4 ; encoding: [0x74,0x74,0xbc,0xc2] // VI: s_buffer_load_dwordx4 ttmp[8:11], ttmp[4:7], ttmp4 ; encoding: [0x3a,0x1e,0x28,0xc0,0x74,0x00,0x00,0x00] +// GFX10: s_buffer_load_dwordx4 ttmp[8:11], ttmp[4:7], ttmp4 ; encoding: [0x38,0x1d,0x28,0xf4,0x00,0x00,0x00,0xe0] s_buffer_load_dwordx4 [ttmp[8],ttmp[8+1],ttmp[5*2],ttmp[(3+2)*2+1]], ttmp[45/11:(33+45)/11], ttmp4 // SICI: s_buffer_load_dwordx4 ttmp[8:11], ttmp[4:7], ttmp4 ; encoding: [0x74,0x74,0xbc,0xc2] // VI: s_buffer_load_dwordx4 ttmp[8:11], ttmp[4:7], ttmp4 ; encoding: [0x3a,0x1e,0x28,0xc0,0x74,0x00,0x00,0x00] +// GFX10: s_buffer_load_dwordx4 ttmp[8:11], ttmp[4:7], ttmp4 ; encoding: [0x38,0x1d,0x28,0xf4,0x00,0x00,0x00,0xe0] s_buffer_load_dwordx4 ttmp[7+1:(3+2)*2+1], [ttmp[45/11],ttmp[5],ttmp6,ttmp[(33+45)/11]], ttmp4 // SICI: s_buffer_load_dwordx4 ttmp[8:11], ttmp[4:7], ttmp4 ; encoding: [0x74,0x74,0xbc,0xc2] // VI: s_buffer_load_dwordx4 ttmp[8:11], ttmp[4:7], ttmp4 ; encoding: [0x3a,0x1e,0x28,0xc0,0x74,0x00,0x00,0x00] +// GFX10: s_buffer_load_dwordx4 ttmp[8:11], ttmp[4:7], ttmp4 ; encoding: [0x38,0x1d,0x28,0xf4,0x00,0x00,0x00,0xe0] flat_load_dword v[8:8], v[2:3] -// VI: flat_load_dword v8, v[2:3] ; encoding: [0x00,0x00,0x50,0xdc,0x02,0x00,0x00,0x08] +// VI: flat_load_dword v8, v[2:3] ; encoding: [0x00,0x00,0x50,0xdc,0x02,0x00,0x00,0x08] +// GFX10: flat_load_dword v8, v[2:3] ; encoding: [0x00,0x00,0x30,0xdc,0x02,0x00,0x7d,0x08] +// NOSICI: error: instruction not supported on this GPU flat_load_dword v[63/8+1:65/8], v[2:3] -// VI: flat_load_dword v8, v[2:3] ; encoding: [0x00,0x00,0x50,0xdc,0x02,0x00,0x00,0x08] +// VI: flat_load_dword v8, v[2:3] ; encoding: [0x00,0x00,0x50,0xdc,0x02,0x00,0x00,0x08] +// GFX10: flat_load_dword v8, v[2:3] ; encoding: [0x00,0x00,0x30,0xdc,0x02,0x00,0x7d,0x08] +// NOSICI: error: instruction not supported on this GPU flat_load_dword v8, v[2*2-2:(3+7)/3] -// VI: flat_load_dword v8, v[2:3] ; encoding: [0x00,0x00,0x50,0xdc,0x02,0x00,0x00,0x08] +// VI: flat_load_dword v8, v[2:3] ; encoding: [0x00,0x00,0x50,0xdc,0x02,0x00,0x00,0x08] +// GFX10: flat_load_dword v8, v[2:3] ; encoding: [0x00,0x00,0x30,0xdc,0x02,0x00,0x7d,0x08] +// NOSICI: error: instruction not supported on this GPU flat_load_dword v[63/8+1], v[2:3] -// VI: flat_load_dword v8, v[2:3] ; encoding: [0x00,0x00,0x50,0xdc,0x02,0x00,0x00,0x08] +// VI: flat_load_dword v8, v[2:3] ; encoding: [0x00,0x00,0x50,0xdc,0x02,0x00,0x00,0x08] +// GFX10: flat_load_dword v8, v[2:3] ; encoding: [0x00,0x00,0x30,0xdc,0x02,0x00,0x7d,0x08] +// NOSICI: error: instruction not supported on this GPU flat_load_dwordx4 v[8:11], v[2*2-2:(3*3-6)] // VI: flat_load_dwordx4 v[8:11], v[2:3] ; encoding: [0x00,0x00,0x5c,0xdc,0x02,0x00,0x00,0x08] +// GFX10: flat_load_dwordx4 v[8:11], v[2:3] ; encoding: [0x00,0x00,0x38,0xdc,0x02,0x00,0x7d,0x08] +// NOSICI: error: instruction not supported on this GPU flat_load_dwordx4 v[8/2+4:11/2+6], v[2:3] // VI: flat_load_dwordx4 v[8:11], v[2:3] ; encoding: [0x00,0x00,0x5c,0xdc,0x02,0x00,0x00,0x08] +// GFX10: flat_load_dwordx4 v[8:11], v[2:3] ; encoding: [0x00,0x00,0x38,0xdc,0x02,0x00,0x7d,0x08] +// NOSICI: error: instruction not supported on this GPU flat_load_dwordx4 [v[8/2+4],v9,v[10],v[11/2+6]], v[2:3] // VI: flat_load_dwordx4 v[8:11], v[2:3] ; encoding: [0x00,0x00,0x5c,0xdc,0x02,0x00,0x00,0x08] +// GFX10: flat_load_dwordx4 v[8:11], v[2:3] ; encoding: [0x00,0x00,0x38,0xdc,0x02,0x00,0x7d,0x08] +// NOSICI: error: instruction not supported on this GPU v_mul_f32 v0, null, v2 -// NOSICIVI: error: -// GFX10: v_mul_f32_e32 v0, null, v2 ; encoding: [0x7d,0x04,0x00,0x10] +// NOSICIVI: error: not a valid operand. +// GFX10: v_mul_f32_e32 v0, null, v2 ; encoding: [0x7d,0x04,0x00,0x10] +// NOVI: error: not a valid operand. v_mul_f64 v[0:1], null, null -// NOSICIVI: error: -// GFX10: v_mul_f64 v[0:1], null, null ; encoding: [0x00,0x00,0x65,0xd5,0x7d,0xfa,0x00,0x00] +// NOSICIVI: error: not a valid operand. +// GFX10: v_mul_f64 v[0:1], null, null ; encoding: [0x00,0x00,0x65,0xd5,0x7d,0xfa,0x00,0x00] +// NOVI: error: not a valid operand. s_add_u32 null, null, null -// NOSICIVI: error: -// GFX10: s_add_u32 null, null, null ; encoding: [0x7d,0x7d,0x7d,0x80] +// NOSICIVI: error: not a valid operand. +// GFX10: s_add_u32 null, null, null ; encoding: [0x7d,0x7d,0x7d,0x80] +// NOVI: error: not a valid operand. s_not_b64 s[2:3], null -// NOSICIVI: error: -// GFX10: s_not_b64 s[2:3], null ; encoding: [0x7d,0x08,0x82,0xbe] +// NOSICIVI: error: not a valid operand. +// GFX10: s_not_b64 s[2:3], null ; encoding: [0x7d,0x08,0x82,0xbe] +// NOVI: error: not a valid operand. diff --git a/llvm/test/MC/AMDGPU/regression/bug28538.s b/llvm/test/MC/AMDGPU/regression/bug28538.s index 59fac226343d..f9cdb157bbb1 100644 --- a/llvm/test/MC/AMDGPU/regression/bug28538.s +++ b/llvm/test/MC/AMDGPU/regression/bug28538.s @@ -1,12 +1,12 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOCIVI --check-prefix=NOVI -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck %s --check-prefix=NOCIVI --check-prefix=NOVI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck %s --check-prefix=NOSICI --implicit-check-not=error: -// NOSICI: error: +// NOSICI: error: not a valid operand. // NOVI: error: failed parsing operand v_mov_b32 v0, v0 row_bcast:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // NOVI: error: failed parsing operand v_mov_b32 v0, v0 row_bcast:13 diff --git a/llvm/test/MC/AMDGPU/smem-err.s b/llvm/test/MC/AMDGPU/smem-err.s index 83cfeb81b6ee..5f62318a1ac7 100644 --- a/llvm/test/MC/AMDGPU/smem-err.s +++ b/llvm/test/MC/AMDGPU/smem-err.s @@ -1,4 +1,4 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=NOVI %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=NOVI --implicit-check-not=error: %s s_memtime exec // NOVI: :11: error: invalid operand for instruction diff --git a/llvm/test/MC/AMDGPU/smem.s b/llvm/test/MC/AMDGPU/smem.s index dcff79fef529..4d81929b415e 100644 --- a/llvm/test/MC/AMDGPU/smem.s +++ b/llvm/test/MC/AMDGPU/smem.s @@ -3,12 +3,12 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck -check-prefix=GCN -check-prefix=VI -check-prefix=GFX89 %s // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck -check-prefix=GCN -check-prefix=GFX89 -check-prefix=GFX9 %s // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1012 -show-encoding %s | FileCheck -check-prefix=GCN -check-prefix=GFX10 -check-prefix=GFX1012 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefix=NOSICI -check-prefix=NOSICIVI -check-prefix=NOSICIGFX10 -check-prefix=NOSICIVIGFX10 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck -check-prefix=NOSICI -check-prefix=NOSICIVI -check-prefix=NOSICIGFX10 -check-prefix=NOSICIVIGFX10 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=kaveri %s 2>&1 | FileCheck -check-prefix=NOSICI -check-prefix=NOSICIVI -check-prefix=NOSICIGFX10 -check-prefix=NOSICIVIGFX10 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=NOSICIVI -check-prefix=NOVI -check-prefix=NOSICIVIGFX10 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefix=NOGFX9 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1012 %s 2>&1 | FileCheck -check-prefix=NOSICIGFX10 -check-prefix=NOGFX9 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefix=NOSICI -check-prefix=NOSICIVI -check-prefix=NOSICIGFX10 -check-prefix=NOSICIVIGFX10 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck -check-prefix=NOSICI -check-prefix=NOSICIVI -check-prefix=NOSICIGFX10 -check-prefix=NOSICIVIGFX10 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=kaveri %s 2>&1 | FileCheck -check-prefix=NOSICI -check-prefix=NOSICIVI -check-prefix=NOSICIGFX10 -check-prefix=NOSICIVIGFX10 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=NOSICIVI -check-prefix=NOVI -check-prefix=NOSICIVIGFX10 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefix=NOGFX9 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1012 %s 2>&1 | FileCheck -check-prefix=NOSICIGFX10 -check-prefix=NOGFX9 --implicit-check-not=error: %s s_dcache_wb // GFX89: s_dcache_wb ; encoding: [0x00,0x00,0x84,0xc0,0x00,0x00,0x00,0x00] @@ -105,14 +105,17 @@ s_store_dword tma_hi, s[2:3], s4 s_load_dword s1, s[2:3], 0xfc glc // GFX89: s_load_dword s1, s[2:3], 0xfc glc ; encoding: [0x41,0x00,0x03,0xc0,0xfc,0x00,0x00,0x00] // GFX10: s_load_dword s1, s[2:3], 0xfc glc ; encoding: [0x41,0x00,0x01,0xf4,0xfc,0x00,0x00,0xfa] +// SICI: s_load_dword s1, s[2:3], 0xfc glc ; encoding: [0xfc,0x83,0x00,0xc0] s_load_dword s1, s[2:3], s4 glc // GFX89: s_load_dword s1, s[2:3], s4 glc ; encoding: [0x41,0x00,0x01,0xc0,0x04,0x00,0x00,0x00] // GFX10: s_load_dword s1, s[2:3], s4 glc ; encoding: [0x41,0x00,0x01,0xf4,0x00,0x00,0x00,0x08] +// SICI: s_load_dword s1, s[2:3], s4 glc ; encoding: [0x04,0x82,0x00,0xc0] s_buffer_store_dword s10, s[92:95], m0 // GFX89: s_buffer_store_dword s10, s[92:95], m0 ; encoding: [0xae,0x02,0x60,0xc0,0x7c,0x00,0x00,0x00] // NOSICI: error: instruction not supported on this GPU +// GFX10: s_buffer_store_dword s10, s[92:95], m0 ; encoding: [0xae,0x02,0x60,0xf4,0x00,0x00,0x00,0xf8] s_buffer_store_dword tba_lo, s[92:95], m0 // VI: s_buffer_store_dword tba_lo, s[92:95], m0 ; encoding: [0x2e,0x1b,0x60,0xc0,0x7c,0x00,0x00,0x00] @@ -138,14 +141,17 @@ s_buffer_store_dword ttmp0, s[92:95], m0 // VI: s_buffer_store_dword ttmp0, s[92:95], m0 ; encoding: [0x2e,0x1c,0x60,0xc0,0x7c,0x00,0x00,0x00] // GFX9: s_buffer_store_dword ttmp0, s[92:95], m0 ; encoding: [0x2e,0x1b,0x60,0xc0,0x7c,0x00,0x00,0x00] // NOSICI: error: instruction not supported on this GPU +// GFX10: s_buffer_store_dword ttmp0, s[92:95], m0 ; encoding: [0x2e,0x1b,0x60,0xf4,0x00,0x00,0x00,0xf8] s_buffer_store_dwordx2 s[10:11], s[92:95], m0 // GFX89: s_buffer_store_dwordx2 s[10:11], s[92:95], m0 ; encoding: [0xae,0x02,0x64,0xc0,0x7c,0x00,0x00,0x00] // NOSICI: error: instruction not supported on this GPU +// GFX10: s_buffer_store_dwordx2 s[10:11], s[92:95], m0 ; encoding: [0xae,0x02,0x64,0xf4,0x00,0x00,0x00,0xf8] s_buffer_store_dwordx4 s[8:11], s[92:95], m0 glc // GFX89: s_buffer_store_dwordx4 s[8:11], s[92:95], m0 glc ; encoding: [0x2e,0x02,0x69,0xc0,0x7c,0x00,0x00,0x00] // NOSICI: error: invalid operand for instruction +// GFX10: s_buffer_store_dwordx4 s[8:11], s[92:95], m0 glc ; encoding: [0x2e,0x02,0x69,0xf4,0x00,0x00,0x00,0xf8] s_buffer_store_dwordx2 tba, s[92:95], m0 glc // VI: s_buffer_store_dwordx2 tba, s[92:95], m0 glc ; encoding: [0x2e,0x1b,0x65,0xc0,0x7c,0x00,0x00,0x00] @@ -154,6 +160,8 @@ s_buffer_store_dwordx2 tba, s[92:95], m0 glc s_buffer_load_dword s10, s[92:95], m0 // GFX89: s_buffer_load_dword s10, s[92:95], m0 ; encoding: [0xae,0x02,0x20,0xc0,0x7c,0x00,0x00,0x00] +// SICI: s_buffer_load_dword s10, s[92:95], m0 ; encoding: [0x7c,0x5c,0x05,0xc2] +// GFX10: s_buffer_load_dword s10, s[92:95], m0 ; encoding: [0xae,0x02,0x20,0xf4,0x00,0x00,0x00,0xf8] // SICIGFX10: s_buffer_load_dword s10, s[92:95], m0 ; encoding: [0x7c,0x5c,0x05,0xc2] s_buffer_load_dword tba_lo, s[92:95], m0 @@ -207,6 +215,7 @@ s_buffer_load_dwordx2 ttmp[0:1], s[92:95], m0 s_buffer_load_dwordx4 s[8:11], s[92:95], m0 glc // GFX89: s_buffer_load_dwordx4 s[8:11], s[92:95], m0 glc ; encoding: [0x2e,0x02,0x29,0xc0,0x7c,0x00,0x00,0x00] // GFX10: s_buffer_load_dwordx4 s[8:11], s[92:95], m0 glc ; encoding: [0x2e,0x02,0x29,0xf4,0x00,0x00,0x00,0xf8] +// SICI: s_buffer_load_dwordx4 s[8:11], s[92:95], m0 glc ; encoding: [0x7c,0x5c,0x84,0xc2] //===----------------------------------------------------------------------===// // s_scratch instructions @@ -220,7 +229,7 @@ s_scratch_load_dword s5, s[2:3], s101 s_scratch_load_dword s5, s[2:3], s0 glc // GFX9: s_scratch_load_dword s5, s[2:3], s0 glc ; encoding: [0x41,0x01,0x15,0xc0,0x00,0x00,0x00,0x00] // GFX1012: s_scratch_load_dword s5, s[2:3], s0 glc ; encoding: [0x41,0x01,0x15,0xf4,0x00,0x00,0x00,0x00] -// NOSICIVI: error +// NOSICIVI: error: invalid operand for instruction s_scratch_load_dwordx2 s[100:101], s[2:3], s0 // GFX9: s_scratch_load_dwordx2 s[100:101], s[2:3], s0 ; encoding: [0x01,0x19,0x18,0xc0,0x00,0x00,0x00,0x00] @@ -230,7 +239,7 @@ s_scratch_load_dwordx2 s[100:101], s[2:3], s0 s_scratch_load_dwordx2 s[10:11], s[2:3], 0x1 glc // GFX9: s_scratch_load_dwordx2 s[10:11], s[2:3], 0x1 glc ; encoding: [0x81,0x02,0x1b,0xc0,0x01,0x00,0x00,0x00] // GFX1012: s_scratch_load_dwordx2 s[10:11], s[2:3], 0x1 glc ; encoding: [0x81,0x02,0x19,0xf4,0x01,0x00,0x00,0xfa] -// NOSICIVI: error +// NOSICIVI: error: invalid operand for instruction s_scratch_load_dwordx4 s[20:23], s[4:5], s0 // GFX9: s_scratch_load_dwordx4 s[20:23], s[4:5], s0 ; encoding: [0x02,0x05,0x1c,0xc0,0x00,0x00,0x00,0x00] @@ -245,17 +254,17 @@ s_scratch_store_dword s101, s[4:5], s0 s_scratch_store_dword s1, s[4:5], 0x123 glc // GFX9: s_scratch_store_dword s1, s[4:5], 0x123 glc ; encoding: [0x42,0x00,0x57,0xc0,0x23,0x01,0x00,0x00] // GFX1012: s_scratch_store_dword s1, s[4:5], 0x123 glc ; encoding: [0x42,0x00,0x55,0xf4,0x23,0x01,0x00,0xfa] -// NOSICIVI: error +// NOSICIVI: error: invalid operand for instruction s_scratch_store_dwordx2 s[2:3], s[4:5], s101 glc // GFX9: s_scratch_store_dwordx2 s[2:3], s[4:5], s101 glc ; encoding: [0x82,0x00,0x59,0xc0,0x65,0x00,0x00,0x00] // GFX1012: s_scratch_store_dwordx2 s[2:3], s[4:5], s101 glc ; encoding: [0x82,0x00,0x59,0xf4,0x00,0x00,0x00,0xca] -// NOSICIVI: error +// NOSICIVI: error: invalid operand for instruction s_scratch_store_dwordx4 s[4:7], s[4:5], s0 glc // GFX9: s_scratch_store_dwordx4 s[4:7], s[4:5], s0 glc ; encoding: [0x02,0x01,0x5d,0xc0,0x00,0x00,0x00,0x00] // GFX1012: s_scratch_store_dwordx4 s[4:7], s[4:5], s0 glc ; encoding: [0x02,0x01,0x5d,0xf4,0x00,0x00,0x00,0x00] -// NOSICIVI: error +// NOSICIVI: error: invalid operand for instruction //===----------------------------------------------------------------------===// // s_dcache_discard instructions @@ -288,162 +297,162 @@ s_dcache_discard_x2 s[2:3], 0x0 s_atomic_add s5, s[2:3], s101 // GFX9: s_atomic_add s5, s[2:3], s101 ; encoding: [0x41,0x01,0x08,0xc2,0x65,0x00,0x00,0x00] // GFX1012: s_atomic_add s5, s[2:3], s101 ; encoding: [0x41,0x01,0x08,0xf6,0x00,0x00,0x00,0xca] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_add s5, s[2:3], 0x0 // GFX9: s_atomic_add s5, s[2:3], 0x0 ; encoding: [0x41,0x01,0x0a,0xc2,0x00,0x00,0x00,0x00] // GFX1012: s_atomic_add s5, s[2:3], 0x0 ; encoding: [0x41,0x01,0x08,0xf6,0x00,0x00,0x00,0xfa] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_add s5, s[2:3], s0 glc // GFX9: s_atomic_add s5, s[2:3], s0 glc ; encoding: [0x41,0x01,0x09,0xc2,0x00,0x00,0x00,0x00] // GFX1012: s_atomic_add s5, s[2:3], s0 glc ; encoding: [0x41,0x01,0x09,0xf6,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_add_x2 s[10:11], s[2:3], s101 // GFX9: s_atomic_add_x2 s[10:11], s[2:3], s101 ; encoding: [0x81,0x02,0x88,0xc2,0x65,0x00,0x00,0x00] // GFX1012: s_atomic_add_x2 s[10:11], s[2:3], s101 ; encoding: [0x81,0x02,0x88,0xf6,0x00,0x00,0x00,0xca] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_and s5, s[2:3], s101 // GFX9: s_atomic_and s5, s[2:3], s101 ; encoding: [0x41,0x01,0x20,0xc2,0x65,0x00,0x00,0x00] // GFX1012: s_atomic_and s5, s[2:3], s101 ; encoding: [0x41,0x01,0x20,0xf6,0x00,0x00,0x00,0xca] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_and_x2 s[10:11], s[2:3], 0x0 // GFX9: s_atomic_and_x2 s[10:11], s[2:3], 0x0 ; encoding: [0x81,0x02,0xa2,0xc2,0x00,0x00,0x00,0x00] // GFX1012: s_atomic_and_x2 s[10:11], s[2:3], 0x0 ; encoding: [0x81,0x02,0xa0,0xf6,0x00,0x00,0x00,0xfa] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_cmpswap s[10:11], s[2:3], s101 // GFX9: s_atomic_cmpswap s[10:11], s[2:3], s101 ; encoding: [0x81,0x02,0x04,0xc2,0x65,0x00,0x00,0x00] // GFX1012: s_atomic_cmpswap s[10:11], s[2:3], s101 ; encoding: [0x81,0x02,0x04,0xf6,0x00,0x00,0x00,0xca] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_cmpswap s[10:11], s[2:3], 0x0 // GFX9: s_atomic_cmpswap s[10:11], s[2:3], 0x0 ; encoding: [0x81,0x02,0x06,0xc2,0x00,0x00,0x00,0x00] // GFX1012: s_atomic_cmpswap s[10:11], s[2:3], 0x0 ; encoding: [0x81,0x02,0x04,0xf6,0x00,0x00,0x00,0xfa] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_cmpswap s[10:11], s[2:3], s0 glc // GFX9: s_atomic_cmpswap s[10:11], s[2:3], s0 glc ; encoding: [0x81,0x02,0x05,0xc2,0x00,0x00,0x00,0x00] // GFX1012: s_atomic_cmpswap s[10:11], s[2:3], s0 glc ; encoding: [0x81,0x02,0x05,0xf6,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_cmpswap_x2 s[20:23], s[2:3], s101 // GFX9: s_atomic_cmpswap_x2 s[20:23], s[2:3], s101 ; encoding: [0x01,0x05,0x84,0xc2,0x65,0x00,0x00,0x00] // GFX1012: s_atomic_cmpswap_x2 s[20:23], s[2:3], s101 ; encoding: [0x01,0x05,0x84,0xf6,0x00,0x00,0x00,0xca] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_cmpswap_x2 s[20:23], s[2:3], 0x0 // GFX9: s_atomic_cmpswap_x2 s[20:23], s[2:3], 0x0 ; encoding: [0x01,0x05,0x86,0xc2,0x00,0x00,0x00,0x00] // GFX1012: s_atomic_cmpswap_x2 s[20:23], s[2:3], 0x0 ; encoding: [0x01,0x05,0x84,0xf6,0x00,0x00,0x00,0xfa] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_cmpswap_x2 s[20:23], s[2:3], s0 glc // GFX9: s_atomic_cmpswap_x2 s[20:23], s[2:3], s0 glc ; encoding: [0x01,0x05,0x85,0xc2,0x00,0x00,0x00,0x00] // GFX1012: s_atomic_cmpswap_x2 s[20:23], s[2:3], s0 glc ; encoding: [0x01,0x05,0x85,0xf6,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_dec s5, s[2:3], s0 glc // GFX9: s_atomic_dec s5, s[2:3], s0 glc ; encoding: [0x41,0x01,0x31,0xc2,0x00,0x00,0x00,0x00] // GFX1012: s_atomic_dec s5, s[2:3], s0 glc ; encoding: [0x41,0x01,0x31,0xf6,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_dec_x2 s[10:11], s[2:3], s101 // GFX9: s_atomic_dec_x2 s[10:11], s[2:3], s101 ; encoding: [0x81,0x02,0xb0,0xc2,0x65,0x00,0x00,0x00] // GFX1012: s_atomic_dec_x2 s[10:11], s[2:3], s101 ; encoding: [0x81,0x02,0xb0,0xf6,0x00,0x00,0x00,0xca] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_inc s5, s[2:3], s0 glc // GFX9: s_atomic_inc s5, s[2:3], s0 glc ; encoding: [0x41,0x01,0x2d,0xc2,0x00,0x00,0x00,0x00] // GFX1012: s_atomic_inc s5, s[2:3], s0 glc ; encoding: [0x41,0x01,0x2d,0xf6,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_inc_x2 s[10:11], s[2:3], s101 // GFX9: s_atomic_inc_x2 s[10:11], s[2:3], s101 ; encoding: [0x81,0x02,0xac,0xc2,0x65,0x00,0x00,0x00] // GFX1012: s_atomic_inc_x2 s[10:11], s[2:3], s101 ; encoding: [0x81,0x02,0xac,0xf6,0x00,0x00,0x00,0xca] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_or s5, s[2:3], 0x0 // GFX9: s_atomic_or s5, s[2:3], 0x0 ; encoding: [0x41,0x01,0x26,0xc2,0x00,0x00,0x00,0x00] // GFX1012: s_atomic_or s5, s[2:3], 0x0 ; encoding: [0x41,0x01,0x24,0xf6,0x00,0x00,0x00,0xfa] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_or_x2 s[10:11], s[2:3], s0 glc // GFX9: s_atomic_or_x2 s[10:11], s[2:3], s0 glc ; encoding: [0x81,0x02,0xa5,0xc2,0x00,0x00,0x00,0x00] // GFX1012: s_atomic_or_x2 s[10:11], s[2:3], s0 glc ; encoding: [0x81,0x02,0xa5,0xf6,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_smax s5, s[2:3], s101 // GFX9: s_atomic_smax s5, s[2:3], s101 ; encoding: [0x41,0x01,0x18,0xc2,0x65,0x00,0x00,0x00] // GFX1012: s_atomic_smax s5, s[2:3], s101 ; encoding: [0x41,0x01,0x18,0xf6,0x00,0x00,0x00,0xca] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_smax_x2 s[10:11], s[2:3], s0 glc // GFX9: s_atomic_smax_x2 s[10:11], s[2:3], s0 glc ; encoding: [0x81,0x02,0x99,0xc2,0x00,0x00,0x00,0x00] // GFX1012: s_atomic_smax_x2 s[10:11], s[2:3], s0 glc ; encoding: [0x81,0x02,0x99,0xf6,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_smin s5, s[2:3], s101 // GFX9: s_atomic_smin s5, s[2:3], s101 ; encoding: [0x41,0x01,0x10,0xc2,0x65,0x00,0x00,0x00] // GFX1012: s_atomic_smin s5, s[2:3], s101 ; encoding: [0x41,0x01,0x10,0xf6,0x00,0x00,0x00,0xca] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_smin_x2 s[10:11], s[2:3], s0 glc // GFX9: s_atomic_smin_x2 s[10:11], s[2:3], s0 glc ; encoding: [0x81,0x02,0x91,0xc2,0x00,0x00,0x00,0x00] // GFX1012: s_atomic_smin_x2 s[10:11], s[2:3], s0 glc ; encoding: [0x81,0x02,0x91,0xf6,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_sub s5, s[2:3], s101 // GFX9: s_atomic_sub s5, s[2:3], s101 ; encoding: [0x41,0x01,0x0c,0xc2,0x65,0x00,0x00,0x00] // GFX1012: s_atomic_sub s5, s[2:3], s101 ; encoding: [0x41,0x01,0x0c,0xf6,0x00,0x00,0x00,0xca] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_sub_x2 s[10:11], s[2:3], s0 glc // GFX9: s_atomic_sub_x2 s[10:11], s[2:3], s0 glc ; encoding: [0x81,0x02,0x8d,0xc2,0x00,0x00,0x00,0x00] // GFX1012: s_atomic_sub_x2 s[10:11], s[2:3], s0 glc ; encoding: [0x81,0x02,0x8d,0xf6,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_swap s5, s[2:3], s101 // GFX9: s_atomic_swap s5, s[2:3], s101 ; encoding: [0x41,0x01,0x00,0xc2,0x65,0x00,0x00,0x00] // GFX1012: s_atomic_swap s5, s[2:3], s101 ; encoding: [0x41,0x01,0x00,0xf6,0x00,0x00,0x00,0xca] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_swap_x2 s[10:11], s[2:3], s0 glc // GFX9: s_atomic_swap_x2 s[10:11], s[2:3], s0 glc ; encoding: [0x81,0x02,0x81,0xc2,0x00,0x00,0x00,0x00] // GFX1012: s_atomic_swap_x2 s[10:11], s[2:3], s0 glc ; encoding: [0x81,0x02,0x81,0xf6,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_umax s5, s[2:3], s0 glc // GFX9: s_atomic_umax s5, s[2:3], s0 glc ; encoding: [0x41,0x01,0x1d,0xc2,0x00,0x00,0x00,0x00] // GFX1012: s_atomic_umax s5, s[2:3], s0 glc ; encoding: [0x41,0x01,0x1d,0xf6,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_umax_x2 s[10:11], s[2:3], s101 // GFX9: s_atomic_umax_x2 s[10:11], s[2:3], s101 ; encoding: [0x81,0x02,0x9c,0xc2,0x65,0x00,0x00,0x00] // GFX1012: s_atomic_umax_x2 s[10:11], s[2:3], s101 ; encoding: [0x81,0x02,0x9c,0xf6,0x00,0x00,0x00,0xca] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_umin s5, s[2:3], s101 // GFX9: s_atomic_umin s5, s[2:3], s101 ; encoding: [0x41,0x01,0x14,0xc2,0x65,0x00,0x00,0x00] // GFX1012: s_atomic_umin s5, s[2:3], s101 ; encoding: [0x41,0x01,0x14,0xf6,0x00,0x00,0x00,0xca] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_umin_x2 s[10:11], s[2:3], s0 glc // GFX9: s_atomic_umin_x2 s[10:11], s[2:3], s0 glc ; encoding: [0x81,0x02,0x95,0xc2,0x00,0x00,0x00,0x00] // GFX1012: s_atomic_umin_x2 s[10:11], s[2:3], s0 glc ; encoding: [0x81,0x02,0x95,0xf6,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_xor s5, s[2:3], s101 // GFX9: s_atomic_xor s5, s[2:3], s101 ; encoding: [0x41,0x01,0x28,0xc2,0x65,0x00,0x00,0x00] // GFX1012: s_atomic_xor s5, s[2:3], s101 ; encoding: [0x41,0x01,0x28,0xf6,0x00,0x00,0x00,0xca] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_atomic_xor_x2 s[10:11], s[2:3], s0 glc // GFX9: s_atomic_xor_x2 s[10:11], s[2:3], s0 glc ; encoding: [0x81,0x02,0xa9,0xc2,0x00,0x00,0x00,0x00] // GFX1012: s_atomic_xor_x2 s[10:11], s[2:3], s0 glc ; encoding: [0x81,0x02,0xa9,0xf6,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU //===----------------------------------------------------------------------===// // s_buffer_atomic instructions @@ -452,162 +461,162 @@ s_atomic_xor_x2 s[10:11], s[2:3], s0 glc s_buffer_atomic_add s5, s[4:7], s101 // GFX9: s_buffer_atomic_add s5, s[4:7], s101 ; encoding: [0x42,0x01,0x08,0xc1,0x65,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_add s5, s[4:7], s101 ; encoding: [0x42,0x01,0x08,0xf5,0x00,0x00,0x00,0xca] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_add s5, s[4:7], 0x0 // GFX9: s_buffer_atomic_add s5, s[4:7], 0x0 ; encoding: [0x42,0x01,0x0a,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_add s5, s[4:7], 0x0 ; encoding: [0x42,0x01,0x08,0xf5,0x00,0x00,0x00,0xfa] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_add s5, s[4:7], s0 glc // GFX9: s_buffer_atomic_add s5, s[4:7], s0 glc ; encoding: [0x42,0x01,0x09,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_add s5, s[4:7], s0 glc ; encoding: [0x42,0x01,0x09,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_add_x2 s[10:11], s[4:7], s0 // GFX9: s_buffer_atomic_add_x2 s[10:11], s[4:7], s0 ; encoding: [0x82,0x02,0x88,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_add_x2 s[10:11], s[4:7], s0 ; encoding: [0x82,0x02,0x88,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_and s101, s[4:7], s0 // GFX9: s_buffer_atomic_and s101, s[4:7], s0 ; encoding: [0x42,0x19,0x20,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_and s101, s[4:7], s0 ; encoding: [0x42,0x19,0x20,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_and_x2 s[10:11], s[8:11], s0 // GFX9: s_buffer_atomic_and_x2 s[10:11], s[8:11], s0 ; encoding: [0x84,0x02,0xa0,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_and_x2 s[10:11], s[8:11], s0 ; encoding: [0x84,0x02,0xa0,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_cmpswap s[10:11], s[4:7], s0 // GFX9: s_buffer_atomic_cmpswap s[10:11], s[4:7], s0 ; encoding: [0x82,0x02,0x04,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_cmpswap s[10:11], s[4:7], s0 ; encoding: [0x82,0x02,0x04,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_cmpswap s[10:11], s[4:7], 0x0 // GFX9: s_buffer_atomic_cmpswap s[10:11], s[4:7], 0x0 ; encoding: [0x82,0x02,0x06,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_cmpswap s[10:11], s[4:7], 0x0 ; encoding: [0x82,0x02,0x04,0xf5,0x00,0x00,0x00,0xfa] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_cmpswap s[10:11], s[4:7], s0 glc // GFX9: s_buffer_atomic_cmpswap s[10:11], s[4:7], s0 glc ; encoding: [0x82,0x02,0x05,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_cmpswap s[10:11], s[4:7], s0 glc ; encoding: [0x82,0x02,0x05,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_cmpswap_x2 s[20:23], s[4:7], s101 // GFX9: s_buffer_atomic_cmpswap_x2 s[20:23], s[4:7], s101 ; encoding: [0x02,0x05,0x84,0xc1,0x65,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_cmpswap_x2 s[20:23], s[4:7], s101 ; encoding: [0x02,0x05,0x84,0xf5,0x00,0x00,0x00,0xca] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_cmpswap_x2 s[20:23], s[4:7], 0x0 // GFX9: s_buffer_atomic_cmpswap_x2 s[20:23], s[4:7], 0x0 ; encoding: [0x02,0x05,0x86,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_cmpswap_x2 s[20:23], s[4:7], 0x0 ; encoding: [0x02,0x05,0x84,0xf5,0x00,0x00,0x00,0xfa] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_cmpswap_x2 s[20:23], s[4:7], s0 glc // GFX9: s_buffer_atomic_cmpswap_x2 s[20:23], s[4:7], s0 glc ; encoding: [0x02,0x05,0x85,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_cmpswap_x2 s[20:23], s[4:7], s0 glc ; encoding: [0x02,0x05,0x85,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_dec s5, s[4:7], s0 // GFX9: s_buffer_atomic_dec s5, s[4:7], s0 ; encoding: [0x42,0x01,0x30,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_dec s5, s[4:7], s0 ; encoding: [0x42,0x01,0x30,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_dec_x2 s[10:11], s[4:7], s0 glc // GFX9: s_buffer_atomic_dec_x2 s[10:11], s[4:7], s0 glc ; encoding: [0x82,0x02,0xb1,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_dec_x2 s[10:11], s[4:7], s0 glc ; encoding: [0x82,0x02,0xb1,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_inc s101, s[4:7], s0 // GFX9: s_buffer_atomic_inc s101, s[4:7], s0 ; encoding: [0x42,0x19,0x2c,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_inc s101, s[4:7], s0 ; encoding: [0x42,0x19,0x2c,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_inc_x2 s[10:11], s[4:7], 0x0 // GFX9: s_buffer_atomic_inc_x2 s[10:11], s[4:7], 0x0 ; encoding: [0x82,0x02,0xae,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_inc_x2 s[10:11], s[4:7], 0x0 ; encoding: [0x82,0x02,0xac,0xf5,0x00,0x00,0x00,0xfa] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_or s5, s[8:11], s0 // GFX9: s_buffer_atomic_or s5, s[8:11], s0 ; encoding: [0x44,0x01,0x24,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_or s5, s[8:11], s0 ; encoding: [0x44,0x01,0x24,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_or_x2 s[10:11], s[96:99], s0 // GFX9: s_buffer_atomic_or_x2 s[10:11], s[96:99], s0 ; encoding: [0xb0,0x02,0xa4,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_or_x2 s[10:11], s[96:99], s0 ; encoding: [0xb0,0x02,0xa4,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_smax s5, s[4:7], s101 // GFX9: s_buffer_atomic_smax s5, s[4:7], s101 ; encoding: [0x42,0x01,0x18,0xc1,0x65,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_smax s5, s[4:7], s101 ; encoding: [0x42,0x01,0x18,0xf5,0x00,0x00,0x00,0xca] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_smax_x2 s[100:101], s[4:7], s0 // GFX9: s_buffer_atomic_smax_x2 s[100:101], s[4:7], s0 ; encoding: [0x02,0x19,0x98,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_smax_x2 s[100:101], s[4:7], s0 ; encoding: [0x02,0x19,0x98,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_smin s5, s[4:7], 0x0 // GFX9: s_buffer_atomic_smin s5, s[4:7], 0x0 ; encoding: [0x42,0x01,0x12,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_smin s5, s[4:7], 0x0 ; encoding: [0x42,0x01,0x10,0xf5,0x00,0x00,0x00,0xfa] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_smin_x2 s[12:13], s[4:7], s0 // GFX9: s_buffer_atomic_smin_x2 s[12:13], s[4:7], s0 ; encoding: [0x02,0x03,0x90,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_smin_x2 s[12:13], s[4:7], s0 ; encoding: [0x02,0x03,0x90,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_sub s5, s[4:7], s0 glc // GFX9: s_buffer_atomic_sub s5, s[4:7], s0 glc ; encoding: [0x42,0x01,0x0d,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_sub s5, s[4:7], s0 glc ; encoding: [0x42,0x01,0x0d,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_sub_x2 s[10:11], s[4:7], s0 // GFX9: s_buffer_atomic_sub_x2 s[10:11], s[4:7], s0 ; encoding: [0x82,0x02,0x8c,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_sub_x2 s[10:11], s[4:7], s0 ; encoding: [0x82,0x02,0x8c,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_swap s5, s[4:7], s0 // GFX9: s_buffer_atomic_swap s5, s[4:7], s0 ; encoding: [0x42,0x01,0x00,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_swap s5, s[4:7], s0 ; encoding: [0x42,0x01,0x00,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_swap_x2 s[10:11], s[4:7], s0 glc // GFX9: s_buffer_atomic_swap_x2 s[10:11], s[4:7], s0 glc ; encoding: [0x82,0x02,0x81,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_swap_x2 s[10:11], s[4:7], s0 glc ; encoding: [0x82,0x02,0x81,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_umax s5, s[4:7], s0 // GFX9: s_buffer_atomic_umax s5, s[4:7], s0 ; encoding: [0x42,0x01,0x1c,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_umax s5, s[4:7], s0 ; encoding: [0x42,0x01,0x1c,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_umax_x2 s[10:11], s[4:7], s0 glc // GFX9: s_buffer_atomic_umax_x2 s[10:11], s[4:7], s0 glc ; encoding: [0x82,0x02,0x9d,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_umax_x2 s[10:11], s[4:7], s0 glc ; encoding: [0x82,0x02,0x9d,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_umin s5, s[4:7], s0 // GFX9: s_buffer_atomic_umin s5, s[4:7], s0 ; encoding: [0x42,0x01,0x14,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_umin s5, s[4:7], s0 ; encoding: [0x42,0x01,0x14,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_umin_x2 s[10:11], s[4:7], s0 glc // GFX9: s_buffer_atomic_umin_x2 s[10:11], s[4:7], s0 glc ; encoding: [0x82,0x02,0x95,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_umin_x2 s[10:11], s[4:7], s0 glc ; encoding: [0x82,0x02,0x95,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_xor s5, s[4:7], s0 // GFX9: s_buffer_atomic_xor s5, s[4:7], s0 ; encoding: [0x42,0x01,0x28,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_xor s5, s[4:7], s0 ; encoding: [0x42,0x01,0x28,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU s_buffer_atomic_xor_x2 s[10:11], s[4:7], s0 glc // GFX9: s_buffer_atomic_xor_x2 s[10:11], s[4:7], s0 glc ; encoding: [0x82,0x02,0xa9,0xc1,0x00,0x00,0x00,0x00] // GFX1012: s_buffer_atomic_xor_x2 s[10:11], s[4:7], s0 glc ; encoding: [0x82,0x02,0xa9,0xf5,0x00,0x00,0x00,0x00] -// NOSICIVI: error: +// NOSICIVI: error: instruction not supported on this GPU //===----------------------------------------------------------------------===// // Unsigned 20-bit offsets (VI+) diff --git a/llvm/test/MC/AMDGPU/smrd-err.s b/llvm/test/MC/AMDGPU/smrd-err.s index d7ef74901c6f..68f2ac6570c9 100644 --- a/llvm/test/MC/AMDGPU/smrd-err.s +++ b/llvm/test/MC/AMDGPU/smrd-err.s @@ -1,15 +1,14 @@ -// RUN: llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=SI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=VI %s +// RUN: llvm-mc -arch=amdgcn -mcpu=tahiti %s | FileCheck -check-prefix=GCN -check-prefix=SI %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=NOVI --implicit-check-not=error: %s s_load_dwordx4 s[100:103], s[2:3], s4 -// VI: error: not a valid operand +// NOVI: error: not a valid operand // SI: s_load_dwordx4 s[100:103], s[2:3], s4 - s_load_dwordx8 s[96:103], s[2:3], s4 -// VI: error: not a valid operand +// NOVI: error: not a valid operand // SI: s_load_dwordx8 s[96:103], s[2:3], s4 s_load_dwordx16 s[88:103], s[2:3], s4 -// VI: error: not a valid operand +// NOVI: error: not a valid operand // SI: s_load_dwordx16 s[88:103], s[2:3], s4 diff --git a/llvm/test/MC/AMDGPU/smrd.s b/llvm/test/MC/AMDGPU/smrd.s index 0ad3b0f20645..30f01b2ced1c 100644 --- a/llvm/test/MC/AMDGPU/smrd.s +++ b/llvm/test/MC/AMDGPU/smrd.s @@ -3,9 +3,9 @@ // RUN: llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=CI %s // RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck --check-prefix=VI %s -// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=NOSI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s --check-prefix=NOSI -// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji %s 2>&1 | FileCheck %s --check-prefix=NOVI +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=NOSI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s --check-prefix=NOSI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji %s 2>&1 | FileCheck %s --check-prefix=NOVI --implicit-check-not=error: //===----------------------------------------------------------------------===// // Offset Handling diff --git a/llvm/test/MC/AMDGPU/sop1-err.s b/llvm/test/MC/AMDGPU/sop1-err.s index 0225fa1778ea..6322f5b098c3 100644 --- a/llvm/test/MC/AMDGPU/sop1-err.s +++ b/llvm/test/MC/AMDGPU/sop1-err.s @@ -1,6 +1,6 @@ -// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck -check-prefix=GCN %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=SI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=VI %s +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck -check-prefix=GCN --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=SI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=VI --implicit-check-not=error: %s s_mov_b32 v1, s2 // GCN: error: invalid operand for instruction diff --git a/llvm/test/MC/AMDGPU/sop1.s b/llvm/test/MC/AMDGPU/sop1.s index 76525b943cad..dafbf650b671 100644 --- a/llvm/test/MC/AMDGPU/sop1.s +++ b/llvm/test/MC/AMDGPU/sop1.s @@ -1,71 +1,84 @@ // RUN: not llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=VI --check-prefix=GFX89 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=GFX89 --check-prefix=GFX9 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=GFX10 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=VI --check-prefix=GFX89 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=GFX89 --check-prefix=GFX9 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=GFX10 %s -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck --check-prefix=NOSICI --check-prefix=NOSICIVI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=NOVI --check-prefix=NOSICIVI --check-prefix=NOGFX89 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck --check-prefix=NOGFX89 %s - -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding 2>&1 %s | FileCheck --check-prefix=GFX10-ERR %s +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck --check-prefix=NOSICI --check-prefix=NOSICIVI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji %s 2>&1 | FileCheck --check-prefix=NOVI --check-prefix=NOSICIVI --check-prefix=NOGFX89 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck --check-prefix=NOGFX9 --check-prefix=NOGFX89 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 2>&1 %s | FileCheck --check-prefix=GFX10-ERR --implicit-check-not=error: %s s_mov_b32 s1, s2 // SICI: s_mov_b32 s1, s2 ; encoding: [0x02,0x03,0x81,0xbe] // GFX89: s_mov_b32 s1, s2 ; encoding: [0x02,0x00,0x81,0xbe] +// GFX10: s_mov_b32 s1, s2 ; encoding: [0x02,0x03,0x81,0xbe] s_mov_b32 s1, 1 // SICI: s_mov_b32 s1, 1 ; encoding: [0x81,0x03,0x81,0xbe] // GFX89: s_mov_b32 s1, 1 ; encoding: [0x81,0x00,0x81,0xbe] +// GFX10: s_mov_b32 s1, 1 ; encoding: [0x81,0x03,0x81,0xbe] s_mov_b32 s1, 100 // SICI: s_mov_b32 s1, 0x64 ; encoding: [0xff,0x03,0x81,0xbe,0x64,0x00,0x00,0x00] // GFX89: s_mov_b32 s1, 0x64 ; encoding: [0xff,0x00,0x81,0xbe,0x64,0x00,0x00,0x00] +// GFX10: s_mov_b32 s1, 0x64 ; encoding: [0xff,0x03,0x81,0xbe,0x64,0x00,0x00,0x00] // Literal constant sign bit s_mov_b32 s1, 0x80000000 // SICI: s_mov_b32 s1, 0x80000000 ; encoding: [0xff,0x03,0x81,0xbe,0x00,0x00,0x00,0x80] // GFX89: s_mov_b32 s1, 0x80000000 ; encoding: [0xff,0x00,0x81,0xbe,0x00,0x00,0x00,0x80] +// GFX10: s_mov_b32 s1, 0x80000000 ; encoding: [0xff,0x03,0x81,0xbe,0x00,0x00,0x00,0x80] // Negative 32-bit constant s_mov_b32 s0, 0xfe5163ab // SICI: s_mov_b32 s0, 0xfe5163ab ; encoding: [0xff,0x03,0x80,0xbe,0xab,0x63,0x51,0xfe] // GFX89: s_mov_b32 s0, 0xfe5163ab ; encoding: [0xff,0x00,0x80,0xbe,0xab,0x63,0x51,0xfe] +// GFX10: s_mov_b32 s0, 0xfe5163ab ; encoding: [0xff,0x03,0x80,0xbe,0xab,0x63,0x51,0xfe] s_mov_b64 s[2:3], s[4:5] // SICI: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x04,0x82,0xbe] // GFX89: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x01,0x82,0xbe] +// GFX10: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x04,0x82,0xbe] s_mov_b64 null, s[4:5] // GFX10: s_mov_b64 null, s[4:5] ; encoding: [0x04,0x04,0xfd,0xbe] // NOSICIVI: error: not a valid operand. +// NOGFX9: error: not a valid operand. s_mov_b64 s[2:3], 0xffffffffffffffff // SICI: s_mov_b64 s[2:3], -1 ; encoding: [0xc1,0x04,0x82,0xbe] // GFX89: s_mov_b64 s[2:3], -1 ; encoding: [0xc1,0x01,0x82,0xbe] +// GFX10: s_mov_b64 s[2:3], -1 ; encoding: [0xc1,0x04,0x82,0xbe] s_mov_b64 s[2:3], 0xffffffff // SICI: s_mov_b64 s[2:3], 0xffffffff ; encoding: [0xff,0x04,0x82,0xbe,0xff,0xff,0xff,0xff] // GFX89: s_mov_b64 s[2:3], 0xffffffff ; encoding: [0xff,0x01,0x82,0xbe,0xff,0xff,0xff,0xff] +// GFX10: s_mov_b64 s[2:3], 0xffffffff ; encoding: [0xff,0x04,0x82,0xbe,0xff,0xff,0xff,0xff] s_mov_b64 s[0:1], 0x80000000 // SICI: s_mov_b64 s[0:1], 0x80000000 ; encoding: [0xff,0x04,0x80,0xbe,0x00,0x00,0x00,0x80] // GFX89: s_mov_b64 s[0:1], 0x80000000 ; encoding: [0xff,0x01,0x80,0xbe,0x00,0x00,0x00,0x80] +// GFX10: s_mov_b64 s[0:1], 0x80000000 ; encoding: [0xff,0x04,0x80,0xbe,0x00,0x00,0x00,0x80] s_mov_b64 s[102:103], -1 // SICI: s_mov_b64 s[102:103], -1 ; encoding: [0xc1,0x04,0xe6,0xbe] // NOGFX89: error: not a valid operand +// GFX10: s_mov_b64 s[102:103], -1 ; encoding: [0xc1,0x04,0xe6,0xbe] s_cmov_b32 s1, 200 // SICI: s_cmov_b32 s1, 0xc8 ; encoding: [0xff,0x05,0x81,0xbe,0xc8,0x00,0x00,0x00] // GFX89: s_cmov_b32 s1, 0xc8 ; encoding: [0xff,0x02,0x81,0xbe,0xc8,0x00,0x00,0x00] +// GFX10: s_cmov_b32 s1, 0xc8 ; encoding: [0xff,0x05,0x81,0xbe,0xc8,0x00,0x00,0x00] s_cmov_b32 s1, 1.0 // SICI: s_cmov_b32 s1, 1.0 ; encoding: [0xf2,0x05,0x81,0xbe] // GFX89: s_cmov_b32 s1, 1.0 ; encoding: [0xf2,0x02,0x81,0xbe] +// GFX10: s_cmov_b32 s1, 1.0 ; encoding: [0xf2,0x05,0x81,0xbe] s_cmov_b32 s1, s2 // SICI: s_cmov_b32 s1, s2 ; encoding: [0x02,0x05,0x81,0xbe] // GFX89: s_cmov_b32 s1, s2 ; encoding: [0x02,0x02,0x81,0xbe] +// GFX10: s_cmov_b32 s1, s2 ; encoding: [0x02,0x05,0x81,0xbe] //s_cmov_b64 s[2:3], 1.0 //GCN-FIXME: s_cmov_b64 s[2:3], 1.0 ; encoding: [0xf2,0x05,0x82,0xb3] @@ -73,174 +86,217 @@ s_cmov_b32 s1, s2 s_cmov_b64 s[2:3], s[4:5] // SICI: s_cmov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x06,0x82,0xbe] // GFX89: s_cmov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x03,0x82,0xbe] +// GFX10: s_cmov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x06,0x82,0xbe] s_not_b32 s1, s2 // SICI: s_not_b32 s1, s2 ; encoding: [0x02,0x07,0x81,0xbe] // GFX89: s_not_b32 s1, s2 ; encoding: [0x02,0x04,0x81,0xbe] +// GFX10: s_not_b32 s1, s2 ; encoding: [0x02,0x07,0x81,0xbe] s_not_b64 s[2:3], s[4:5] // SICI: s_not_b64 s[2:3], s[4:5] ; encoding: [0x04,0x08,0x82,0xbe] // GFX89: s_not_b64 s[2:3], s[4:5] ; encoding: [0x04,0x05,0x82,0xbe] +// GFX10: s_not_b64 s[2:3], s[4:5] ; encoding: [0x04,0x08,0x82,0xbe] s_wqm_b32 s1, s2 // SICI: s_wqm_b32 s1, s2 ; encoding: [0x02,0x09,0x81,0xbe] // GFX89: s_wqm_b32 s1, s2 ; encoding: [0x02,0x06,0x81,0xbe] +// GFX10: s_wqm_b32 s1, s2 ; encoding: [0x02,0x09,0x81,0xbe] s_wqm_b64 s[2:3], s[4:5] // SICI: s_wqm_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0a,0x82,0xbe] // GFX89: s_wqm_b64 s[2:3], s[4:5] ; encoding: [0x04,0x07,0x82,0xbe] +// GFX10: s_wqm_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0a,0x82,0xbe] s_brev_b32 s1, s2 // SICI: s_brev_b32 s1, s2 ; encoding: [0x02,0x0b,0x81,0xbe] // GFX89: s_brev_b32 s1, s2 ; encoding: [0x02,0x08,0x81,0xbe] +// GFX10: s_brev_b32 s1, s2 ; encoding: [0x02,0x0b,0x81,0xbe] s_brev_b64 s[2:3], s[4:5] // SICI: s_brev_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0c,0x82,0xbe] // GFX89: s_brev_b64 s[2:3], s[4:5] ; encoding: [0x04,0x09,0x82,0xbe] +// GFX10: s_brev_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0c,0x82,0xbe] s_bcnt0_i32_b32 s1, s2 // SICI: s_bcnt0_i32_b32 s1, s2 ; encoding: [0x02,0x0d,0x81,0xbe] // GFX89: s_bcnt0_i32_b32 s1, s2 ; encoding: [0x02,0x0a,0x81,0xbe] +// GFX10: s_bcnt0_i32_b32 s1, s2 ; encoding: [0x02,0x0d,0x81,0xbe] s_bcnt0_i32_b64 s1, s[2:3] // SICI: s_bcnt0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0e,0x81,0xbe] // GFX89: s_bcnt0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0b,0x81,0xbe] +// GFX10: s_bcnt0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0e,0x81,0xbe] s_bcnt1_i32_b32 s1, s2 // SICI: s_bcnt1_i32_b32 s1, s2 ; encoding: [0x02,0x0f,0x81,0xbe] // GFX89: s_bcnt1_i32_b32 s1, s2 ; encoding: [0x02,0x0c,0x81,0xbe] +// GFX10: s_bcnt1_i32_b32 s1, s2 ; encoding: [0x02,0x0f,0x81,0xbe] s_bcnt1_i32_b64 s1, s[2:3] // SICI: s_bcnt1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x10,0x81,0xbe] // GFX89: s_bcnt1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0d,0x81,0xbe] +// GFX10: s_bcnt1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x10,0x81,0xbe] s_ff0_i32_b32 s1, s2 // SICI: s_ff0_i32_b32 s1, s2 ; encoding: [0x02,0x11,0x81,0xbe] // GFX89: s_ff0_i32_b32 s1, s2 ; encoding: [0x02,0x0e,0x81,0xbe] +// GFX10: s_ff0_i32_b32 s1, s2 ; encoding: [0x02,0x11,0x81,0xbe] s_ff0_i32_b64 s1, s[2:3] // SICI: s_ff0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x12,0x81,0xbe] // GFX89: s_ff0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0f,0x81,0xbe] +// GFX10: s_ff0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x12,0x81,0xbe] s_ff1_i32_b32 s1, s2 // SICI: s_ff1_i32_b32 s1, s2 ; encoding: [0x02,0x13,0x81,0xbe] // GFX89: s_ff1_i32_b32 s1, s2 ; encoding: [0x02,0x10,0x81,0xbe] +// GFX10: s_ff1_i32_b32 s1, s2 ; encoding: [0x02,0x13,0x81,0xbe] s_ff1_i32_b64 s1, s[2:3] // SICI: s_ff1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x14,0x81,0xbe] // GFX89: s_ff1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x11,0x81,0xbe] +// GFX10: s_ff1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x14,0x81,0xbe] s_flbit_i32_b32 s1, s2 // SICI: s_flbit_i32_b32 s1, s2 ; encoding: [0x02,0x15,0x81,0xbe] // GFX89: s_flbit_i32_b32 s1, s2 ; encoding: [0x02,0x12,0x81,0xbe] +// GFX10: s_flbit_i32_b32 s1, s2 ; encoding: [0x02,0x15,0x81,0xbe] s_flbit_i32_b64 s1, s[2:3] // SICI: s_flbit_i32_b64 s1, s[2:3] ; encoding: [0x02,0x16,0x81,0xbe] // GFX89: s_flbit_i32_b64 s1, s[2:3] ; encoding: [0x02,0x13,0x81,0xbe] +// GFX10: s_flbit_i32_b64 s1, s[2:3] ; encoding: [0x02,0x16,0x81,0xbe] s_flbit_i32 s1, s2 // SICI: s_flbit_i32 s1, s2 ; encoding: [0x02,0x17,0x81,0xbe] // GFX89: s_flbit_i32 s1, s2 ; encoding: [0x02,0x14,0x81,0xbe] +// GFX10: s_flbit_i32 s1, s2 ; encoding: [0x02,0x17,0x81,0xbe] s_flbit_i32_i64 s1, s[2:3] // SICI: s_flbit_i32_i64 s1, s[2:3] ; encoding: [0x02,0x18,0x81,0xbe] // GFX89: s_flbit_i32_i64 s1, s[2:3] ; encoding: [0x02,0x15,0x81,0xbe] +// GFX10: s_flbit_i32_i64 s1, s[2:3] ; encoding: [0x02,0x18,0x81,0xbe] s_sext_i32_i8 s1, s2 // SICI: s_sext_i32_i8 s1, s2 ; encoding: [0x02,0x19,0x81,0xbe] // GFX89: s_sext_i32_i8 s1, s2 ; encoding: [0x02,0x16,0x81,0xbe] +// GFX10: s_sext_i32_i8 s1, s2 ; encoding: [0x02,0x19,0x81,0xbe] s_sext_i32_i16 s1, s2 // SICI: s_sext_i32_i16 s1, s2 ; encoding: [0x02,0x1a,0x81,0xbe] // GFX89: s_sext_i32_i16 s1, s2 ; encoding: [0x02,0x17,0x81,0xbe] +// GFX10: s_sext_i32_i16 s1, s2 ; encoding: [0x02,0x1a,0x81,0xbe] s_bitset0_b32 s1, s2 // SICI: s_bitset0_b32 s1, s2 ; encoding: [0x02,0x1b,0x81,0xbe] // GFX89: s_bitset0_b32 s1, s2 ; encoding: [0x02,0x18,0x81,0xbe] +// GFX10: s_bitset0_b32 s1, s2 ; encoding: [0x02,0x1b,0x81,0xbe] s_bitset0_b64 s[2:3], s4 // SICI: s_bitset0_b64 s[2:3], s4 ; encoding: [0x04,0x1c,0x82,0xbe] // GFX89: s_bitset0_b64 s[2:3], s4 ; encoding: [0x04,0x19,0x82,0xbe] +// GFX10: s_bitset0_b64 s[2:3], s4 ; encoding: [0x04,0x1c,0x82,0xbe] s_bitset1_b32 s1, s2 // SICI: s_bitset1_b32 s1, s2 ; encoding: [0x02,0x1d,0x81,0xbe] // GFX89: s_bitset1_b32 s1, s2 ; encoding: [0x02,0x1a,0x81,0xbe] +// GFX10: s_bitset1_b32 s1, s2 ; encoding: [0x02,0x1d,0x81,0xbe] s_bitset1_b64 s[2:3], s4 // SICI: s_bitset1_b64 s[2:3], s4 ; encoding: [0x04,0x1e,0x82,0xbe] // GFX89: s_bitset1_b64 s[2:3], s4 ; encoding: [0x04,0x1b,0x82,0xbe] +// GFX10: s_bitset1_b64 s[2:3], s4 ; encoding: [0x04,0x1e,0x82,0xbe] s_getpc_b64 s[2:3] // SICI: s_getpc_b64 s[2:3] ; encoding: [0x00,0x1f,0x82,0xbe] // GFX89: s_getpc_b64 s[2:3] ; encoding: [0x00,0x1c,0x82,0xbe] +// GFX10: s_getpc_b64 s[2:3] ; encoding: [0x00,0x1f,0x82,0xbe] s_setpc_b64 s[4:5] // SICI: s_setpc_b64 s[4:5] ; encoding: [0x04,0x20,0x80,0xbe] // GFX89: s_setpc_b64 s[4:5] ; encoding: [0x04,0x1d,0x80,0xbe] +// GFX10: s_setpc_b64 s[4:5] ; encoding: [0x04,0x20,0x80,0xbe] s_swappc_b64 s[2:3], s[4:5] // SICI: s_swappc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x21,0x82,0xbe] // GFX89: s_swappc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x1e,0x82,0xbe] +// GFX10: s_swappc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x21,0x82,0xbe] s_rfe_b64 s[4:5] // SICI: s_rfe_b64 s[4:5] ; encoding: [0x04,0x22,0x80,0xbe] // GFX89: s_rfe_b64 s[4:5] ; encoding: [0x04,0x1f,0x80,0xbe] +// GFX10: s_rfe_b64 s[4:5] ; encoding: [0x04,0x22,0x80,0xbe] s_and_saveexec_b64 s[2:3], s[4:5] // SICI: s_and_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x24,0x82,0xbe] // GFX89: s_and_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x20,0x82,0xbe] +// GFX10: s_and_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x24,0x82,0xbe] s_or_saveexec_b64 s[2:3], s[4:5] // SICI: s_or_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x25,0x82,0xbe] // GFX89: s_or_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x21,0x82,0xbe] +// GFX10: s_or_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x25,0x82,0xbe] s_xor_saveexec_b64 s[2:3], s[4:5] // SICI: s_xor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x26,0x82,0xbe] // GFX89: s_xor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x22,0x82,0xbe] +// GFX10: s_xor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x26,0x82,0xbe] s_andn2_saveexec_b64 s[2:3], s[4:5] // SICI: s_andn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x27,0x82,0xbe] // GFX89: s_andn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x23,0x82,0xbe] +// GFX10: s_andn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x27,0x82,0xbe] s_orn2_saveexec_b64 s[2:3], s[4:5] // SICI: s_orn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x28,0x82,0xbe] // GFX89: s_orn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x24,0x82,0xbe] +// GFX10: s_orn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x28,0x82,0xbe] s_nand_saveexec_b64 s[2:3], s[4:5] // SICI: s_nand_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x29,0x82,0xbe] // GFX89: s_nand_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x25,0x82,0xbe] +// GFX10: s_nand_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x29,0x82,0xbe] s_nor_saveexec_b64 s[2:3], s[4:5] // SICI: s_nor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2a,0x82,0xbe] // GFX89: s_nor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x26,0x82,0xbe] +// GFX10: s_nor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2a,0x82,0xbe] s_xnor_saveexec_b64 s[2:3], s[4:5] // SICI: s_xnor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2b,0x82,0xbe] // GFX89: s_xnor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x27,0x82,0xbe] +// GFX10: s_xnor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2b,0x82,0xbe] s_quadmask_b32 s1, s2 // SICI: s_quadmask_b32 s1, s2 ; encoding: [0x02,0x2c,0x81,0xbe] // GFX89: s_quadmask_b32 s1, s2 ; encoding: [0x02,0x28,0x81,0xbe] +// GFX10: s_quadmask_b32 s1, s2 ; encoding: [0x02,0x2c,0x81,0xbe] s_quadmask_b64 s[2:3], s[4:5] // SICI: s_quadmask_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2d,0x82,0xbe] // GFX89: s_quadmask_b64 s[2:3], s[4:5] ; encoding: [0x04,0x29,0x82,0xbe] +// GFX10: s_quadmask_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2d,0x82,0xbe] s_movrels_b32 s1, s2 // SICI: s_movrels_b32 s1, s2 ; encoding: [0x02,0x2e,0x81,0xbe] // GFX89: s_movrels_b32 s1, s2 ; encoding: [0x02,0x2a,0x81,0xbe] +// GFX10: s_movrels_b32 s1, s2 ; encoding: [0x02,0x2e,0x81,0xbe] s_movrels_b64 s[2:3], s[4:5] // SICI: s_movrels_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2f,0x82,0xbe] // GFX89: s_movrels_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2b,0x82,0xbe] +// GFX10: s_movrels_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2f,0x82,0xbe] s_movreld_b32 s1, s2 // SICI: s_movreld_b32 s1, s2 ; encoding: [0x02,0x30,0x81,0xbe] // GFX89: s_movreld_b32 s1, s2 ; encoding: [0x02,0x2c,0x81,0xbe] +// GFX10: s_movreld_b32 s1, s2 ; encoding: [0x02,0x30,0x81,0xbe] s_movreld_b64 s[2:3], s[4:5] // SICI: s_movreld_b64 s[2:3], s[4:5] ; encoding: [0x04,0x31,0x82,0xbe] // GFX89: s_movreld_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2d,0x82,0xbe] +// GFX10: s_movreld_b64 s[2:3], s[4:5] ; encoding: [0x04,0x31,0x82,0xbe] s_cbranch_join s4 // SICI: s_cbranch_join s4 ; encoding: [0x04,0x32,0x80,0xbe] @@ -250,55 +306,69 @@ s_cbranch_join s4 s_cbranch_join 1 // NOSICI: error: invalid operand for instruction // NOGFX89: error: invalid operand for instruction +// GFX10-ERR: error: invalid operand for instruction s_cbranch_join 100 // NOSICI: error: invalid operand for instruction // NOGFX89: error: invalid operand for instruction +// GFX10-ERR: error: invalid operand for instruction s_abs_i32 s1, s2 // SICI: s_abs_i32 s1, s2 ; encoding: [0x02,0x34,0x81,0xbe] // GFX89: s_abs_i32 s1, s2 ; encoding: [0x02,0x30,0x81,0xbe] +// GFX10: s_abs_i32 s1, s2 ; encoding: [0x02,0x34,0x81,0xbe] s_set_gpr_idx_idx s0 // GFX89: s_set_gpr_idx_idx s0 ; encoding: [0x00,0x32,0x80,0xbe] // NOSICI: error: instruction not supported on this GPU +// GFX10-ERR: error: instruction not supported on this GPU s_andn1_saveexec_b64 s[100:101], s[2:3] // GFX9: s_andn1_saveexec_b64 s[100:101], s[2:3] ; encoding: [0x02,0x33,0xe4,0xbe] // NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_andn1_saveexec_b64 s[100:101], s[2:3] ; encoding: [0x02,0x37,0xe4,0xbe] s_andn1_saveexec_b64 s[10:11], s[4:5] // GFX9: s_andn1_saveexec_b64 s[10:11], s[4:5] ; encoding: [0x04,0x33,0x8a,0xbe] // NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_andn1_saveexec_b64 s[10:11], s[4:5] ; encoding: [0x04,0x37,0x8a,0xbe] s_andn1_saveexec_b64 s[10:11], -1 // GFX9: s_andn1_saveexec_b64 s[10:11], -1 ; encoding: [0xc1,0x33,0x8a,0xbe] // NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_andn1_saveexec_b64 s[10:11], -1 ; encoding: [0xc1,0x37,0x8a,0xbe] s_andn1_saveexec_b64 s[10:11], 0xaf123456 // GFX9: s_andn1_saveexec_b64 s[10:11], 0xaf123456 ; encoding: [0xff,0x33,0x8a,0xbe,0x56,0x34,0x12,0xaf] // NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_andn1_saveexec_b64 s[10:11], 0xaf123456 ; encoding: [0xff,0x37,0x8a,0xbe,0x56,0x34,0x12,0xaf] s_andn1_wrexec_b64 s[10:11], s[2:3] // GFX9: s_andn1_wrexec_b64 s[10:11], s[2:3] ; encoding: [0x02,0x35,0x8a,0xbe] // NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_andn1_wrexec_b64 s[10:11], s[2:3] ; encoding: [0x02,0x39,0x8a,0xbe] s_andn2_wrexec_b64 s[12:13], s[2:3] // GFX9: s_andn2_wrexec_b64 s[12:13], s[2:3] ; encoding: [0x02,0x36,0x8c,0xbe] // NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_andn2_wrexec_b64 s[12:13], s[2:3] ; encoding: [0x02,0x3a,0x8c,0xbe] s_orn1_saveexec_b64 s[10:11], 0 // GFX9: s_orn1_saveexec_b64 s[10:11], 0 ; encoding: [0x80,0x34,0x8a,0xbe] // NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_orn1_saveexec_b64 s[10:11], 0 ; encoding: [0x80,0x38,0x8a,0xbe] s_bitreplicate_b64_b32 s[10:11], s101 // GFX9: s_bitreplicate_b64_b32 s[10:11], s101 ; encoding: [0x65,0x37,0x8a,0xbe] // NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_bitreplicate_b64_b32 s[10:11], s101 ; encoding: [0x65,0x3b,0x8a,0xbe] s_bitreplicate_b64_b32 s[10:11], -1 // GFX9: s_bitreplicate_b64_b32 s[10:11], -1 ; encoding: [0xc1,0x37,0x8a,0xbe] // NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_bitreplicate_b64_b32 s[10:11], -1 ; encoding: [0xc1,0x3b,0x8a,0xbe] s_bitreplicate_b64_b32 s[10:11], 0x3f717273 // GFX9: s_bitreplicate_b64_b32 s[10:11], 0x3f717273 ; encoding: [0xff,0x37,0x8a,0xbe,0x73,0x72,0x71,0x3f] // NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_bitreplicate_b64_b32 s[10:11], 0x3f717273 ; encoding: [0xff,0x3b,0x8a,0xbe,0x73,0x72,0x71,0x3f] diff --git a/llvm/test/MC/AMDGPU/sop2-err.s b/llvm/test/MC/AMDGPU/sop2-err.s index 128a3d7b33ce..f6a6054ebdcc 100644 --- a/llvm/test/MC/AMDGPU/sop2-err.s +++ b/llvm/test/MC/AMDGPU/sop2-err.s @@ -1,4 +1,4 @@ -// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck -check-prefix=GCN %s +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck -check-prefix=GCN --implicit-check-not=error: %s s_cbranch_g_fork 100, s[6:7] // GCN: error: invalid operand for instruction diff --git a/llvm/test/MC/AMDGPU/sop2.s b/llvm/test/MC/AMDGPU/sop2.s index c1fe19a787d0..89f41a7b3d51 100644 --- a/llvm/test/MC/AMDGPU/sop2.s +++ b/llvm/test/MC/AMDGPU/sop2.s @@ -5,13 +5,12 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=GFX89 --check-prefix=GFX9 %s // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=GFX10 %s -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck --check-prefix=NOSICIVI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck --check-prefix=NOSICIVI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck --check-prefix=NOSICIVI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=NOSICIVI --check-prefix=NOVI --check-prefix=NOGFX89 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck --check-prefix=NOGFX89 %s - -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding 2>&1 %s | FileCheck --check-prefix=GFX10-ERR %s +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck --check-prefix=NOSICIVI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck --check-prefix=NOSICIVI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck --check-prefix=NOSICIVI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji %s 2>&1 | FileCheck --check-prefix=NOSICIVI --check-prefix=NOVI --check-prefix=NOGFX89 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck --check-prefix=NOGFX9 --check-prefix=NOGFX89 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 2>&1 %s | FileCheck --check-prefix=GFX10-ERR --implicit-check-not=error: %s s_add_u32 s1, s2, s3 // GCN: s_add_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x80] @@ -52,134 +51,167 @@ s_cselect_b64 s[2:3], s[4:5], s[6:7] s_and_b32 s2, s4, s6 // SICI: s_and_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x87] // GFX89: s_and_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x86] +// GFX10: s_and_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x87] s_and_b32 s2, 1234, 1234 // SICI: s_and_b32 s2, 0x4d2, 0x4d2 ; encoding: [0xff,0xff,0x02,0x87,0xd2,0x04,0x00,0x00] // GFX89: s_and_b32 s2, 0x4d2, 0x4d2 ; encoding: [0xff,0xff,0x02,0x86,0xd2,0x04,0x00,0x00] +// GFX10: s_and_b32 s2, 0x4d2, 0x4d2 ; encoding: [0xff,0xff,0x02,0x87,0xd2,0x04,0x00,0x00] s_and_b32 s2, 0xFFFF0000, -65536 // SICI: s_and_b32 s2, 0xffff0000, 0xffff0000 ; encoding: [0xff,0xff,0x02,0x87,0x00,0x00,0xff,0xff] // GFX89: s_and_b32 s2, 0xffff0000, 0xffff0000 ; encoding: [0xff,0xff,0x02,0x86,0x00,0x00,0xff,0xff] +// GFX10: s_and_b32 s2, 0xffff0000, 0xffff0000 ; encoding: [0xff,0xff,0x02,0x87,0x00,0x00,0xff,0xff] s_and_b64 null, s[4:5], s[6:7] // GFX10: s_and_b64 null, s[4:5], s[6:7] ; encoding: [0x04,0x06,0xfd,0x87] // NOSICIVI: error: not a valid operand. +// NOGFX9: error: not a valid operand. s_and_b64 s[2:3], s[4:5], s[6:7] // SICI: s_and_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x87] // GFX89: s_and_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x86] +// GFX10: s_and_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x87] s_or_b32 s2, s4, s6 // SICI: s_or_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x88] // GFX89: s_or_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x87] +// GFX10: s_or_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x88] s_or_b64 s[2:3], s[4:5], s[6:7] // SICI: s_or_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x88] // GFX89: s_or_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x87] +// GFX10: s_or_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x88] s_xor_b32 s2, s4, s6 // SICI: s_xor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x89] // GFX89: s_xor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x88] +// GFX10: s_xor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x89] s_xor_b64 s[2:3], s[4:5], s[6:7] // SICI: s_xor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x89] // GFX89: s_xor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x88] +// GFX10: s_xor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x89] s_andn2_b32 s2, s4, s6 // SICI: s_andn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8a] // GFX89: s_andn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x89] +// GFX10: s_andn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8a] s_andn2_b64 s[2:3], s[4:5], s[6:7] // SICI: s_andn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8a] // GFX89: s_andn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x89] +// GFX10: s_andn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8a] s_orn2_b32 s2, s4, s6 // SICI: s_orn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8b] // GFX89: s_orn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8a] +// GFX10: s_orn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8b] s_orn2_b64 s[2:3], s[4:5], s[6:7] // SICI: s_orn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8b] // GFX89: s_orn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8a] +// GFX10: s_orn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8b] s_nand_b32 s2, s4, s6 // SICI: s_nand_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8c] // GFX89: s_nand_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8b] +// GFX10: s_nand_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8c] s_nand_b64 s[2:3], s[4:5], s[6:7] // SICI: s_nand_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8c] // GFX89: s_nand_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8b] +// GFX10: s_nand_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8c] s_nor_b32 s2, s4, s6 // SICI: s_nor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8d] // GFX89: s_nor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8c] +// GFX10: s_nor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8d] s_nor_b64 s[2:3], s[4:5], s[6:7] // SICI: s_nor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8d] // GFX89: s_nor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8c] +// GFX10: s_nor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8d] s_xnor_b32 s2, s4, s6 // SICI: s_xnor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8e] // GFX89: s_xnor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8d] +// GFX10: s_xnor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8e] s_xnor_b64 s[2:3], s[4:5], s[6:7] // SICI: s_xnor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8e] // GFX89: s_xnor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8d] +// GFX10: s_xnor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8e] s_lshl_b32 s2, s4, s6 // SICI: s_lshl_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8f] // GFX89: s_lshl_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8e] +// GFX10: s_lshl_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8f] s_lshl_b64 s[2:3], s[4:5], s6 // SICI: s_lshl_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8f] // GFX89: s_lshl_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8e] +// GFX10: s_lshl_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8f] s_lshr_b32 s2, s4, s6 // SICI: s_lshr_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x90] // GFX89: s_lshr_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8f] +// GFX10: s_lshr_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x90] s_lshr_b64 s[2:3], s[4:5], s6 // SICI: s_lshr_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x90] // GFX89: s_lshr_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8f] +// GFX10: s_lshr_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x90] s_ashr_i32 s2, s4, s6 // SICI: s_ashr_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x91] // GFX89: s_ashr_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x90] +// GFX10: s_ashr_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x91] s_ashr_i64 s[2:3], s[4:5], s6 // SICI: s_ashr_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x91] // GFX89: s_ashr_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x90] +// GFX10: s_ashr_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x91] s_ashr_i64 s[2:3], -65536, 0xFFFF0000 // SICI: s_ashr_i64 s[2:3], 0xffff0000, 0xffff0000 ; encoding: [0xff,0xff,0x82,0x91,0x00,0x00,0xff,0xff] // GFX89: s_ashr_i64 s[2:3], 0xffff0000, 0xffff0000 ; encoding: [0xff,0xff,0x82,0x90,0x00,0x00,0xff,0xff] +// GFX10: s_ashr_i64 s[2:3], 0xffff0000, 0xffff0000 ; encoding: [0xff,0xff,0x82,0x91,0x00,0x00,0xff,0xff] s_bfm_b32 s2, s4, s6 // SICI: s_bfm_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x92] // GFX89: s_bfm_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x91] +// GFX10: s_bfm_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x92] s_bfm_b64 s[2:3], s4, s6 // SICI: s_bfm_b64 s[2:3], s4, s6 ; encoding: [0x04,0x06,0x82,0x92] // GFX89: s_bfm_b64 s[2:3], s4, s6 ; encoding: [0x04,0x06,0x82,0x91] +// GFX10: s_bfm_b64 s[2:3], s4, s6 ; encoding: [0x04,0x06,0x82,0x92] s_mul_i32 s2, s4, s6 // SICI: s_mul_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x93] // GFX89: s_mul_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x92] +// GFX10: s_mul_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x93] s_bfe_u32 s2, s4, s6 // SICI: s_bfe_u32 s2, s4, s6 ; encoding: [0x04,0x06,0x82,0x93] // GFX89: s_bfe_u32 s2, s4, s6 ; encoding: [0x04,0x06,0x82,0x92] +// GFX10: s_bfe_u32 s2, s4, s6 ; encoding: [0x04,0x06,0x82,0x93] s_bfe_i32 s2, s4, s6 // SICI: s_bfe_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x94] // GFX89: s_bfe_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x93] +// GFX10: s_bfe_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x94] s_bfe_u64 s[2:3], s[4:5], s6 // SICI: s_bfe_u64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x94] // GFX89: s_bfe_u64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x93] +// GFX10: s_bfe_u64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x94] s_bfe_i64 s[2:3], s[4:5], s6 // SICI: s_bfe_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x02,0x95] // GFX89: s_bfe_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x02,0x94] +// GFX10: s_bfe_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x02,0x95] s_cbranch_g_fork s[4:5], s[6:7] // SICI: s_cbranch_g_fork s[4:5], s[6:7] ; encoding: [0x04,0x06,0x80,0x95] @@ -199,79 +231,99 @@ s_cbranch_g_fork s[6:7], 2 s_absdiff_i32 s2, s4, s6 // SICI: s_absdiff_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x96] // GFX89: s_absdiff_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x95] +// GFX10: s_absdiff_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x96] s_add_u32 s101, s102, s103 // SICI: s_add_u32 s101, s102, s103 ; encoding: [0x66,0x67,0x65,0x80] // NOGFX89: error: not a valid operand +// GFX10: s_add_u32 s101, s102, s103 ; encoding: [0x66,0x67,0x65,0x80] s_lshl1_add_u32 s5, s1, s2 // GFX9: s_lshl1_add_u32 s5, s1, s2 ; encoding: [0x01,0x02,0x05,0x97] -// NOSICIVI: error +// NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_lshl1_add_u32 s5, s1, s2 ; encoding: [0x01,0x02,0x05,0x97] s_lshl1_add_u32 s5, -1, s2 // GFX9: s_lshl1_add_u32 s5, -1, s2 ; encoding: [0xc1,0x02,0x05,0x97] -// NOSICIVI: error +// NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_lshl1_add_u32 s5, -1, s2 ; encoding: [0xc1,0x02,0x05,0x97] s_lshl1_add_u32 s5, s1, 0 // GFX9: s_lshl1_add_u32 s5, s1, 0 ; encoding: [0x01,0x80,0x05,0x97] -// NOSICIVI: error +// NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_lshl1_add_u32 s5, s1, 0 ; encoding: [0x01,0x80,0x05,0x97] s_lshl1_add_u32 s5, s1, 0x3f717273 // GFX9: s_lshl1_add_u32 s5, s1, 0x3f717273 ; encoding: [0x01,0xff,0x05,0x97,0x73,0x72,0x71,0x3f] -// NOSICIVI: error +// NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_lshl1_add_u32 s5, s1, 0x3f717273 ; encoding: [0x01,0xff,0x05,0x97,0x73,0x72,0x71,0x3f] s_lshl2_add_u32 s101, s1, s2 // GFX9: s_lshl2_add_u32 s101, s1, s2 ; encoding: [0x01,0x02,0xe5,0x97] -// NOSICIVI: error +// NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_lshl2_add_u32 s101, s1, s2 ; encoding: [0x01,0x02,0xe5,0x97] s_lshl2_add_u32 s5, 0xaf123456, s2 // GFX9: s_lshl2_add_u32 s5, 0xaf123456, s2 ; encoding: [0xff,0x02,0x85,0x97,0x56,0x34,0x12,0xaf] -// NOSICIVI: error +// NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_lshl2_add_u32 s5, 0xaf123456, s2 ; encoding: [0xff,0x02,0x85,0x97,0x56,0x34,0x12,0xaf] s_lshl3_add_u32 s5, 0x3f717273, s2 // GFX9: s_lshl3_add_u32 s5, 0x3f717273, s2 ; encoding: [0xff,0x02,0x05,0x98,0x73,0x72,0x71,0x3f] -// NOSICIVI: error +// NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_lshl3_add_u32 s5, 0x3f717273, s2 ; encoding: [0xff,0x02,0x05,0x98,0x73,0x72,0x71,0x3f] s_lshl3_add_u32 s5, s1, s101 // GFX9: s_lshl3_add_u32 s5, s1, s101 ; encoding: [0x01,0x65,0x05,0x98] -// NOSICIVI: error +// NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_lshl3_add_u32 s5, s1, s101 ; encoding: [0x01,0x65,0x05,0x98] s_lshl4_add_u32 s5, s1, 0xaf123456 // GFX9: s_lshl4_add_u32 s5, s1, 0xaf123456 ; encoding: [0x01,0xff,0x85,0x98,0x56,0x34,0x12,0xaf] -// NOSICIVI: error +// NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_lshl4_add_u32 s5, s1, 0xaf123456 ; encoding: [0x01,0xff,0x85,0x98,0x56,0x34,0x12,0xaf] s_lshl4_add_u32 s5, -1, s2 // GFX9: s_lshl4_add_u32 s5, -1, s2 ; encoding: [0xc1,0x02,0x85,0x98] -// NOSICIVI: error +// NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_lshl4_add_u32 s5, -1, s2 ; encoding: [0xc1,0x02,0x85,0x98] s_mul_hi_i32 s5, s101, s2 // GFX9: s_mul_hi_i32 s5, s101, s2 ; encoding: [0x65,0x02,0x85,0x96] -// NOSICIVI: error +// NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_mul_hi_i32 s5, s101, s2 ; encoding: [0x65,0x02,0x05,0x9b] s_mul_hi_i32 s5, 0, s2 // GFX9: s_mul_hi_i32 s5, 0, s2 ; encoding: [0x80,0x02,0x85,0x96] -// NOSICIVI: error +// NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_mul_hi_i32 s5, 0, s2 ; encoding: [0x80,0x02,0x05,0x9b] s_mul_hi_i32 s5, 0x3f717273, s2 // GFX9: s_mul_hi_i32 s5, 0x3f717273, s2 ; encoding: [0xff,0x02,0x85,0x96,0x73,0x72,0x71,0x3f] -// NOSICIVI: error +// NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_mul_hi_i32 s5, 0x3f717273, s2 ; encoding: [0xff,0x02,0x05,0x9b,0x73,0x72,0x71,0x3f] s_mul_hi_i32 s5, s1, s101 // GFX9: s_mul_hi_i32 s5, s1, s101 ; encoding: [0x01,0x65,0x85,0x96] -// NOSICIVI: error +// NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_mul_hi_i32 s5, s1, s101 ; encoding: [0x01,0x65,0x05,0x9b] s_mul_hi_i32 s5, s1, 0 // GFX9: s_mul_hi_i32 s5, s1, 0 ; encoding: [0x01,0x80,0x85,0x96] -// NOSICIVI: error +// NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_mul_hi_i32 s5, s1, 0 ; encoding: [0x01,0x80,0x05,0x9b] s_mul_hi_u32 s5, s1, 0x3f717273 // GFX9: s_mul_hi_u32 s5, s1, 0x3f717273 ; encoding: [0x01,0xff,0x05,0x96,0x73,0x72,0x71,0x3f] -// NOSICIVI: error +// NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_mul_hi_u32 s5, s1, 0x3f717273 ; encoding: [0x01,0xff,0x85,0x9a,0x73,0x72,0x71,0x3f] s_mul_hi_u32 s5, s1, s101 // GFX9: s_mul_hi_u32 s5, s1, s101 ; encoding: [0x01,0x65,0x05,0x96] -// NOSICIVI: error +// NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_mul_hi_u32 s5, s1, s101 ; encoding: [0x01,0x65,0x85,0x9a] s_mul_hi_u32 s5, s1, 0 // GFX9: s_mul_hi_u32 s5, s1, 0 ; encoding: [0x01,0x80,0x05,0x96] -// NOSICIVI: error +// NOSICIVI: error: instruction not supported on this GPU +// GFX10: s_mul_hi_u32 s5, s1, 0 ; encoding: [0x01,0x80,0x85,0x9a] diff --git a/llvm/test/MC/AMDGPU/sopc-err.s b/llvm/test/MC/AMDGPU/sopc-err.s index 88788862f1d7..5f2021a5aaf5 100644 --- a/llvm/test/MC/AMDGPU/sopc-err.s +++ b/llvm/test/MC/AMDGPU/sopc-err.s @@ -1,4 +1,4 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=VI %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=VI --implicit-check-not=error: %s s_set_gpr_idx_on s0, s1 // VI: error: expected absolute expression diff --git a/llvm/test/MC/AMDGPU/sopc.s b/llvm/test/MC/AMDGPU/sopc.s index 38b385aa6a36..3ef217798a2e 100644 --- a/llvm/test/MC/AMDGPU/sopc.s +++ b/llvm/test/MC/AMDGPU/sopc.s @@ -1,7 +1,7 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s | FileCheck -check-prefix=GCN -check-prefix=SICI %s // RUN: llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck -check-prefix=GCN -check-prefix=VI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck -check-prefix=NOSICI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX10-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefix=NOSICI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck -check-prefix=GFX10-ERR --implicit-check-not=error: %s //===----------------------------------------------------------------------===// // SOPC Instructions @@ -76,41 +76,51 @@ s_cmp_lg_u64 s[0:1], s[2:3] gpr_idx = 1 s_set_gpr_idx_on s0, gpr_idx // VI: s_set_gpr_idx_on s0, gpr_idx(SRC0) ; encoding: [0x00,0x01,0x11,0xbf] -// NOSICI: error: +// NOSICI: error: invalid operand for instruction +// GFX10-ERR: error: invalid operand for instruction gpr_idx_mode = 10 s_set_gpr_idx_on s0, gpr_idx_mode + 5 // VI: s_set_gpr_idx_on s0, gpr_idx(SRC0,SRC1,SRC2,DST) ; encoding: [0x00,0x0f,0x11,0xbf] -// NOSICI: error: +// NOSICI: error: invalid operand for instruction +// GFX10-ERR: error: invalid operand for instruction s_set_gpr_idx_on s0, 0 // VI: s_set_gpr_idx_on s0, gpr_idx() ; encoding: [0x00,0x00,0x11,0xbf] -// NOSICI: error: +// NOSICI: error: invalid operand for instruction +// GFX10-ERR: error: invalid operand for instruction s_set_gpr_idx_on s0, gpr_idx() // VI: s_set_gpr_idx_on s0, gpr_idx() ; encoding: [0x00,0x00,0x11,0xbf] -// NOSICI: error: +// NOSICI: error: unknown token in expression +// GFX10-ERR: error: unknown token in expression s_set_gpr_idx_on s0, 1 // VI: s_set_gpr_idx_on s0, gpr_idx(SRC0) ; encoding: [0x00,0x01,0x11,0xbf] -// NOSICI: error: +// NOSICI: error: invalid operand for instruction +// GFX10-ERR: error: invalid operand for instruction s_set_gpr_idx_on s0, gpr_idx(SRC0) // VI: s_set_gpr_idx_on s0, gpr_idx(SRC0) ; encoding: [0x00,0x01,0x11,0xbf] -// NOSICI: error: +// NOSICI: error: invalid operand for instruction +// GFX10-ERR: error: invalid operand for instruction s_set_gpr_idx_on s0, 3 // VI: s_set_gpr_idx_on s0, gpr_idx(SRC0,SRC1) ; encoding: [0x00,0x03,0x11,0xbf] -// NOSICI: error: +// NOSICI: error: invalid operand for instruction +// GFX10-ERR: error: invalid operand for instruction s_set_gpr_idx_on s0, gpr_idx(SRC1,SRC0) // VI: s_set_gpr_idx_on s0, gpr_idx(SRC0,SRC1) ; encoding: [0x00,0x03,0x11,0xbf] -// NOSICI: error: +// NOSICI: error: expected ')' in parentheses expression +// GFX10-ERR: error: expected ')' in parentheses expression s_set_gpr_idx_on s0, 15 // VI: s_set_gpr_idx_on s0, gpr_idx(SRC0,SRC1,SRC2,DST) ; encoding: [0x00,0x0f,0x11,0xbf] -// NOSICI: error: +// NOSICI: error: invalid operand for instruction +// GFX10-ERR: error: invalid operand for instruction s_set_gpr_idx_on s0, gpr_idx(SRC0,DST,SRC2,SRC1) // VI: s_set_gpr_idx_on s0, gpr_idx(SRC0,SRC1,SRC2,DST) ; encoding: [0x00,0x0f,0x11,0xbf] -// NOSICI: error: +// NOSICI: error: expected ')' in parentheses expression +// GFX10-ERR: error: expected ')' in parentheses expression diff --git a/llvm/test/MC/AMDGPU/sopk-err.s b/llvm/test/MC/AMDGPU/sopk-err.s index 7d1bd8110b5d..2311c72b52b2 100644 --- a/llvm/test/MC/AMDGPU/sopk-err.s +++ b/llvm/test/MC/AMDGPU/sopk-err.s @@ -1,9 +1,14 @@ -// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck -check-prefix=GCN %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=SI-ERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=VI-ERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=GFX9-ERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX9 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX10 %s +// RUN: not llvm-mc -arch=amdgcn -show-encoding %s | FileCheck -check-prefixes=SICI %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s | FileCheck -check-prefixes=SI,SICI %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck -check-prefixes=VI %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck -check-prefix=GFX9 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s | FileCheck -check-prefix=GFX10 %s + +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck -check-prefixes=GCN,SICIVI-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefixes=GCN,SICIVI-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefixes=GCN,SICIVI-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefixes=GCN,GFX9-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck -check-prefixes=GCN,GFX10-ERR --implicit-check-not=error: %s s_setreg_b32 0x1f803, s2 // GCN: error: invalid immediate: only 16-bit values are legal @@ -42,61 +47,55 @@ s_getreg_b32 s2, hwreg(3,32,32) // GCN: error: invalid bit offset: only 5-bit values are legal s_cbranch_i_fork s[2:3], 0x6 -// GFX10: error: instruction not supported on this GPU +// SICI: s_cbranch_i_fork s[2:3], 6 ; encoding: [0x06,0x00,0x82,0xb8] +// GFX10-ERR: error: instruction not supported on this GPU +// GFX9: s_cbranch_i_fork s[2:3], 6 ; encoding: [0x06,0x00,0x02,0xb8] +// VI: s_cbranch_i_fork s[2:3], 6 ; encoding: [0x06,0x00,0x02,0xb8] s_getreg_b32 s2, hwreg(HW_REG_SH_MEM_BASES) -// SI-ERR: specified hardware register is not supported on this GPU -// VI-ERR: specified hardware register is not supported on this GPU -// GFX9: s_getreg_b32 s2, hwreg(HW_REG_SH_MEM_BASES) ; encoding: [0x0f,0xf8,0x82,0xb8] // GFX10: s_getreg_b32 s2, hwreg(HW_REG_SH_MEM_BASES) ; encoding: [0x0f,0xf8,0x02,0xb9] +// SICIVI-ERR: error: specified hardware register is not supported on this GPU +// GFX9: s_getreg_b32 s2, hwreg(HW_REG_SH_MEM_BASES) ; encoding: [0x0f,0xf8,0x82,0xb8] s_getreg_b32 s2, hwreg(HW_REG_TBA_LO) -// SI-ERR: specified hardware register is not supported on this GPU -// VI-ERR: specified hardware register is not supported on this GPU -// GFX9-ERR: specified hardware register is not supported on this GPU // GFX10: s_getreg_b32 s2, hwreg(HW_REG_TBA_LO) ; encoding: [0x10,0xf8,0x02,0xb9] +// SICIVI-ERR: error: specified hardware register is not supported on this GPU +// GFX9-ERR: error: specified hardware register is not supported on this GPU s_getreg_b32 s2, hwreg(HW_REG_TBA_HI) -// SI-ERR: specified hardware register is not supported on this GPU -// VI-ERR: specified hardware register is not supported on this GPU -// GFX9-ERR: specified hardware register is not supported on this GPU // GFX10: s_getreg_b32 s2, hwreg(HW_REG_TBA_HI) ; encoding: [0x11,0xf8,0x02,0xb9] +// SICIVI-ERR: error: specified hardware register is not supported on this GPU +// GFX9-ERR: error: specified hardware register is not supported on this GPU s_getreg_b32 s2, hwreg(HW_REG_TMA_LO) -// SI-ERR: specified hardware register is not supported on this GPU -// VI-ERR: specified hardware register is not supported on this GPU -// GFX9-ERR: specified hardware register is not supported on this GPU // GFX10: s_getreg_b32 s2, hwreg(HW_REG_TMA_LO) ; encoding: [0x12,0xf8,0x02,0xb9] +// SICIVI-ERR: error: specified hardware register is not supported on this GPU +// GFX9-ERR: error: specified hardware register is not supported on this GPU s_getreg_b32 s2, hwreg(HW_REG_TMA_HI) -// SI-ERR: specified hardware register is not supported on this GPU -// VI-ERR: specified hardware register is not supported on this GPU -// GFX9-ERR: specified hardware register is not supported on this GPU // GFX10: s_getreg_b32 s2, hwreg(HW_REG_TMA_HI) ; encoding: [0x13,0xf8,0x02,0xb9] +// SICIVI-ERR: error: specified hardware register is not supported on this GPU +// GFX9-ERR: error: specified hardware register is not supported on this GPU s_getreg_b32 s2, hwreg(HW_REG_FLAT_SCR_LO) -// SI-ERR: specified hardware register is not supported on this GPU -// VI-ERR: specified hardware register is not supported on this GPU -// GFX9-ERR: specified hardware register is not supported on this GPU // GFX10: s_getreg_b32 s2, hwreg(HW_REG_FLAT_SCR_LO) ; encoding: [0x14,0xf8,0x02,0xb9] +// SICIVI-ERR: error: specified hardware register is not supported on this GPU +// GFX9-ERR: error: specified hardware register is not supported on this GPU s_getreg_b32 s2, hwreg(HW_REG_FLAT_SCR_HI) -// SI-ERR: specified hardware register is not supported on this GPU -// VI-ERR: specified hardware register is not supported on this GPU -// GFX9-ERR: specified hardware register is not supported on this GPU // GFX10: s_getreg_b32 s2, hwreg(HW_REG_FLAT_SCR_HI) ; encoding: [0x15,0xf8,0x02,0xb9] +// SICIVI-ERR: error: specified hardware register is not supported on this GPU +// GFX9-ERR: error: specified hardware register is not supported on this GPU s_getreg_b32 s2, hwreg(HW_REG_XNACK_MASK) -// SI-ERR: specified hardware register is not supported on this GPU -// VI-ERR: specified hardware register is not supported on this GPU -// GFX9-ERR: specified hardware register is not supported on this GPU // GFX10: s_getreg_b32 s2, hwreg(HW_REG_XNACK_MASK) ; encoding: [0x16,0xf8,0x02,0xb9] +// SICIVI-ERR: error: specified hardware register is not supported on this GPU +// GFX9-ERR: error: specified hardware register is not supported on this GPU s_getreg_b32 s2, hwreg(HW_REG_POPS_PACKER) -// SI-ERR: specified hardware register is not supported on this GPU -// VI-ERR: specified hardware register is not supported on this GPU -// GFX9-ERR: specified hardware register is not supported on this GPU // GFX10: s_getreg_b32 s2, hwreg(HW_REG_POPS_PACKER) ; encoding: [0x19,0xf8,0x02,0xb9] +// SICIVI-ERR: error: specified hardware register is not supported on this GPU +// GFX9-ERR: error: specified hardware register is not supported on this GPU s_cmpk_le_u32 s2, -1 // GCN: error: invalid operand for instruction diff --git a/llvm/test/MC/AMDGPU/sopk.s b/llvm/test/MC/AMDGPU/sopk.s index ebadd76cee2f..e128df94c611 100644 --- a/llvm/test/MC/AMDGPU/sopk.s +++ b/llvm/test/MC/AMDGPU/sopk.s @@ -4,10 +4,10 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=VI9 --check-prefix=GFX9 %s // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=GFX10 %s -// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck -check-prefix=NOSICIVI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefix=NOSICIVI -check-prefix=NOSI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji %s 2>&1 | FileCheck -check-prefix=NOSICIVI -check-prefix=NOVI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck --check-prefix=NOGFX9 %s +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck -check-prefix=NOSICIVI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefix=NOSICIVI -check-prefix=NOSI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji %s 2>&1 | FileCheck -check-prefix=NOSICIVI -check-prefix=NOVI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck --check-prefix=NOGFX9 --implicit-check-not=error: %s //===----------------------------------------------------------------------===// // Instructions diff --git a/llvm/test/MC/AMDGPU/sopp-err.s b/llvm/test/MC/AMDGPU/sopp-err.s index 2a78940655fc..f3181de9438f 100644 --- a/llvm/test/MC/AMDGPU/sopp-err.s +++ b/llvm/test/MC/AMDGPU/sopp-err.s @@ -1,7 +1,7 @@ -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=SICI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=SICI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=VI --check-prefix=SICIVI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN %s +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=SICI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=SICI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=VI --check-prefix=SICIVI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=GFX10 --implicit-check-not=error: %s //===----------------------------------------------------------------------===// // sendmsg @@ -84,15 +84,22 @@ s_sendmsg sendmsg(MSG_GS_DONE, 0, 0) s_sendmsg sendmsg(MSG_GS_ALLOC_REQ) // SICIVI: error: invalid message id +// SICI: error: invalid message id s_sendmsg sendmsg(MSG_GS_ALLOC_REQ, 0) // SICIVI: error: invalid message id +// SICI: error: invalid message id +// GFX10: error: message does not support operations s_sendmsg sendmsg(-1) // SICIVI: error: invalid message id +// SICI: error: invalid message id +// GFX10: error: invalid message id s_sendmsg sendmsg(16) // SICIVI: error: invalid message id +// SICI: error: invalid message id +// GFX10: error: invalid message id s_sendmsg sendmsg(MSG_SYSMSG) // GCN: error: missing message operation @@ -112,6 +119,7 @@ s_sendmsg sendmsg(MSG_SYSMSG, 5) s_waitcnt lgkmcnt(16) // SICIVI: error: too large value for lgkmcnt +// SICI: error: too large value for lgkmcnt s_waitcnt lgkmcnt(64) // GCN: error: too large value for lgkmcnt @@ -121,9 +129,12 @@ s_waitcnt expcnt(8) s_waitcnt vmcnt(16) // SICIVI: error: too large value for vmcnt +// SICI: error: too large value for vmcnt s_waitcnt vmcnt(64) // GFX10: error: too large value for vmcnt +// SICI: error: too large value for vmcnt +// SICIVI: error: too large value for vmcnt s_waitcnt vmcnt(0xFFFFFFFFFFFF0000) // GCN: error: too large value for vmcnt diff --git a/llvm/test/MC/AMDGPU/sopp.s b/llvm/test/MC/AMDGPU/sopp.s index 4be932374115..63783f61c6bf 100644 --- a/llvm/test/MC/AMDGPU/sopp.s +++ b/llvm/test/MC/AMDGPU/sopp.s @@ -1,5 +1,5 @@ // RUN: not llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=NOSICI --implicit-check-not=error: // RUN: llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=VI %s //===----------------------------------------------------------------------===// @@ -357,23 +357,23 @@ s_ttracedata s_set_gpr_idx_off // VI: s_set_gpr_idx_off ; encoding: [0x00,0x00,0x9c,0xbf] -// NOSICI: error: +// NOSICI: error: instruction not supported on this GPU s_set_gpr_idx_mode 0 // VI: s_set_gpr_idx_mode gpr_idx() ; encoding: [0x00,0x00,0x9d,0xbf] -// NOSICI: error: +// NOSICI: error: invalid operand for instruction s_set_gpr_idx_mode gpr_idx() // VI: s_set_gpr_idx_mode gpr_idx() ; encoding: [0x00,0x00,0x9d,0xbf] -// NOSICI: error: +// NOSICI: error: unknown token in expression s_set_gpr_idx_mode 15 // VI: s_set_gpr_idx_mode gpr_idx(SRC0,SRC1,SRC2,DST) ; encoding: [0x0f,0x00,0x9d,0xbf] -// NOSICI: error: +// NOSICI: error: invalid operand for instruction s_set_gpr_idx_mode gpr_idx(SRC2,SRC1,SRC0,DST) // VI: s_set_gpr_idx_mode gpr_idx(SRC0,SRC1,SRC2,DST) ; encoding: [0x0f,0x00,0x9d,0xbf] -// NOSICI: error: +// NOSICI: error: expected ')' in parentheses expression s_endpgm_saved // VI: s_endpgm_saved ; encoding: [0x00,0x00,0x9b,0xbf] diff --git a/llvm/test/MC/AMDGPU/trap.s b/llvm/test/MC/AMDGPU/trap.s index 7b527ba3072e..5d23c1f30d6e 100644 --- a/llvm/test/MC/AMDGPU/trap.s +++ b/llvm/test/MC/AMDGPU/trap.s @@ -3,10 +3,10 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck %s --check-prefix=VI // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck %s --check-prefix=GFX9 -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICIVI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICIVI -// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICIVI -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGFX9 +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=NOSICIVI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s --check-prefix=NOSICIVI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji %s 2>&1 | FileCheck %s --check-prefix=NOSICIVI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck %s --check-prefix=NOGFX9 --implicit-check-not=error: //===----------------------------------------------------------------------===// // Trap Handler related - 32 bit registers diff --git a/llvm/test/MC/AMDGPU/vintrp-err.s b/llvm/test/MC/AMDGPU/vintrp-err.s index 08ab2797ce53..00491e0fe987 100644 --- a/llvm/test/MC/AMDGPU/vintrp-err.s +++ b/llvm/test/MC/AMDGPU/vintrp-err.s @@ -1,5 +1,5 @@ -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=SI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=VI %s +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=SI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=GCN -check-prefix=VI --implicit-check-not=error: %s v_interp_p1_f32 v0, v1, attr64.w // GCN: :25: error: out of bounds attr diff --git a/llvm/test/MC/AMDGPU/vop-err.s b/llvm/test/MC/AMDGPU/vop-err.s index 13388263b20e..c66b5b90e27a 100644 --- a/llvm/test/MC/AMDGPU/vop-err.s +++ b/llvm/test/MC/AMDGPU/vop-err.s @@ -1,5 +1,5 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck --implicit-check-not=error: %s // GENERIC LIMITATIONS ON VOP FORMATS: CONSTANT BUS RESTRICTIONS diff --git a/llvm/test/MC/AMDGPU/vop1-gfx9-err.s b/llvm/test/MC/AMDGPU/vop1-gfx9-err.s index 61bf5f661759..934563285537 100644 --- a/llvm/test/MC/AMDGPU/vop1-gfx9-err.s +++ b/llvm/test/MC/AMDGPU/vop1-gfx9-err.s @@ -1,6 +1,6 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck -check-prefixes=GCN,GFX9 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck -check-prefixes=GCN,VI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=hawaii -show-encoding %s 2>&1 | FileCheck -check-prefixes=GCN,CI %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefixes=GCN,GFX9 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefixes=GCN,VI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=hawaii %s 2>&1 | FileCheck -check-prefixes=GCN,CI --implicit-check-not=error: %s v_swap_b32 v1, 1 // GCN: :16: error: invalid operand for instruction diff --git a/llvm/test/MC/AMDGPU/vop1-gfx9.s b/llvm/test/MC/AMDGPU/vop1-gfx9.s index 96e328c433ba..9f74e3a71a6c 100644 --- a/llvm/test/MC/AMDGPU/vop1-gfx9.s +++ b/llvm/test/MC/AMDGPU/vop1-gfx9.s @@ -1,7 +1,7 @@ // RUN: llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck -check-prefix=GFX9 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck -check-prefix=NOVI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=hawaii -show-encoding %s 2>&1 | FileCheck -check-prefix=NOVI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck -check-prefix=NOVI %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefix=NOVI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=hawaii %s 2>&1 | FileCheck -check-prefix=NOVI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=NOVI --implicit-check-not=error: %s v_swap_b32 v1, v2 // GFX9: v_swap_b32 v1, v2 ; encoding: [0x02,0xa3,0x02,0x7e] diff --git a/llvm/test/MC/AMDGPU/vop1.s b/llvm/test/MC/AMDGPU/vop1.s index e9d288418c42..12a033c92992 100644 --- a/llvm/test/MC/AMDGPU/vop1.s +++ b/llvm/test/MC/AMDGPU/vop1.s @@ -3,10 +3,10 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=SICI --check-prefix=CIVI // RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=CIVI --check-prefix=VI -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck %s -check-prefix=NOVI +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck %s --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck %s -check-prefix=NOVI --implicit-check-not=error: // Force 32-bit encoding diff --git a/llvm/test/MC/AMDGPU/vop2-err.s b/llvm/test/MC/AMDGPU/vop2-err.s index c446f1f01ec1..526483b1f5c3 100644 --- a/llvm/test/MC/AMDGPU/vop2-err.s +++ b/llvm/test/MC/AMDGPU/vop2-err.s @@ -1,5 +1,5 @@ -// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck --implicit-check-not=error: %s //===----------------------------------------------------------------------===// // Generic checks diff --git a/llvm/test/MC/AMDGPU/vop2.s b/llvm/test/MC/AMDGPU/vop2.s index 1505c8cfa44d..b2893154dd6d 100644 --- a/llvm/test/MC/AMDGPU/vop2.s +++ b/llvm/test/MC/AMDGPU/vop2.s @@ -3,10 +3,10 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=SICI // RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=CIVI --check-prefix=VI -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck %s -check-prefix=NOVI +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck %s --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck %s -check-prefix=NOVI --implicit-check-not=error: //===----------------------------------------------------------------------===// // Generic Checks for floating-point instructions (These have modifiers). diff --git a/llvm/test/MC/AMDGPU/vop3-convert.s b/llvm/test/MC/AMDGPU/vop3-convert.s index 0bdf86cb5586..a654af5e4752 100644 --- a/llvm/test/MC/AMDGPU/vop3-convert.s +++ b/llvm/test/MC/AMDGPU/vop3-convert.s @@ -3,10 +3,10 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=SICI // RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=CIVI --check-prefix=VI -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck %s -check-prefix=NOVI +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck %s --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck %s -check-prefix=NOVI --implicit-check-not=error: v_mov_b32 [v1], [v2] // GCN: v_mov_b32_e32 v1, v2 ; encoding: [0x02,0x03,0x02,0x7e] diff --git a/llvm/test/MC/AMDGPU/vop3-errs.s b/llvm/test/MC/AMDGPU/vop3-errs.s index 9fbce0515543..01cbb130f95c 100644 --- a/llvm/test/MC/AMDGPU/vop3-errs.s +++ b/llvm/test/MC/AMDGPU/vop3-errs.s @@ -1,7 +1,7 @@ -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=GFX67 --check-prefix=GCN -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck %s --check-prefix=GFX67 --check-prefix=GCN -// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck %s --check-prefix=GFX89 --check-prefix=GCN -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=GFX89 --check-prefix=GCN +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=GFX67 --check-prefix=GCN --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s --check-prefix=GFX67 --check-prefix=GCN --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji %s 2>&1 | FileCheck %s --check-prefix=GFX89 --check-prefix=GCN --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck %s --check-prefix=GFX89 --check-prefix=GCN --implicit-check-not=error: v_add_f32_e64 v0, v1 // GCN: error: too few operands for instruction diff --git a/llvm/test/MC/AMDGPU/vop3-gfx9.s b/llvm/test/MC/AMDGPU/vop3-gfx9.s index e11271ab1eed..c98fc47093f8 100644 --- a/llvm/test/MC/AMDGPU/vop3-gfx9.s +++ b/llvm/test/MC/AMDGPU/vop3-gfx9.s @@ -1,507 +1,648 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck -check-prefix=GFX9 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck -check-prefix=NOVI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=hawaii -show-encoding %s 2>&1 | FileCheck -check-prefix=NOVI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck -check-prefix=NOVI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck -check-prefix=NOGFX9 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefixes=NOSI,NOSICI,NOGCN --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=hawaii %s 2>&1 | FileCheck -check-prefixes=NOCI,NOSICI,NOGCN --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefixes=NOVI,NOGCN --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefix=NOGFX9 --implicit-check-not=error: %s v_lshl_add_u32 v1, v2, v3, v4 // GFX9: v_lshl_add_u32 v1, v2, v3, v4 ; encoding: [0x01,0x00,0xfd,0xd1,0x02,0x07,0x12,0x04] -// NOVI: :1: error: instruction not supported on this GPU +// NOGCN: :1: error: instruction not supported on this GPU v_add_lshl_u32 v1, v2, v3, v4 // GFX9: v_add_lshl_u32 v1, v2, v3, v4 ; encoding: [0x01,0x00,0xfe,0xd1,0x02,0x07,0x12,0x04] -// NOVI: :1: error: instruction not supported on this GPU +// NOGCN: :1: error: instruction not supported on this GPU v_add3_u32 v1, v2, v3, v4 // GFX9: v_add3_u32 v1, v2, v3, v4 ; encoding: [0x01,0x00,0xff,0xd1,0x02,0x07,0x12,0x04] -// NOVI: :1: error: instruction not supported on this GPU +// NOGCN: :1: error: instruction not supported on this GPU v_lshl_or_b32 v1, v2, v3, v4 // GFX9: v_lshl_or_b32 v1, v2, v3, v4 ; encoding: [0x01,0x00,0x00,0xd2,0x02,0x07,0x12,0x04] -// NOVI: :1: error: instruction not supported on this GPU +// NOGCN: :1: error: instruction not supported on this GPU v_and_or_b32 v1, v2, v3, v4 // GFX9: v_and_or_b32 v1, v2, v3, v4 ; encoding: [0x01,0x00,0x01,0xd2,0x02,0x07,0x12,0x04] -// NOVI: :1: error: instruction not supported on this GPU +// NOGCN: :1: error: instruction not supported on this GPU v_or3_b32 v1, v2, v3, v4 // GFX9: v_or3_b32 v1, v2, v3, v4 ; encoding: [0x01,0x00,0x02,0xd2,0x02,0x07,0x12,0x04] -// NOVI: :1: error: instruction not supported on this GPU +// NOGCN: :1: error: instruction not supported on this GPU v_pack_b32_f16 v1, v2, v3 // GFX9: v_pack_b32_f16 v1, v2, v3 ; encoding: [0x01,0x00,0xa0,0xd2,0x02,0x07,0x02,0x00] -// NOVI: :1: error: instruction not supported on this GPU +// NOGCN: :1: error: instruction not supported on this GPU v_pack_b32_f16 v5, v1, v2 op_sel:[1,0,0] // GFX9: v_pack_b32_f16 v5, v1, v2 op_sel:[1,0,0] ; encoding: [0x05,0x08,0xa0,0xd2,0x01,0x05,0x02,0x00] +// NOGCN: error: not a valid operand. v_pack_b32_f16 v5, v1, v2 op_sel:[0,1,0] // GFX9: v_pack_b32_f16 v5, v1, v2 op_sel:[0,1,0] ; encoding: [0x05,0x10,0xa0,0xd2,0x01,0x05,0x02,0x00] +// NOGCN: error: not a valid operand. v_pack_b32_f16 v5, v1, v2 op_sel:[0,0,1] // GFX9: v_pack_b32_f16 v5, v1, v2 op_sel:[0,0,1] ; encoding: [0x05,0x40,0xa0,0xd2,0x01,0x05,0x02,0x00] +// NOGCN: error: not a valid operand. v_xad_u32 v1, v2, v3, v4 // GFX9: v_xad_u32 v1, v2, v3, v4 ; encoding: [0x01,0x00,0xf3,0xd1,0x02,0x07,0x12,0x04] -// NOVI: :1: error: instruction not supported on this GPU +// NOGCN: :1: error: instruction not supported on this GPU v_min3_f16 v1, v2, v3, v4 // GFX9: v_min3_f16 v1, v2, v3, v4 ; encoding: [0x01,0x00,0xf4,0xd1,0x02,0x07,0x12,0x04] -// NOVI: :1: error: instruction not supported on this GPU +// NOGCN: :1: error: instruction not supported on this GPU v_min3_i16 v1, v2, v3, v4 // GFX9: v_min3_i16 v1, v2, v3, v4 ; encoding: [0x01,0x00,0xf5,0xd1,0x02,0x07,0x12,0x04] -// NOVI: :1: error: instruction not supported on this GPU +// NOGCN: :1: error: instruction not supported on this GPU v_min3_u16 v1, v2, v3, v4 // GFX9: v_min3_u16 v1, v2, v3, v4 ; encoding: [0x01,0x00,0xf6,0xd1,0x02,0x07,0x12,0x04] -// NOVI: :1: error: instruction not supported on this GPU +// NOGCN: :1: error: instruction not supported on this GPU v_max3_f16 v1, v2, v3, v4 // GFX9: v_max3_f16 v1, v2, v3, v4 ; encoding: [0x01,0x00,0xf7,0xd1,0x02,0x07,0x12,0x04] -// NOVI: :1: error: instruction not supported on this GPU +// NOGCN: :1: error: instruction not supported on this GPU v_max3_f16 v5, v1, v2, v3 op_sel:[0,0,0,0] // GFX9: v_max3_f16 v5, v1, v2, v3 ; encoding: [0x05,0x00,0xf7,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_max3_f16 v5, v1, v2, v3 op_sel:[1,0,0,0] // GFX9: v_max3_f16 v5, v1, v2, v3 op_sel:[1,0,0,0] ; encoding: [0x05,0x08,0xf7,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_max3_f16 v5, v1, v2, v3 op_sel:[0,1,0,0] // GFX9: v_max3_f16 v5, v1, v2, v3 op_sel:[0,1,0,0] ; encoding: [0x05,0x10,0xf7,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_max3_f16 v5, v1, v2, v3 op_sel:[0,0,1,0] // GFX9: v_max3_f16 v5, v1, v2, v3 op_sel:[0,0,1,0] ; encoding: [0x05,0x20,0xf7,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_max3_f16 v5, v1, v2, v3 op_sel:[0,0,0,1] // GFX9: v_max3_f16 v5, v1, v2, v3 op_sel:[0,0,0,1] ; encoding: [0x05,0x40,0xf7,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_max3_f16 v5, v1, v2, v3 op_sel:[1,1,1,1] // GFX9: v_max3_f16 v5, v1, v2, v3 op_sel:[1,1,1,1] ; encoding: [0x05,0x78,0xf7,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_max3_i16 v1, v2, v3, v4 // GFX9: v_max3_i16 v1, v2, v3, v4 ; encoding: [0x01,0x00,0xf8,0xd1,0x02,0x07,0x12,0x04] -// NOVI: :1: error: instruction not supported on this GPU +// NOGCN: :1: error: instruction not supported on this GPU v_max3_i16 v5, v1, v2, v3 op_sel:[0,0,0,0] // GFX9: v_max3_i16 v5, v1, v2, v3 ; encoding: [0x05,0x00,0xf8,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_max3_i16 v5, v1, v2, v3 op_sel:[1,0,0,0] // GFX9: v_max3_i16 v5, v1, v2, v3 op_sel:[1,0,0,0] ; encoding: [0x05,0x08,0xf8,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_max3_i16 v5, v1, v2, v3 op_sel:[0,1,0,0] // GFX9: v_max3_i16 v5, v1, v2, v3 op_sel:[0,1,0,0] ; encoding: [0x05,0x10,0xf8,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_max3_i16 v5, v1, v2, v3 op_sel:[0,0,1,0] // GFX9: v_max3_i16 v5, v1, v2, v3 op_sel:[0,0,1,0] ; encoding: [0x05,0x20,0xf8,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_max3_i16 v5, v1, v2, v3 op_sel:[0,0,0,1] // GFX9: v_max3_i16 v5, v1, v2, v3 op_sel:[0,0,0,1] ; encoding: [0x05,0x40,0xf8,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_max3_i16 v5, v1, v2, v3 op_sel:[1,1,1,1] // GFX9: v_max3_i16 v5, v1, v2, v3 op_sel:[1,1,1,1] ; encoding: [0x05,0x78,0xf8,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_max3_u16 v1, v2, v3, v4 // GFX9: v_max3_u16 v1, v2, v3, v4 ; encoding: [0x01,0x00,0xf9,0xd1,0x02,0x07,0x12,0x04] -// NOVI: :1: error: instruction not supported on this GPU +// NOGCN: :1: error: instruction not supported on this GPU v_med3_f16 v1, v2, v3, v4 // GFX9: v_med3_f16 v1, v2, v3, v4 ; encoding: [0x01,0x00,0xfa,0xd1,0x02,0x07,0x12,0x04] -// NOVI: :1: error: instruction not supported on this GPU +// NOGCN: :1: error: instruction not supported on this GPU v_med3_i16 v1, v2, v3, v4 // GFX9: v_med3_i16 v1, v2, v3, v4 ; encoding: [0x01,0x00,0xfb,0xd1,0x02,0x07,0x12,0x04] -// NOVI: :1: error: instruction not supported on this GPU +// NOGCN: :1: error: instruction not supported on this GPU v_med3_u16 v1, v2, v3, v4 // GFX9: v_med3_u16 v1, v2, v3, v4 ; encoding: [0x01,0x00,0xfc,0xd1,0x02,0x07,0x12,0x04] -// NOVI: :1: error: instruction not supported on this GPU +// NOGCN: :1: error: instruction not supported on this GPU v_mad_u32_u16 v5, v1, v2, v3 // GFX9: v_mad_u32_u16 v5, v1, v2, v3 ; encoding: [0x05,0x00,0xf1,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: instruction not supported on this GPU v_mad_u32_u16 v5, v1, v2, v3 op_sel:[1,0,0,0] // GFX9: v_mad_u32_u16 v5, v1, v2, v3 op_sel:[1,0,0,0] ; encoding: [0x05,0x08,0xf1,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_mad_u32_u16 v5, v1, v2, v3 op_sel:[0,1,0,0] // GFX9: v_mad_u32_u16 v5, v1, v2, v3 op_sel:[0,1,0,0] ; encoding: [0x05,0x10,0xf1,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_mad_u32_u16 v5, v1, v2, v3 op_sel:[0,0,1,0] // GFX9: v_mad_u32_u16 v5, v1, v2, v3 op_sel:[0,0,1,0] ; encoding: [0x05,0x20,0xf1,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_mad_u32_u16 v5, v1, v2, v3 op_sel:[0,0,0,1] // GFX9: v_mad_u32_u16 v5, v1, v2, v3 op_sel:[0,0,0,1] ; encoding: [0x05,0x40,0xf1,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_mad_u32_u16 v5, v1, v2, v3 op_sel:[1,1,1,1] // GFX9: v_mad_u32_u16 v5, v1, v2, v3 op_sel:[1,1,1,1] ; encoding: [0x05,0x78,0xf1,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_mad_i32_i16 v5, v1, v2, v3 // GFX9: v_mad_i32_i16 v5, v1, v2, v3 ; encoding: [0x05,0x00,0xf2,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: instruction not supported on this GPU v_mad_i32_i16 v5, v1, v2, v3 op_sel:[0,0,0,1] // GFX9: v_mad_i32_i16 v5, v1, v2, v3 op_sel:[0,0,0,1] ; encoding: [0x05,0x40,0xf2,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_cvt_pknorm_i16_f16 v5, v1, v2 // GFX9: v_cvt_pknorm_i16_f16 v5, v1, v2 ; encoding: [0x05,0x00,0x99,0xd2,0x01,0x05,0x02,0x00] +// NOGCN: error: instruction not supported on this GPU v_cvt_pknorm_i16_f16 v5, -v1, v2 // GFX9: v_cvt_pknorm_i16_f16 v5, -v1, v2 ; encoding: [0x05,0x00,0x99,0xd2,0x01,0x05,0x02,0x20] +// NOGCN: error: not a valid operand. v_cvt_pknorm_i16_f16 v5, v1, -v2 // GFX9: v_cvt_pknorm_i16_f16 v5, v1, -v2 ; encoding: [0x05,0x00,0x99,0xd2,0x01,0x05,0x02,0x40] +// NOGCN: error: not a valid operand. v_cvt_pknorm_i16_f16 v5, -v1, -v2 // GFX9: v_cvt_pknorm_i16_f16 v5, -v1, -v2 ; encoding: [0x05,0x00,0x99,0xd2,0x01,0x05,0x02,0x60] +// NOGCN: error: not a valid operand. v_cvt_pknorm_i16_f16 v5, |v1|, v2 // GFX9: v_cvt_pknorm_i16_f16 v5, |v1|, v2 ; encoding: [0x05,0x01,0x99,0xd2,0x01,0x05,0x02,0x00] +// NOGCN: error: not a valid operand. v_cvt_pknorm_i16_f16 v5, v1, |v2| // GFX9: v_cvt_pknorm_i16_f16 v5, v1, |v2| ; encoding: [0x05,0x02,0x99,0xd2,0x01,0x05,0x02,0x00] +// NOGCN: error: not a valid operand. v_cvt_pknorm_i16_f16 v5, v1, v2 op_sel:[0,0,0] // GFX9: v_cvt_pknorm_i16_f16 v5, v1, v2 ; encoding: [0x05,0x00,0x99,0xd2,0x01,0x05,0x02,0x00] +// NOGCN: error: not a valid operand. v_cvt_pknorm_i16_f16 v5, v1, v2 op_sel:[1,0,0] // GFX9: v_cvt_pknorm_i16_f16 v5, v1, v2 op_sel:[1,0,0] ; encoding: [0x05,0x08,0x99,0xd2,0x01,0x05,0x02,0x00] +// NOGCN: error: not a valid operand. v_cvt_pknorm_i16_f16 v5, v1, v2 op_sel:[1,1,1] // GFX9: v_cvt_pknorm_i16_f16 v5, v1, v2 op_sel:[1,1,1] ; encoding: [0x05,0x58,0x99,0xd2,0x01,0x05,0x02,0x00] +// NOGCN: error: not a valid operand. v_cvt_pknorm_u16_f16 v5, -v1, -v2 // GFX9: v_cvt_pknorm_u16_f16 v5, -v1, -v2 ; encoding: [0x05,0x00,0x9a,0xd2,0x01,0x05,0x02,0x60] +// NOGCN: error: not a valid operand. v_cvt_pknorm_u16_f16 v5, |v1|, |v2| // GFX9: v_cvt_pknorm_u16_f16 v5, |v1|, |v2| ; encoding: [0x05,0x03,0x9a,0xd2,0x01,0x05,0x02,0x00] +// NOGCN: error: not a valid operand. v_cvt_pknorm_u16_f16 v5, v1, v2 op_sel:[1,1,1] // GFX9: v_cvt_pknorm_u16_f16 v5, v1, v2 op_sel:[1,1,1] ; encoding: [0x05,0x58,0x9a,0xd2,0x01,0x05,0x02,0x00] +// NOGCN: error: not a valid operand. v_add_i16 v5, v1, v2 // GFX9: v_add_i16 v5, v1, v2 ; encoding: [0x05,0x00,0x9e,0xd2,0x01,0x05,0x02,0x00] +// NOGCN: error: instruction not supported on this GPU v_add_i16 v5, v1, v2 op_sel:[1,1,1] // GFX9: v_add_i16 v5, v1, v2 op_sel:[1,1,1] ; encoding: [0x05,0x58,0x9e,0xd2,0x01,0x05,0x02,0x00] +// NOGCN: error: not a valid operand. v_sub_i16 v5, v1, v2 // GFX9: v_sub_i16 v5, v1, v2 ; encoding: [0x05,0x00,0x9f,0xd2,0x01,0x05,0x02,0x00] +// NOGCN: error: instruction not supported on this GPU v_sub_i16 v5, v1, v2 op_sel:[1,1,1] // GFX9: v_sub_i16 v5, v1, v2 op_sel:[1,1,1] ; encoding: [0x05,0x58,0x9f,0xd2,0x01,0x05,0x02,0x00] +// NOGCN: error: not a valid operand. v_sub_i16 v5, v1, v2 clamp // GFX9: v_sub_i16 v5, v1, v2 clamp ; encoding: [0x05,0x80,0x9f,0xd2,0x01,0x05,0x02,0x00] +// NOGCN: error: invalid operand for instruction v_fma_f16_e64 v5, v1, v2, v3 // GFX9: v_fma_f16 v5, v1, v2, v3 ; encoding: [0x05,0x00,0x06,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: instruction not supported on this GPU v_fma_f16 v5, v1, -v2, v3 // GFX9: v_fma_f16 v5, v1, -v2, v3 ; encoding: [0x05,0x00,0x06,0xd2,0x01,0x05,0x0e,0x44] +// NOSICI: error: not a valid operand. v_fma_f16 v5, v1, v2, |v3| // GFX9: v_fma_f16 v5, v1, v2, |v3| ; encoding: [0x05,0x04,0x06,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. v_fma_f16 v5, v1, v2, v3 clamp // GFX9: v_fma_f16 v5, v1, v2, v3 clamp ; encoding: [0x05,0x80,0x06,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: invalid operand for instruction v_fma_f16 v5, v1, v2, v3 op_sel:[1,0,0,0] // GFX9: v_fma_f16 v5, v1, v2, v3 op_sel:[1,0,0,0] ; encoding: [0x05,0x08,0x06,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. +// NOVI: error: instruction not supported on this GPU v_fma_f16 v5, v1, v2, v3 op_sel:[0,1,0,0] // GFX9: v_fma_f16 v5, v1, v2, v3 op_sel:[0,1,0,0] ; encoding: [0x05,0x10,0x06,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. +// NOVI: error: instruction not supported on this GPU v_fma_f16 v5, v1, v2, v3 op_sel:[1,1,1,1] // GFX9: v_fma_f16 v5, v1, v2, v3 op_sel:[1,1,1,1] ; encoding: [0x05,0x78,0x06,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. +// NOVI: error: instruction not supported on this GPU v_fma_legacy_f16_e64 v5, v1, v2, v3 // GFX9: v_fma_legacy_f16 v5, v1, v2, v3 ; encoding: [0x05,0x00,0xee,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: instruction not supported on this GPU v_fma_legacy_f16 v5, -v1, v2, v3 // GFX9: v_fma_legacy_f16 v5, -v1, v2, v3 ; encoding: [0x05,0x00,0xee,0xd1,0x01,0x05,0x0e,0x24] +// NOGCN: error: not a valid operand. v_fma_legacy_f16 v5, v1, |v2|, v3 // GFX9: v_fma_legacy_f16 v5, v1, |v2|, v3 ; encoding: [0x05,0x02,0xee,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_fma_legacy_f16 v5, v1, v2, v3 clamp // GFX9: v_fma_legacy_f16 v5, v1, v2, v3 clamp ; encoding: [0x05,0x80,0xee,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: invalid operand for instruction v_div_fixup_f16_e64 v5, 0.5, v2, v3 // GFX9: v_div_fixup_f16 v5, 0.5, v2, v3 ; encoding: [0x05,0x00,0x07,0xd2,0xf0,0x04,0x0e,0x04] +// NOSICI: error: instruction not supported on this GPU v_div_fixup_f16 v5, v1, 0.5, v3 // GFX9: v_div_fixup_f16 v5, v1, 0.5, v3 ; encoding: [0x05,0x00,0x07,0xd2,0x01,0xe1,0x0d,0x04] +// NOSICI: error: instruction not supported on this GPU v_div_fixup_f16 v5, v1, v2, 0.5 // GFX9: v_div_fixup_f16 v5, v1, v2, 0.5 ; encoding: [0x05,0x00,0x07,0xd2,0x01,0x05,0xc2,0x03] +// NOSICI: error: instruction not supported on this GPU v_div_fixup_f16 v5, -v1, v2, v3 // GFX9: v_div_fixup_f16 v5, -v1, v2, v3 ; encoding: [0x05,0x00,0x07,0xd2,0x01,0x05,0x0e,0x24] +// NOSICI: error: not a valid operand. v_div_fixup_f16 v5, |v1|, v2, v3 // GFX9: v_div_fixup_f16 v5, |v1|, v2, v3 ; encoding: [0x05,0x01,0x07,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. v_div_fixup_f16 v5, v1, v2, v3 clamp // GFX9: v_div_fixup_f16 v5, v1, v2, v3 clamp ; encoding: [0x05,0x80,0x07,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: invalid operand for instruction v_div_fixup_f16 v5, v1, v2, v3 op_sel:[1,0,0,0] // GFX9: v_div_fixup_f16 v5, v1, v2, v3 op_sel:[1,0,0,0] ; encoding: [0x05,0x08,0x07,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. +// NOVI: error: instruction not supported on this GPU v_div_fixup_f16 v5, v1, v2, v3 op_sel:[0,0,1,0] // GFX9: v_div_fixup_f16 v5, v1, v2, v3 op_sel:[0,0,1,0] ; encoding: [0x05,0x20,0x07,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. +// NOVI: error: instruction not supported on this GPU v_div_fixup_f16 v5, v1, v2, v3 op_sel:[0,0,0,1] // GFX9: v_div_fixup_f16 v5, v1, v2, v3 op_sel:[0,0,0,1] ; encoding: [0x05,0x40,0x07,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. +// NOVI: error: instruction not supported on this GPU v_div_fixup_legacy_f16_e64 v5, 0.5, v2, v3 // GFX9: v_div_fixup_legacy_f16 v5, 0.5, v2, v3 ; encoding: [0x05,0x00,0xef,0xd1,0xf0,0x04,0x0e,0x04] +// NOGCN: error: instruction not supported on this GPU v_div_fixup_legacy_f16 v5, v1, 0.5, v3 // GFX9: v_div_fixup_legacy_f16 v5, v1, 0.5, v3 ; encoding: [0x05,0x00,0xef,0xd1,0x01,0xe1,0x0d,0x04] +// NOGCN: error: instruction not supported on this GPU v_div_fixup_legacy_f16 v5, v1, v2, 0.5 // GFX9: v_div_fixup_legacy_f16 v5, v1, v2, 0.5 ; encoding: [0x05,0x00,0xef,0xd1,0x01,0x05,0xc2,0x03] +// NOGCN: error: instruction not supported on this GPU v_div_fixup_legacy_f16 v5, -v1, v2, v3 // GFX9: v_div_fixup_legacy_f16 v5, -v1, v2, v3 ; encoding: [0x05,0x00,0xef,0xd1,0x01,0x05,0x0e,0x24] +// NOGCN: error: not a valid operand. v_div_fixup_legacy_f16 v5, v1, |v2|, v3 // GFX9: v_div_fixup_legacy_f16 v5, v1, |v2|, v3 ; encoding: [0x05,0x02,0xef,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_div_fixup_legacy_f16 v5, v1, v2, v3 clamp // GFX9: v_div_fixup_legacy_f16 v5, v1, v2, v3 clamp ; encoding: [0x05,0x80,0xef,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: invalid operand for instruction v_mad_f16_e64 v5, 0.5, v2, v3 // GFX9: v_mad_f16 v5, 0.5, v2, v3 ; encoding: [0x05,0x00,0x03,0xd2,0xf0,0x04,0x0e,0x04] +// NOSICI: error: instruction not supported on this GPU v_mad_f16 v5, v1, 0.5, v3 // GFX9: v_mad_f16 v5, v1, 0.5, v3 ; encoding: [0x05,0x00,0x03,0xd2,0x01,0xe1,0x0d,0x04] +// NOSICI: error: instruction not supported on this GPU v_mad_f16 v5, v1, v2, 0.5 // GFX9: v_mad_f16 v5, v1, v2, 0.5 ; encoding: [0x05,0x00,0x03,0xd2,0x01,0x05,0xc2,0x03] +// NOSICI: error: instruction not supported on this GPU v_mad_f16 v5, v1, v2, -v3 // GFX9: v_mad_f16 v5, v1, v2, -v3 ; encoding: [0x05,0x00,0x03,0xd2,0x01,0x05,0x0e,0x84] +// NOSICI: error: not a valid operand. v_mad_f16 v5, v1, v2, |v3| // GFX9: v_mad_f16 v5, v1, v2, |v3| ; encoding: [0x05,0x04,0x03,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. v_mad_f16 v5, v1, v2, v3 op_sel:[0,0,0,0] // GFX9: v_mad_f16 v5, v1, v2, v3 ; encoding: [0x05,0x00,0x03,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. +// NOVI: error: instruction not supported on this GPU v_mad_f16 v5, v1, v2, v3 op_sel:[1,0,0,0] // GFX9: v_mad_f16 v5, v1, v2, v3 op_sel:[1,0,0,0] ; encoding: [0x05,0x08,0x03,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. +// NOVI: error: instruction not supported on this GPU v_mad_f16 v5, v1, v2, v3 op_sel:[0,1,0,0] // GFX9: v_mad_f16 v5, v1, v2, v3 op_sel:[0,1,0,0] ; encoding: [0x05,0x10,0x03,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. +// NOVI: error: instruction not supported on this GPU v_mad_f16 v5, v1, v2, v3 op_sel:[0,0,1,0] // GFX9: v_mad_f16 v5, v1, v2, v3 op_sel:[0,0,1,0] ; encoding: [0x05,0x20,0x03,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. +// NOVI: error: instruction not supported on this GPU v_mad_f16 v5, v1, v2, v3 op_sel:[0,0,0,1] // GFX9: v_mad_f16 v5, v1, v2, v3 op_sel:[0,0,0,1] ; encoding: [0x05,0x40,0x03,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. +// NOVI: error: instruction not supported on this GPU v_mad_f16 v5, v1, v2, v3 op_sel:[1,1,1,1] // GFX9: v_mad_f16 v5, v1, v2, v3 op_sel:[1,1,1,1] ; encoding: [0x05,0x78,0x03,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. +// NOVI: error: instruction not supported on this GPU v_mad_f16 v5, v1, v2, v3 clamp // GFX9: v_mad_f16 v5, v1, v2, v3 clamp ; encoding: [0x05,0x80,0x03,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: invalid operand for instruction v_mad_i16_e64 v5, 0, v2, v3 // GFX9: v_mad_i16 v5, 0, v2, v3 ; encoding: [0x05,0x00,0x05,0xd2,0x80,0x04,0x0e,0x04] +// NOSICI: error: instruction not supported on this GPU v_mad_i16 v5, v1, -1, v3 // GFX9: v_mad_i16 v5, v1, -1, v3 ; encoding: [0x05,0x00,0x05,0xd2,0x01,0x83,0x0d,0x04] +// NOSICI: error: instruction not supported on this GPU v_mad_i16 v5, v1, v2, -4.0 -// NOGFX9: invalid literal operand +// NOGFX9: error: invalid literal operand +// NOSICI: error: instruction not supported on this GPU +// NOVI: error: invalid literal operand v_mad_i16 v5, v1, v2, v3 clamp // GFX9: v_mad_i16 v5, v1, v2, v3 clamp ; encoding: [0x05,0x80,0x05,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: invalid operand for instruction v_mad_i16 v5, v1, v2, v3 op_sel:[0,0,0,1] // GFX9: v_mad_i16 v5, v1, v2, v3 op_sel:[0,0,0,1] ; encoding: [0x05,0x40,0x05,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. +// NOVI: error: instruction not supported on this GPU v_mad_i16 v5, v1, v2, v3 op_sel:[1,1,1,1] // GFX9: v_mad_i16 v5, v1, v2, v3 op_sel:[1,1,1,1] ; encoding: [0x05,0x78,0x05,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. +// NOVI: error: instruction not supported on this GPU v_mad_legacy_f16_e64 v5, 0.5, v2, v3 // GFX9: v_mad_legacy_f16 v5, 0.5, v2, v3 ; encoding: [0x05,0x00,0xea,0xd1,0xf0,0x04,0x0e,0x04] +// NOGCN: error: instruction not supported on this GPU v_mad_legacy_f16 v5, v1, 0.5, v3 // GFX9: v_mad_legacy_f16 v5, v1, 0.5, v3 ; encoding: [0x05,0x00,0xea,0xd1,0x01,0xe1,0x0d,0x04] +// NOGCN: error: instruction not supported on this GPU v_mad_legacy_f16 v5, v1, v2, 0.5 // GFX9: v_mad_legacy_f16 v5, v1, v2, 0.5 ; encoding: [0x05,0x00,0xea,0xd1,0x01,0x05,0xc2,0x03] +// NOGCN: error: instruction not supported on this GPU v_mad_legacy_f16 v5, v1, -v2, v3 // GFX9: v_mad_legacy_f16 v5, v1, -v2, v3 ; encoding: [0x05,0x00,0xea,0xd1,0x01,0x05,0x0e,0x44] +// NOGCN: error: not a valid operand. v_mad_legacy_f16 v5, v1, |v2|, v3 // GFX9: v_mad_legacy_f16 v5, v1, |v2|, v3 ; encoding: [0x05,0x02,0xea,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: not a valid operand. v_mad_legacy_f16 v5, v1, v2, v3 clamp // GFX9: v_mad_legacy_f16 v5, v1, v2, v3 clamp ; encoding: [0x05,0x80,0xea,0xd1,0x01,0x05,0x0e,0x04] +// NOGCN: error: invalid operand for instruction v_mad_legacy_i16_e64 v5, 0, v2, v3 // GFX9: v_mad_legacy_i16 v5, 0, v2, v3 ; encoding: [0x05,0x00,0xec,0xd1,0x80,0x04,0x0e,0x04] +// NOGCN: error: instruction not supported on this GPU v_mad_legacy_i16 v5, v1, -1, v3 // GFX9: v_mad_legacy_i16 v5, v1, -1, v3 ; encoding: [0x05,0x00,0xec,0xd1,0x01,0x83,0x0d,0x04] +// NOGCN: error: instruction not supported on this GPU v_mad_legacy_i16 v5, v1, v2, -4.0 -// NOGFX9: invalid literal operand +// NOGFX9: error: invalid literal operand +// NOGCN: error: instruction not supported on this GPU v_mad_legacy_i16 v5, v1, v2, -4.0 clamp -// NOGFX9: invalid literal operand +// NOGFX9: error: invalid literal operand +// NOGCN: error: invalid operand for instruction v_mad_legacy_u16_e64 v5, 0, v2, v3 // GFX9: v_mad_legacy_u16 v5, 0, v2, v3 ; encoding: [0x05,0x00,0xeb,0xd1,0x80,0x04,0x0e,0x04] +// NOGCN: error: instruction not supported on this GPU v_mad_legacy_u16 v5, v1, -1, v3 // GFX9: v_mad_legacy_u16 v5, v1, -1, v3 ; encoding: [0x05,0x00,0xeb,0xd1,0x01,0x83,0x0d,0x04] +// NOGCN: error: instruction not supported on this GPU v_mad_legacy_u16 v5, v1, v2, -4.0 -// NOGFX9: invalid literal operand +// NOGFX9: error: invalid literal operand +// NOGCN: error: instruction not supported on this GPU v_mad_legacy_u16 v5, v1, v2, -4.0 clamp -// NOGFX9: invalid literal operand +// NOGFX9: error: invalid literal operand +// NOGCN: error: invalid operand for instruction v_mad_u16_e64 v5, 0, v2, v3 // GFX9: v_mad_u16 v5, 0, v2, v3 ; encoding: [0x05,0x00,0x04,0xd2,0x80,0x04,0x0e,0x04] +// NOSICI: error: instruction not supported on this GPU v_mad_u16 v5, v1, -1, v3 // GFX9: v_mad_u16 v5, v1, -1, v3 ; encoding: [0x05,0x00,0x04,0xd2,0x01,0x83,0x0d,0x04] +// NOSICI: error: instruction not supported on this GPU v_mad_u16 v5, v1, v2, -4.0 -// NOGFX9: invalid literal operand +// NOGFX9: error: invalid literal operand +// NOSICI: error: instruction not supported on this GPU +// NOVI: error: invalid literal operand v_mad_u16 v5, v1, v2, v3 clamp // GFX9: v_mad_u16 v5, v1, v2, v3 clamp ; encoding: [0x05,0x80,0x04,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: invalid operand for instruction v_mad_u16 v5, v1, v2, v3 op_sel:[1,0,0,0] // GFX9: v_mad_u16 v5, v1, v2, v3 op_sel:[1,0,0,0] ; encoding: [0x05,0x08,0x04,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. +// NOVI: error: instruction not supported on this GPU v_mad_u16 v5, v1, v2, v3 op_sel:[0,0,0,1] // GFX9: v_mad_u16 v5, v1, v2, v3 op_sel:[0,0,0,1] ; encoding: [0x05,0x40,0x04,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. +// NOVI: error: instruction not supported on this GPU v_mad_u16 v5, v1, v2, v3 op_sel:[1,1,1,1] // GFX9: v_mad_u16 v5, v1, v2, v3 op_sel:[1,1,1,1] ; encoding: [0x05,0x78,0x04,0xd2,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. +// NOVI: error: instruction not supported on this GPU v_interp_p2_f16 v5, v2, attr0.x, v3 // GFX9: v_interp_p2_f16 v5, v2, attr0.x, v3 ; encoding: [0x05,0x00,0x77,0xd2,0x00,0x04,0x0e,0x04] +// NOSICI: error: invalid operand for instruction v_interp_p2_f16 v5, -v2, attr0.x, v3 // GFX9: v_interp_p2_f16 v5, -v2, attr0.x, v3 ; encoding: [0x05,0x00,0x77,0xd2,0x00,0x04,0x0e,0x44] +// NOSICI: error: not a valid operand. v_interp_p2_f16 v5, v2, attr0.x, |v3| // GFX9: v_interp_p2_f16 v5, v2, attr0.x, |v3| ; encoding: [0x05,0x04,0x77,0xd2,0x00,0x04,0x0e,0x04] +// NOSICI: error: not a valid operand. v_interp_p2_f16 v5, v2, attr0.w, v3 // GFX9: v_interp_p2_f16 v5, v2, attr0.w, v3 ; encoding: [0x05,0x00,0x77,0xd2,0xc0,0x04,0x0e,0x04] +// NOSICI: error: invalid operand for instruction v_interp_p2_f16 v5, v2, attr0.x, v3 high // GFX9: v_interp_p2_f16 v5, v2, attr0.x, v3 high ; encoding: [0x05,0x00,0x77,0xd2,0x00,0x05,0x0e,0x04] +// NOSICI: error: invalid operand for instruction v_interp_p2_f16 v5, v2, attr0.x, v3 clamp // GFX9: v_interp_p2_f16 v5, v2, attr0.x, v3 clamp ; encoding: [0x05,0x80,0x77,0xd2,0x00,0x04,0x0e,0x04] +// NOSICI: error: invalid operand for instruction v_interp_p2_legacy_f16 v5, v2, attr31.x, v3 // GFX9: v_interp_p2_legacy_f16 v5, v2, attr31.x, v3 ; encoding: [0x05,0x00,0x76,0xd2,0x1f,0x04,0x0e,0x04] +// NOGCN: error: invalid operand for instruction v_interp_p2_legacy_f16 v5, -v2, attr0.x, v3 // GFX9: v_interp_p2_legacy_f16 v5, -v2, attr0.x, v3 ; encoding: [0x05,0x00,0x76,0xd2,0x00,0x04,0x0e,0x44] +// NOGCN: error: not a valid operand. v_interp_p2_legacy_f16 v5, v2, attr0.x, |v3| // GFX9: v_interp_p2_legacy_f16 v5, v2, attr0.x, |v3| ; encoding: [0x05,0x04,0x76,0xd2,0x00,0x04,0x0e,0x04] +// NOGCN: error: not a valid operand. v_interp_p2_legacy_f16 v5, v2, attr0.w, v3 // GFX9: v_interp_p2_legacy_f16 v5, v2, attr0.w, v3 ; encoding: [0x05,0x00,0x76,0xd2,0xc0,0x04,0x0e,0x04] +// NOGCN: error: invalid operand for instruction v_interp_p2_legacy_f16 v5, v2, attr0.x, v3 high // GFX9: v_interp_p2_legacy_f16 v5, v2, attr0.x, v3 high ; encoding: [0x05,0x00,0x76,0xd2,0x00,0x05,0x0e,0x04] +// NOGCN: error: invalid operand for instruction v_interp_p2_legacy_f16 v5, v2, attr0.x, v3 clamp // GFX9: v_interp_p2_legacy_f16 v5, v2, attr0.x, v3 clamp ; encoding: [0x05,0x80,0x76,0xd2,0x00,0x04,0x0e,0x04] +// NOGCN: error: invalid operand for instruction v_cvt_norm_i16_f16_e64 v5, -v1 // GFX9: v_cvt_norm_i16_f16_e64 v5, -v1 ; encoding: [0x05,0x00,0x8d,0xd1,0x01,0x01,0x00,0x20] -// NOVI: error: instruction not supported on this GPU +// NOGCN: error: not a valid operand. v_cvt_norm_i16_f16_e64 v5, |v1| // GFX9: v_cvt_norm_i16_f16_e64 v5, |v1| ; encoding: [0x05,0x01,0x8d,0xd1,0x01,0x01,0x00,0x00] -// NOVI: error: instruction not supported on this GPU +// NOGCN: error: not a valid operand. v_cvt_norm_u16_f16_e64 v5, -v1 // GFX9: v_cvt_norm_u16_f16_e64 v5, -v1 ; encoding: [0x05,0x00,0x8e,0xd1,0x01,0x01,0x00,0x20] -// NOVI: error: instruction not supported on this GPU +// NOGCN: error: not a valid operand. v_cvt_norm_u16_f16_e64 v5, |v1| // GFX9: v_cvt_norm_u16_f16_e64 v5, |v1| ; encoding: [0x05,0x01,0x8e,0xd1,0x01,0x01,0x00,0x00] -// NOVI: error: instruction not supported on this GPU +// NOGCN: error: not a valid operand. v_sat_pk_u8_i16_e64 v5, -1 // GFX9: v_sat_pk_u8_i16_e64 v5, -1 ; encoding: [0x05,0x00,0x8f,0xd1,0xc1,0x00,0x00,0x00] -// NOVI: error: instruction not supported on this GPU +// NOGCN: error: instruction not supported on this GPU v_sat_pk_u8_i16_e64 v5, v255 // GFX9: v_sat_pk_u8_i16_e64 v5, v255 ; encoding: [0x05,0x00,0x8f,0xd1,0xff,0x01,0x00,0x00] -// NOVI: error: instruction not supported on this GPU +// NOGCN: error: instruction not supported on this GPU v_screen_partition_4se_b32_e64 v5, v1 // GXF9: [0x05,0x00,0x77,0xd1,0x01,0x01,0x00,0x00] -// NOVI: error: instruction not supported on this GPU +// NOGCN: error: instruction not supported on this GPU +// GFX9: v_screen_partition_4se_b32_e64 v5, v1 ; encoding: [0x05,0x00,0x77,0xd1,0x01,0x01,0x00,0x00] v_screen_partition_4se_b32_e64 v5, -1 // GXF9: [0x05,0x00,0x77,0xd1,0xc1,0x00,0x00,0x00] -// NOVI: error: instruction not supported on this GPU +// NOGCN: error: instruction not supported on this GPU +// GFX9: v_screen_partition_4se_b32_e64 v5, -1 ; encoding: [0x05,0x00,0x77,0xd1,0xc1,0x00,0x00,0x00] v_add_u32 v84, v13, s31 clamp // GFX9: v_add_u32_e64 v84, v13, s31 clamp ; encoding: [0x54,0x80,0x34,0xd1,0x0d,0x3f,0x00,0x00] -// NOVI: error: +// NOGCN: error: invalid operand for instruction v_sub_u32 v84, v13, s31 clamp // GFX9: v_sub_u32_e64 v84, v13, s31 clamp ; encoding: [0x54,0x80,0x35,0xd1,0x0d,0x3f,0x00,0x00] -// NOVI: error: +// NOGCN: error: invalid operand for instruction v_subrev_u32 v84, v13, s31 clamp // GFX9: v_subrev_u32_e64 v84, v13, s31 clamp ; encoding: [0x54,0x80,0x36,0xd1,0x0d,0x3f,0x00,0x00] -// NOVI: error: +// NOGCN: error: invalid operand for instruction v_addc_co_u32 v84, s[4:5], v13, v31, vcc clamp // GFX9: v_addc_co_u32_e64 v84, s[4:5], v13, v31, vcc clamp ; encoding: [0x54,0x84,0x1c,0xd1,0x0d,0x3f,0xaa,0x01] -// NOVI: error: +// NOGCN: error: invalid operand for instruction v_subb_co_u32 v84, s[2:3], v13, v31, vcc clamp // GFX9: v_subb_co_u32_e64 v84, s[2:3], v13, v31, vcc clamp ; encoding: [0x54,0x82,0x1d,0xd1,0x0d,0x3f,0xaa,0x01] -// NOVI: error: +// NOGCN: error: invalid operand for instruction v_subbrev_co_u32 v84, vcc, v13, v31, s[6:7] clamp // GFX9: v_subbrev_co_u32_e64 v84, vcc, v13, v31, s[6:7] clamp ; encoding: [0x54,0xea,0x1e,0xd1,0x0d,0x3f,0x1a,0x00] -// NOVI: error: +// NOGCN: error: invalid operand for instruction v_add_co_u32 v84, s[4:5], v13, v31 clamp // GFX9: v_add_co_u32_e64 v84, s[4:5], v13, v31 clamp ; encoding: [0x54,0x84,0x19,0xd1,0x0d,0x3f,0x02,0x00] -// NOVI: error: +// NOSICI: error: integer clamping is not supported on this GPU +// NOVI: error: invalid operand for instruction v_sub_co_u32 v84, s[2:3], v13, v31 clamp // GFX9: v_sub_co_u32_e64 v84, s[2:3], v13, v31 clamp ; encoding: [0x54,0x82,0x1a,0xd1,0x0d,0x3f,0x02,0x00] -// NOVI: error: +// NOSICI: error: integer clamping is not supported on this GPU +// NOVI: error: invalid operand for instruction v_subrev_co_u32 v84, vcc, v13, v31 clamp // GFX9: v_subrev_co_u32_e64 v84, vcc, v13, v31 clamp ; encoding: [0x54,0xea,0x1b,0xd1,0x0d,0x3f,0x02,0x00] -// NOVI: error: +// NOSICI: error: integer clamping is not supported on this GPU +// NOVI: error: invalid operand for instruction v_addc_co_u32 v84, vcc, v13, v31, vcc // GFX9: v_addc_co_u32_e32 v84, vcc, v13, v31, vcc ; encoding: [0x0d,0x3f,0xa8,0x38] -// NOVI: error: instruction not supported on this GPU +// NOGCN: error: instruction not supported on this GPU v_subb_co_u32 v84, vcc, v13, v31, vcc // GFX9: v_subb_co_u32_e32 v84, vcc, v13, v31, vcc ; encoding: [0x0d,0x3f,0xa8,0x3a] -// NOVI: error: instruction not supported on this GPU +// NOGCN: error: instruction not supported on this GPU v_subbrev_co_u32 v84, vcc, v13, v31, vcc // GFX9: v_subbrev_co_u32_e32 v84, vcc, v13, v31, vcc ; encoding: [0x0d,0x3f,0xa8,0x3c] -// NOVI: error: instruction not supported on this GPU +// NOGCN: error: instruction not supported on this GPU v_add_co_u32 v84, vcc, v13, v31 // GFX9: v_add_co_u32_e32 v84, vcc, v13, v31 ; encoding: [0x0d,0x3f,0xa8,0x32] @@ -517,97 +658,97 @@ v_subrev_co_u32 v84, vcc, v13, v31 v_add_i32 v1, v2, v3 // GFX9: v_add_i32 v1, v2, v3 ; encoding: [0x01,0x00,0x9c,0xd2,0x02,0x07,0x02,0x00] -// NOVI: error: instruction not supported on this GPU +// NOGCN: error: instruction not supported on this GPU v_add_i32 v1, v2, v3 clamp // GFX9: v_add_i32 v1, v2, v3 clamp ; encoding: [0x01,0x80,0x9c,0xd2,0x02,0x07,0x02,0x00] -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction v_sub_i32 v1, v2, v3 // GFX9: v_sub_i32 v1, v2, v3 ; encoding: [0x01,0x00,0x9d,0xd2,0x02,0x07,0x02,0x00] -// NOVI: error: instruction not supported on this GPU +// NOGCN: error: instruction not supported on this GPU v_sub_i32 v1, v2, v3 clamp // GFX9: v_sub_i32 v1, v2, v3 clamp ; encoding: [0x01,0x80,0x9d,0xd2,0x02,0x07,0x02,0x00] -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction //===----------------------------------------------------------------------===// // Validate register size checks (bug 37943) //===----------------------------------------------------------------------===// -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_f64 v[0:1], s0, v[0:1] -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_f64 v[0:1], s[0:3], v[0:1] -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_f64 v[0:1], v0, v[0:1] -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_f64 v[0:1], v[0:2], v[0:1] -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_f64 v[0:1], v[0:3], v[0:1] -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_f64 v[0:1], v[0:1], v0 -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_f64 v[0:1], v[0:1], s0 -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_f32 v0, s[0:1], v0 -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_f32 v0, v[0:1], v0 -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_f32 v0, v0, s[0:1] -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_f32 v0, v0, v[0:1] -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_f16 v0, s[0:1], v0 -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_f16 v0, v[0:1], v0 -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_f16 v0, v0, s[0:1] -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_f16 v0, v0, v[0:1] -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_u16 v0, s[0:1], v0 -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_u16 v0, v[0:1], v0 -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_u16 v0, v0, s[0:1] -// NOVI: error: invalid operand for instruction +// NOGCN: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_add_u16 v0, v0, v[0:1] diff --git a/llvm/test/MC/AMDGPU/vop3-literal.s b/llvm/test/MC/AMDGPU/vop3-literal.s index 99265352f0ce..43223108163a 100644 --- a/llvm/test/MC/AMDGPU/vop3-literal.s +++ b/llvm/test/MC/AMDGPU/vop3-literal.s @@ -1,7 +1,7 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX10 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX9 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX10-ERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX9-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 -show-encoding %s | FileCheck -check-prefix=GFX10 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck -check-prefix=GFX9 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-WavefrontSize32,+WavefrontSize64 %s 2>&1 | FileCheck -check-prefix=GFX10-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefix=GFX9-ERR --implicit-check-not=error: %s v_bfe_u32 v0, 0x3039, v1, s1 // GFX10: v_bfe_u32 v0, 0x3039, v1, s1 ; encoding: [0x00,0x00,0x48,0xd5,0xff,0x02,0x06,0x00,0x39,0x30,0x00,0x00] @@ -44,12 +44,12 @@ v_bfe_u32 v0, 0x3039, 0x12345, v2 // GFX9-ERR: error: invalid literal operand v_bfe_u32 v0, s1, 0x3039, s1 -// GFX10-ERR: v_bfe_u32 v0, s1, 0x3039, s1 ; encoding: [0x00,0x00,0x48,0xd5,0x01,0xfe,0x05,0x00,0x39,0x30,0x00,0x00] // GFX9-ERR: error: invalid literal operand +// GFX10: v_bfe_u32 v0, s1, 0x3039, s1 ; encoding: [0x00,0x00,0x48,0xd5,0x01,0xfe,0x05,0x00,0x39,0x30,0x00,0x00] v_bfe_u32 v0, s1, 0x3039, s2 -// GFX10: error: invalid operand (violates constant bus restrictions) // GFX9-ERR: error: invalid literal operand +// GFX10-ERR: error: invalid operand (violates constant bus restrictions) v_bfm_b32_e64 v0, 0x3039, s1 // GFX10: v_bfm_b32_e64 v0, 0x3039, s1 ; encoding: [0x00,0x00,0x63,0xd7,0xff,0x02,0x00,0x00,0x39,0x30,0x00,0x00] @@ -197,12 +197,15 @@ v_min3_i16 v5, 0x5678, 0x5678, 0x5679 v_add_nc_u16 v5, 0xfe0b, v2 // GFX10: v_add_nc_u16_e64 v5, 0xfe0b, v2 ; encoding: [0x05,0x00,0x03,0xd7,0xff,0x04,0x02,0x00,0x0b,0xfe,0x00,0x00] +// GFX9-ERR: error: instruction not supported on this GPU v_add_nc_u16 v5, v1, 0x1234 // GFX10: v_add_nc_u16_e64 v5, v1, 0x1234 ; encoding: [0x05,0x00,0x03,0xd7,0x01,0xff,0x01,0x00,0x34,0x12,0x00,0x00] +// GFX9-ERR: error: instruction not supported on this GPU v_add_nc_u16 v5, 0x1234, 0x1234 // GFX10: v_add_nc_u16_e64 v5, 0x1234, 0x1234 ; encoding: [0x05,0x00,0x03,0xd7,0xff,0xfe,0x01,0x00,0x34,0x12,0x00,0x00] +// GFX9-ERR: error: instruction not supported on this GPU v_ashrrev_i16_e64 v5, 0x3456, v2 // GFX10: v_ashrrev_i16_e64 v5, 0x3456, v2 ; encoding: [0x05,0x00,0x08,0xd7,0xff,0x04,0x02,0x00,0x56,0x34,0x00,0x00] @@ -254,6 +257,7 @@ v_cmp_f_i32_e64 s[10:11], 0xaf123456, 0xaf123456 v_cmp_f_i32_e64 s[10:11], 0xaf123456, 0xaf123455 // GFX10-ERR: error: invalid literal operand +// GFX9-ERR: error: invalid literal operand v_cmp_f_u64_e64 s[10:11], 0xaf123456, v[2:3] // GFX10: v_cmp_f_u64_e64 s[10:11], 0xaf123456, v[2:3] ; encoding: [0x0a,0x00,0xe0,0xd4,0xff,0x04,0x02,0x00,0x56,0x34,0x12,0xaf] @@ -269,33 +273,43 @@ v_cmp_f_u64_e64 s[10:11], 0x3f717273, 0x3f717273 v_cmpx_class_f32_e64 0xaf123456, v2 // GFX10: v_cmpx_class_f32_e64 0xaf123456, v2 ; encoding: [0x00,0x00,0x98,0xd4,0xff,0x04,0x02,0x00,0x56,0x34,0x12,0xaf] +// GFX9-ERR: error: instruction not supported on this GPU v_cmpx_class_f32_e64 v1, 0xaf123456 // GFX10: v_cmpx_class_f32_e64 v1, 0xaf123456 ; encoding: [0x00,0x00,0x98,0xd4,0x01,0xff,0x01,0x00,0x56,0x34,0x12,0xaf] +// GFX9-ERR: error: instruction not supported on this GPU v_cmpx_class_f32_e64 0xaf123456, 0xaf123456 // GFX10: v_cmpx_class_f32_e64 0xaf123456, 0xaf123456 ; encoding: [0x00,0x00,0x98,0xd4,0xff,0xfe,0x01,0x00,0x56,0x34,0x12,0xaf] +// GFX9-ERR: error: instruction not supported on this GPU v_cmpx_class_f32_e64 0xaf123456, 0xaf123455 // GFX10-ERR: error: invalid literal operand +// GFX9-ERR: error: instruction not supported on this GPU v_cmpx_lt_i16_e64 v1, 0x3456 // GFX10: v_cmpx_lt_i16_e64 v1, 0x3456 ; encoding: [0x00,0x00,0x99,0xd4,0x01,0xff,0x01,0x00,0x56,0x34,0x00,0x00] +// GFX9-ERR: error: instruction not supported on this GPU v_cmpx_lt_i16_e64 0x3456, v2 // GFX10: v_cmpx_lt_i16_e64 0x3456, v2 ; encoding: [0x00,0x00,0x99,0xd4,0xff,0x04,0x02,0x00,0x56,0x34,0x00,0x00] +// GFX9-ERR: error: instruction not supported on this GPU v_cmpx_lt_i16_e64 0x3456, 0x3456 // GFX10: v_cmpx_lt_i16_e64 0x3456, 0x3456 ; encoding: [0x00,0x00,0x99,0xd4,0xff,0xfe,0x01,0x00,0x56,0x34,0x00,0x00] +// GFX9-ERR: error: instruction not supported on this GPU v_cmpx_f_i64_e64 0xaf123456, v[2:3] // GFX10: v_cmpx_f_i64_e64 0xaf123456, v[2:3] ; encoding: [0x00,0x00,0xb0,0xd4,0xff,0x04,0x02,0x00,0x56,0x34,0x12,0xaf] +// GFX9-ERR: error: instruction not supported on this GPU v_cmpx_f_i64_e64 v[1:2], 0x3f717273 // GFX10: v_cmpx_f_i64_e64 v[1:2], 0x3f717273 ; encoding: [0x00,0x00,0xb0,0xd4,0x01,0xff,0x01,0x00,0x73,0x72,0x71,0x3f] +// GFX9-ERR: error: instruction not supported on this GPU v_cmpx_f_i64_e64 0x3f717273, 0x3f717273 // GFX10: v_cmpx_f_i64_e64 0x3f717273, 0x3f717273 ; encoding: [0x00,0x00,0xb0,0xd4,0xff,0xfe,0x01,0x00,0x73,0x72,0x71,0x3f] +// GFX9-ERR: error: instruction not supported on this GPU v_lshlrev_b64 v[5:6], 0xaf123456, v[2:3] // GFX10: v_lshlrev_b64 v[5:6], 0xaf123456, v[2:3] ; encoding: [0x05,0x00,0xff,0xd6,0xff,0x04,0x02,0x00,0x56,0x34,0x12,0xaf] @@ -307,18 +321,23 @@ v_lshlrev_b64 v[5:6], v1, 0x3f717273 v_fma_mix_f32 v5, 0x123, v2, v3 // GFX10: v_fma_mix_f32 v5, 0x123, v2, v3 ; encoding: [0x05,0x00,0x20,0xcc,0xff,0x04,0x0e,0x04,0x23,0x01,0x00,0x00] +// GFX9-ERR: error: instruction not supported on this GPU v_fma_mix_f32 v5, v1, 0x7b, v3 // GFX10: v_fma_mix_f32 v5, v1, 0x7b, v3 ; encoding: [0x05,0x00,0x20,0xcc,0x01,0xff,0x0d,0x04,0x7b,0x00,0x00,0x00] +// GFX9-ERR: error: instruction not supported on this GPU v_fma_mix_f32 v5, v1, v2, 0x1c8 // GFX10: v_fma_mix_f32 v5, v1, v2, 0x1c8 ; encoding: [0x05,0x00,0x20,0xcc,0x01,0x05,0xfe,0x03,0xc8,0x01,0x00,0x00] +// GFX9-ERR: error: instruction not supported on this GPU v_fma_mix_f32 v5, 0x1c8a, v2, 0x1c8a // GFX10: v_fma_mix_f32 v5, 0x1c8a, v2, 0x1c8a ; encoding: [0x05,0x00,0x20,0xcc,0xff,0x04,0xfe,0x03,0x8a,0x1c,0x00,0x00] +// GFX9-ERR: error: instruction not supported on this GPU v_fma_mix_f32 v5, 0x1c8a, 0x1c8a, 0x1c8a // GFX10: v_fma_mix_f32 v5, 0x1c8a, 0x1c8a, 0x1c8a ; encoding: [0x05,0x00,0x20,0xcc,0xff,0xfe,0xfd,0x03,0x8a,0x1c,0x00,0x00] +// GFX9-ERR: error: instruction not supported on this GPU v_pk_add_f16 v5, 0xaf123456, v2 // GFX10: v_pk_add_f16 v5, 0xaf123456, v2 ; encoding: [0x05,0x00,0x0f,0xcc,0xff,0x04,0x02,0x18,0x56,0x34,0x12,0xaf] diff --git a/llvm/test/MC/AMDGPU/vop3-modifiers-err.s b/llvm/test/MC/AMDGPU/vop3-modifiers-err.s index b28768c1ca09..95811c789e84 100644 --- a/llvm/test/MC/AMDGPU/vop3-modifiers-err.s +++ b/llvm/test/MC/AMDGPU/vop3-modifiers-err.s @@ -1,4 +1,4 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck --implicit-check-not=error: %s //---------------------------------------------------------------------------// // VOP3 Modifiers diff --git a/llvm/test/MC/AMDGPU/vop3.s b/llvm/test/MC/AMDGPU/vop3.s index 2e9081767740..e5ff3f030a6f 100644 --- a/llvm/test/MC/AMDGPU/vop3.s +++ b/llvm/test/MC/AMDGPU/vop3.s @@ -1,14 +1,14 @@ // RUN: not llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s --check-prefix=SICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=hawaii -show-encoding %s | FileCheck %s --check-prefix=CI +// RUN: not llvm-mc -arch=amdgcn -mcpu=hawaii -show-encoding %s | FileCheck %s --check-prefix=CI --check-prefix=SICI // RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck %s --check-prefix=VI // Make sure interp instructions disassemble regardless of lds bank count // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx810 -show-encoding %s | FileCheck %s --check-prefix=VI -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=hawaii -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOVI - +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=hawaii %s 2>&1 | FileCheck %s -check-prefix=NOCI --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck %s --check-prefix=NOVI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx810 %s 2>&1 | FileCheck -check-prefix=NOVI --implicit-check-not=error: %s //===----------------------------------------------------------------------===// // VOPC Instructions @@ -287,39 +287,42 @@ v_mac_f32_e64 v0, -v1, |v2| // VI: v_mac_f32_e64 v0, -v1, |v2| ; encoding: [0x00,0x02,0x16,0xd1,0x01,0x05,0x02,0x20] v_mac_f16_e64 v0, 0.5, flat_scratch_lo -// NOSICI: error: // VI: v_mac_f16_e64 v0, 0.5, flat_scratch_lo ; encoding: [0x00,0x00,0x23,0xd1,0xf0,0xcc,0x00,0x00] +// NOCI: error: instruction not supported on this GPU +// NOSI: error: not a valid operand. v_mac_f16_e64 v0, -4.0, flat_scratch_lo -// NOSICI: error: // VI: v_mac_f16_e64 v0, -4.0, flat_scratch_lo ; encoding: [0x00,0x00,0x23,0xd1,0xf7,0xcc,0x00,0x00] +// NOCI: error: instruction not supported on this GPU +// NOSI: error: not a valid operand. v_mac_f16_e64 v0, flat_scratch_lo, -4.0 -// NOSICI: error: // VI: v_mac_f16_e64 v0, flat_scratch_lo, -4.0 ; encoding: [0x00,0x00,0x23,0xd1,0x66,0xee,0x01,0x00] +// NOCI: error: instruction not supported on this GPU +// NOSI: error: not a valid operand. v_add_u32 v84, vcc, v13, s31 clamp -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // VI: v_add_u32_e64 v84, vcc, v13, s31 clamp ; encoding: [0x54,0xea,0x19,0xd1,0x0d,0x3f,0x00,0x00] v_sub_u32 v84, s[2:3], v13, s31 clamp -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // VI: v_sub_u32_e64 v84, s[2:3], v13, s31 clamp ; encoding: [0x54,0x82,0x1a,0xd1,0x0d,0x3f,0x00,0x00] v_subrev_u32 v84, vcc, v13, s31 clamp -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // VI: v_subrev_u32_e64 v84, vcc, v13, s31 clamp ; encoding: [0x54,0xea,0x1b,0xd1,0x0d,0x3f,0x00,0x00] v_addc_u32 v84, s[4:5], v13, v31, vcc clamp -// NOSICI: error: +// NOSICI: error: integer clamping is not supported on this GPU // VI: v_addc_u32_e64 v84, s[4:5], v13, v31, vcc clamp ; encoding: [0x54,0x84,0x1c,0xd1,0x0d,0x3f,0xaa,0x01] v_subb_u32 v84, s[2:3], v13, v31, vcc clamp -// NOSICI: error: +// NOSICI: error: integer clamping is not supported on this GPU // VI: v_subb_u32_e64 v84, s[2:3], v13, v31, vcc clamp ; encoding: [0x54,0x82,0x1d,0xd1,0x0d,0x3f,0xaa,0x01] v_subbrev_u32 v84, vcc, v13, v31, s[6:7] clamp -// NOSICI: error: +// NOSICI: error: integer clamping is not supported on this GPU // VI: v_subbrev_u32_e64 v84, vcc, v13, v31, s[6:7] clamp ; encoding: [0x54,0xea,0x1e,0xd1,0x0d,0x3f,0x1a,0x00] ///===---------------------------------------------------------------------===// @@ -493,81 +496,107 @@ v_cubeid_f32 v0, |-1|, |-1.0|, |1.0| v_fma_f16_e64 v5, v1, v2, v3 // VI: v_fma_f16 v5, v1, v2, v3 ; encoding: [0x05,0x00,0xee,0xd1,0x01,0x05,0x0e,0x04] +// NOSICI: error: instruction not supported on this GPU v_fma_f16 v5, v1, v2, 0.5 // VI: v_fma_f16 v5, v1, v2, 0.5 ; encoding: [0x05,0x00,0xee,0xd1,0x01,0x05,0xc2,0x03] +// NOSICI: error: instruction not supported on this GPU v_fma_f16 v5, -v1, -v2, -v3 // VI: v_fma_f16 v5, -v1, -v2, -v3 ; encoding: [0x05,0x00,0xee,0xd1,0x01,0x05,0x0e,0xe4] +// NOSICI: error: not a valid operand. v_fma_f16 v5, |v1|, |v2|, |v3| // VI: v_fma_f16 v5, |v1|, |v2|, |v3| ; encoding: [0x05,0x07,0xee,0xd1,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. v_fma_f16 v5, v1, v2, v3 clamp // VI: v_fma_f16 v5, v1, v2, v3 clamp ; encoding: [0x05,0x80,0xee,0xd1,0x01,0x05,0x0e,0x04] +// NOSICI: error: invalid operand for instruction v_div_fixup_f16_e64 v5, v1, v2, v3 // VI: v_div_fixup_f16 v5, v1, v2, v3 ; encoding: [0x05,0x00,0xef,0xd1,0x01,0x05,0x0e,0x04] +// NOSICI: error: instruction not supported on this GPU v_div_fixup_f16 v5, 0.5, v2, v3 // VI: v_div_fixup_f16 v5, 0.5, v2, v3 ; encoding: [0x05,0x00,0xef,0xd1,0xf0,0x04,0x0e,0x04] +// NOSICI: error: instruction not supported on this GPU v_div_fixup_f16 v5, v1, 0.5, v3 // VI: v_div_fixup_f16 v5, v1, 0.5, v3 ; encoding: [0x05,0x00,0xef,0xd1,0x01,0xe1,0x0d,0x04] +// NOSICI: error: instruction not supported on this GPU v_div_fixup_f16 v5, v1, v2, 0.5 // VI: v_div_fixup_f16 v5, v1, v2, 0.5 ; encoding: [0x05,0x00,0xef,0xd1,0x01,0x05,0xc2,0x03] +// NOSICI: error: instruction not supported on this GPU v_div_fixup_f16 v5, v1, v2, -4.0 // VI: v_div_fixup_f16 v5, v1, v2, -4.0 ; encoding: [0x05,0x00,0xef,0xd1,0x01,0x05,0xde,0x03] +// NOSICI: error: instruction not supported on this GPU v_div_fixup_f16 v5, -v1, v2, v3 // VI: v_div_fixup_f16 v5, -v1, v2, v3 ; encoding: [0x05,0x00,0xef,0xd1,0x01,0x05,0x0e,0x24] +// NOSICI: error: not a valid operand. v_div_fixup_f16 v5, v1, |v2|, v3 // VI: v_div_fixup_f16 v5, v1, |v2|, v3 ; encoding: [0x05,0x02,0xef,0xd1,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. v_div_fixup_f16 v5, v1, v2, v3 clamp // VI: v_div_fixup_f16 v5, v1, v2, v3 clamp ; encoding: [0x05,0x80,0xef,0xd1,0x01,0x05,0x0e,0x04] +// NOSICI: error: invalid operand for instruction v_mad_f16_e64 v5, v1, v2, v3 // VI: v_mad_f16 v5, v1, v2, v3 ; encoding: [0x05,0x00,0xea,0xd1,0x01,0x05,0x0e,0x04] +// NOSICI: error: instruction not supported on this GPU v_mad_f16 v5, 0.5, v2, v3 // VI: v_mad_f16 v5, 0.5, v2, v3 ; encoding: [0x05,0x00,0xea,0xd1,0xf0,0x04,0x0e,0x04] +// NOSICI: error: instruction not supported on this GPU v_mad_f16 v5, v1, 0.5, v3 // VI: v_mad_f16 v5, v1, 0.5, v3 ; encoding: [0x05,0x00,0xea,0xd1,0x01,0xe1,0x0d,0x04] +// NOSICI: error: instruction not supported on this GPU v_mad_f16 v5, v1, v2, 0.5 // VI: v_mad_f16 v5, v1, v2, 0.5 ; encoding: [0x05,0x00,0xea,0xd1,0x01,0x05,0xc2,0x03] +// NOSICI: error: instruction not supported on this GPU v_mad_f16 v5, v1, -v2, v3 // VI: v_mad_f16 v5, v1, -v2, v3 ; encoding: [0x05,0x00,0xea,0xd1,0x01,0x05,0x0e,0x44] +// NOSICI: error: not a valid operand. v_mad_f16 v5, v1, v2, |v3| // VI: v_mad_f16 v5, v1, v2, |v3| ; encoding: [0x05,0x04,0xea,0xd1,0x01,0x05,0x0e,0x04] +// NOSICI: error: not a valid operand. v_mad_f16 v5, v1, v2, v3 clamp // VI: v_mad_f16 v5, v1, v2, v3 clamp ; encoding: [0x05,0x80,0xea,0xd1,0x01,0x05,0x0e,0x04] +// NOSICI: error: invalid operand for instruction v_mad_i16_e64 v5, -1, v2, v3 // VI: v_mad_i16 v5, -1, v2, v3 ; encoding: [0x05,0x00,0xec,0xd1,0xc1,0x04,0x0e,0x04] +// NOSICI: error: instruction not supported on this GPU v_mad_i16 v5, v1, -4.0, v3 // NOVI: error: invalid literal operand +// NOSICI: error: instruction not supported on this GPU v_mad_i16 v5, v1, v2, 0 // VI: v_mad_i16 v5, v1, v2, 0 ; encoding: [0x05,0x00,0xec,0xd1,0x01,0x05,0x02,0x02] +// NOSICI: error: instruction not supported on this GPU v_mad_u16_e64 v5, -1, v2, v3 // VI: v_mad_u16 v5, -1, v2, v3 ; encoding: [0x05,0x00,0xeb,0xd1,0xc1,0x04,0x0e,0x04] +// NOSICI: error: instruction not supported on this GPU v_mad_u16 v5, v1, 0, v3 // VI: v_mad_u16 v5, v1, 0, v3 ; encoding: [0x05,0x00,0xeb,0xd1,0x01,0x01,0x0d,0x04] +// NOSICI: error: instruction not supported on this GPU v_mad_u16 v5, v1, v2, -4.0 // NOVI: error: invalid literal operand +// NOSICI: error: instruction not supported on this GPU ///===---------------------------------------------------------------------===// // VOP3 with Integer Clamp @@ -606,19 +635,21 @@ v_mqsad_pk_u16_u8 v[5:6], v[1:2], v2, v[3:4] clamp // VI: v_mqsad_pk_u16_u8 v[5:6], v[1:2], v2, v[3:4] clamp ; encoding: [0x05,0x80,0xe6,0xd1,0x01,0x05,0x0e,0x04] v_qsad_pk_u16_u8 v[5:6], v[1:2], v2, v[3:4] clamp -// NOSICI: error: // VI: v_qsad_pk_u16_u8 v[5:6], v[1:2], v2, v[3:4] clamp ; encoding: [0x05,0x80,0xe5,0xd1,0x01,0x05,0x0e,0x04] +// NOCI: error: integer clamping is not supported on this GPU +// NOSI: error: invalid operand for instruction v_mqsad_u32_u8 v[252:255], v[1:2], v2, v[3:6] clamp -// NOSICI: error: // VI: v_mqsad_u32_u8 v[252:255], v[1:2], v2, v[3:6] clamp ; encoding: [0xfc,0x80,0xe7,0xd1,0x01,0x05,0x0e,0x04] +// NOCI: error: integer clamping is not supported on this GPU +// NOSI: error: invalid operand for instruction v_mad_u16 v5, v1, v2, v3 clamp -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // VI: v_mad_u16 v5, v1, v2, v3 clamp ; encoding: [0x05,0x80,0xeb,0xd1,0x01,0x05,0x0e,0x04] v_mad_i16 v5, v1, v2, v3 clamp -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // VI: v_mad_i16 v5, v1, v2, v3 clamp ; encoding: [0x05,0x80,0xec,0xd1,0x01,0x05,0x0e,0x04] // diff --git a/llvm/test/MC/AMDGPU/vop3p-err.s b/llvm/test/MC/AMDGPU/vop3p-err.s index 9dfd28a4b9f9..614a348ae133 100644 --- a/llvm/test/MC/AMDGPU/vop3p-err.s +++ b/llvm/test/MC/AMDGPU/vop3p-err.s @@ -1,4 +1,4 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX9 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefix=GFX9 --implicit-check-not=error: %s // GFX9: 25: error: invalid operand for instruction v_pk_add_u16 v1, v2, v3 op_sel @@ -15,7 +15,7 @@ v_pk_add_u16 v1, v2, v3 op_sel:[] // GFX9: 33: error: unknown token in expression v_pk_add_u16 v1, v2, v3 op_sel:[,] -// XXGFX9: 34: error: failed parsing operand. +// FIXME: Should trigger an error. // v_pk_add_u16 v1, v2, v3 op_sel:[0] // GFX9: 35: error: expected a comma @@ -51,14 +51,14 @@ v_pk_add_u16 v1, v2, v3 op_sel:[0,-1] // GFX9: 40: error: expected a closing square bracket v_pk_add_u16 v1, v2, v3 op_sel:[0,0,0,0,0] -// XXGFX9: invalid operand for instruction +// FIXME: should trigger an error v_pk_add_u16 v1, v2, v3 neg_lo:[0,0] // // Regular modifiers on packed instructions // -// FIXME: should be invalid operand for instruction +// FIXME: should be "invalid operand for instruction" // GFX9: :18: error: not a valid operand. v_pk_add_f16 v1, |v2|, v3 @@ -87,5 +87,5 @@ v_pk_add_u16 v1, -v2, v3 // Constant bus restrictions // -// GFX9: invalid operand (violates constant bus restrictions) +// GFX9: error: invalid operand (violates constant bus restrictions) v_pk_add_f16 v255, s1, s2 diff --git a/llvm/test/MC/AMDGPU/vop_dpp.s b/llvm/test/MC/AMDGPU/vop_dpp.s index c059b80fd6de..e0dfc255a89a 100644 --- a/llvm/test/MC/AMDGPU/vop_dpp.s +++ b/llvm/test/MC/AMDGPU/vop_dpp.s @@ -1,61 +1,61 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=VI --check-prefix=VI9 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=GFX9 --check-prefix=VI9 -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOVI -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGFX9 +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck %s --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck %s --check-prefix=NOVI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck %s --check-prefix=NOGFX9 --implicit-check-not=error: //===----------------------------------------------------------------------===// // Check dpp_ctrl values //===----------------------------------------------------------------------===// -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mov_b32_dpp v0, v0 quad_perm:[0,2,1,1] row_mask:0xf bank_mask:0xf ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x58,0x00,0xff] v_mov_b32 v0, v0 quad_perm:[0,2,1,1] -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mov_b32_dpp v0, v0 row_shl:1 row_mask:0xf bank_mask:0xf ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x01,0x01,0xff] v_mov_b32 v0, v0 row_shl:1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mov_b32_dpp v0, v0 row_shr:15 row_mask:0xf bank_mask:0xf ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x1f,0x01,0xff] v_mov_b32 v0, v0 row_shr:0xf -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mov_b32_dpp v0, v0 row_ror:12 row_mask:0xf bank_mask:0xf ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x2c,0x01,0xff] v_mov_b32 v0, v0 row_ror:0xc -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mov_b32_dpp v0, v0 wave_shl:1 row_mask:0xf bank_mask:0xf ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x30,0x01,0xff] v_mov_b32 v0, v0 wave_shl:1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mov_b32_dpp v0, v0 wave_rol:1 row_mask:0xf bank_mask:0xf ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x34,0x01,0xff] v_mov_b32 v0, v0 wave_rol:1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mov_b32_dpp v0, v0 wave_shr:1 row_mask:0xf bank_mask:0xf ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x38,0x01,0xff] v_mov_b32 v0, v0 wave_shr:1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mov_b32_dpp v0, v0 wave_ror:1 row_mask:0xf bank_mask:0xf ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x3c,0x01,0xff] v_mov_b32 v0, v0 wave_ror:1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // VI9: v_mov_b32_dpp v0, v0 row_mirror row_mask:0xf bank_mask:0xf ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x40,0x01,0xff] v_mov_b32 v0, v0 row_mirror -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // VI9: v_mov_b32_dpp v0, v0 row_half_mirror row_mask:0xf bank_mask:0xf ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x41,0x01,0xff] v_mov_b32 v0, v0 row_half_mirror -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mov_b32_dpp v0, v0 row_bcast:15 row_mask:0xf bank_mask:0xf ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x42,0x01,0xff] v_mov_b32 v0, v0 row_bcast:15 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mov_b32_dpp v0, v0 row_bcast:31 row_mask:0xf bank_mask:0xf ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x43,0x01,0xff] v_mov_b32 v0, v0 row_bcast:31 @@ -63,31 +63,31 @@ v_mov_b32 v0, v0 row_bcast:31 // Check optional fields //===----------------------------------------------------------------------===// -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mov_b32_dpp v0, v0 quad_perm:[1,3,0,1] row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x4d,0x08,0xa1] v_mov_b32 v0, v0 quad_perm:[1,3,0,1] row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mov_b32_dpp v0, v0 quad_perm:[1,3,0,1] row_mask:0xa bank_mask:0xf ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x4d,0x00,0xaf] v_mov_b32 v0, v0 quad_perm:[1,3,0,1] row_mask:0xa -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mov_b32_dpp v0, v0 quad_perm:[1,3,0,1] row_mask:0xf bank_mask:0x1 ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x4d,0x00,0xf1] v_mov_b32 v0, v0 quad_perm:[1,3,0,1] bank_mask:0x1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mov_b32_dpp v0, v0 quad_perm:[1,3,0,1] row_mask:0xf bank_mask:0xf bound_ctrl:0 ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x4d,0x08,0xff] v_mov_b32 v0, v0 quad_perm:[1,3,0,1] bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mov_b32_dpp v0, v0 quad_perm:[1,3,0,1] row_mask:0xa bank_mask:0x1 ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x4d,0x00,0xa1] v_mov_b32 v0, v0 quad_perm:[1,3,0,1] row_mask:0xa bank_mask:0x1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mov_b32_dpp v0, v0 quad_perm:[1,3,0,1] row_mask:0xa bank_mask:0xf bound_ctrl:0 ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x4d,0x08,0xaf] v_mov_b32 v0, v0 quad_perm:[1,3,0,1] row_mask:0xa bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mov_b32_dpp v0, v0 quad_perm:[1,3,0,1] row_mask:0xf bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x02,0x00,0x7e,0x00,0x4d,0x08,0xf1] v_mov_b32 v0, v0 quad_perm:[1,3,0,1] bank_mask:0x1 bound_ctrl:0 @@ -95,19 +95,19 @@ v_mov_b32 v0, v0 quad_perm:[1,3,0,1] bank_mask:0x1 bound_ctrl:0 // Check modifiers //===----------------------------------------------------------------------===// -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_add_f32_dpp v0, -v0, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x00,0x00,0x02,0x00,0x01,0x19,0xa1] v_add_f32 v0, -v0, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_add_f32_dpp v0, v0, |v0| row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x00,0x00,0x02,0x00,0x01,0x89,0xa1] v_add_f32 v0, v0, |v0| row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_add_f32_dpp v0, -v0, |v0| row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x00,0x00,0x02,0x00,0x01,0x99,0xa1] v_add_f32 v0, -v0, |v0| row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_add_f32_dpp v0, |v0|, -v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x00,0x00,0x02,0x00,0x01,0x69,0xa1] v_add_f32 v0, |v0|, -v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 @@ -115,242 +115,244 @@ v_add_f32 v0, |v0|, -v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 // Check VOP1 opcodes //===----------------------------------------------------------------------===// -// NOSICI: error: +// NOSICI: error: not a valid operand. +// NOGFX9: error: not a valid operand. +// NOVI: error: not a valid operand. v_nop row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cvt_u32_f32_dpp v0, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x0e,0x00,0x7e,0x00,0x01,0x09,0xa1] v_cvt_u32_f32 v0, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_fract_f32_dpp v0, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x36,0x00,0x7e,0x00,0x01,0x09,0xa1] v_fract_f32 v0, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_sin_f32_dpp v0, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x52,0x00,0x7e,0x00,0x01,0x09,0xa1] v_sin_f32 v0, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mov_b32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x02,0x02,0x7e,0x00,0x01,0x09,0xa1] v_mov_b32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cvt_f32_i32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x0a,0x02,0x7e,0x00,0x01,0x09,0xa1] v_cvt_f32_i32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cvt_f32_u32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x0c,0x02,0x7e,0x00,0x01,0x09,0xa1] v_cvt_f32_u32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cvt_i32_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x10,0x02,0x7e,0x00,0x01,0x09,0xa1] v_cvt_i32_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cvt_f16_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x14,0x02,0x7e,0x00,0x01,0x09,0xa1] v_cvt_f16_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cvt_f32_f16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x16,0x02,0x7e,0x00,0x01,0x09,0xa1] v_cvt_f32_f16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cvt_rpi_i32_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x18,0x02,0x7e,0x00,0x01,0x09,0xa1] v_cvt_rpi_i32_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cvt_flr_i32_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x1a,0x02,0x7e,0x00,0x01,0x09,0xa1] v_cvt_flr_i32_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cvt_off_f32_i4_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x1c,0x02,0x7e,0x00,0x01,0x09,0xa1] v_cvt_off_f32_i4 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cvt_f32_ubyte0_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x22,0x02,0x7e,0x00,0x01,0x09,0xa1] v_cvt_f32_ubyte0 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cvt_f32_ubyte1_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x24,0x02,0x7e,0x00,0x01,0x09,0xa1] v_cvt_f32_ubyte1 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cvt_f32_ubyte2_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x26,0x02,0x7e,0x00,0x01,0x09,0xa1] v_cvt_f32_ubyte2 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cvt_f32_ubyte3_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x28,0x02,0x7e,0x00,0x01,0x09,0xa1] v_cvt_f32_ubyte3 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_trunc_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x38,0x02,0x7e,0x00,0x01,0x09,0xa1] v_trunc_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_ceil_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x3a,0x02,0x7e,0x00,0x01,0x09,0xa1] v_ceil_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_rndne_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x3c,0x02,0x7e,0x00,0x01,0x09,0xa1] v_rndne_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_floor_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x3e,0x02,0x7e,0x00,0x01,0x09,0xa1] v_floor_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_exp_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x40,0x02,0x7e,0x00,0x01,0x09,0xa1] v_exp_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_log_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x42,0x02,0x7e,0x00,0x01,0x09,0xa1] v_log_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_rcp_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x44,0x02,0x7e,0x00,0x01,0x09,0xa1] v_rcp_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_rcp_iflag_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x46,0x02,0x7e,0x00,0x01,0x09,0xa1] v_rcp_iflag_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_rsq_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x48,0x02,0x7e,0x00,0x01,0x09,0xa1] v_rsq_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_sqrt_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x4e,0x02,0x7e,0x00,0x01,0x09,0xa1] v_sqrt_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cos_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x54,0x02,0x7e,0x00,0x01,0x09,0xa1] v_cos_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_not_b32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x56,0x02,0x7e,0x00,0x01,0x09,0xa1] v_not_b32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_bfrev_b32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x58,0x02,0x7e,0x00,0x01,0x09,0xa1] v_bfrev_b32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_ffbh_u32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x5a,0x02,0x7e,0x00,0x01,0x09,0xa1] v_ffbh_u32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_ffbl_b32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x5c,0x02,0x7e,0x00,0x01,0x09,0xa1] v_ffbl_b32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_ffbh_i32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x5e,0x02,0x7e,0x00,0x01,0x09,0xa1] v_ffbh_i32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_frexp_exp_i32_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x66,0x02,0x7e,0x00,0x01,0x09,0xa1] v_frexp_exp_i32_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_frexp_mant_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x68,0x02,0x7e,0x00,0x01,0x09,0xa1] v_frexp_mant_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_log_legacy_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x98,0x02,0x7e,0x00,0x01,0x09,0xa1] v_log_legacy_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_exp_legacy_f32_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x96,0x02,0x7e,0x00,0x01,0x09,0xa1] v_exp_legacy_f32 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cvt_f16_u16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x72,0x02,0x7e,0x00,0x01,0x09,0xa1] v_cvt_f16_u16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cvt_f16_i16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x74,0x02,0x7e,0x00,0x01,0x09,0xa1] v_cvt_f16_i16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cvt_u16_f16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x76,0x02,0x7e,0x00,0x01,0x09,0xa1] v_cvt_u16_f16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cvt_i16_f16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x78,0x02,0x7e,0x00,0x01,0x09,0xa1] v_cvt_i16_f16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_rcp_f16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x7a,0x02,0x7e,0x00,0x01,0x09,0xa1] v_rcp_f16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_sqrt_f16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x7c,0x02,0x7e,0x00,0x01,0x09,0xa1] v_sqrt_f16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_rsq_f16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x7e,0x02,0x7e,0x00,0x01,0x09,0xa1] v_rsq_f16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_log_f16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x80,0x02,0x7e,0x00,0x01,0x09,0xa1] v_log_f16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_exp_f16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x82,0x02,0x7e,0x00,0x01,0x09,0xa1] v_exp_f16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_frexp_mant_f16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x84,0x02,0x7e,0x00,0x01,0x09,0xa1] v_frexp_mant_f16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_frexp_exp_i16_f16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x86,0x02,0x7e,0x00,0x01,0x09,0xa1] v_frexp_exp_i16_f16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_floor_f16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x88,0x02,0x7e,0x00,0x01,0x09,0xa1] v_floor_f16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_ceil_f16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x8a,0x02,0x7e,0x00,0x01,0x09,0xa1] v_ceil_f16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_trunc_f16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x8c,0x02,0x7e,0x00,0x01,0x09,0xa1] v_trunc_f16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_rndne_f16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x8e,0x02,0x7e,0x00,0x01,0x09,0xa1] v_rndne_f16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_fract_f16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x90,0x02,0x7e,0x00,0x01,0x09,0xa1] v_fract_f16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_sin_f16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x92,0x02,0x7e,0x00,0x01,0x09,0xa1] v_sin_f16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_cos_f16_dpp v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x94,0x02,0x7e,0x00,0x01,0x09,0xa1] v_cos_f16 v1, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 // GFX9: v_cvt_norm_i16_f16_dpp v5, |v1| quad_perm:[0,1,2,3] row_mask:0x0 bank_mask:0x0 ; encoding: [0xfa,0x9a,0x0a,0x7e,0x01,0xe4,0x20,0x00] -// NOSICI: error -// NOVI: error +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. v_cvt_norm_i16_f16_dpp v5, |v1| quad_perm:[0,1,2,3] row_mask:0x0 bank_mask:0x0 // GFX9: v_cvt_norm_u16_f16_dpp v5, v1 quad_perm:[3,2,1,0] row_mask:0x0 bank_mask:0x0 ; encoding: [0xfa,0x9c,0x0a,0x7e,0x01,0x1b,0x00,0x00] -// NOSICI: error -// NOVI: error +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. v_cvt_norm_u16_f16_dpp v5, v1 quad_perm:[3,2,1,0] row_mask:0x0 bank_mask:0x0 // GFX9: v_sat_pk_u8_i16_dpp v5, v1 row_ror:15 row_mask:0x0 bank_mask:0x0 ; encoding: [0xfa,0x9e,0x0a,0x7e,0x01,0x2f,0x01,0x00] -// NOSICI: error -// NOVI: error +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. v_sat_pk_u8_i16_dpp v5, v1 row_ror:15 row_mask:0x0 bank_mask:0x0 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. // GFX9: v_screen_partition_4se_b32_dpp v5, v1 quad_perm:[0,1,2,3] row_mask:0x0 bank_mask:0x0 bound_ctrl:0 ; encoding: [0xfa,0x6e,0x0a,0x7e,0x01,0xe4,0x08,0x00] v_screen_partition_4se_b32_dpp v5, v1 quad_perm:[0,1,2,3] row_mask:0x0 bank_mask:0x0 bound_ctrl:0 @@ -359,239 +361,239 @@ v_screen_partition_4se_b32_dpp v5, v1 quad_perm:[0,1,2,3] row_mask:0x0 bank_mask //===----------------------------------------------------------------------===// // ToDo: VOP2bInst instructions: v_add_u32, v_sub_u32 ... (vcc and ApplyMnemonic in AsmMatcherEmitter.cpp) -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mac_f32_dpp v0, v0, v0 row_shl:1 row_mask:0xf bank_mask:0xf ; encoding: [0xfa,0x00,0x00,0x2c,0x00,0x01,0x01,0xff] v_mac_f32 v0, v0, v0 row_shl:1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mac_f32_dpp v0, v0, v0 row_shr:15 row_mask:0xf bank_mask:0xf ; encoding: [0xfa,0x00,0x00,0x2c,0x00,0x1f,0x01,0xff] v_mac_f32 v0, v0, v0 row_shr:0xf -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mac_f32_dpp v0, v0, v0 quad_perm:[1,3,0,1] row_mask:0xa bank_mask:0xf bound_ctrl:0 ; encoding: [0xfa,0x00,0x00,0x2c,0x00,0x4d,0x08,0xaf] v_mac_f32 v0, v0, v0 quad_perm:[1,3,0,1] row_mask:0xa bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_add_f32_dpp v0, v0, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x00,0x00,0x02,0x00,0x01,0x09,0xa1] v_add_f32 v0, v0, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_min_f32_dpp v0, v0, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x00,0x00,0x14,0x00,0x01,0x09,0xa1] v_min_f32 v0, v0, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_and_b32_dpp v0, v0, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x00,0x00,0x26,0x00,0x01,0x09,0xa1] v_and_b32 v0, v0, v0 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mul_i32_i24_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x0c,0x02,0x01,0x09,0xa1] v_mul_i32_i24 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_sub_f32_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x04,0x02,0x01,0x09,0xa1] v_sub_f32 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_subrev_f32_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x06,0x02,0x01,0x09,0xa1] v_subrev_f32 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mul_f32_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x0a,0x02,0x01,0x09,0xa1] v_mul_f32 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mul_hi_i32_i24_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x0e,0x02,0x01,0x09,0xa1] v_mul_hi_i32_i24 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mul_u32_u24_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x10,0x02,0x01,0x09,0xa1] v_mul_u32_u24 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mul_hi_u32_u24_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x12,0x02,0x01,0x09,0xa1] v_mul_hi_u32_u24 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_max_f32_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x16,0x02,0x01,0x09,0xa1] v_max_f32 v1, v2 v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_min_i32_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x18,0x02,0x01,0x09,0xa1] v_min_i32 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_max_i32_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x1a,0x02,0x01,0x09,0xa1] v_max_i32 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_min_u32_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x1c,0x02,0x01,0x09,0xa1] v_min_u32 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_max_u32_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x1e,0x02,0x01,0x09,0xa1] v_max_u32 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_lshrrev_b32_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x20,0x02,0x01,0x09,0xa1] v_lshrrev_b32 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_ashrrev_i32_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x22,0x02,0x01,0x09,0xa1] v_ashrrev_i32 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_lshlrev_b32_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x24,0x02,0x01,0x09,0xa1] v_lshlrev_b32 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_or_b32_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x28,0x02,0x01,0x09,0xa1] v_or_b32 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_xor_b32_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x2a,0x02,0x01,0x09,0xa1] v_xor_b32 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_add_f16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x3e,0x02,0x01,0x09,0xa1] v_add_f16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_sub_f16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x40,0x02,0x01,0x09,0xa1] v_sub_f16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_subrev_f16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x42,0x02,0x01,0x09,0xa1] v_subrev_f16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mul_f16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x44,0x02,0x01,0x09,0xa1] v_mul_f16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mac_f16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x46,0x02,0x01,0x09,0xa1] v_mac_f16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_add_u16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x4c,0x02,0x01,0x09,0xa1] v_add_u16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_sub_u16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x4e,0x02,0x01,0x09,0xa1] v_sub_u16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_subrev_u16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x50,0x02,0x01,0x09,0xa1] v_subrev_u16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_mul_lo_u16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x52,0x02,0x01,0x09,0xa1] v_mul_lo_u16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_lshlrev_b16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x54,0x02,0x01,0x09,0xa1] v_lshlrev_b16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_lshrrev_b16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x56,0x02,0x01,0x09,0xa1] v_lshrrev_b16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_ashrrev_i16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x58,0x02,0x01,0x09,0xa1] v_ashrrev_i16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_max_f16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x5a,0x02,0x01,0x09,0xa1] v_max_f16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_min_f16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x5c,0x02,0x01,0x09,0xa1] v_min_f16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_max_u16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x5e,0x02,0x01,0x09,0xa1] v_max_u16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_max_i16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x60,0x02,0x01,0x09,0xa1] v_max_i16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_min_u16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x62,0x02,0x01,0x09,0xa1] v_min_u16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_min_i16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x64,0x02,0x01,0x09,0xa1] v_min_i16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI9: v_ldexp_f16_dpp v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x66,0x02,0x01,0x09,0xa1] v_ldexp_f16 v1, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: -// NOGFX9: error: +// NOSICI: error: not a valid operand. +// NOGFX9: error: not a valid operand. // VI: v_add_u32_dpp v1, vcc, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x32,0x02,0x01,0x09,0xa1] v_add_u32 v1, vcc, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: -// NOGFX9: error: +// NOSICI: error: not a valid operand. +// NOGFX9: error: not a valid operand. // VI: v_sub_u32_dpp v1, vcc, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x34,0x02,0x01,0x09,0xa1] v_sub_u32 v1, vcc, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: -// NOGFX9: error: +// NOSICI: error: not a valid operand. +// NOGFX9: error: not a valid operand. // VI: v_subrev_u32_dpp v1, vcc, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x36,0x02,0x01,0x09,0xa1] v_subrev_u32 v1, vcc, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: -// NOGFX9: error: +// NOSICI: error: not a valid operand. +// NOGFX9: error: not a valid operand. // VI: v_addc_u32_dpp v1, vcc, v2, v3, vcc row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x38,0x02,0x01,0x09,0xa1] v_addc_u32 v1, vcc, v2, v3, vcc row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: -// NOGFX9: error: +// NOSICI: error: not a valid operand. +// NOGFX9: error: not a valid operand. // VI: v_subb_u32_dpp v1, vcc, v2, v3, vcc row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x3a,0x02,0x01,0x09,0xa1] v_subb_u32 v1, vcc, v2, v3, vcc row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: -// NOGFX9: error: +// NOSICI: error: not a valid operand. +// NOGFX9: error: not a valid operand. // VI: v_subbrev_u32_dpp v1, vcc, v2, v3, vcc row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x3c,0x02,0x01,0x09,0xa1] v_subbrev_u32 v1, vcc, v2, v3, vcc row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. // GFX9: v_add_co_u32_dpp v1, vcc, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x32,0x02,0x01,0x09,0xa1] v_add_co_u32 v1, vcc, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. // GFX9: v_sub_co_u32_dpp v1, vcc, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x34,0x02,0x01,0x09,0xa1] v_sub_co_u32 v1, vcc, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. // GFX9: v_subrev_co_u32_dpp v1, vcc, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x36,0x02,0x01,0x09,0xa1] v_subrev_co_u32 v1, vcc, v2, v3 row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. // GFX9: v_addc_co_u32_dpp v1, vcc, v2, v3, vcc row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x38,0x02,0x01,0x09,0xa1] v_addc_co_u32 v1, vcc, v2, v3, vcc row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. // GFX9: v_subb_co_u32_dpp v1, vcc, v2, v3, vcc row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x3a,0x02,0x01,0x09,0xa1] v_subb_co_u32 v1, vcc, v2, v3, vcc row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. // GFX9: v_subbrev_co_u32_dpp v1, vcc, v2, v3, vcc row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 ; encoding: [0xfa,0x06,0x02,0x3c,0x02,0x01,0x09,0xa1] v_subbrev_co_u32 v1, vcc, v2, v3, vcc row_shl:1 row_mask:0xa bank_mask:0x1 bound_ctrl:0 -// NOSICI: error +// NOSICI: error: not a valid operand. // VI9: v_cndmask_b32_dpp v5, v1, v2, vcc quad_perm:[0,1,2,3] row_mask:0x0 bank_mask:0x0 ; encoding: [0xfa,0x04,0x0a,0x00,0x01,0xe4,0x00,0x00] v_cndmask_b32_dpp v5, v1, v2, vcc quad_perm:[0,1,2,3] row_mask:0x0 bank_mask:0x0 -// NOSICI: error +// NOSICI: error: not a valid operand. // VI9: v_cndmask_b32_dpp v5, v1, v2, vcc row_shl:15 row_mask:0x0 bank_mask:0x0 ; encoding: [0xfa,0x04,0x0a,0x00,0x01,0x0f,0x01,0x00] v_cndmask_b32_dpp v5, v1, v2, vcc row_shl:15 row_mask:0x0 bank_mask:0x0 diff --git a/llvm/test/MC/AMDGPU/vop_sdwa.s b/llvm/test/MC/AMDGPU/vop_sdwa.s index a0c71253df81..88386e046917 100644 --- a/llvm/test/MC/AMDGPU/vop_sdwa.s +++ b/llvm/test/MC/AMDGPU/vop_sdwa.s @@ -1,41 +1,41 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=VI --check-prefix=GFX89 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=GFX9 --check-prefix=GFX89 -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOVI --check-prefix=NOGFX89 -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGFX9 --check-prefix=NOGFX89 +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck %s --check-prefixes=NOCI,NOSICI --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck %s --check-prefix=NOVI --check-prefix=NOGFX89 --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck %s --check-prefix=NOGFX9 --check-prefix=NOGFX89 --implicit-check-not=error: //---------------------------------------------------------------------------// // Check SDWA operands //---------------------------------------------------------------------------// -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_mov_b32_sdwa v1, v2 dst_sel:BYTE_0 dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x02,0x02,0x7e,0x02,0x10,0x06,0x00] v_mov_b32 v1, v2 dst_sel:BYTE_0 dst_unused:UNUSED_PRESERVE src0_sel:DWORD -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_mov_b32_sdwa v3, v4 dst_sel:BYTE_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1 ; encoding: [0xf9,0x02,0x06,0x7e,0x04,0x11,0x05,0x00] v_mov_b32 v3, v4 dst_sel:BYTE_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_mov_b32_sdwa v15, v99 dst_sel:BYTE_2 dst_unused:UNUSED_SEXT src0_sel:WORD_0 ; encoding: [0xf9,0x02,0x1e,0x7e,0x63,0x0a,0x04,0x00] v_mov_b32 v15, v99 dst_sel:BYTE_2 dst_unused:UNUSED_SEXT src0_sel:WORD_0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_min_u32_sdwa v194, v13, v1 dst_sel:BYTE_3 dst_unused:UNUSED_SEXT src0_sel:BYTE_3 src1_sel:BYTE_2 ; encoding: [0xf9,0x02,0x84,0x1d,0x0d,0x0b,0x03,0x02] v_min_u32 v194, v13, v1 dst_sel:BYTE_3 dst_unused:UNUSED_SEXT src0_sel:BYTE_3 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_min_u32_sdwa v255, v4, v1 dst_sel:WORD_0 dst_unused:UNUSED_PAD src0_sel:BYTE_2 src1_sel:WORD_1 ; encoding: [0xf9,0x02,0xfe,0x1d,0x04,0x04,0x02,0x05] v_min_u32 v255, v4, v1 dst_sel:WORD_0 dst_unused:UNUSED_PAD src0_sel:BYTE_2 src1_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_min_u32_sdwa v200, v200, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:BYTE_1 src1_sel:DWORD ; encoding: [0xf9,0x02,0x90,0x1d,0xc8,0x05,0x01,0x06] v_min_u32 v200, v200, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:BYTE_1 src1_sel:DWORD -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_min_u32_sdwa v1, v1, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD ; encoding: [0xf9,0x02,0x02,0x1c,0x01,0x06,0x00,0x06] v_min_u32 v1, v1, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_sel:DWORD @@ -43,43 +43,43 @@ v_min_u32 v1, v1, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0 src1_se // Check optional operands //---------------------------------------------------------------------------// -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_cvt_u32_f32_sdwa v0, v0 clamp dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x0e,0x00,0x7e,0x00,0x36,0x06,0x00] v_cvt_u32_f32 v0, v0 clamp dst_sel:DWORD -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_fract_f32_sdwa v0, v0 clamp dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD ; encoding: [0xf9,0x36,0x00,0x7e,0x00,0x26,0x06,0x00] v_fract_f32 v0, v0 clamp dst_sel:DWORD dst_unused:UNUSED_PAD -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_sin_f32_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x52,0x00,0x7e,0x00,0x06,0x05,0x00] v_sin_f32 v0, v0 dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_mov_b32_sdwa v1, v0 clamp dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:WORD_1 ; encoding: [0xf9,0x02,0x02,0x7e,0x00,0x36,0x05,0x00] v_mov_b32 v1, v0 clamp src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_trunc_f32_sdwa v1, v0 clamp dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:WORD_1 ; encoding: [0xf9,0x38,0x02,0x7e,0x00,0x36,0x05,0x00] v_trunc_f32 v1, v0 clamp dst_sel:DWORD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_mov_b32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x02,0x02,0x7e,0x00,0x16,0x06,0x00] v_mov_b32_sdwa v1, v0 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_add_f32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD ; encoding: [0xf9,0x00,0x00,0x02,0x00,0x06,0x05,0x06] v_add_f32_sdwa v0, v0, v0 dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_min_f32_sdwa v0, v0, v0 clamp dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:BYTE_2 ; encoding: [0xf9,0x00,0x00,0x14,0x00,0x36,0x06,0x02] v_min_f32 v0, v0, v0 clamp dst_sel:DWORD src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_2 ; encoding: [0xf9,0x00,0x00,0x26,0x00,0x06,0x06,0x02] v_and_b32 v0, v0, v0 dst_unused:UNUSED_PAD src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_mul_i32_i24_sdwa v1, v2, v3 clamp dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x06,0x02,0x0c,0x02,0x36,0x06,0x06] v_mul_i32_i24_sdwa v1, v2, v3 clamp @@ -87,31 +87,31 @@ v_mul_i32_i24_sdwa v1, v2, v3 clamp // Check modifiers //===----------------------------------------------------------------------===// -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_fract_f32_sdwa v0, |v0| dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x36,0x00,0x7e,0x00,0x06,0x25,0x00] v_fract_f32 v0, |v0| dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_sin_f32_sdwa v0, -|v0| dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x52,0x00,0x7e,0x00,0x06,0x35,0x00] v_sin_f32 v0, -abs(v0) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_add_f32_sdwa v0, -|v0|, -v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x00,0x00,0x02,0x00,0x06,0x35,0x12] v_add_f32 v0, -|v0|, -v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_min_f32_sdwa v0, |v0|, -v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x00,0x00,0x14,0x00,0x06,0x25,0x12] v_min_f32 v0, abs(v0), -v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_mov_b32_sdwa v1, sext(v0) dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x02,0x02,0x7e,0x00,0x16,0x0e,0x00] v_mov_b32_sdwa v1, sext(v0) -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_and_b32_sdwa v0, sext(v0), sext(v0) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_2 ; encoding: [0xf9,0x00,0x00,0x26,0x00,0x06,0x0e,0x0a] v_and_b32 v0, sext(v0), sext(v0) dst_unused:UNUSED_PAD src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI: v_cmp_class_f32 vcc, -v1, sext(v2) src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x20,0x7c,0x01,0x00,0x12,0x0c] // GFX9: v_cmp_class_f32_sdwa vcc, -v1, sext(v2) src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x20,0x7c,0x01,0x00,0x12,0x0c] v_cmp_class_f32_sdwa vcc, -v1, sext(v2) src0_sel:BYTE_2 src1_sel:WORD_0 @@ -120,477 +120,479 @@ v_cmp_class_f32_sdwa vcc, -v1, sext(v2) src0_sel:BYTE_2 src1_sel:WORD_0 // Check VOP1 opcodes //===----------------------------------------------------------------------===// -// NOSICI: error: +// NOSICI: error: instruction not supported on this GPU // GFX89: v_nop ; encoding: [0xf9,0x00,0x00,0x7e,0x00,0x00,0x00,0x00] v_nop_sdwa -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_cvt_u32_f32_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x0e,0x00,0x7e,0x00,0x06,0x05,0x00] v_cvt_u32_f32 v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_fract_f32_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x36,0x00,0x7e,0x00,0x06,0x05,0x00] v_fract_f32 v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_sin_f32_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x52,0x00,0x7e,0x00,0x06,0x05,0x00] v_sin_f32 v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_mov_b32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x02,0x02,0x7e,0x00,0x06,0x05,0x00] v_mov_b32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_cvt_f32_i32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x0a,0x02,0x7e,0x00,0x06,0x05,0x00] v_cvt_f32_i32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_cvt_f32_u32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x0c,0x02,0x7e,0x00,0x06,0x05,0x00] v_cvt_f32_u32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_cvt_i32_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x10,0x02,0x7e,0x00,0x06,0x05,0x00] v_cvt_i32_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_cvt_f16_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x14,0x02,0x7e,0x00,0x06,0x05,0x00] v_cvt_f16_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_cvt_f32_f16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x16,0x02,0x7e,0x00,0x06,0x05,0x00] v_cvt_f32_f16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_cvt_rpi_i32_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x18,0x02,0x7e,0x00,0x06,0x05,0x00] v_cvt_rpi_i32_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_cvt_flr_i32_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x1a,0x02,0x7e,0x00,0x06,0x05,0x00] v_cvt_flr_i32_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_cvt_off_f32_i4_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x1c,0x02,0x7e,0x00,0x06,0x05,0x00] v_cvt_off_f32_i4 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_cvt_f32_ubyte0_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x22,0x02,0x7e,0x00,0x06,0x05,0x00] v_cvt_f32_ubyte0 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_cvt_f32_ubyte1_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x24,0x02,0x7e,0x00,0x06,0x05,0x00] v_cvt_f32_ubyte1 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_cvt_f32_ubyte2_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x26,0x02,0x7e,0x00,0x06,0x05,0x00] v_cvt_f32_ubyte2 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_cvt_f32_ubyte3_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x28,0x02,0x7e,0x00,0x06,0x05,0x00] v_cvt_f32_ubyte3 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_trunc_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x38,0x02,0x7e,0x00,0x06,0x05,0x00] v_trunc_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_ceil_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x3a,0x02,0x7e,0x00,0x06,0x05,0x00] v_ceil_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_rndne_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x3c,0x02,0x7e,0x00,0x06,0x05,0x00] v_rndne_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_floor_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x3e,0x02,0x7e,0x00,0x06,0x05,0x00] v_floor_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_exp_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x40,0x02,0x7e,0x00,0x06,0x05,0x00] v_exp_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_log_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x42,0x02,0x7e,0x00,0x06,0x05,0x00] v_log_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_rcp_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x44,0x02,0x7e,0x00,0x06,0x05,0x00] v_rcp_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_rcp_iflag_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x46,0x02,0x7e,0x00,0x06,0x05,0x00] v_rcp_iflag_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_rsq_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x48,0x02,0x7e,0x00,0x06,0x05,0x00] v_rsq_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_sqrt_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x4e,0x02,0x7e,0x00,0x06,0x05,0x00] v_sqrt_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_cos_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x54,0x02,0x7e,0x00,0x06,0x05,0x00] v_cos_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_not_b32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x56,0x02,0x7e,0x00,0x06,0x05,0x00] v_not_b32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_bfrev_b32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x58,0x02,0x7e,0x00,0x06,0x05,0x00] v_bfrev_b32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_ffbh_u32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x5a,0x02,0x7e,0x00,0x06,0x05,0x00] v_ffbh_u32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_ffbl_b32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x5c,0x02,0x7e,0x00,0x06,0x05,0x00] v_ffbl_b32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_ffbh_i32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x5e,0x02,0x7e,0x00,0x06,0x05,0x00] v_ffbh_i32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_frexp_exp_i32_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x66,0x02,0x7e,0x00,0x06,0x05,0x00] v_frexp_exp_i32_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_frexp_mant_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x68,0x02,0x7e,0x00,0x06,0x05,0x00] v_frexp_mant_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: // GFX89: v_log_legacy_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x98,0x02,0x7e,0x00,0x06,0x05,0x00] +// NOSI: error: not a valid operand. +// NOCI: error: invalid operand for instruction v_log_legacy_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: // GFX89: v_exp_legacy_f32_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x96,0x02,0x7e,0x00,0x06,0x05,0x00] +// NOSI: error: not a valid operand. +// NOCI: error: invalid operand for instruction v_exp_legacy_f32 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_cvt_f16_u16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x72,0x02,0x7e,0x00,0x06,0x05,0x00] v_cvt_f16_u16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_cvt_f16_i16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x74,0x02,0x7e,0x00,0x06,0x05,0x00] v_cvt_f16_i16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_cvt_u16_f16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x76,0x02,0x7e,0x00,0x06,0x05,0x00] v_cvt_u16_f16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_cvt_i16_f16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x78,0x02,0x7e,0x00,0x06,0x05,0x00] v_cvt_i16_f16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_rcp_f16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x7a,0x02,0x7e,0x00,0x06,0x05,0x00] v_rcp_f16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_sqrt_f16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x7c,0x02,0x7e,0x00,0x06,0x05,0x00] v_sqrt_f16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_rsq_f16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x7e,0x02,0x7e,0x00,0x06,0x05,0x00] v_rsq_f16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_log_f16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x80,0x02,0x7e,0x00,0x06,0x05,0x00] v_log_f16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_exp_f16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x82,0x02,0x7e,0x00,0x06,0x05,0x00] v_exp_f16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_frexp_mant_f16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x84,0x02,0x7e,0x00,0x06,0x05,0x00] v_frexp_mant_f16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_frexp_exp_i16_f16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x86,0x02,0x7e,0x00,0x06,0x05,0x00] v_frexp_exp_i16_f16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_floor_f16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x88,0x02,0x7e,0x00,0x06,0x05,0x00] v_floor_f16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_ceil_f16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x8a,0x02,0x7e,0x00,0x06,0x05,0x00] v_ceil_f16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_trunc_f16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x8c,0x02,0x7e,0x00,0x06,0x05,0x00] v_trunc_f16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_rndne_f16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x8e,0x02,0x7e,0x00,0x06,0x05,0x00] v_rndne_f16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_fract_f16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x90,0x02,0x7e,0x00,0x06,0x05,0x00] v_fract_f16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_sin_f16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x92,0x02,0x7e,0x00,0x06,0x05,0x00] v_sin_f16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_cos_f16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x94,0x02,0x7e,0x00,0x06,0x05,0x00] v_cos_f16 v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 // GFX9: v_cvt_norm_i16_f16_sdwa v5, -v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD ; encoding: [0xf9,0x9a,0x0a,0x7e,0x01,0x06,0x16,0x00] -// NOSICI: error -// NOVI: error +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. v_cvt_norm_i16_f16_sdwa v5, -v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD // GFX9: v_cvt_norm_i16_f16_sdwa v5, |v1| dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD ; encoding: [0xf9,0x9a,0x0a,0x7e,0x01,0x06,0x26,0x00] -// NOSICI: error -// NOVI: error +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. v_cvt_norm_i16_f16_sdwa v5, |v1| dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD // GFX9: v_cvt_norm_u16_f16_sdwa v5, v1 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x9c,0x0a,0x7e,0x01,0x16,0x06,0x00] -// NOSICI: error -// NOVI: error +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. v_cvt_norm_u16_f16_sdwa v5, v1 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD // GFX9: v_cvt_norm_u16_f16_sdwa v5, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 ; encoding: [0xf9,0x9c,0x0a,0x7e,0x01,0x06,0x05,0x00] -// NOSICI: error -// NOVI: error +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. v_cvt_norm_u16_f16_sdwa v5, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 // GFX9: v_sat_pk_u8_i16_sdwa v5, sext(v1) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD ; encoding: [0xf9,0x9e,0x0a,0x7e,0x01,0x06,0x0e,0x00] -// NOSICI: error -// NOVI: error +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. v_sat_pk_u8_i16_sdwa v5, sext(v1) dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD //===----------------------------------------------------------------------===// // Check VOP2 opcodes //===----------------------------------------------------------------------===// -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_add_f32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x00,0x00,0x02,0x00,0x06,0x05,0x02] v_add_f32 v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_min_f32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x00,0x00,0x14,0x00,0x06,0x05,0x02] v_min_f32 v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_and_b32_sdwa v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x00,0x00,0x26,0x00,0x06,0x05,0x02] v_and_b32 v0, v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_mul_i32_i24_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x0c,0x02,0x06,0x05,0x02] v_mul_i32_i24 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_sub_f32_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x04,0x02,0x06,0x05,0x02] v_sub_f32 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_subrev_f32_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x06,0x02,0x06,0x05,0x02] v_subrev_f32 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_mul_f32_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x0a,0x02,0x06,0x05,0x02] v_mul_f32 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_mul_hi_i32_i24_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x0e,0x02,0x06,0x05,0x02] v_mul_hi_i32_i24 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_mul_u32_u24_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x10,0x02,0x06,0x05,0x02] v_mul_u32_u24 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_mul_hi_u32_u24_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x12,0x02,0x06,0x05,0x02] v_mul_hi_u32_u24 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // GFX89: v_max_f32_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x16,0x02,0x06,0x05,0x02] v_max_f32 v1, v2 v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_min_i32_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x18,0x02,0x06,0x05,0x02] v_min_i32 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_max_i32_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x1a,0x02,0x06,0x05,0x02] v_max_i32 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_min_u32_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x1c,0x02,0x06,0x05,0x02] v_min_u32 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_max_u32_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x1e,0x02,0x06,0x05,0x02] v_max_u32 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_lshrrev_b32_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x20,0x02,0x06,0x05,0x02] v_lshrrev_b32 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_ashrrev_i32_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x22,0x02,0x06,0x05,0x02] v_ashrrev_i32 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_lshlrev_b32_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x24,0x02,0x06,0x05,0x02] v_lshlrev_b32 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_or_b32_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x28,0x02,0x06,0x05,0x02] v_or_b32 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_xor_b32_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x2a,0x02,0x06,0x05,0x02] v_xor_b32 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_add_f16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x3e,0x02,0x06,0x05,0x02] v_add_f16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_sub_f16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x40,0x02,0x06,0x05,0x02] v_sub_f16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_subrev_f16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x42,0x02,0x06,0x05,0x02] v_subrev_f16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_mul_f16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x44,0x02,0x06,0x05,0x02] v_mul_f16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_add_u16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x4c,0x02,0x06,0x05,0x02] v_add_u16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_sub_u16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x4e,0x02,0x06,0x05,0x02] v_sub_u16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_subrev_u16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x50,0x02,0x06,0x05,0x02] v_subrev_u16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_mul_lo_u16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x52,0x02,0x06,0x05,0x02] v_mul_lo_u16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_lshlrev_b16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x54,0x02,0x06,0x05,0x02] v_lshlrev_b16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_lshrrev_b16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x56,0x02,0x06,0x05,0x02] v_lshrrev_b16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_ashrrev_i16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x58,0x02,0x06,0x05,0x02] v_ashrrev_i16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_max_f16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x5a,0x02,0x06,0x05,0x02] v_max_f16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_min_f16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x5c,0x02,0x06,0x05,0x02] v_min_f16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_max_u16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x5e,0x02,0x06,0x05,0x02] v_max_u16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_max_i16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x60,0x02,0x06,0x05,0x02] v_max_i16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_min_u16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x62,0x02,0x06,0x05,0x02] v_min_u16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_min_i16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x64,0x02,0x06,0x05,0x02] v_min_i16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // GFX89: v_ldexp_f16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x66,0x02,0x06,0x05,0x02] v_ldexp_f16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOGFX9: error: +// NOSICI: error: not a valid operand. +// NOGFX9: error: instruction not supported on this GPU // VI: v_add_u32_sdwa v1, vcc, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x32,0x02,0x06,0x05,0x02] v_add_u32_sdwa v1, vcc, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOGFX9: error: +// NOSICI: error: not a valid operand. +// NOGFX9: error: instruction not supported on this GPU // VI: v_sub_u32_sdwa v1, vcc, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x34,0x02,0x06,0x05,0x02] v_sub_u32_sdwa v1, vcc, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOGFX9: error: +// NOSICI: error: not a valid operand. +// NOGFX9: error: instruction not supported on this GPU // VI: v_subrev_u32_sdwa v1, vcc, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x36,0x02,0x06,0x05,0x02] v_subrev_u32_sdwa v1, vcc, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOGFX9: error: +// NOSICI: error: invalid operand for instruction +// NOGFX9: error: not a valid operand. // VI: v_addc_u32_sdwa v1, vcc, v2, v3, vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x38,0x02,0x06,0x05,0x02] v_addc_u32_sdwa v1, vcc, v2, v3, vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOGFX9: error: +// NOSICI: error: invalid operand for instruction +// NOGFX9: error: not a valid operand. // VI: v_subb_u32_sdwa v1, vcc, v2, v3, vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x3a,0x02,0x06,0x05,0x02] v_subb_u32_sdwa v1, vcc, v2, v3, vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOGFX9: error: +// NOSICI: error: invalid operand for instruction +// NOGFX9: error: not a valid operand. // VI: v_subbrev_u32_sdwa v1, vcc, v2, v3, vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x3c,0x02,0x06,0x05,0x02] v_subbrev_u32_sdwa v1, vcc, v2, v3, vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: not a valid operand. // GFX9: v_add_co_u32_sdwa v1, vcc, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x32,0x02,0x06,0x05,0x02] v_add_co_u32_sdwa v1, vcc, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: not a valid operand. // GFX9: v_sub_co_u32_sdwa v1, vcc, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x34,0x02,0x06,0x05,0x02] v_sub_co_u32_sdwa v1, vcc, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: not a valid operand. // GFX9: v_subrev_co_u32_sdwa v1, vcc, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x36,0x02,0x06,0x05,0x02] v_subrev_co_u32_sdwa v1, vcc, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. // GFX9: v_addc_co_u32_sdwa v1, vcc, v2, v3, vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x38,0x02,0x06,0x05,0x02] v_addc_co_u32_sdwa v1, vcc, v2, v3, vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. // GFX9: v_subb_co_u32_sdwa v1, vcc, v2, v3, vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x3a,0x02,0x06,0x05,0x02] v_subb_co_u32_sdwa v1, vcc, v2, v3, vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. // GFX9: v_subbrev_co_u32_sdwa v1, vcc, v2, v3, vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x3c,0x02,0x06,0x05,0x02] v_subbrev_co_u32_sdwa v1, vcc, v2, v3, vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error +// NOSICI: error: not a valid operand. // GFX89: v_cndmask_b32_sdwa v5, v1, v2, vcc dst_sel:BYTE_0 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x0a,0x00,0x01,0x00,0x06,0x06] v_cndmask_b32_sdwa v5, v1, v2, vcc dst_sel:BYTE_0 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD -// NOSICI: error -// NOVI: error +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_cndmask_b32_sdwa v5, -1, v2, vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x0a,0x00,0xc1,0x06,0x86,0x06] v_cndmask_b32_sdwa v5, -1, v2, vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD -// NOSICI: error +// NOSICI: error: not a valid operand. // GFX89: v_cndmask_b32_sdwa v5, v1, sext(v2), vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x0a,0x00,0x01,0x06,0x06,0x0e] v_cndmask_b32_sdwa v5, v1, sext(v2), vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD @@ -603,72 +605,72 @@ v_cndmask_b32_sdwa v5, vcc_lo, v2, vcc dst_sel:DWORD dst_unused:UNUSED_PRESERVE // Check VOPC opcodes //===----------------------------------------------------------------------===// -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // VI: v_cmp_eq_f32 vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x84,0x7c,0x01,0x00,0x02,0x04] // GFX9: v_cmp_eq_f32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x84,0x7c,0x01,0x00,0x02,0x04] v_cmp_eq_f32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // VI: v_cmp_nle_f32 vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x98,0x7c,0x01,0x00,0x02,0x04] // GFX9: v_cmp_nle_f32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x98,0x7c,0x01,0x00,0x02,0x04] v_cmp_nle_f32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // VI: v_cmpx_gt_f32 vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0xa8,0x7c,0x01,0x00,0x02,0x04] // GFX9: v_cmpx_gt_f32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0xa8,0x7c,0x01,0x00,0x02,0x04] v_cmpx_gt_f32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // VI: v_cmpx_nlt_f32 vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0xbc,0x7c,0x01,0x00,0x02,0x04] // GFX9: v_cmpx_nlt_f32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0xbc,0x7c,0x01,0x00,0x02,0x04] v_cmpx_nlt_f32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI: v_cmp_lt_i32 vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x82,0x7d,0x01,0x00,0x02,0x04] // GFX9: v_cmp_lt_i32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x82,0x7d,0x01,0x00,0x02,0x04] v_cmp_lt_i32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI: v_cmp_t_i32 vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x8e,0x7d,0x01,0x00,0x02,0x04] // GFX9: v_cmp_t_i32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x8e,0x7d,0x01,0x00,0x02,0x04] v_cmp_t_i32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI: v_cmpx_eq_i32 vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0xa4,0x7d,0x01,0x00,0x02,0x04] // GFX9: v_cmpx_eq_i32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0xa4,0x7d,0x01,0x00,0x02,0x04] v_cmpx_eq_i32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI: v_cmpx_ne_i32 vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0xaa,0x7d,0x01,0x00,0x02,0x04] // GFX9: v_cmpx_ne_i32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0xaa,0x7d,0x01,0x00,0x02,0x04] v_cmpx_ne_i32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI: v_cmp_f_u32 vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x90,0x7d,0x01,0x00,0x02,0x04] // GFX9: v_cmp_f_u32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x90,0x7d,0x01,0x00,0x02,0x04] v_cmp_f_u32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI: v_cmp_gt_u32 vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x98,0x7d,0x01,0x00,0x02,0x04] // GFX9: v_cmp_gt_u32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x98,0x7d,0x01,0x00,0x02,0x04] v_cmp_gt_u32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI: v_cmpx_le_u32 vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0xb6,0x7d,0x01,0x00,0x02,0x04] // GFX9: v_cmpx_le_u32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0xb6,0x7d,0x01,0x00,0x02,0x04] v_cmpx_le_u32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI: v_cmpx_ne_u32 vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0xba,0x7d,0x01,0x00,0x02,0x04] // GFX9: v_cmpx_ne_u32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0xba,0x7d,0x01,0x00,0x02,0x04] v_cmpx_ne_u32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI: v_cmp_class_f32 vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x20,0x7c,0x01,0x00,0x02,0x04] // GFX9: v_cmp_class_f32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x20,0x7c,0x01,0x00,0x02,0x04] v_cmp_class_f32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI: v_cmpx_class_f32 vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x22,0x7c,0x01,0x00,0x02,0x04] // GFX9: v_cmpx_class_f32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 ; encoding: [0xf9,0x04,0x22,0x7c,0x01,0x00,0x02,0x04] v_cmpx_class_f32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 @@ -681,22 +683,22 @@ v_cmpx_class_f32_sdwa vcc, v1, v2 src0_sel:BYTE_2 src1_sel:WORD_0 // v_mac_f16/f32 is prohibited //===----------------------------------------------------------------------===// -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // VI: v_mac_f32_sdwa v3, v4, v5 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:WORD_1 src1_sel:DWORD ; encoding: [0xf9,0x0a,0x06,0x2c,0x04,0x16,0x05,0x06] // NOGFX9: error: instruction not supported on this GPU v_mac_f32 v3, v4, v5 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:WORD_1 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // VI: v_mac_f32_sdwa v15, v99, v194 dst_sel:DWORD dst_unused:UNUSED_SEXT src0_sel:WORD_0 src1_sel:DWORD ; encoding: [0xf9,0x84,0x1f,0x2c,0x63,0x0e,0x04,0x06] // NOGFX9: error: instruction not supported on this GPU v_mac_f32 v15, v99, v194 dst_sel:DWORD dst_unused:UNUSED_SEXT src0_sel:WORD_0 -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // NOVI: error: invalid operand for instruction // NOGFX9: error: instruction not supported on this GPU v_mac_f32 v194, v13, v1 dst_sel:BYTE_0 dst_unused:UNUSED_SEXT src0_sel:BYTE_3 src1_sel:BYTE_2 -// NOSICI: error: +// NOSICI: error: not a valid operand. // VI: v_mac_f16_sdwa v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x06,0x02,0x46,0x02,0x06,0x05,0x02] // NOGFX9: error: instruction not supported on this GPU v_mac_f16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 @@ -705,312 +707,318 @@ v_mac_f16 v1, v2, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_se // Scalar registers are allowed //===----------------------------------------------------------------------===// -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_mov_b32_sdwa v1, s2 dst_sel:BYTE_0 dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x02,0x02,0x7e,0x02,0x10,0x86,0x00] v_mov_b32 v1, s2 dst_sel:BYTE_0 dst_unused:UNUSED_PRESERVE src0_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_mov_b32_sdwa v1, exec_lo dst_sel:BYTE_0 dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x02,0x02,0x7e,0x7e,0x10,0x86,0x00] v_mov_b32 v1, exec_lo dst_sel:BYTE_0 dst_unused:UNUSED_PRESERVE src0_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. // GFX9: v_mov_b32_sdwa v1, ttmp12 dst_sel:BYTE_0 dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x02,0x02,0x7e,0x78,0x10,0x86,0x00] v_mov_b32_sdwa v1, ttmp12 dst_sel:BYTE_0 dst_unused:UNUSED_PRESERVE src0_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_add_f32_sdwa v0, s0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x00,0x00,0x02,0x00,0x06,0x85,0x02] v_add_f32 v0, s0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_add_f32_sdwa v0, v0, s22 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x2c,0x00,0x02,0x00,0x06,0x05,0x82] v_add_f32 v0, v0, s22 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction +// NOGFX9: error: invalid operand for instruction // NO: invalid operand (violates constant bus restrictions) v_add_f32 v0, exec_lo, vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction +// NOGFX9: error: not a valid operand. // NO: error: not a valid operand v_add_f32 v0, v1, tba_lo dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction +// NOGFX9: error: not a valid operand. // NO: error: not a valid operand v_add_f32 v0, v1, tma_hi dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_cmp_eq_f32_sdwa vcc, s1, v2 src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x04,0x84,0x7c,0x01,0x00,0x85,0x02] v_cmp_eq_f32_sdwa vcc, s1, v2 src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_cmp_eq_f32_sdwa vcc, v1, s22 src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x2c,0x84,0x7c,0x01,0x00,0x05,0x82] v_cmp_eq_f32_sdwa vcc, v1, s22 src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. // GFX9: v_cmp_eq_f32_sdwa ttmp[12:13], v1, v2 src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x04,0x84,0x7c,0x01,0xf8,0x05,0x02] v_cmp_eq_f32_sdwa ttmp[12:13], v1, v2 src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: instruction not supported on this GPU +// NOGFX9: error: not a valid operand. // NO: error: not a valid operand v_cmp_eq_f32_sdwa tba, v1, v2 src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: instruction not supported on this GPU +// NOGFX9: error: not a valid operand. // NO: error: not a valid operand v_cmp_eq_f32_sdwa tma, v1, v2 src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. // GFX9: v_cmp_eq_f32_sdwa vcc, v1, ttmp15 src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0xf6,0x84,0x7c,0x01,0x00,0x05,0x82] v_cmp_eq_f32_sdwa vcc, v1, ttmp15 src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // NOGFX9: error: invalid operand (violates constant bus restrictions) v_cmp_eq_f32_sdwa vcc, exec_lo, vcc_lo src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOVI: error: invalid operand for instruction // GFX9: v_ceil_f16_sdwa v5, flat_scratch_lo dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD ; encoding: [0xf9,0x8a,0x0a,0x7e,0x66,0x06,0x86,0x00] +// NOSI: error: not a valid operand. +// NOCI: error: not a valid operand. v_ceil_f16_sdwa v5, flat_scratch_lo dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD //===----------------------------------------------------------------------===// // Inline constants are allowed (though semantics is not clear yet) //===----------------------------------------------------------------------===// -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_mov_b32_sdwa v5, 0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD ; encoding: [0xf9,0x02,0x0a,0x7e,0x80,0x06,0x86,0x00] v_mov_b32_sdwa v5, 0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_mov_b32_sdwa v5, -1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD ; encoding: [0xf9,0x02,0x0a,0x7e,0xc1,0x06,0x86,0x00] v_mov_b32_sdwa v5, -1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_mov_b32_sdwa v5, 0.5 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD ; encoding: [0xf9,0x02,0x0a,0x7e,0xf0,0x06,0x86,0x00] v_mov_b32_sdwa v5, 0.5 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_mov_b32_sdwa v5, -4.0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD ; encoding: [0xf9,0x02,0x0a,0x7e,0xf7,0x06,0x86,0x00] v_mov_b32_sdwa v5, -4.0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_mov_b32_sdwa v5, sext(-1) dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x02,0x0a,0x7e,0xc1,0x16,0x8e,0x00] v_mov_b32_sdwa v5, sext(-1) dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_add_f32_sdwa v5, -1, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x0a,0x02,0xc1,0x06,0x86,0x06] v_add_f32_sdwa v5, -1, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_add_f32_sdwa v5, |-1|, v2 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x0a,0x02,0xc1,0x16,0xa6,0x06] v_add_f32_sdwa v5, |-1|, v2 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_add_f32_sdwa v5, neg(-1), -|v2| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x0a,0x02,0xc1,0x16,0x96,0x36] v_add_f32_sdwa v5, neg(-1), -|v2| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_add_f32_sdwa v5, -|-1|, v2 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x0a,0x02,0xc1,0x16,0xb6,0x06] v_add_f32_sdwa v5, -|-1|, v2 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_add_f32_sdwa v5, 0.5, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x0a,0x02,0xf0,0x06,0x86,0x06] v_add_f32_sdwa v5, 0.5, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_add_f32_sdwa v5, |-4.0|, v2 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x0a,0x02,0xf7,0x16,0xa6,0x06] v_add_f32_sdwa v5, |-4.0|, v2 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_add_f32_sdwa v5, neg(-4.0), v2 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x0a,0x02,0xf7,0x16,0x96,0x06] v_add_f32_sdwa v5, neg(-4.0), v2 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_add_f32_sdwa v5, -|-4.0|, v2 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x0a,0x02,0xf7,0x16,0xb6,0x06] v_add_f32_sdwa v5, -|-4.0|, v2 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_add_f32_sdwa v5, v2, -4.0 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0xee,0x0b,0x02,0x02,0x16,0x06,0x86] v_add_f32_sdwa v5, v2, -4.0 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_add_f32_sdwa v5, v2, |-4.0| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0xee,0x0b,0x02,0x02,0x16,0x06,0xa6] v_add_f32_sdwa v5, v2, |-4.0| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_add_f32_sdwa v5, v2, neg(-4.0) dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0xee,0x0b,0x02,0x02,0x16,0x06,0x96] v_add_f32_sdwa v5, v2, neg(-4.0) dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_add_f32_sdwa v5, v2, -|-4.0| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0xee,0x0b,0x02,0x02,0x16,0x06,0xb6] v_add_f32_sdwa v5, v2, -|-4.0| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_add_f32_sdwa v5, v2, -1 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x82,0x0b,0x02,0x02,0x16,0x06,0x86] v_add_f32_sdwa v5, v2, -1 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_add_f32_sdwa v5, v2, |-1| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x82,0x0b,0x02,0x02,0x16,0x06,0xa6] v_add_f32_sdwa v5, v2, |-1| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_add_f32_sdwa v5, v2, neg(-1) dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x82,0x0b,0x02,0x02,0x16,0x06,0x96] v_add_f32_sdwa v5, v2, neg(-1) dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_add_f32_sdwa v5, v2, -|-1| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x82,0x0b,0x02,0x02,0x16,0x06,0xb6] v_add_f32_sdwa v5, v2, -|-1| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_and_b32_sdwa v5, -4.0, v2 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x0a,0x26,0xf7,0x16,0x86,0x06] v_and_b32_sdwa v5, -4.0, v2 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_and_b32_sdwa v5, sext(-4.0), v2 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x0a,0x26,0xf7,0x16,0x8e,0x06] v_and_b32_sdwa v5, sext(-4.0), v2 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_and_b32_sdwa v5, v2, -1 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x82,0x0b,0x26,0x02,0x16,0x06,0x86] v_and_b32_sdwa v5, v2, -1 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_and_b32_sdwa v5, v2, sext(-1) dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x82,0x0b,0x26,0x02,0x16,0x06,0x8e] v_and_b32_sdwa v5, v2, sext(-1) dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_exp_f16_sdwa v5, -1 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x82,0x0a,0x7e,0xc1,0x16,0x86,0x00] v_exp_f16_sdwa v5, -1 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_exp_f16_sdwa v5, |-1| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x82,0x0a,0x7e,0xc1,0x16,0xa6,0x00] v_exp_f16_sdwa v5, |-1| -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_exp_f16_sdwa v5, neg(-1) dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x82,0x0a,0x7e,0xc1,0x16,0x96,0x00] v_exp_f16_sdwa v5, neg(-1) -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_exp_f16_sdwa v5, -|-1| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x82,0x0a,0x7e,0xc1,0x16,0xb6,0x00] v_exp_f16_sdwa v5, -|-1| -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_exp_f16_sdwa v5, 0.5 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x82,0x0a,0x7e,0xf0,0x16,0x86,0x00] v_exp_f16_sdwa v5, 0.5 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_exp_f16_sdwa v5, |0.5| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x82,0x0a,0x7e,0xf0,0x16,0xa6,0x00] v_exp_f16_sdwa v5, |0.5| -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_exp_f16_sdwa v5, neg(0.5) dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x82,0x0a,0x7e,0xf0,0x16,0x96,0x00] v_exp_f16_sdwa v5, neg(0.5) -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_exp_f16_sdwa v5, -|0.5| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x82,0x0a,0x7e,0xf0,0x16,0xb6,0x00] v_exp_f16_sdwa v5, -|0.5| -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_max_i16_sdwa v5, -4.0, v2 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction v_max_i16_sdwa v5, sext(-4.0), v2 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_max_i16_sdwa v5, v2, -1 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x82,0x0b,0x60,0x02,0x16,0x06,0x86] v_max_i16_sdwa v5, v2, -1 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: invalid operand for instruction // GFX9: v_max_i16_sdwa v5, v2, sext(-1) dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x82,0x0b,0x60,0x02,0x16,0x06,0x8e] v_max_i16_sdwa v5, v2, sext(-1) dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_cmp_eq_f32_sdwa s[6:7], -4.0, v2 src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x84,0x7c,0xf7,0x86,0x86,0x06] v_cmp_eq_f32_sdwa s[6:7], -4.0, v2 src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_cmp_eq_f32_sdwa s[6:7], |-4.0|, v2 src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x84,0x7c,0xf7,0x86,0xa6,0x06] v_cmp_eq_f32_sdwa s[6:7], |-4.0|, v2 src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_cmp_eq_f32_sdwa s[6:7], neg(-4.0), v2 src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x84,0x7c,0xf7,0x86,0x96,0x06] v_cmp_eq_f32_sdwa s[6:7], neg(-4.0), v2 src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_cmp_eq_f32_sdwa s[6:7], -|-4.0|, v2 src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x84,0x7c,0xf7,0x86,0xb6,0x06] v_cmp_eq_f32_sdwa s[6:7], -|-4.0|, v2 src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_cmp_eq_f32_sdwa s[6:7], v2, -1 src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x82,0x85,0x7c,0x02,0x86,0x06,0x86] v_cmp_eq_f32_sdwa s[6:7], v2, -1 src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_cmp_eq_f32_sdwa s[6:7], v2, |-1| src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x82,0x85,0x7c,0x02,0x86,0x06,0xa6] v_cmp_eq_f32_sdwa s[6:7], v2, |-1| src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_cmp_eq_f32_sdwa s[6:7], v2, neg(-1) src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x82,0x85,0x7c,0x02,0x86,0x06,0x96] v_cmp_eq_f32_sdwa s[6:7], v2, neg(-1) src0_sel:DWORD src1_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_cmp_eq_f32_sdwa s[6:7], v2, -|-1| src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x82,0x85,0x7c,0x02,0x86,0x06,0xb6] v_cmp_eq_f32_sdwa s[6:7], v2, -|-1| src0_sel:DWORD src1_sel:DWORD @@ -1018,19 +1026,19 @@ v_cmp_eq_f32_sdwa s[6:7], v2, -|-1| src0_sel:DWORD src1_sel:DWORD // Literals are not allowed //===----------------------------------------------------------------------===// -// NOSICI: error: +// NOSICI: error: invalid operand for instruction // NOGFX89: error: invalid operand for instruction v_add_f32 v0, v1, 3.45 src0_sel:BYTE_2 src1_sel:WORD_0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // NOGFX89: error: invalid operand for instruction v_cmpx_class_f32 vcc, v1, 200 src0_sel:BYTE_2 src1_sel:WORD_0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // NOGFX89: error: invalid operand for instruction v_cmpx_class_f32 vcc, 200, v1 src0_sel:BYTE_2 src1_sel:WORD_0 -// NOSICI: error: +// NOSICI: error: not a valid operand. // NOGFX89: error: invalid operand for instruction v_mov_b32_sdwa v5, -17 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD @@ -1038,18 +1046,18 @@ v_mov_b32_sdwa v5, -17 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD // VOPC with arbitrary SGPR destination //===----------------------------------------------------------------------===// -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: instruction not supported on this GPU // GFX9: v_cmp_eq_f32_sdwa s[2:3], v1, v2 src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x04,0x84,0x7c,0x01,0x82,0x05,0x02] v_cmp_eq_f32_sdwa s[2:3], v1, v2 src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: instruction not supported on this GPU // GFX9: v_cmp_eq_f32_sdwa exec, v1, v2 src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x04,0x84,0x7c,0x01,0xfe,0x05,0x02] v_cmp_eq_f32_sdwa exec, v1, v2 src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: invalid operand for instruction // GFX9: v_cmp_eq_f32_sdwa exec, s2, v2 src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x04,0x84,0x7c,0x02,0xfe,0x85,0x02] v_cmp_eq_f32_sdwa exec, s2, v2 src0_sel:WORD_1 src1_sel:BYTE_2 @@ -1057,23 +1065,23 @@ v_cmp_eq_f32_sdwa exec, s2, v2 src0_sel:WORD_1 src1_sel:BYTE_2 // OMod output modifier allowed //===----------------------------------------------------------------------===// -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: instruction not supported on this GPU // GFX9: v_trunc_f32_sdwa v1, v2 mul:2 dst_sel:BYTE_0 dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x38,0x02,0x7e,0x02,0x50,0x06,0x00] v_trunc_f32 v1, v2 mul:2 dst_sel:BYTE_0 dst_unused:UNUSED_PRESERVE src0_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: instruction not supported on this GPU // GFX9: v_trunc_f32_sdwa v1, v2 clamp div:2 dst_sel:BYTE_0 dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x38,0x02,0x7e,0x02,0xf0,0x06,0x00] v_trunc_f32 v1, v2 clamp div:2 dst_sel:BYTE_0 dst_unused:UNUSED_PRESERVE src0_sel:DWORD -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: instruction not supported on this GPU // GFX9: v_add_f32_sdwa v0, v0, v0 mul:2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x00,0x00,0x02,0x00,0x46,0x05,0x02] v_add_f32 v0, v0, v0 mul:2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 -// NOSICI: error: -// NOVI: error: +// NOSICI: error: invalid operand for instruction +// NOVI: error: instruction not supported on this GPU // GFX9: v_add_f32_sdwa v0, v0, v0 clamp div:2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 ; encoding: [0xf9,0x00,0x00,0x02,0x00,0xe6,0x05,0x02] v_add_f32 v0, v0, v0 clamp div:2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2 @@ -1081,8 +1089,8 @@ v_add_f32 v0, v0, v0 clamp div:2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WO // Check Instructions //---------------------------------------------------------------------------// -// NOSICI: error: -// NOVI: error: +// NOSICI: error: not a valid operand. +// NOVI: error: not a valid operand. // GFX9: v_screen_partition_4se_b32_sdwa v5, v1 dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:BYTE_0 ; encoding: [0xf9,0x6e,0x0a,0x7e,0x01,0x16,0x00,0x00] v_screen_partition_4se_b32_sdwa v5, v1 src0_sel:BYTE_0 diff --git a/llvm/test/MC/AMDGPU/vopc-errs.s b/llvm/test/MC/AMDGPU/vopc-errs.s index bc8902f051ad..4998aebe0b04 100644 --- a/llvm/test/MC/AMDGPU/vopc-errs.s +++ b/llvm/test/MC/AMDGPU/vopc-errs.s @@ -1,6 +1,6 @@ -// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck %s +// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck --implicit-check-not=error: %s // Force 32-bit encoding with non-vcc result diff --git a/llvm/test/MC/AMDGPU/vopc-vi.s b/llvm/test/MC/AMDGPU/vopc-vi.s index f79923dfbd2e..f4c796528200 100644 --- a/llvm/test/MC/AMDGPU/vopc-vi.s +++ b/llvm/test/MC/AMDGPU/vopc-vi.s @@ -1,6 +1,6 @@ // RUN: llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck -check-prefix=VI %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck -check-prefix=NOSICI %s - // RUN: not llvm-mc -arch=amdgcn -mcpu=hawaii -show-encoding %s 2>&1 | FileCheck -check-prefix=NOSICI %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefix=NOSICI --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=hawaii %s 2>&1 | FileCheck -check-prefix=NOSICI --implicit-check-not=error: %s v_cmp_class_f16 vcc, v2, v4 // VI: v_cmp_class_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x28,0x7c] diff --git a/llvm/test/MC/AMDGPU/wave32.s b/llvm/test/MC/AMDGPU/wave32.s index b9532aebd157..b9f6af4b2816 100644 --- a/llvm/test/MC/AMDGPU/wave32.s +++ b/llvm/test/MC/AMDGPU/wave32.s @@ -1,7 +1,7 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=+wavefrontsize32,-wavefrontsize64 -show-encoding %s | FileCheck -check-prefix=GFX1032 %s // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-wavefrontsize32,+wavefrontsize64 -show-encoding %s | FileCheck -check-prefix=GFX1064 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=+wavefrontsize32,-wavefrontsize64 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX1032-ERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-wavefrontsize32,+wavefrontsize64 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX1064-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=+wavefrontsize32,-wavefrontsize64 %s 2>&1 | FileCheck -check-prefix=GFX1032-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-wavefrontsize32,+wavefrontsize64 %s 2>&1 | FileCheck -check-prefix=GFX1064-ERR --implicit-check-not=error: %s v_cmp_ge_i32_e32 s0, v0 // GFX1032: v_cmp_ge_i32_e32 vcc_lo, s0, v0 ; encoding: [0x00,0x00,0x0c,0x7d] diff --git a/llvm/test/MC/AMDGPU/xdl-insts-err.s b/llvm/test/MC/AMDGPU/xdl-insts-err.s index 8f596bea7aad..d774260bf941 100644 --- a/llvm/test/MC/AMDGPU/xdl-insts-err.s +++ b/llvm/test/MC/AMDGPU/xdl-insts-err.s @@ -1,5 +1,5 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx906 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GCN-ERR,GFX906-ERR %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx908 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GCN-ERR,GFX908-ERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx906 %s 2>&1 | FileCheck --check-prefixes=GCN-ERR,GFX906-ERR --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx908 %s 2>&1 | FileCheck --check-prefixes=GCN-ERR,GFX908-ERR --implicit-check-not=error: %s // GFX906-ERR: error: instruction not supported on this GPU v_dot2c_f32_f16 v0, v1, v2 diff --git a/llvm/test/MC/AMDGPU/xnack-mask.s b/llvm/test/MC/AMDGPU/xnack-mask.s index c88a8c298507..0fa5242d3789 100644 --- a/llvm/test/MC/AMDGPU/xnack-mask.s +++ b/llvm/test/MC/AMDGPU/xnack-mask.s @@ -1,9 +1,9 @@ -// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck -check-prefix=NOSICIVI10 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=hawaii -show-encoding %s 2>&1 | FileCheck -check-prefix=NOSICIVI10 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck -check-prefix=NOSICIVI10 %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1001 -show-encoding %s 2>&1 | FileCheck -check-prefix=NOSICIVI10 %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefix=NOSICIVI10 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=hawaii %s 2>&1 | FileCheck -check-prefix=NOSICIVI10 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck -check-prefix=NOSICIVI10 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1001 %s 2>&1 | FileCheck -check-prefix=NOSICIVI10 --implicit-check-not=error: %s -// RUN: not llvm-mc -arch=amdgcn -mcpu=stoney -show-encoding %s 2>&1 | FileCheck -check-prefix=XNACKERR %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=stoney %s 2>&1 | FileCheck -check-prefix=XNACKERR --implicit-check-not=error: %s // RUN: not llvm-mc -arch=amdgcn -mcpu=stoney -show-encoding %s | FileCheck -check-prefix=XNACK %s s_mov_b64 xnack_mask, -1 From 92a541978618674ce112b2f500853218fed24db8 Mon Sep 17 00:00:00 2001 From: peter klausler Date: Mon, 31 Aug 2020 12:22:24 -0700 Subject: [PATCH 23/26] [flang] Support multiple CookedSource instances These are owned by an instance of a new class AllCookedSources. This removes the need for a Scope to own a string containing a module's cooked source stream, and will enable errors to be emitted when parsing module files in the future. Differential Revision: https://reviews.llvm.org/D86891 --- flang/include/flang/Lower/Bridge.h | 12 +- flang/include/flang/Lower/ConvertType.h | 5 - .../flang/Parser/instrumented-parser.h | 2 +- flang/include/flang/Parser/message.h | 16 +-- flang/include/flang/Parser/parsing.h | 13 ++- flang/include/flang/Parser/provenance.h | 61 +++++++--- flang/include/flang/Parser/user-state.h | 11 +- flang/include/flang/Semantics/scope.h | 5 - flang/include/flang/Semantics/semantics.h | 13 +-- flang/lib/Parser/debug-parser.cpp | 4 +- flang/lib/Parser/instrumented-parser.cpp | 7 +- flang/lib/Parser/message.cpp | 28 ++--- flang/lib/Parser/parsing.cpp | 28 ++--- flang/lib/Parser/prescan.cpp | 29 ++--- flang/lib/Parser/prescan.h | 14 +-- flang/lib/Parser/provenance.cpp | 107 +++++++++++------- flang/lib/Semantics/mod-file.cpp | 3 +- flang/lib/Semantics/scope.cpp | 8 -- flang/lib/Semantics/semantics.cpp | 9 +- flang/test/Semantics/getsymbols02.f90 | 4 +- flang/tools/f18-parse-demo/f18-parse-demo.cpp | 7 +- flang/tools/f18/f18.cpp | 15 +-- flang/unittests/Evaluate/intrinsics.cpp | 9 +- 23 files changed, 230 insertions(+), 180 deletions(-) diff --git a/flang/include/flang/Lower/Bridge.h b/flang/include/flang/Lower/Bridge.h index aee7a0ef5bd8..ebaffaa4a6e0 100644 --- a/flang/include/flang/Lower/Bridge.h +++ b/flang/include/flang/Lower/Bridge.h @@ -34,7 +34,7 @@ namespace evaluate { class IntrinsicProcTable; } // namespace evaluate namespace parser { -class CookedSource; +class AllCookedSources; struct Program; } // namespace parser namespace semantics { @@ -55,8 +55,8 @@ class LoweringBridge { static LoweringBridge create(const Fortran::common::IntrinsicTypeDefaultKinds &defaultKinds, const Fortran::evaluate::IntrinsicProcTable &intrinsics, - const Fortran::parser::CookedSource &cooked) { - return LoweringBridge{defaultKinds, intrinsics, cooked}; + const Fortran::parser::AllCookedSources &allCooked) { + return LoweringBridge{defaultKinds, intrinsics, allCooked}; } //===--------------------------------------------------------------------===// @@ -71,7 +71,7 @@ class LoweringBridge { const Fortran::evaluate::IntrinsicProcTable &getIntrinsicTable() const { return intrinsics; } - const Fortran::parser::CookedSource *getCookedSource() const { + const Fortran::parser::AllCookedSources *getCookedSource() const { return cooked; } @@ -99,13 +99,13 @@ class LoweringBridge { explicit LoweringBridge( const Fortran::common::IntrinsicTypeDefaultKinds &defaultKinds, const Fortran::evaluate::IntrinsicProcTable &intrinsics, - const Fortran::parser::CookedSource &cooked); + const Fortran::parser::AllCookedSources &); LoweringBridge() = delete; LoweringBridge(const LoweringBridge &) = delete; const Fortran::common::IntrinsicTypeDefaultKinds &defaultKinds; const Fortran::evaluate::IntrinsicProcTable &intrinsics; - const Fortran::parser::CookedSource *cooked; + const Fortran::parser::AllCookedSources *cooked; std::unique_ptr context; std::unique_ptr module; fir::KindMapping kindMap; diff --git a/flang/include/flang/Lower/ConvertType.h b/flang/include/flang/Lower/ConvertType.h index f4046efba112..b807d6203818 100644 --- a/flang/include/flang/Lower/ConvertType.h +++ b/flang/include/flang/Lower/ConvertType.h @@ -48,11 +48,6 @@ template class Type; } // namespace evaluate -namespace parser { -class CharBlock; -class CookedSource; -} // namespace parser - namespace semantics { class Symbol; } // namespace semantics diff --git a/flang/include/flang/Parser/instrumented-parser.h b/flang/include/flang/Parser/instrumented-parser.h index 51dbd5f03c17..1bc1c526dc9f 100644 --- a/flang/include/flang/Parser/instrumented-parser.h +++ b/flang/include/flang/Parser/instrumented-parser.h @@ -31,7 +31,7 @@ class ParsingLog { bool Fails(const char *at, const MessageFixedText &tag, ParseState &); void Note(const char *at, const MessageFixedText &tag, bool pass, const ParseState &); - void Dump(llvm::raw_ostream &, const CookedSource &) const; + void Dump(llvm::raw_ostream &, const AllCookedSources &) const; private: struct LogForPosition { diff --git a/flang/include/flang/Parser/message.h b/flang/include/flang/Parser/message.h index 46a72e08a237..cd1df0a968e7 100644 --- a/flang/include/flang/Parser/message.h +++ b/flang/include/flang/Parser/message.h @@ -186,14 +186,14 @@ class Message : public common::ReferenceCounted { bool SortBefore(const Message &that) const; bool IsFatal() const; std::string ToString() const; - std::optional GetProvenanceRange(const CookedSource &) const; - void Emit(llvm::raw_ostream &, const CookedSource &, + std::optional GetProvenanceRange( + const AllCookedSources &) const; + void Emit(llvm::raw_ostream &, const AllCookedSources &, bool echoSourceLine = true) const; - // If this Message or any of its attachments locates itself via a CharBlock - // within a particular CookedSource, replace its location with the - // corresponding ProvenanceRange. - void ResolveProvenances(const CookedSource &); + // If this Message or any of its attachments locates itself via a CharBlock, + // replace its location with the corresponding ProvenanceRange. + void ResolveProvenances(const AllCookedSources &); bool IsMergeable() const { return std::holds_alternative(text_); @@ -255,8 +255,8 @@ class Messages { bool Merge(const Message &); void Merge(Messages &&); void Copy(const Messages &); - void ResolveProvenances(const CookedSource &); - void Emit(llvm::raw_ostream &, const CookedSource &cooked, + void ResolveProvenances(const AllCookedSources &); + void Emit(llvm::raw_ostream &, const AllCookedSources &, bool echoSourceLines = true) const; void AttachTo(Message &); bool AnyFatalError() const; diff --git a/flang/include/flang/Parser/parsing.h b/flang/include/flang/Parser/parsing.h index 9f8bff9e1d70..6594f97088d5 100644 --- a/flang/include/flang/Parser/parsing.h +++ b/flang/include/flang/Parser/parsing.h @@ -40,15 +40,17 @@ struct Options { class Parsing { public: - explicit Parsing(AllSources &); + explicit Parsing(AllCookedSources &); ~Parsing(); bool consumedWholeFile() const { return consumedWholeFile_; } const char *finalRestingPlace() const { return finalRestingPlace_; } - CookedSource &cooked() { return cooked_; } + AllCookedSources &allCooked() { return allCooked_; } Messages &messages() { return messages_; } std::optional &parseTree() { return parseTree_; } + const CookedSource &cooked() const { return DEREF(currentCooked_); } + const SourceFile *Prescan(const std::string &path, Options); void DumpCookedChars(llvm::raw_ostream &) const; void DumpProvenance(llvm::raw_ostream &) const; @@ -58,13 +60,14 @@ class Parsing { void EmitMessage(llvm::raw_ostream &o, const char *at, const std::string &message, bool echoSourceLine = false) const { - cooked_.allSources().EmitMessage( - o, cooked_.GetProvenanceRange(CharBlock(at)), message, echoSourceLine); + allCooked_.allSources().EmitMessage(o, + allCooked_.GetProvenanceRange(CharBlock(at)), message, echoSourceLine); } private: Options options_; - CookedSource cooked_; + AllCookedSources &allCooked_; + CookedSource *currentCooked_{nullptr}; Messages messages_; bool consumedWholeFile_{false}; const char *finalRestingPlace_{nullptr}; diff --git a/flang/include/flang/Parser/provenance.h b/flang/include/flang/Parser/provenance.h index b543cd7d7b4e..52aac931e899 100644 --- a/flang/include/flang/Parser/provenance.h +++ b/flang/include/flang/Parser/provenance.h @@ -17,6 +17,7 @@ #include "flang/Common/interval.h" #include "llvm/Support/raw_ostream.h" #include +#include #include #include #include @@ -213,28 +214,22 @@ class AllSources { Encoding encoding_{Encoding::UTF_8}; }; +// Represents the result of preprocessing and prescanning a single source +// file (and all its inclusions) or module file. Parsers operate within +// single instances of CookedSource. class CookedSource { public: - explicit CookedSource(AllSources &); - ~CookedSource(); - - AllSources &allSources() { return allSources_; } - const AllSources &allSources() const { return allSources_; } const std::string &data() const { return data_; } - bool IsValid(const char *p) const { + bool Contains(const char *p) const { return p >= &data_.front() && p <= &data_.back() + 1; } - bool IsValid(CharBlock range) const { - return !range.empty() && IsValid(range.begin()) && IsValid(range.end() - 1); + bool Contains(CharBlock range) const { + return !range.empty() && Contains(range.begin()) && + Contains(range.end() - 1); } - bool IsValid(ProvenanceRange r) const { return allSources_.IsValid(r); } std::optional GetProvenanceRange(CharBlock) const; - std::optional GetCharBlockFromLineAndColumns( - int line, int startColumn, int endColumn) const; - std::optional> - GetSourcePositionRange(CharBlock) const; std::optional GetCharBlock(ProvenanceRange) const; // The result of a Put() is the offset that the new data @@ -256,17 +251,51 @@ class CookedSource { } std::size_t BufferedBytes() const; - void Marshal(); // marshals text into one contiguous block - void CompileProvenanceRangeToOffsetMappings(); + void Marshal(AllSources &); // marshals text into one contiguous block + void CompileProvenanceRangeToOffsetMappings(AllSources &); std::string AcquireData() { return std::move(data_); } llvm::raw_ostream &Dump(llvm::raw_ostream &) const; private: - AllSources &allSources_; CharBuffer buffer_; // before Marshal() std::string data_; // all of it, prescanned and preprocessed OffsetToProvenanceMappings provenanceMap_; ProvenanceRangeToOffsetMappings invertedMap_; }; + +class AllCookedSources { +public: + explicit AllCookedSources(AllSources &); + ~AllCookedSources(); + + AllSources &allSources() { return allSources_; } + const AllSources &allSources() const { return allSources_; } + + CookedSource &NewCookedSource(); + + template // const char * or CharBlock + const CookedSource *Find(A x) const { + for (const auto &c : cooked_) { + if (c.Contains(x)) { + return &c; + } + } + return nullptr; + } + + bool IsValid(ProvenanceRange r) const { return allSources_.IsValid(r); } + + std::optional GetProvenanceRange(CharBlock) const; + std::optional GetCharBlockFromLineAndColumns( + int line, int startColumn, int endColumn) const; + std::optional> + GetSourcePositionRange(CharBlock) const; + std::optional GetCharBlock(ProvenanceRange) const; + void Dump(llvm::raw_ostream &) const; + +private: + AllSources &allSources_; + std::list cooked_; // owns all CookedSource instances +}; } // namespace Fortran::parser #endif // FORTRAN_PARSER_PROVENANCE_H_ diff --git a/flang/include/flang/Parser/user-state.h b/flang/include/flang/Parser/user-state.h index 75757d2f305a..6a4cf9736f1f 100644 --- a/flang/include/flang/Parser/user-state.h +++ b/flang/include/flang/Parser/user-state.h @@ -26,7 +26,7 @@ namespace Fortran::parser { -class CookedSource; +class AllCookedSources; class ParsingLog; class ParseState; @@ -34,10 +34,11 @@ class Success {}; // for when one must return something that's present class UserState { public: - UserState(const CookedSource &cooked, common::LanguageFeatureControl features) - : cooked_{cooked}, features_{features} {} + UserState(const AllCookedSources &allCooked, + common::LanguageFeatureControl features) + : allCooked_{allCooked}, features_{features} {} - const CookedSource &cooked() const { return cooked_; } + const AllCookedSources &allCooked() const { return allCooked_; } const common::LanguageFeatureControl &features() const { return features_; } llvm::raw_ostream *debugOutput() const { return debugOutput_; } @@ -89,7 +90,7 @@ class UserState { } private: - const CookedSource &cooked_; + const AllCookedSources &allCooked_; llvm::raw_ostream *debugOutput_{nullptr}; diff --git a/flang/include/flang/Semantics/scope.h b/flang/include/flang/Semantics/scope.h index 5ebe5f32eb67..853d7044f7fd 100644 --- a/flang/include/flang/Semantics/scope.h +++ b/flang/include/flang/Semantics/scope.h @@ -187,10 +187,6 @@ class Scope { const DeclTypeSpec &MakeTypeStarType(); const DeclTypeSpec &MakeClassStarType(); - // For modules read from module files, this is the stream of characters - // that are referenced by SourceName objects. - void set_chars(parser::CookedSource &); - std::size_t size() const { return size_; } void set_size(std::size_t size) { size_ = size; } std::size_t alignment() const { return alignment_; } @@ -245,7 +241,6 @@ class Scope { mapType crayPointers_; std::map> submodules_; std::list declTypeSpecs_; - std::string chars_; std::optional importKind_; std::set importNames_; DerivedTypeSpec *derivedTypeSpec_{nullptr}; // dTS->scope() == this diff --git a/flang/include/flang/Semantics/semantics.h b/flang/include/flang/Semantics/semantics.h index 3c7ba98f6620..4c2c0e75992a 100644 --- a/flang/include/flang/Semantics/semantics.h +++ b/flang/include/flang/Semantics/semantics.h @@ -30,7 +30,7 @@ class IntrinsicTypeDefaultKinds; namespace Fortran::parser { struct Name; struct Program; -class CookedSource; +class AllCookedSources; struct AssociateConstruct; struct BlockConstruct; struct CaseConstruct; @@ -60,7 +60,7 @@ using ConstructStack = std::vector; class SemanticsContext { public: SemanticsContext(const common::IntrinsicTypeDefaultKinds &, - const common::LanguageFeatureControl &, parser::AllSources &); + const common::LanguageFeatureControl &, parser::AllCookedSources &); ~SemanticsContext(); const common::IntrinsicTypeDefaultKinds &defaultKinds() const { @@ -89,7 +89,7 @@ class SemanticsContext { Scope &globalScope() { return globalScope_; } parser::Messages &messages() { return messages_; } evaluate::FoldingContext &foldingContext() { return foldingContext_; } - parser::AllSources &allSources() { return allSources_; } + parser::AllCookedSources &allCookedSources() { return allCookedSources_; } SemanticsContext &set_location( const std::optional &location) { @@ -179,7 +179,7 @@ class SemanticsContext { const common::IntrinsicTypeDefaultKinds &defaultKinds_; const common::LanguageFeatureControl languageFeatures_; - parser::AllSources &allSources_; + parser::AllCookedSources &allCookedSources_; std::optional location_; std::vector searchDirectories_; std::string moduleDirectory_{"."s}; @@ -204,8 +204,8 @@ class SemanticsContext { class Semantics { public: explicit Semantics(SemanticsContext &context, parser::Program &program, - parser::CookedSource &cooked, bool debugModuleWriter = false) - : context_{context}, program_{program}, cooked_{cooked} { + const parser::CookedSource &cooked, bool debugModuleWriter = false) + : context_{context}, program_{program} { context.set_debugModuleWriter(debugModuleWriter); context.globalScope().AddSourceRange(parser::CharBlock{cooked.data()}); } @@ -223,7 +223,6 @@ class Semantics { private: SemanticsContext &context_; parser::Program &program_; - const parser::CookedSource &cooked_; }; // Base class for semantics checkers. diff --git a/flang/lib/Parser/debug-parser.cpp b/flang/lib/Parser/debug-parser.cpp index dbcc64f14bb1..af5da091cde6 100644 --- a/flang/lib/Parser/debug-parser.cpp +++ b/flang/lib/Parser/debug-parser.cpp @@ -18,9 +18,9 @@ std::optional DebugParser::Parse(ParseState &state) const { std::string note{str_, length_}; Message message{state.GetLocation(), "parser debug: %s"_en_US, note}; message.SetContext(state.context().get()); - message.Emit(*out, ustate->cooked(), true); + message.Emit(*out, ustate->allCooked(), true); } } - return {Success{}}; + return Success{}; } } // namespace Fortran::parser diff --git a/flang/lib/Parser/instrumented-parser.cpp b/flang/lib/Parser/instrumented-parser.cpp index 765d29219395..6687aa1bbe54 100644 --- a/flang/lib/Parser/instrumented-parser.cpp +++ b/flang/lib/Parser/instrumented-parser.cpp @@ -63,14 +63,15 @@ void ParsingLog::Note(const char *at, const MessageFixedText &tag, bool pass, } } -void ParsingLog::Dump(llvm::raw_ostream &o, const CookedSource &cooked) const { +void ParsingLog::Dump( + llvm::raw_ostream &o, const AllCookedSources &allCooked) const { for (const auto &posLog : perPos_) { const char *at{reinterpret_cast(posLog.first)}; for (const auto &tagLog : posLog.second.perTag) { - Message{at, tagLog.first}.Emit(o, cooked, true); + Message{at, tagLog.first}.Emit(o, allCooked, true); auto &entry{tagLog.second}; o << " " << (entry.pass ? "pass" : "fail") << " " << entry.count << '\n'; - entry.messages.Emit(o, cooked); + entry.messages.Emit(o, allCooked); } } } diff --git a/flang/lib/Parser/message.cpp b/flang/lib/Parser/message.cpp index 87594d64a8c1..6819ee4d83b2 100644 --- a/flang/lib/Parser/message.cpp +++ b/flang/lib/Parser/message.cpp @@ -165,43 +165,43 @@ std::string Message::ToString() const { text_); } -void Message::ResolveProvenances(const CookedSource &cooked) { +void Message::ResolveProvenances(const AllCookedSources &allCooked) { if (CharBlock * cb{std::get_if(&location_)}) { if (std::optional resolved{ - cooked.GetProvenanceRange(*cb)}) { + allCooked.GetProvenanceRange(*cb)}) { location_ = *resolved; } } if (Message * attachment{attachment_.get()}) { - attachment->ResolveProvenances(cooked); + attachment->ResolveProvenances(allCooked); } } std::optional Message::GetProvenanceRange( - const CookedSource &cooked) const { + const AllCookedSources &allCooked) const { return std::visit( common::visitors{ - [&](CharBlock cb) { return cooked.GetProvenanceRange(cb); }, + [&](CharBlock cb) { return allCooked.GetProvenanceRange(cb); }, [](const ProvenanceRange &pr) { return std::make_optional(pr); }, }, location_); } -void Message::Emit(llvm::raw_ostream &o, const CookedSource &cooked, +void Message::Emit(llvm::raw_ostream &o, const AllCookedSources &allCooked, bool echoSourceLine) const { - std::optional provenanceRange{GetProvenanceRange(cooked)}; + std::optional provenanceRange{GetProvenanceRange(allCooked)}; std::string text; if (IsFatal()) { text += "error: "; } text += ToString(); - const AllSources &sources{cooked.allSources()}; + const AllSources &sources{allCooked.allSources()}; sources.EmitMessage(o, provenanceRange, text, echoSourceLine); if (attachmentIsContext_) { for (const Message *context{attachment_.get()}; context; context = context->attachment_.get()) { std::optional contextProvenance{ - context->GetProvenanceRange(cooked)}; + context->GetProvenanceRange(allCooked)}; text = "in the context: "; text += context->ToString(); // TODO: don't echo the source lines of a context when it's the @@ -213,7 +213,7 @@ void Message::Emit(llvm::raw_ostream &o, const CookedSource &cooked, } else { for (const Message *attachment{attachment_.get()}; attachment; attachment = attachment->attachment_.get()) { - sources.EmitMessage(o, attachment->GetProvenanceRange(cooked), + sources.EmitMessage(o, attachment->GetProvenanceRange(allCooked), attachment->ToString(), echoSourceLine); } } @@ -300,13 +300,13 @@ void Messages::Copy(const Messages &that) { } } -void Messages::ResolveProvenances(const CookedSource &cooked) { +void Messages::ResolveProvenances(const AllCookedSources &allCooked) { for (Message &m : messages_) { - m.ResolveProvenances(cooked); + m.ResolveProvenances(allCooked); } } -void Messages::Emit(llvm::raw_ostream &o, const CookedSource &cooked, +void Messages::Emit(llvm::raw_ostream &o, const AllCookedSources &allCooked, bool echoSourceLines) const { std::vector sorted; for (const auto &msg : messages_) { @@ -315,7 +315,7 @@ void Messages::Emit(llvm::raw_ostream &o, const CookedSource &cooked, std::stable_sort(sorted.begin(), sorted.end(), [](const Message *x, const Message *y) { return x->SortBefore(*y); }); for (const Message *msg : sorted) { - msg->Emit(o, cooked, echoSourceLines); + msg->Emit(o, allCooked, echoSourceLines); } } diff --git a/flang/lib/Parser/parsing.cpp b/flang/lib/Parser/parsing.cpp index b77242ae0876..819f3cf99867 100644 --- a/flang/lib/Parser/parsing.cpp +++ b/flang/lib/Parser/parsing.cpp @@ -17,12 +17,12 @@ namespace Fortran::parser { -Parsing::Parsing(AllSources &s) : cooked_{s} {} +Parsing::Parsing(AllCookedSources &allCooked) : allCooked_{allCooked} {} Parsing::~Parsing() {} const SourceFile *Parsing::Prescan(const std::string &path, Options options) { options_ = options; - AllSources &allSources{cooked_.allSources()}; + AllSources &allSources{allCooked_.allSources()}; if (options.isModuleFile) { for (const auto &path : options.searchDirectories) { allSources.PushSearchPathDirectory(path); @@ -63,7 +63,9 @@ const SourceFile *Parsing::Prescan(const std::string &path, Options options) { preprocessor.Undefine(predef.first); } } - Prescanner prescanner{messages_, cooked_, preprocessor, options.features}; + currentCooked_ = &allCooked_.NewCookedSource(); + Prescanner prescanner{ + messages_, *currentCooked_, allSources, preprocessor, options.features}; prescanner.set_fixedForm(options.isFixedForm) .set_fixedFormColumnLimit(options.fixedFormColumns) .AddCompilerDirectiveSentinel("dir$"); @@ -77,21 +79,21 @@ const SourceFile *Parsing::Prescan(const std::string &path, Options options) { ProvenanceRange range{allSources.AddIncludedFile( *sourceFile, ProvenanceRange{}, options.isModuleFile)}; prescanner.Prescan(range); - if (cooked_.BufferedBytes() == 0 && !options.isModuleFile) { + if (currentCooked_->BufferedBytes() == 0 && !options.isModuleFile) { // Input is empty. Append a newline so that any warning // message about nonstandard usage will have provenance. - cooked_.Put('\n', range.start()); + currentCooked_->Put('\n', range.start()); } - cooked_.Marshal(); + currentCooked_->Marshal(allSources); if (options.needProvenanceRangeToCharBlockMappings) { - cooked_.CompileProvenanceRangeToOffsetMappings(); + currentCooked_->CompileProvenanceRangeToOffsetMappings(allSources); } return sourceFile; } void Parsing::DumpCookedChars(llvm::raw_ostream &out) const { - UserState userState{cooked_, common::LanguageFeatureControl{}}; - ParseState parseState{cooked_}; + UserState userState{allCooked_, common::LanguageFeatureControl{}}; + ParseState parseState{cooked()}; parseState.set_inFixedForm(options_.isFixedForm).set_userState(&userState); while (std::optional p{parseState.GetNextChar()}) { out << **p; @@ -99,19 +101,19 @@ void Parsing::DumpCookedChars(llvm::raw_ostream &out) const { } void Parsing::DumpProvenance(llvm::raw_ostream &out) const { - cooked_.Dump(out); + allCooked_.Dump(out); } void Parsing::DumpParsingLog(llvm::raw_ostream &out) const { - log_.Dump(out, cooked_); + log_.Dump(out, allCooked_); } void Parsing::Parse(llvm::raw_ostream &out) { - UserState userState{cooked_, options_.features}; + UserState userState{allCooked_, options_.features}; userState.set_debugOutput(out) .set_instrumentedParse(options_.instrumentedParse) .set_log(&log_); - ParseState parseState{cooked_}; + ParseState parseState{cooked()}; parseState.set_inFixedForm(options_.isFixedForm).set_userState(&userState); parseTree_ = program.Parse(parseState); CHECK( diff --git a/flang/lib/Parser/prescan.cpp b/flang/lib/Parser/prescan.cpp index 5e6f13797646..8e8e57c1334d 100644 --- a/flang/lib/Parser/prescan.cpp +++ b/flang/lib/Parser/prescan.cpp @@ -26,14 +26,16 @@ using common::LanguageFeature; static constexpr int maxPrescannerNesting{100}; Prescanner::Prescanner(Messages &messages, CookedSource &cooked, - Preprocessor &preprocessor, common::LanguageFeatureControl lfc) - : messages_{messages}, cooked_{cooked}, preprocessor_{preprocessor}, - features_{lfc}, encoding_{cooked.allSources().encoding()} {} + AllSources &allSources, Preprocessor &preprocessor, + common::LanguageFeatureControl lfc) + : messages_{messages}, cooked_{cooked}, allSources_{allSources}, + preprocessor_{preprocessor}, features_{lfc}, + encoding_{allSources_.encoding()} {} Prescanner::Prescanner(const Prescanner &that) : messages_{that.messages_}, cooked_{that.cooked_}, - preprocessor_{that.preprocessor_}, features_{that.features_}, - inFixedForm_{that.inFixedForm_}, + allSources_{that.allSources_}, preprocessor_{that.preprocessor_}, + features_{that.features_}, inFixedForm_{that.inFixedForm_}, fixedFormColumnLimit_{that.fixedFormColumnLimit_}, encoding_{that.encoding_}, prescannerNesting_{that.prescannerNesting_ + 1}, @@ -59,10 +61,10 @@ static void NormalizeCompilerDirectiveCommentMarker(TokenSequence &dir) { } void Prescanner::Prescan(ProvenanceRange range) { - AllSources &allSources{cooked_.allSources()}; startProvenance_ = range.start(); std::size_t offset{0}; - const SourceFile *source{allSources.GetSourceFile(startProvenance_, &offset)}; + const SourceFile *source{ + allSources_.GetSourceFile(startProvenance_, &offset)}; CHECK(source); start_ = source->content().data() + offset; limit_ = start_ + range.size(); @@ -84,7 +86,7 @@ void Prescanner::Prescan(ProvenanceRange range) { dir += "free"; } dir += '\n'; - TokenSequence tokens{dir, allSources.AddCompilerInsertion(dir).start()}; + TokenSequence tokens{dir, allSources_.AddCompilerInsertion(dir).start()}; tokens.Emit(cooked_); } } @@ -761,14 +763,13 @@ void Prescanner::FortranInclude(const char *firstQuote) { std::string buf; llvm::raw_string_ostream error{buf}; Provenance provenance{GetProvenance(nextLine_)}; - AllSources &allSources{cooked_.allSources()}; - const SourceFile *currentFile{allSources.GetSourceFile(provenance)}; + const SourceFile *currentFile{allSources_.GetSourceFile(provenance)}; if (currentFile) { - allSources.PushSearchPathDirectory(DirectoryName(currentFile->path())); + allSources_.PushSearchPathDirectory(DirectoryName(currentFile->path())); } - const SourceFile *included{allSources.Open(path, error)}; + const SourceFile *included{allSources_.Open(path, error)}; if (currentFile) { - allSources.PopSearchPathDirectory(); + allSources_.PopSearchPathDirectory(); } if (!included) { Say(provenance, "INCLUDE: %s"_err_en_US, error.str()); @@ -776,7 +777,7 @@ void Prescanner::FortranInclude(const char *firstQuote) { ProvenanceRange includeLineRange{ provenance, static_cast(p - nextLine_)}; ProvenanceRange fileRange{ - allSources.AddIncludedFile(*included, includeLineRange)}; + allSources_.AddIncludedFile(*included, includeLineRange)}; Prescanner{*this}.set_encoding(included->encoding()).Prescan(fileRange); } } diff --git a/flang/lib/Parser/prescan.h b/flang/lib/Parser/prescan.h index 0b5b64792004..ab56ed455040 100644 --- a/flang/lib/Parser/prescan.h +++ b/flang/lib/Parser/prescan.h @@ -33,7 +33,7 @@ class Preprocessor; class Prescanner { public: - Prescanner(Messages &, CookedSource &, Preprocessor &, + Prescanner(Messages &, CookedSource &, AllSources &, Preprocessor &, common::LanguageFeatureControl); Prescanner(const Prescanner &); @@ -65,10 +65,7 @@ class Prescanner { Provenance GetCurrentProvenance() const { return GetProvenance(at_); } template Message &Say(A &&...a) { - Message &m{messages_.Say(std::forward(a)...)}; - std::optional range{m.GetProvenanceRange(cooked_)}; - CHECK(!range || cooked_.IsValid(*range)); - return m; + return messages_.Say(std::forward(a)...); } private: @@ -124,7 +121,7 @@ class Prescanner { } void EmitInsertedChar(TokenSequence &tokens, char ch) { - Provenance provenance{cooked_.allSources().CompilerInsertionProvenance(ch)}; + Provenance provenance{allSources_.CompilerInsertionProvenance(ch)}; tokens.PutNextTokenChar(ch, provenance); } @@ -184,6 +181,7 @@ class Prescanner { Messages &messages_; CookedSource &cooked_; + AllSources &allSources_; Preprocessor &preprocessor_; common::LanguageFeatureControl features_; bool inFixedForm_{false}; @@ -222,9 +220,9 @@ class Prescanner { bool skipLeadingAmpersand_{false}; const Provenance spaceProvenance_{ - cooked_.allSources().CompilerInsertionProvenance(' ')}; + allSources_.CompilerInsertionProvenance(' ')}; const Provenance backslashProvenance_{ - cooked_.allSources().CompilerInsertionProvenance('\\')}; + allSources_.CompilerInsertionProvenance('\\')}; // To avoid probing the set of active compiler directive sentinel strings // on every comment line, they're checked first with a cheap Bloom filter. diff --git a/flang/lib/Parser/provenance.cpp b/flang/lib/Parser/provenance.cpp index 73e0f7154b6b..bcb871bd7cb4 100644 --- a/flang/lib/Parser/provenance.cpp +++ b/flang/lib/Parser/provenance.cpp @@ -400,12 +400,9 @@ const AllSources::Origin &AllSources::MapToOrigin(Provenance at) const { return origin_[low]; } -CookedSource::CookedSource(AllSources &s) : allSources_{s} {} -CookedSource::~CookedSource() {} - std::optional CookedSource::GetProvenanceRange( CharBlock cookedRange) const { - if (!IsValid(cookedRange)) { + if (!Contains(cookedRange)) { return std::nullopt; } ProvenanceRange first{provenanceMap_.Map(cookedRange.begin() - &data_[0])}; @@ -416,34 +413,6 @@ std::optional CookedSource::GetProvenanceRange( return {ProvenanceRange{first.start(), last.start() - first.start()}}; } -std::optional CookedSource::GetCharBlockFromLineAndColumns( - int line, int startColumn, int endColumn) const { - // 2nd column is exclusive, meaning it is target column + 1. - CHECK(line > 0 && startColumn > 0 && endColumn > 0); - CHECK(startColumn < endColumn); - auto provenanceStart{allSources_.GetFirstFileProvenance().value().start()}; - if (auto sourceFile{allSources_.GetSourceFile(provenanceStart)}) { - CHECK(line <= static_cast(sourceFile->lines())); - return GetCharBlock(ProvenanceRange(sourceFile->GetLineStartOffset(line) + - provenanceStart.offset() + startColumn - 1, - endColumn - startColumn)); - } - return std::nullopt; -} - -std::optional> -CookedSource::GetSourcePositionRange(CharBlock cookedRange) const { - if (auto range{GetProvenanceRange(cookedRange)}) { - if (auto firstOffset{allSources_.GetSourcePosition(range->start())}) { - if (auto secondOffset{ - allSources_.GetSourcePosition(range->start() + range->size())}) { - return std::pair{*firstOffset, *secondOffset}; - } - } - } - return std::nullopt; -} - std::optional CookedSource::GetCharBlock( ProvenanceRange range) const { CHECK(!invertedMap_.empty() && @@ -457,16 +426,17 @@ std::optional CookedSource::GetCharBlock( std::size_t CookedSource::BufferedBytes() const { return buffer_.bytes(); } -void CookedSource::Marshal() { +void CookedSource::Marshal(AllSources &allSources) { CHECK(provenanceMap_.SizeInBytes() == buffer_.bytes()); - provenanceMap_.Put(allSources_.AddCompilerInsertion("(after end of source)")); + provenanceMap_.Put(allSources.AddCompilerInsertion("(after end of source)")); data_ = buffer_.Marshal(); buffer_.clear(); } -void CookedSource::CompileProvenanceRangeToOffsetMappings() { +void CookedSource::CompileProvenanceRangeToOffsetMappings( + AllSources &allSources) { if (invertedMap_.empty()) { - invertedMap_ = provenanceMap_.Invert(allSources_); + invertedMap_ = provenanceMap_.Invert(allSources); } } @@ -534,12 +504,73 @@ llvm::raw_ostream &AllSources::Dump(llvm::raw_ostream &o) const { } llvm::raw_ostream &CookedSource::Dump(llvm::raw_ostream &o) const { - o << "CookedSource:\n"; - allSources_.Dump(o); o << "CookedSource::provenanceMap_:\n"; provenanceMap_.Dump(o); o << "CookedSource::invertedMap_:\n"; invertedMap_.Dump(o); return o; } + +AllCookedSources::AllCookedSources(AllSources &s) : allSources_{s} {} +AllCookedSources::~AllCookedSources() {} + +CookedSource &AllCookedSources::NewCookedSource() { + return cooked_.emplace_back(); +} + +std::optional AllCookedSources::GetProvenanceRange( + CharBlock cb) const { + if (const CookedSource * c{Find(cb)}) { + return c->GetProvenanceRange(cb); + } else { + return std::nullopt; + } +} + +std::optional AllCookedSources::GetCharBlockFromLineAndColumns( + int line, int startColumn, int endColumn) const { + // 2nd column is exclusive, meaning it is target column + 1. + CHECK(line > 0 && startColumn > 0 && endColumn > 0); + CHECK(startColumn < endColumn); + auto provenanceStart{allSources_.GetFirstFileProvenance().value().start()}; + if (auto sourceFile{allSources_.GetSourceFile(provenanceStart)}) { + CHECK(line <= static_cast(sourceFile->lines())); + return GetCharBlock(ProvenanceRange(sourceFile->GetLineStartOffset(line) + + provenanceStart.offset() + startColumn - 1, + endColumn - startColumn)); + } + return std::nullopt; +} + +std::optional> +AllCookedSources::GetSourcePositionRange(CharBlock cookedRange) const { + if (auto range{GetProvenanceRange(cookedRange)}) { + if (auto firstOffset{allSources_.GetSourcePosition(range->start())}) { + if (auto secondOffset{ + allSources_.GetSourcePosition(range->start() + range->size())}) { + return std::pair{*firstOffset, *secondOffset}; + } + } + } + return std::nullopt; +} + +std::optional AllCookedSources::GetCharBlock( + ProvenanceRange range) const { + for (const auto &c : cooked_) { + if (auto result{c.GetCharBlock(range)}) { + return result; + } + } + return nullptr; +} + +void AllCookedSources::Dump(llvm::raw_ostream &o) const { + o << "AllSources:\n"; + allSources_.Dump(o); + for (const auto &c : cooked_) { + c.Dump(o); + } +} + } // namespace Fortran::parser diff --git a/flang/lib/Semantics/mod-file.cpp b/flang/lib/Semantics/mod-file.cpp index 6fa59f0a82a0..ef62a94b1b89 100644 --- a/flang/lib/Semantics/mod-file.cpp +++ b/flang/lib/Semantics/mod-file.cpp @@ -751,7 +751,7 @@ Scope *ModFileReader::Read(const SourceName &name, Scope *ancestor) { return it->second->scope(); } } - parser::Parsing parsing{context_.allSources()}; + parser::Parsing parsing{context_.allCookedSources()}; parser::Options options; options.isModuleFile = true; options.features.Enable(common::LanguageFeature::BackslashEscapes); @@ -796,7 +796,6 @@ Scope *ModFileReader::Read(const SourceName &name, Scope *ancestor) { } auto &modSymbol{*it->second}; modSymbol.set(Symbol::Flag::ModFile); - modSymbol.scope()->set_chars(parsing.cooked()); return modSymbol.scope(); } diff --git a/flang/lib/Semantics/scope.cpp b/flang/lib/Semantics/scope.cpp index a2a9e1dbe9e7..c7635c0b1a3b 100644 --- a/flang/lib/Semantics/scope.cpp +++ b/flang/lib/Semantics/scope.cpp @@ -217,14 +217,6 @@ DeclTypeSpec &Scope::MakeDerivedType( return declTypeSpecs_.emplace_back(category, std::move(spec)); } -void Scope::set_chars(parser::CookedSource &cooked) { - CHECK(kind_ == Kind::Module); - CHECK(parent_.IsGlobal() || parent_.IsModuleFile()); - CHECK(DEREF(symbol_).test(Symbol::Flag::ModFile)); - // TODO: Preserve the CookedSource rather than acquiring its string. - chars_ = cooked.AcquireData(); -} - Scope::ImportKind Scope::GetImportKind() const { if (importKind_) { return *importKind_; diff --git a/flang/lib/Semantics/semantics.cpp b/flang/lib/Semantics/semantics.cpp index af5b120d9393..b5b7802c22a1 100644 --- a/flang/lib/Semantics/semantics.cpp +++ b/flang/lib/Semantics/semantics.cpp @@ -181,9 +181,9 @@ static bool PerformStatementSemantics( SemanticsContext::SemanticsContext( const common::IntrinsicTypeDefaultKinds &defaultKinds, const common::LanguageFeatureControl &languageFeatures, - parser::AllSources &allSources) + parser::AllCookedSources &allCookedSources) : defaultKinds_{defaultKinds}, languageFeatures_{languageFeatures}, - allSources_{allSources}, + allCookedSources_{allCookedSources}, intrinsics_{evaluate::IntrinsicProcTable::Configure(defaultKinds_)}, foldingContext_{ parser::ContextualMessages{&messages_}, defaultKinds_, intrinsics_} {} @@ -351,7 +351,7 @@ bool Semantics::Perform() { } void Semantics::EmitMessages(llvm::raw_ostream &os) const { - context_.messages().Emit(os, cooked_); + context_.messages().Emit(os, context_.allCookedSources()); } void Semantics::DumpSymbols(llvm::raw_ostream &os) { @@ -361,9 +361,10 @@ void Semantics::DumpSymbols(llvm::raw_ostream &os) { void Semantics::DumpSymbolsSources(llvm::raw_ostream &os) const { NameToSymbolMap symbols; GetSymbolNames(context_.globalScope(), symbols); + const parser::AllCookedSources &allCooked{context_.allCookedSources()}; for (const auto &pair : symbols) { const Symbol &symbol{pair.second}; - if (auto sourceInfo{cooked_.GetSourcePositionRange(symbol.name())}) { + if (auto sourceInfo{allCooked.GetSourcePositionRange(symbol.name())}) { os << symbol.name().ToString() << ": " << sourceInfo->first.file.path() << ", " << sourceInfo->first.line << ", " << sourceInfo->first.column << "-" << sourceInfo->second.column << "\n"; diff --git a/flang/test/Semantics/getsymbols02.f90 b/flang/test/Semantics/getsymbols02.f90 index 1eed3e922e82..80b7651f029b 100644 --- a/flang/test/Semantics/getsymbols02.f90 +++ b/flang/test/Semantics/getsymbols02.f90 @@ -10,5 +10,5 @@ PROGRAM helloworld ! RUN: %f18 -fparse-only %S/Inputs/getsymbols02-a.f90 ! RUN: %f18 -fparse-only %S/Inputs/getsymbols02-b.f90 ! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s -! CHECK: callget5: mm2b -! CHECK: get5: mm2a +! CHECK: callget5: ./mm2b.mod, +! CHECK: get5: ./mm2a.mod, diff --git a/flang/tools/f18-parse-demo/f18-parse-demo.cpp b/flang/tools/f18-parse-demo/f18-parse-demo.cpp index 60303aa7a24f..4ccc65e0631d 100644 --- a/flang/tools/f18-parse-demo/f18-parse-demo.cpp +++ b/flang/tools/f18-parse-demo/f18-parse-demo.cpp @@ -160,14 +160,15 @@ std::string CompileFortran( } options.searchDirectories = driver.searchDirectories; Fortran::parser::AllSources allSources; - Fortran::parser::Parsing parsing{allSources}; + Fortran::parser::AllCookedSources allCookedSources{allSources}; + Fortran::parser::Parsing parsing{allCookedSources}; auto start{CPUseconds()}; parsing.Prescan(path, options); if (!parsing.messages().empty() && (driver.warningsAreErrors || parsing.messages().AnyFatalError())) { llvm::errs() << driver.prefix << "could not scan " << path << '\n'; - parsing.messages().Emit(llvm::errs(), parsing.cooked()); + parsing.messages().Emit(llvm::errs(), parsing.allCooked()); exitStatus = EXIT_FAILURE; return {}; } @@ -191,7 +192,7 @@ std::string CompileFortran( } parsing.ClearLog(); - parsing.messages().Emit(llvm::errs(), parsing.cooked()); + parsing.messages().Emit(llvm::errs(), parsing.allCooked()); if (!parsing.consumedWholeFile()) { parsing.EmitMessage(llvm::errs(), parsing.finalRestingPlace(), "parser FAIL (final position)"); diff --git a/flang/tools/f18/f18.cpp b/flang/tools/f18/f18.cpp index 156c2337d0c8..a33a167686e4 100644 --- a/flang/tools/f18/f18.cpp +++ b/flang/tools/f18/f18.cpp @@ -188,9 +188,10 @@ std::string CompileFortran(std::string path, Fortran::parser::Options options, DriverOptions &driver, const Fortran::common::IntrinsicTypeDefaultKinds &defaultKinds) { Fortran::parser::AllSources allSources; + Fortran::parser::AllCookedSources allCookedSources{allSources}; allSources.set_encoding(driver.encoding); Fortran::semantics::SemanticsContext semanticsContext{ - defaultKinds, options.features, allSources}; + defaultKinds, options.features, allCookedSources}; semanticsContext.set_moduleDirectory(driver.moduleDirectory) .set_moduleFileSuffix(driver.moduleFileSuffix) .set_searchDirectories(driver.searchDirectories) @@ -204,12 +205,12 @@ std::string CompileFortran(std::string path, Fortran::parser::Options options, } } options.searchDirectories = driver.searchDirectories; - Fortran::parser::Parsing parsing{semanticsContext.allSources()}; + Fortran::parser::Parsing parsing{allCookedSources}; parsing.Prescan(path, options); if (!parsing.messages().empty() && (driver.warningsAreErrors || parsing.messages().AnyFatalError())) { llvm::errs() << driver.prefix << "could not scan " << path << '\n'; - parsing.messages().Emit(llvm::errs(), parsing.cooked()); + parsing.messages().Emit(llvm::errs(), allCookedSources); exitStatus = EXIT_FAILURE; return {}; } @@ -218,7 +219,7 @@ std::string CompileFortran(std::string path, Fortran::parser::Options options, return {}; } if (driver.dumpCookedChars) { - parsing.messages().Emit(llvm::errs(), parsing.cooked()); + parsing.messages().Emit(llvm::errs(), allCookedSources); parsing.DumpCookedChars(llvm::outs()); return {}; } @@ -228,7 +229,7 @@ std::string CompileFortran(std::string path, Fortran::parser::Options options, return {}; } parsing.ClearLog(); - parsing.messages().Emit(llvm::errs(), parsing.cooked()); + parsing.messages().Emit(llvm::errs(), allCookedSources); if (!parsing.consumedWholeFile()) { parsing.EmitMessage(llvm::errs(), parsing.finalRestingPlace(), "parser FAIL (final position)"); @@ -274,7 +275,7 @@ std::string CompileFortran(std::string path, Fortran::parser::Options options, return {}; } if (driver.getDefinition) { - if (auto cb{parsing.cooked().GetCharBlockFromLineAndColumns( + if (auto cb{allCookedSources.GetCharBlockFromLineAndColumns( driver.getDefinitionArgs.line, driver.getDefinitionArgs.startColumn, driver.getDefinitionArgs.endColumn)}) { @@ -283,7 +284,7 @@ std::string CompileFortran(std::string path, Fortran::parser::Options options, llvm::errs() << "Found symbol name: " << symbol->name().ToString() << "\n"; if (auto sourceInfo{ - parsing.cooked().GetSourcePositionRange(symbol->name())}) { + allCookedSources.GetSourcePositionRange(symbol->name())}) { llvm::outs() << symbol->name().ToString() << ": " << sourceInfo->first.file.path() << ", " << sourceInfo->first.line << ", " diff --git a/flang/unittests/Evaluate/intrinsics.cpp b/flang/unittests/Evaluate/intrinsics.cpp index 3b9805946286..4f2a21dfe604 100644 --- a/flang/unittests/Evaluate/intrinsics.cpp +++ b/flang/unittests/Evaluate/intrinsics.cpp @@ -22,9 +22,9 @@ class CookedStrings { } void Save(const std::string &s) { offsets_[s] = cooked_.Put(s); - cooked_.PutProvenance(cooked_.allSources().AddCompilerInsertion(s)); + cooked_.PutProvenance(allSources_.AddCompilerInsertion(s)); } - void Marshal() { cooked_.Marshal(); } + void Marshal() { cooked_.Marshal(allSources_); } parser::CharBlock operator()(const std::string &s) { return {cooked_.data().data() + offsets_[s], s.size()}; } @@ -32,12 +32,13 @@ class CookedStrings { return parser::ContextualMessages{cooked_.data(), &buffer}; } void Emit(llvm::raw_ostream &o, const parser::Messages &messages) { - messages.Emit(o, cooked_); + messages.Emit(o, allCookedSources_); } private: parser::AllSources allSources_; - parser::CookedSource cooked_{allSources_}; + parser::AllCookedSources allCookedSources_{allSources_}; + parser::CookedSource &cooked_{allCookedSources_.NewCookedSource()}; std::map offsets_; }; From d70e05c9e36ada3ea6341764a3bc34de7de7d8dd Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Wed, 2 Sep 2020 17:44:00 +0100 Subject: [PATCH 24/26] [clang-format] Parse double-square attributes as pointer qualifiers Before: x = (foo *[[clang::attr]]) * v; After: x = (foo *[[clang::attr]])*v; Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D86721 --- clang/lib/Format/TokenAnnotator.cpp | 6 ++++++ clang/unittests/Format/FormatTest.cpp | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index a9077500e041..f04f101f0459 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1840,6 +1840,12 @@ class AnnotatingParser { T = T->MatchingParen->Previous->Previous; continue; } + } else if (T->is(TT_AttributeSquare)) { + // Handle `x = (foo *[[clang::foo]])&v;`: + if (T->MatchingParen && T->MatchingParen->Previous) { + T = T->MatchingParen->Previous; + continue; + } } else if (T->canBePointerOrReferenceQualifier()) { T = T->Previous; continue; diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index f2978cdbed8d..14c97784b738 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -8068,6 +8068,8 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) { verifyIndependentOfContext("MACRO(A *_Null_unspecified a);"); verifyIndependentOfContext("MACRO(A *__attribute__((foo)) a);"); verifyIndependentOfContext("MACRO(A *__attribute((foo)) a);"); + verifyIndependentOfContext("MACRO(A *[[clang::attr]] a);"); + verifyIndependentOfContext("MACRO(A *[[clang::attr(\"foo\")]] a);"); verifyIndependentOfContext("MACRO('0' <= c && c <= '9');"); verifyFormat("void f() { f(float{1}, a * a); }"); // FIXME: Is there a way to make this work? @@ -8137,14 +8139,17 @@ TEST_F(FormatTest, UnderstandsPointerQualifiersInCast) { verifyFormat("x = (foo *_Nullable)*v;"); verifyFormat("x = (foo *_Null_unspecified)*v;"); verifyFormat("x = (foo *_Nonnull)*v;"); + verifyFormat("x = (foo *[[clang::attr]])*v;"); + verifyFormat("x = (foo *[[clang::attr(\"foo\")]])*v;"); // Check that we handle multiple trailing qualifiers and skip them all to // determine that the expression is a cast to a pointer type. FormatStyle LongPointerRight = getLLVMStyleWithColumns(999); FormatStyle LongPointerLeft = getLLVMStyleWithColumns(999); LongPointerLeft.PointerAlignment = FormatStyle::PAS_Left; - StringRef AllQualifiers = "const volatile restrict __attribute__((foo)) " - "_Nonnull _Null_unspecified _Nonnull"; + StringRef AllQualifiers = + "const volatile restrict __attribute__((foo)) _Nonnull _Null_unspecified " + "_Nonnull [[clang::attr]]"; verifyFormat(("x = (foo *" + AllQualifiers + ")*v;").str(), LongPointerRight); verifyFormat(("x = (foo* " + AllQualifiers + ")*v;").str(), LongPointerLeft); From 352cf57cfb6ad33a95ff2d80109e1e88aa39b77e Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Wed, 2 Sep 2020 09:22:50 -0700 Subject: [PATCH 25/26] [Bindings] Move LLVMAddInstructionSimplifyPass to Scalar.cpp Should not be with the pass, but alongside all the other C bindings. Reviewed By: sroland Differential Revision: https://reviews.llvm.org/D87041 --- llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp | 5 ----- llvm/lib/Transforms/Scalar/Scalar.cpp | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp b/llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp index 76e3f7859f08..c11d2e4c1d6b 100644 --- a/llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp +++ b/llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp @@ -17,7 +17,6 @@ #include "llvm/IR/DataLayout.h" #include "llvm/IR/Dominators.h" #include "llvm/IR/Function.h" -#include "llvm/IR/LegacyPassManager.h" #include "llvm/IR/Type.h" #include "llvm/InitializePasses.h" #include "llvm/Pass.h" @@ -131,10 +130,6 @@ FunctionPass *llvm::createInstSimplifyLegacyPass() { return new InstSimplifyLegacyPass(); } -void LLVMAddInstructionSimplifyPass(LLVMPassManagerRef PM) { - unwrap(PM)->add(createInstSimplifyLegacyPass()); -} - PreservedAnalyses InstSimplifyPass::run(Function &F, FunctionAnalysisManager &AM) { auto &DT = AM.getResult(F); diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp b/llvm/lib/Transforms/Scalar/Scalar.cpp index 55b9dd7482cc..f4dc6f2996b9 100644 --- a/llvm/lib/Transforms/Scalar/Scalar.cpp +++ b/llvm/lib/Transforms/Scalar/Scalar.cpp @@ -166,6 +166,10 @@ void LLVMAddIndVarSimplifyPass(LLVMPassManagerRef PM) { unwrap(PM)->add(createIndVarSimplifyPass()); } +void LLVMAddInstructionSimplifyPass(LLVMPassManagerRef PM) { + unwrap(PM)->add(createInstSimplifyLegacyPass()); +} + void LLVMAddJumpThreadingPass(LLVMPassManagerRef PM) { unwrap(PM)->add(createJumpThreadingPass()); } From 8d2d0e84857cb1f2d01456eb433b5172d3a0772b Mon Sep 17 00:00:00 2001 From: Douglas Yung Date: Wed, 2 Sep 2020 10:35:42 -0700 Subject: [PATCH 26/26] Revert "Move all fields of '-cc1' option related classes into def file databases" This reverts commit c4a2a1307484cffe94a291c42572775411bac8d8. This commit was causing a test failure: http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l/builds/1068 --- clang/include/clang/Basic/CodeGenOptions.def | 233 +----------------- clang/include/clang/Basic/CodeGenOptions.h | 212 +++++++++++++++- clang/include/clang/Basic/CommentOptions.def | 26 -- clang/include/clang/Basic/CommentOptions.h | 10 +- .../include/clang/Basic/DiagnosticOptions.def | 27 -- clang/include/clang/Basic/DiagnosticOptions.h | 26 +- .../include/clang/Basic/FileSystemOptions.def | 21 -- clang/include/clang/Basic/FileSystemOptions.h | 5 +- clang/include/clang/Basic/LangOptions.def | 72 ------ clang/include/clang/Basic/LangOptions.h | 69 +++++- clang/include/clang/Basic/TargetOptions.def | 88 ------- clang/include/clang/Basic/TargetOptions.h | 66 ++++- .../clang/Frontend/CompilerInvocation.h | 14 +- .../Frontend/DependencyOutputOptions.def | 50 ---- .../clang/Frontend/DependencyOutputOptions.h | 46 +++- .../clang/Frontend/FrontendOptions.def | 179 -------------- .../include/clang/Frontend/FrontendOptions.h | 191 ++++++++++++-- .../clang/Frontend/MigratorOptions.def | 27 -- .../include/clang/Frontend/MigratorOptions.h | 11 +- .../Frontend/PreprocessorOutputOptions.def | 46 ---- .../Frontend/PreprocessorOutputOptions.h | 12 +- .../include/clang/Lex/HeaderSearchOptions.def | 136 ---------- clang/include/clang/Lex/HeaderSearchOptions.h | 127 +++++++++- .../include/clang/Lex/PreprocessorOptions.def | 166 ------------- clang/include/clang/Lex/PreprocessorOptions.h | 157 ++++++++++-- .../clang/Sema/CodeCompleteOptions.def | 51 ---- .../include/clang/Sema/CodeCompleteOptions.h | 35 ++- .../StaticAnalyzer/Core/AnalyzerOptions.def | 94 +------ .../StaticAnalyzer/Core/AnalyzerOptions.h | 94 ++++++- clang/lib/Basic/CodeGenOptions.cpp | 5 +- clang/lib/Basic/LangOptions.cpp | 3 +- 31 files changed, 975 insertions(+), 1324 deletions(-) delete mode 100644 clang/include/clang/Basic/CommentOptions.def delete mode 100644 clang/include/clang/Basic/FileSystemOptions.def delete mode 100644 clang/include/clang/Basic/TargetOptions.def delete mode 100644 clang/include/clang/Frontend/DependencyOutputOptions.def delete mode 100644 clang/include/clang/Frontend/FrontendOptions.def delete mode 100644 clang/include/clang/Frontend/MigratorOptions.def delete mode 100644 clang/include/clang/Frontend/PreprocessorOutputOptions.def delete mode 100644 clang/include/clang/Lex/HeaderSearchOptions.def delete mode 100644 clang/include/clang/Lex/PreprocessorOptions.def delete mode 100644 clang/include/clang/Sema/CodeCompleteOptions.def diff --git a/clang/include/clang/Basic/CodeGenOptions.def b/clang/include/clang/Basic/CodeGenOptions.def index 758dfbc1d283..8b89aac8d6d5 100644 --- a/clang/include/clang/Basic/CodeGenOptions.def +++ b/clang/include/clang/Basic/CodeGenOptions.def @@ -14,20 +14,17 @@ // //===----------------------------------------------------------------------===// #ifndef CODEGENOPT -#error Define the CODEGENOPT macro to handle language options +# error Define the CODEGENOPT macro to handle language options #endif #ifndef VALUE_CODEGENOPT -#define VALUE_CODEGENOPT(Name, Bits, Default) CODEGENOPT(Name, Bits, Default) +# define VALUE_CODEGENOPT(Name, Bits, Default) \ +CODEGENOPT(Name, Bits, Default) #endif #ifndef ENUM_CODEGENOPT -#define ENUM_CODEGENOPT(Name, Type, Bits, Default) \ - CODEGENOPT(Name, Bits, Default) -#endif - -#ifndef TYPED_CODEGENOPT -#define TYPED_CODEGENOPT(Type, Name, Description) +# define ENUM_CODEGENOPT(Name, Type, Bits, Default) \ +CODEGENOPT(Name, Bits, Default) #endif CODEGENOPT(DisableIntegratedAS, 1, 0) ///< -no-integrated-as @@ -398,226 +395,6 @@ CODEGENOPT(KeepStaticConsts, 1, 0) /// Whether to not follow the AAPCS that enforce at least one read before storing to a volatile bitfield CODEGENOPT(ForceAAPCSBitfieldLoad, 1, 0) -TYPED_CODEGENOPT( - std::string, BBSections, - "This field stores one of the allowed values for the option " - "-fbasic-block-sections=. The allowed values with this option are: " - "{\"labels\", \"all\", \"list=\", \"none\"}. \"labels\": Only " - "generate basic block symbols (labels) for all basic blocks, do not " - "generate unique sections for basic blocks. Use the machine basic block id " - "in the symbol name to associate profile info from virtual address to " - "machine basic block. \"all\" : Generate basic block sections for " - "all basic blocks. \"list=\": Generate basic block sections for a " - "subset of basic blocks. The functions and the machine basic block ids are " - "specified in the file. \"none\": Disable sections/labels for basic " - "blocks.") - -TYPED_CODEGENOPT(std::string, CodeModel, "The code model to use (-mcmodel).") - -TYPED_CODEGENOPT(std::string, CoverageDataFile, - "The filename with path we use for coverage data files. The " - "runtime allows further manipulation with the GCOV_PREFIX and " - "GCOV_PREFIX_STRIP environment variables. The filename with " - "path we use for coverage notes files.") -TYPED_CODEGENOPT(std::string, CoverageNotesFile, "") - -TYPED_CODEGENOPT( - std::string, ProfileFilterFiles, - "Regexes separated by a semi-colon to filter the files to instrument.") - -TYPED_CODEGENOPT( - std::string, ProfileExcludeFiles, - "Regexes separated by a semi-colon to filter the files to not instrument.") - -TYPED_CODEGENOPT(CoverageVersionTy, CoverageVersion, - "The version string to put into coverage files.") - -TYPED_CODEGENOPT(std::string, DebugPass, - "Enable additional debugging information.") - -TYPED_CODEGENOPT(std::string, DebugCompilationDir, - "The string to embed in debug information as the current " - "working directory.") - -TYPED_CODEGENOPT(std::string, DwarfDebugFlags, - "The string to embed in the debug information for the compile " - "unit, if non-empty.") - -TYPED_CODEGENOPT(std::string, RecordCommandLine, - "The string containing the commandline for the " - "llvm.commandline metadata, if non-empty.") - -TYPED_CODEGENOPT(DebugPrefixMapTy, DebugPrefixMap, "") - -TYPED_CODEGENOPT(std::string, FloatABI, - "The ABI to use for passing floating point arguments.") - -TYPED_CODEGENOPT(llvm::DenormalMode, FPDenormalMode, - "The floating-point denormal mode to use.") - -TYPED_CODEGENOPT(llvm::DenormalMode, FP32DenormalMode, - "The floating-point denormal mode to use, for float.") - -TYPED_CODEGENOPT(std::string, LimitFloatPrecision, - "The float precision limit to use, if non-empty.") - -TYPED_CODEGENOPT(std::vector, LinkBitcodeFiles, - "The files specified here are linked in to the module before " - "optimizations.") - -TYPED_CODEGENOPT( - std::string, MainFileName, - "The user provided name for the \"main file\", if non-empty. This is " - "useful in situations where the input file name does not match the " - "original input file, for example with -save-temps.") - -TYPED_CODEGENOPT(std::string, SplitDwarfFile, - "The name for the split debug info file used for the " - "DW_AT_[GNU_]dwo_name attribute in the skeleton CU.") - -TYPED_CODEGENOPT( - std::string, SplitDwarfOutput, - "Output filename for the split debug info, not used in the skeleton CU.") - -TYPED_CODEGENOPT(llvm::Reloc::Model, RelocationModel, - "The name of the relocation model to use.") - -TYPED_CODEGENOPT(std::string, ThreadModel, "The thread model to use") - -TYPED_CODEGENOPT(std::string, TrapFuncName, - "If not an empty string, trap intrinsics are lowered to calls " - "to this function instead of to trap instructions.") - -TYPED_CODEGENOPT(std::vector, DependentLibraries, - "A list of dependent libraries.") - -TYPED_CODEGENOPT(std::vector, LinkerOptions, - "A list of linker options to embed in the object file.") - -TYPED_CODEGENOPT( - std::string, InstrProfileOutput, - "Name of the profile file to use as output for -fprofile-instr-generate, " - "-fprofile-generate, and -fcs-profile-generate.") - -TYPED_CODEGENOPT(std::string, SampleProfileFile, - "Name of the profile file to use with -fprofile-sample-use.") - -TYPED_CODEGENOPT( - std::string, ProfileInstrumentUsePath, - "Name of the profile file to use as input for -fprofile-instr-use") - -TYPED_CODEGENOPT( - std::string, ProfileRemappingFile, - "Name of the profile remapping file to apply to the profile data supplied " - "by -fprofile-sample-use or -fprofile-instr-use.") - -TYPED_CODEGENOPT(std::string, ThinLTOIndexFile, - "Name of the function summary index file to use for ThinLTO " - "function importing.") - -TYPED_CODEGENOPT( - std::string, ThinLinkBitcodeFile, - "Name of a file that can optionally be written with minimized bitcode to " - "be used as input for the ThinLTO thin link step, which only needs the " - "summary and module symbol table (and not, e.g. any debug metadata).") - -TYPED_CODEGENOPT(std::string, SaveTempsFilePrefix, - "Prefix to use for -save-temps output.") - -TYPED_CODEGENOPT( - std::string, CudaGpuBinaryFileName, - "Name of file passed with -fcuda-include-gpubinary option to forward to " - "CUDA runtime back-end for incorporating them into host-side object file.") - -TYPED_CODEGENOPT(std::string, OptRecordFile, - "The name of the file to which the backend should save YAML " - "optimization records.") - -TYPED_CODEGENOPT(std::string, OptRecordPasses, - "The regex that filters the passes that should be saved to " - "the optimization records.") - -TYPED_CODEGENOPT(std::string, OptRecordFormat, - "The format used for serializing remarks (default: YAML)") - -TYPED_CODEGENOPT( - std::string, SymbolPartition, - "The name of the partition that symbols are assigned to, specified with " - "-fsymbol-partition (see https://lld.llvm.org/Partitions.html).") - -TYPED_CODEGENOPT( - std::shared_ptr, OptimizationRemarkPattern, - "Regular expression to select optimizations for which we should enable " - "optimization remarks. Transformation passes whose name matches this " - "expression (and support this feature), will emit a diagnostic whenever " - "they perform a transformation. This is enabled by the -Rpass=regexp flag.") - -TYPED_CODEGENOPT( - std::shared_ptr, OptimizationRemarkMissedPattern, - "Regular expression to select optimizations for which we should enable " - "missed optimization remarks. Transformation passes whose name matches " - "this expression (and support this feature), will emit a diagnostic " - "whenever they tried but failed to perform a transformation. This is " - "enabled by the -Rpass-missed=regexp flag.") - -TYPED_CODEGENOPT( - std::shared_ptr, OptimizationRemarkAnalysisPattern, - "Regular expression to select optimizations for which we should enable " - "optimization analyses. Transformation passes whose name matches this " - "expression (and support this feature), will emit a diagnostic whenever " - "they want to explain why they decided to apply or not apply a given " - "transformation. This is enabled by the -Rpass-analysis=regexp flag.") - -TYPED_CODEGENOPT(std::vector, RewriteMapFiles, - "Set of files defining the rules for the symbol rewriting.") - -TYPED_CODEGENOPT(SanitizerSet, SanitizeRecover, - "Set of sanitizer checks that are non-fatal (i.e. execution " - "should be continued when possible).") - -TYPED_CODEGENOPT(SanitizerSet, SanitizeTrap, - "Set of sanitizer checks that trap rather than diagnose.") - -TYPED_CODEGENOPT(std::vector, CmdArgs, - "List of backend command-line options for -fembed-bitcode.") - -TYPED_CODEGENOPT(std::vector, NoBuiltinFuncs, - "A list of all -fno-builtin-* function names (e.g., memset).") - -TYPED_CODEGENOPT(std::vector, Reciprocals, "") - -TYPED_CODEGENOPT(std::string, PreferVectorWidth, - "The preferred width for auto-vectorization transforms. This " - "is intended to override default transforms based on the " - "width of the architected vector registers.") - -TYPED_CODEGENOPT(XRayInstrSet, XRayInstrumentationBundle, - "Set of XRay instrumentation kinds to emit.") - -TYPED_CODEGENOPT(std::vector, DefaultFunctionAttrs, "") - -TYPED_CODEGENOPT( - std::vector, PassPlugins, - "List of dynamic shared object files to be loaded as pass plugins.") - -TYPED_CODEGENOPT( - std::vector, SanitizeCoverageAllowlistFiles, - "Path to allowlist file specifying which objects (files, functions) should " - "exclusively be instrumented by sanitizer coverage pass.") - -TYPED_CODEGENOPT(std::vector, SanitizeCoverageBlocklistFiles, - "Path to blocklist file specifying which objects (files, " - "functions) listed for instrumentation by sanitizer coverage " - "pass should actually not be instrumented.") - -TYPED_CODEGENOPT( - const char *, Argv0, - "Executable and command-line used to create a given CompilerInvocation. " - "Most of the time this will be the full -cc1 command.") - -TYPED_CODEGENOPT(ArrayRef, CommandLineArgs, "") - #undef CODEGENOPT #undef ENUM_CODEGENOPT #undef VALUE_CODEGENOPT -#undef TYPED_CODEGENOPT diff --git a/clang/include/clang/Basic/CodeGenOptions.h b/clang/include/clang/Basic/CodeGenOptions.h index 093f4014ae8c..ca391bf8f186 100644 --- a/clang/include/clang/Basic/CodeGenOptions.h +++ b/clang/include/clang/Basic/CodeGenOptions.h @@ -110,15 +110,75 @@ class CodeGenOptions : public CodeGenOptionsBase { Embed_Marker // Embed a marker as a placeholder for bitcode. }; + // This field stores one of the allowed values for the option + // -fbasic-block-sections=. The allowed values with this option are: + // {"labels", "all", "list=", "none"}. + // + // "labels": Only generate basic block symbols (labels) for all basic + // blocks, do not generate unique sections for basic blocks. + // Use the machine basic block id in the symbol name to + // associate profile info from virtual address to machine + // basic block. + // "all" : Generate basic block sections for all basic blocks. + // "list=": Generate basic block sections for a subset of basic blocks. + // The functions and the machine basic block ids are specified + // in the file. + // "none": Disable sections/labels for basic blocks. + std::string BBSections; + enum class FramePointerKind { None, // Omit all frame pointers. NonLeaf, // Keep non-leaf frame pointers. All, // Keep all frame pointers. }; - using DebugPrefixMapTy = std::map; + /// The code model to use (-mcmodel). + std::string CodeModel; + + /// The filename with path we use for coverage data files. The runtime + /// allows further manipulation with the GCOV_PREFIX and GCOV_PREFIX_STRIP + /// environment variables. + std::string CoverageDataFile; + + /// The filename with path we use for coverage notes files. + std::string CoverageNotesFile; + + /// Regexes separated by a semi-colon to filter the files to instrument. + std::string ProfileFilterFiles; + + /// Regexes separated by a semi-colon to filter the files to not instrument. + std::string ProfileExcludeFiles; + + /// The version string to put into coverage files. + char CoverageVersion[4]; + + /// Enable additional debugging information. + std::string DebugPass; + + /// The string to embed in debug information as the current working directory. + std::string DebugCompilationDir; + + /// The string to embed in the debug information for the compile unit, if + /// non-empty. + std::string DwarfDebugFlags; + + /// The string containing the commandline for the llvm.commandline metadata, + /// if non-empty. + std::string RecordCommandLine; + + std::map DebugPrefixMap; + + /// The ABI to use for passing floating point arguments. + std::string FloatABI; + + /// The floating-point denormal mode to use. + llvm::DenormalMode FPDenormalMode = llvm::DenormalMode::getIEEE(); - using CoverageVersionTy = char[4]; + /// The floating-point denormal mode to use, for float. + llvm::DenormalMode FP32DenormalMode = llvm::DenormalMode::getIEEE(); + + /// The float precision limit to use, if non-empty. + std::string LimitFloatPrecision; struct BitcodeFileToLink { /// The filename of the bitcode file to link in. @@ -133,14 +193,156 @@ class CodeGenOptions : public CodeGenOptionsBase { unsigned LinkFlags = 0; }; + /// The files specified here are linked in to the module before optimizations. + std::vector LinkBitcodeFiles; + + /// The user provided name for the "main file", if non-empty. This is useful + /// in situations where the input file name does not match the original input + /// file, for example with -save-temps. + std::string MainFileName; + + /// The name for the split debug info file used for the DW_AT_[GNU_]dwo_name + /// attribute in the skeleton CU. + std::string SplitDwarfFile; + + /// Output filename for the split debug info, not used in the skeleton CU. + std::string SplitDwarfOutput; + + /// The name of the relocation model to use. + llvm::Reloc::Model RelocationModel; + + /// The thread model to use + std::string ThreadModel; + + /// If not an empty string, trap intrinsics are lowered to calls to this + /// function instead of to trap instructions. + std::string TrapFuncName; + + /// A list of dependent libraries. + std::vector DependentLibraries; + + /// A list of linker options to embed in the object file. + std::vector LinkerOptions; + + /// Name of the profile file to use as output for -fprofile-instr-generate, + /// -fprofile-generate, and -fcs-profile-generate. + std::string InstrProfileOutput; + + /// Name of the profile file to use with -fprofile-sample-use. + std::string SampleProfileFile; + + /// Name of the profile file to use as input for -fprofile-instr-use + std::string ProfileInstrumentUsePath; + + /// Name of the profile remapping file to apply to the profile data supplied + /// by -fprofile-sample-use or -fprofile-instr-use. + std::string ProfileRemappingFile; + + /// Name of the function summary index file to use for ThinLTO function + /// importing. + std::string ThinLTOIndexFile; + + /// Name of a file that can optionally be written with minimized bitcode + /// to be used as input for the ThinLTO thin link step, which only needs + /// the summary and module symbol table (and not, e.g. any debug metadata). + std::string ThinLinkBitcodeFile; + + /// Prefix to use for -save-temps output. + std::string SaveTempsFilePrefix; + + /// Name of file passed with -fcuda-include-gpubinary option to forward to + /// CUDA runtime back-end for incorporating them into host-side object file. + std::string CudaGpuBinaryFileName; + + /// The name of the file to which the backend should save YAML optimization + /// records. + std::string OptRecordFile; + + /// The regex that filters the passes that should be saved to the optimization + /// records. + std::string OptRecordPasses; + + /// The format used for serializing remarks (default: YAML) + std::string OptRecordFormat; + + /// The name of the partition that symbols are assigned to, specified with + /// -fsymbol-partition (see https://lld.llvm.org/Partitions.html). + std::string SymbolPartition; + + /// Regular expression to select optimizations for which we should enable + /// optimization remarks. Transformation passes whose name matches this + /// expression (and support this feature), will emit a diagnostic + /// whenever they perform a transformation. This is enabled by the + /// -Rpass=regexp flag. + std::shared_ptr OptimizationRemarkPattern; + + /// Regular expression to select optimizations for which we should enable + /// missed optimization remarks. Transformation passes whose name matches this + /// expression (and support this feature), will emit a diagnostic + /// whenever they tried but failed to perform a transformation. This is + /// enabled by the -Rpass-missed=regexp flag. + std::shared_ptr OptimizationRemarkMissedPattern; + + /// Regular expression to select optimizations for which we should enable + /// optimization analyses. Transformation passes whose name matches this + /// expression (and support this feature), will emit a diagnostic + /// whenever they want to explain why they decided to apply or not apply + /// a given transformation. This is enabled by the -Rpass-analysis=regexp + /// flag. + std::shared_ptr OptimizationRemarkAnalysisPattern; + + /// Set of files defining the rules for the symbol rewriting. + std::vector RewriteMapFiles; + + /// Set of sanitizer checks that are non-fatal (i.e. execution should be + /// continued when possible). + SanitizerSet SanitizeRecover; + + /// Set of sanitizer checks that trap rather than diagnose. + SanitizerSet SanitizeTrap; + + /// List of backend command-line options for -fembed-bitcode. + std::vector CmdArgs; + + /// A list of all -fno-builtin-* function names (e.g., memset). + std::vector NoBuiltinFuncs; + + std::vector Reciprocals; + + /// The preferred width for auto-vectorization transforms. This is intended to + /// override default transforms based on the width of the architected vector + /// registers. + std::string PreferVectorWidth; + + /// Set of XRay instrumentation kinds to emit. + XRayInstrSet XRayInstrumentationBundle; + + std::vector DefaultFunctionAttrs; + + /// List of dynamic shared object files to be loaded as pass plugins. + std::vector PassPlugins; + + /// Path to allowlist file specifying which objects + /// (files, functions) should exclusively be instrumented + /// by sanitizer coverage pass. + std::vector SanitizeCoverageAllowlistFiles; + + /// Path to blocklist file specifying which objects + /// (files, functions) listed for instrumentation by sanitizer + /// coverage pass should actually not be instrumented. + std::vector SanitizeCoverageBlocklistFiles; + + /// Executable and command-line used to create a given CompilerInvocation. + /// Most of the time this will be the full -cc1 command. + const char *Argv0 = nullptr; + ArrayRef CommandLineArgs; public: // Define accessors/mutators for code generation options of enumeration type. #define CODEGENOPT(Name, Bits, Default) -#define ENUM_CODEGENOPT(Name, Type, Bits, Default) \ - Type get##Name() const { return static_cast(Name); } \ +#define ENUM_CODEGENOPT(Name, Type, Bits, Default) \ + Type get##Name() const { return static_cast(Name); } \ void set##Name(Type Value) { Name = static_cast(Value); } -#define TYPED_CODEGENOPT(Type, Name, Description) Type Name; #include "clang/Basic/CodeGenOptions.def" CodeGenOptions(); diff --git a/clang/include/clang/Basic/CommentOptions.def b/clang/include/clang/Basic/CommentOptions.def deleted file mode 100644 index 537f9eb34bd4..000000000000 --- a/clang/include/clang/Basic/CommentOptions.def +++ /dev/null @@ -1,26 +0,0 @@ -//===--- CommentOptions.def - Comment option database -------------*- C++ -//-*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This file defines the comment options. Users of this file must -// define the TYPED_COMMENTOPT macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -#ifndef TYPED_COMMENTOPT -#define TYPED_COMMENTOPT(Type, Name, Description) -#endif - -TYPED_COMMENTOPT(BlockCommandNamesTy, BlockCommandNames, - "Command names to treat as vlock commands in comments. Should " - "not include the leading backslash.") - -TYPED_COMMENTOPT(bool, ParseAllComments, - "Treat ordinary comments as documentation comments") - -#undef TYPED_COMMENTOPT diff --git a/clang/include/clang/Basic/CommentOptions.h b/clang/include/clang/Basic/CommentOptions.h index 149650e6192a..7d142fc32f51 100644 --- a/clang/include/clang/Basic/CommentOptions.h +++ b/clang/include/clang/Basic/CommentOptions.h @@ -23,10 +23,14 @@ namespace clang { struct CommentOptions { using BlockCommandNamesTy = std::vector; -#define TYPED_COMMENTOPT(Type, Name, Description) Type Name; -#include "clang/Basic/CommentOptions.def" + /// Command names to treat as block commands in comments. + /// Should not include the leading backslash. + BlockCommandNamesTy BlockCommandNames; - CommentOptions() : ParseAllComments(false) {} + /// Treat ordinary comments as documentation comments. + bool ParseAllComments = false; + + CommentOptions() = default; }; } // namespace clang diff --git a/clang/include/clang/Basic/DiagnosticOptions.def b/clang/include/clang/Basic/DiagnosticOptions.def index 35b01b8c5ce0..a946b5c6be8e 100644 --- a/clang/include/clang/Basic/DiagnosticOptions.def +++ b/clang/include/clang/Basic/DiagnosticOptions.def @@ -43,10 +43,6 @@ DIAGOPT(Name, Bits, Default) ENUM_DIAGOPT(Name, Type, Bits, Default) #endif -#ifndef TYPED_DIAGOPT -#define TYPED_DIAGOPT(Type, Name, Description) -#endif - SEMANTIC_DIAGOPT(IgnoreWarnings, 1, 0) /// -w DIAGOPT(NoRewriteMacros, 1, 0) /// -Wno-rewrite-macros DIAGOPT(Pedantic, 1, 0) /// -pedantic @@ -99,32 +95,9 @@ VALUE_DIAGOPT(TabStop, 32, DefaultTabStop) /// The distance between tab stops. /// Column limit for formatting message diagnostics, or 0 if unused. VALUE_DIAGOPT(MessageLength, 32, 0) -TYPED_DIAGOPT(std::string, DiagnosticLogFile, - "The file to log diagnostic output to.") - -TYPED_DIAGOPT(std::string, DiagnosticSerializationFile, - "The file to serialize diagnostics to (non-appending).") - -TYPED_DIAGOPT(std::vector, Warnings, - "The list of -W... options used to alter the diagnostic " - "mappings, with the prefixes removed.") - -TYPED_DIAGOPT(std::vector, UndefPrefixes, - "The list of prefixes from -Wundef-prefix=... used to generate " - "warnings for undefined macros.") - -TYPED_DIAGOPT(std::vector, Remarks, - "The list of -R... options used to alter the diagnostic " - "mappings, with the prefixes removed.") - -TYPED_DIAGOPT(std::vector, VerifyPrefixes, - "The prefixes for comment directives sought by -verify " - "(\"expected\" by /// default).") - #undef DIAGOPT #undef ENUM_DIAGOPT #undef VALUE_DIAGOPT #undef SEMANTIC_DIAGOPT #undef SEMANTIC_ENUM_DIAGOPT #undef SEMANTIC_VALUE_DIAGOPT -#undef TYPED_DIAGOPT diff --git a/clang/include/clang/Basic/DiagnosticOptions.h b/clang/include/clang/Basic/DiagnosticOptions.h index 2b6bd1fd2be5..7fbe534c5994 100644 --- a/clang/include/clang/Basic/DiagnosticOptions.h +++ b/clang/include/clang/Basic/DiagnosticOptions.h @@ -88,9 +88,31 @@ class DiagnosticOptions : public RefCountedBase{ #include "clang/Basic/DiagnosticOptions.def" public: -#define TYPED_DIAGOPT(Type, Name, Description) Type Name; + /// The file to log diagnostic output to. + std::string DiagnosticLogFile; + + /// The file to serialize diagnostics to (non-appending). + std::string DiagnosticSerializationFile; + + /// The list of -W... options used to alter the diagnostic mappings, with the + /// prefixes removed. + std::vector Warnings; + + /// The list of prefixes from -Wundef-prefix=... used to generate warnings + /// for undefined macros. + std::vector UndefPrefixes; + + /// The list of -R... options used to alter the diagnostic mappings, with the + /// prefixes removed. + std::vector Remarks; + + /// The prefixes for comment directives sought by -verify ("expected" by + /// default). + std::vector VerifyPrefixes; + +public: + // Define accessors/mutators for diagnostic options of enumeration type. #define DIAGOPT(Name, Bits, Default) -// Define accessors/mutators for diagnostic options of enumeration type. #define ENUM_DIAGOPT(Name, Type, Bits, Default) \ Type get##Name() const { return static_cast(Name); } \ void set##Name(Type Value) { Name = static_cast(Value); } diff --git a/clang/include/clang/Basic/FileSystemOptions.def b/clang/include/clang/Basic/FileSystemOptions.def deleted file mode 100644 index 794e9871998e..000000000000 --- a/clang/include/clang/Basic/FileSystemOptions.def +++ /dev/null @@ -1,21 +0,0 @@ -//===--- FileSystemOptions.def - FileSystem option database -----*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This file defines the FileSystem options. -// -//===----------------------------------------------------------------------===// - -#ifndef TYPED_FILESYSTEMOPT -#error define TYPED_FILESYSTEMOPT macro to hand filesystem options -#endif - -TYPED_FILESYSTEMOPT(std::string, WorkingDir, - "If set, paths are resolved as if the working directory was set " - "to the value of WorkingDir.") - -#undef TYPED_FILESYSTEMOPT diff --git a/clang/include/clang/Basic/FileSystemOptions.h b/clang/include/clang/Basic/FileSystemOptions.h index 4fd0851145a2..458af0c7b659 100644 --- a/clang/include/clang/Basic/FileSystemOptions.h +++ b/clang/include/clang/Basic/FileSystemOptions.h @@ -21,8 +21,9 @@ namespace clang { /// Keeps track of options that affect how file operations are performed. class FileSystemOptions { public: -#define TYPED_FILESYSTEMOPT(Type, Name, Description) Type Name; -#include "clang/Basic/FileSystemOptions.def" + /// If set, paths are resolved as if the working directory was + /// set to the value of WorkingDir. + std::string WorkingDir; }; } // end namespace clang diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def index 55a784196bb9..3132e7635418 100644 --- a/clang/include/clang/Basic/LangOptions.def +++ b/clang/include/clang/Basic/LangOptions.def @@ -78,10 +78,6 @@ COMPATIBLE_VALUE_LANGOPT(Name, Bits, Default, Description) #endif -#ifndef TYPED_LANGOPT -#define TYPED_LANGOPT(Type, Name, Descritpion) -#endif - // FIXME: A lot of the BENIGN_ options should be COMPATIBLE_ instead. LANGOPT(C99 , 1, 0, "C99") LANGOPT(C11 , 1, 0, "C11") @@ -391,73 +387,6 @@ LANGOPT(RelativeCXXABIVTables, 1, 0, LANGOPT(ArmSveVectorBits, 32, 0, "SVE vector size in bits") -TYPED_LANGOPT(SanitizerSet, Sanitize, "Set of enabled sanitizers.") - -TYPED_LANGOPT(std::vector, SanitizerBlacklistFiles, - "Paths to blacklist files specifying which objects (files, " - "functions, variables) should not be instrumented.") - -TYPED_LANGOPT(std::vector, XRayAlwaysInstrumentFiles, - "Paths to the XRay \"always instrument\" files specifying which " - "objects (files, functions, variables) should be imbued with the " - "XRay \"always instrument\" attribute. WARNING: This is a " - "deprecated field and will go away in the future.") - -TYPED_LANGOPT(std::vector, XRayNeverInstrumentFiles, - "Paths to the XRay \"never instrument\" files specifying which " - "objects (files, functions, variables) should be imbued with the " - "XRay \"never instrument\" attribute. WARNING: This is a " - "deprecated field and will go away in the future.") - -TYPED_LANGOPT(std::vector, XRayAttrListFiles, - "Paths to the XRay attribute list files, specifying which " - "objects (files, functions, variables) should be imbued with the " - "appropriate XRay attribute(s).") - -TYPED_LANGOPT(clang::ObjCRuntime, ObjCRuntime, "") - -TYPED_LANGOPT(CoreFoundationABI, CFRuntime, "") - -TYPED_LANGOPT(std::string, ObjCConstantStringClass, "") - -TYPED_LANGOPT( - std::string, OverflowHandler, - "The name of the handler function to be called when -ftrapv is specified. " - "If none is specified, abort (GCC-compatible behaviour).") - -TYPED_LANGOPT( - std::string, ModuleName, - "The module currently being compiled as specified by -fmodule-name.") - -TYPED_LANGOPT( - std::string, CurrentModule, - "The name of the current module, of which the main source file is a part. " - "If CompilingModule is set, we are compiling the interface of this module, " - "otherwise we are compiling an implementation file of it. This starts as " - "ModuleName in case -fmodule-name is provided and changes during " - "compilation to reflect the current module.") - -TYPED_LANGOPT(std::vector, ModuleFeatures, - "The names of any features to enable in module 'requires' decls " - "in addition to the hard-coded list in Module.cpp and the target " - "features. This list is sorted.") - -TYPED_LANGOPT(std::vector, NoBuiltinFuncs, - "A list of all -fno-builtin-* function names (e.g., memset).") - -TYPED_LANGOPT( - std::vector, OMPTargetTriples, - "Triples of the OpenMP targets that the host code codegen should take into " - "account in order to generate accurate offloading descriptors.") - -TYPED_LANGOPT(std::string, OMPHostIRFile, - "Name of the IR file that contains the result of the OpenMP " - "target host code generation.") - -TYPED_LANGOPT(bool, IsHeaderFile, - "Indicates whether the front-end is explicitly told that the " - "input is a header file (i.e. -x c-header).") - #undef LANGOPT #undef COMPATIBLE_LANGOPT #undef BENIGN_LANGOPT @@ -467,4 +396,3 @@ TYPED_LANGOPT(bool, IsHeaderFile, #undef VALUE_LANGOPT #undef COMPATIBLE_VALUE_LANGOPT #undef BENIGN_VALUE_LANGOPT -#undef TYPED_LANGOPT diff --git a/clang/include/clang/Basic/LangOptions.h b/clang/include/clang/Basic/LangOptions.h index 6af97fd5b2a7..4e277435bf8f 100644 --- a/clang/include/clang/Basic/LangOptions.h +++ b/clang/include/clang/Basic/LangOptions.h @@ -227,12 +227,75 @@ class LangOptions : public LangOptionsBase { }; public: + /// Set of enabled sanitizers. + SanitizerSet Sanitize; + + /// Paths to blacklist files specifying which objects + /// (files, functions, variables) should not be instrumented. + std::vector SanitizerBlacklistFiles; + + /// Paths to the XRay "always instrument" files specifying which + /// objects (files, functions, variables) should be imbued with the XRay + /// "always instrument" attribute. + /// WARNING: This is a deprecated field and will go away in the future. + std::vector XRayAlwaysInstrumentFiles; + + /// Paths to the XRay "never instrument" files specifying which + /// objects (files, functions, variables) should be imbued with the XRay + /// "never instrument" attribute. + /// WARNING: This is a deprecated field and will go away in the future. + std::vector XRayNeverInstrumentFiles; + + /// Paths to the XRay attribute list files, specifying which objects + /// (files, functions, variables) should be imbued with the appropriate XRay + /// attribute(s). + std::vector XRayAttrListFiles; + + clang::ObjCRuntime ObjCRuntime; + + CoreFoundationABI CFRuntime = CoreFoundationABI::Unspecified; + + std::string ObjCConstantStringClass; + + /// The name of the handler function to be called when -ftrapv is + /// specified. + /// + /// If none is specified, abort (GCC-compatible behaviour). + std::string OverflowHandler; + + /// The module currently being compiled as specified by -fmodule-name. + std::string ModuleName; + + /// The name of the current module, of which the main source file + /// is a part. If CompilingModule is set, we are compiling the interface + /// of this module, otherwise we are compiling an implementation file of + /// it. This starts as ModuleName in case -fmodule-name is provided and + /// changes during compilation to reflect the current module. + std::string CurrentModule; + + /// The names of any features to enable in module 'requires' decls + /// in addition to the hard-coded list in Module.cpp and the target features. + /// + /// This list is sorted. + std::vector ModuleFeatures; + /// Options for parsing comments. CommentOptions CommentOpts; -#define LANGOPT(Name, Bits, Default, Description) -#define TYPED_LANGOPT(Type, Name, Description) Type Name; -#include "clang/Basic/LangOptions.def" + /// A list of all -fno-builtin-* function names (e.g., memset). + std::vector NoBuiltinFuncs; + + /// Triples of the OpenMP targets that the host code codegen should + /// take into account in order to generate accurate offloading descriptors. + std::vector OMPTargetTriples; + + /// Name of the IR file that contains the result of the OpenMP target + /// host code generation. + std::string OMPHostIRFile; + + /// Indicates whether the front-end is explicitly told that the + /// input is a header file (i.e. -x c-header). + bool IsHeaderFile = false; LangOptions(); diff --git a/clang/include/clang/Basic/TargetOptions.def b/clang/include/clang/Basic/TargetOptions.def deleted file mode 100644 index 33e746f012ce..000000000000 --- a/clang/include/clang/Basic/TargetOptions.def +++ /dev/null @@ -1,88 +0,0 @@ -//===--- TargetOptions.def - Target option database -------------*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This file defines the target options. Users of this file must -// define the TYPED_TARGETOPT macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -#ifndef TYPED_TARGETOPT -#error Define the TYPED_TARGETOPT macro to handle target options -#endif - -TYPED_TARGETOPT(std::string, Triple, - "The name of the target triple to compile for.") - -TYPED_TARGETOPT( - std::string, HostTriple, - "When compiling for the device side, contains the triple used to " - "compile for the host.") - -TYPED_TARGETOPT(std::string, CPU, - "If given, the name of the target CPU to generate code for.") - -TYPED_TARGETOPT(std::string, TuneCPU, - "If given, the name of the target CPU to tune code for.") - -TYPED_TARGETOPT(std::string, FPMath, - "If given, the unit to use for floating point math.") - -TYPED_TARGETOPT(std::string, ABI, - "If given, the name of the target ABI to use.") - -TYPED_TARGETOPT(llvm::EABI, EABIVersion, "The EABI version to use.") - -TYPED_TARGETOPT(std::string, LinkerVersion, - "If given, the version string of the linker in use.") - -TYPED_TARGETOPT(std::vector, FeaturesAsWritten, - "The list of target specific features to enable or disable, as " - "written on the command line.") - -TYPED_TARGETOPT( - std::vector, Features, - "The list of target specific features to enable or disable -- this " - "should be a list of strings starting with by '+' or '-'.") - -TYPED_TARGETOPT(llvm::StringMap, FeatureMap, - "The map of which features have been enabled disabled based on " - "the command line.") - -TYPED_TARGETOPT(OpenCLOptions, SupportedOpenCLOptions, - "Supported OpenCL extensions and optional core features.") - -TYPED_TARGETOPT( - std::vector, OpenCLExtensionsAsWritten, - "The list of OpenCL extensions to enable or disable, as written on " - "the command line.") - -TYPED_TARGETOPT( - bool, ForceEnableInt128, - "If given, enables support for __int128_t and __uint128_t types.") - -TYPED_TARGETOPT( - bool, NVPTXUseShortPointers, - "If enabled, use 32-bit pointers for accessing const/local/shared " - "address space.") - -TYPED_TARGETOPT( - std::string, CodeModel, - "The code model to be used as specified by the user. Corresponds to " - "CodeModel::Model enum defined in include/llvm/Support/CodeGen.h, " - "plus \"default\" for the case when the user has not explicitly " - "specified a code model.") - -TYPED_TARGETOPT( - llvm::VersionTuple, SDKVersion, - "The version of the SDK which was used during the compilation. The option " - "is used for two different purposes. On Darwin the version is propagated " - "to LLVM where it's used to support SDK Version metadata (See D55673). " - "CUDA compilation uses it to control parts of CUDA compilation in clang " - "that depend on specific version of the CUDA SDK.") - -#undef TYPED_TARGETOPT diff --git a/clang/include/clang/Basic/TargetOptions.h b/clang/include/clang/Basic/TargetOptions.h index 1771c3bdbb61..d1cc024957da 100644 --- a/clang/include/clang/Basic/TargetOptions.h +++ b/clang/include/clang/Basic/TargetOptions.h @@ -25,9 +25,69 @@ namespace clang { /// Options for controlling the target. class TargetOptions { public: -#define TYPED_TARGETOPT(Type, Name, Description) Type Name; -#include "clang/Basic/TargetOptions.def" - TargetOptions() : ForceEnableInt128(false), NVPTXUseShortPointers(false) {} + /// The name of the target triple to compile for. + std::string Triple; + + /// When compiling for the device side, contains the triple used to compile + /// for the host. + std::string HostTriple; + + /// If given, the name of the target CPU to generate code for. + std::string CPU; + + /// If given, the name of the target CPU to tune code for. + std::string TuneCPU; + + /// If given, the unit to use for floating point math. + std::string FPMath; + + /// If given, the name of the target ABI to use. + std::string ABI; + + /// The EABI version to use + llvm::EABI EABIVersion; + + /// If given, the version string of the linker in use. + std::string LinkerVersion; + + /// The list of target specific features to enable or disable, as written on the command line. + std::vector FeaturesAsWritten; + + /// The list of target specific features to enable or disable -- this should + /// be a list of strings starting with by '+' or '-'. + std::vector Features; + + /// The map of which features have been enabled disabled based on the command + /// line. + llvm::StringMap FeatureMap; + + /// Supported OpenCL extensions and optional core features. + OpenCLOptions SupportedOpenCLOptions; + + /// The list of OpenCL extensions to enable or disable, as written on + /// the command line. + std::vector OpenCLExtensionsAsWritten; + + /// If given, enables support for __int128_t and __uint128_t types. + bool ForceEnableInt128 = false; + + /// \brief If enabled, use 32-bit pointers for accessing const/local/shared + /// address space. + bool NVPTXUseShortPointers = false; + + // The code model to be used as specified by the user. Corresponds to + // CodeModel::Model enum defined in include/llvm/Support/CodeGen.h, plus + // "default" for the case when the user has not explicitly specified a + // code model. + std::string CodeModel; + + /// The version of the SDK which was used during the compilation. + /// The option is used for two different purposes: + /// * on darwin the version is propagated to LLVM where it's used + /// to support SDK Version metadata (See D55673). + /// * CUDA compilation uses it to control parts of CUDA compilation + /// in clang that depend on specific version of the CUDA SDK. + llvm::VersionTuple SDKVersion; }; } // end namespace clang diff --git a/clang/include/clang/Frontend/CompilerInvocation.h b/clang/include/clang/Frontend/CompilerInvocation.h index c8a95ae69d72..c723fc084c85 100644 --- a/clang/include/clang/Frontend/CompilerInvocation.h +++ b/clang/include/clang/Frontend/CompilerInvocation.h @@ -19,10 +19,9 @@ #include "clang/Frontend/FrontendOptions.h" #include "clang/Frontend/MigratorOptions.h" #include "clang/Frontend/PreprocessorOutputOptions.h" -#include "clang/Sema/CodeCompleteOptions.h" #include "clang/StaticAnalyzer/Core/AnalyzerOptions.h" -#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" +#include "llvm/ADT/ArrayRef.h" #include #include @@ -87,9 +86,6 @@ class CompilerInvocationBase { LangOptions *getLangOpts() { return LangOpts.get(); } const LangOptions *getLangOpts() const { return LangOpts.get(); } - CommentOptions &getCommentOpts() { return LangOpts->CommentOpts; } - const CommentOptions &getCommentOpts() const { return LangOpts->CommentOpts; } - TargetOptions &getTargetOpts() { return *TargetOpts.get(); } const TargetOptions &getTargetOpts() const { return *TargetOpts.get(); } @@ -231,14 +227,6 @@ class CompilerInvocation : public CompilerInvocationBase { FrontendOptions &getFrontendOpts() { return FrontendOpts; } const FrontendOptions &getFrontendOpts() const { return FrontendOpts; } - CodeCompleteOptions &getCodeCompleteOpts() { - return FrontendOpts.CodeCompleteOpts; - } - - const CodeCompleteOptions &getCodeCompleteOpts() const { - return FrontendOpts.CodeCompleteOpts; - } - PreprocessorOutputOptions &getPreprocessorOutputOpts() { return PreprocessorOutputOpts; } diff --git a/clang/include/clang/Frontend/DependencyOutputOptions.def b/clang/include/clang/Frontend/DependencyOutputOptions.def deleted file mode 100644 index 0fbd90226f11..000000000000 --- a/clang/include/clang/Frontend/DependencyOutputOptions.def +++ /dev/null @@ -1,50 +0,0 @@ -//===--- DependencyOutputOptions.def -------------------------------C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This file contains the DependencyOutput options, to use this file one needs -// to define the TYPED_DEPENDENCY_OUTPUTOPT and/or the DEPENDECY_OUTPUTOPT macro -// to get more information about bitfields. -// -//===----------------------------------------------------------------------===// - -#ifndef TYPED_DEPENDENCY_OUTPUTOPT -#define TYPED_DEPENDENCY_OUTPUTOPT(Type, Name, Description) -#endif - -#ifndef DEPENDENCY_OUTPUTOPT -#define DEPENDENCY_OUTPUTOPT(Name, Bits, Description) \ - TYPED_DEPENDENCY_OUTPUTOPT(unsigned, Name, Description) -#endif - -DEPENDENCY_OUTPUTOPT(IncludeSystemHeaders, 1, "Include system header dependencies.") -DEPENDENCY_OUTPUTOPT(ShowHeaderIncludes, 1, "Show header inclusions (-H).") -DEPENDENCY_OUTPUTOPT(UsePhonyTargets, 1, "Include phony targets for each dependency, which can " - "avoid some 'make' problems.") -DEPENDENCY_OUTPUTOPT(AddMissingHeaderDeps, 1, "Add missing headers to dependency list.") -DEPENDENCY_OUTPUTOPT(IncludeModuleFiles, 1, "Include module file dependencies.") - -TYPED_DEPENDENCY_OUTPUTOPT(ShowIncludesDestination, ShowIncludesDest, "Destination of cl.exe style /showIncludes info.") - -TYPED_DEPENDENCY_OUTPUTOPT(DependencyOutputFormat, OutputFormat, "The format for the dependency file") - -TYPED_DEPENDENCY_OUTPUTOPT(std::string, OutputFile, "The file to write dependency output to.") - -TYPED_DEPENDENCY_OUTPUTOPT(std::string, HeaderIncludeOutputFile, "The file to write header include output to. This is orthogonal to ShowHeaderIncludes (-H) and will include headers mentioned in the predefines buffer. If the output file is \"-\", output will be sent to stderr.") - -TYPED_DEPENDENCY_OUTPUTOPT(std::vector, Targets, "A list of names to use as the targets in the dependency file; this list must contain at least one entry.") - -TYPED_DEPENDENCY_OUTPUTOPT(std::vector, ExtraDeps, "A list of filenames to be used as extra dependencies for every target.") - -TYPED_DEPENDENCY_OUTPUTOPT(std::string, ShowIncludesPretendHeader, "In /showIncludes mode, pretend the main TU is a header with this name.") - -TYPED_DEPENDENCY_OUTPUTOPT(std::string, DOTOutputFile, "The file to write GraphViz-formatted header dependencies to.") - -TYPED_DEPENDENCY_OUTPUTOPT(std::string, ModuleDependencyOutputDir, "The directory to copy module dependencies to when collecting them.") - -#undef TYPED_DEPENDENCY_OUTPUTOPT -#undef DEPENDENCY_OUTPUTOPT \ No newline at end of file diff --git a/clang/include/clang/Frontend/DependencyOutputOptions.h b/clang/include/clang/Frontend/DependencyOutputOptions.h index 581e9b5a544b..7a4f3337936f 100644 --- a/clang/include/clang/Frontend/DependencyOutputOptions.h +++ b/clang/include/clang/Frontend/DependencyOutputOptions.h @@ -24,15 +24,49 @@ enum class DependencyOutputFormat { Make, NMake }; /// file generation. class DependencyOutputOptions { public: -#define TYPED_DEPENDENCY_OUTPUTOPT(Type, Name, Description) Type Name; -#define DEPENDENCY_OUTPUTOPT(Name, Bits, Description) unsigned Name : Bits; -#include "clang/Frontend/DependencyOutputOptions.def" + unsigned IncludeSystemHeaders : 1; ///< Include system header dependencies. + unsigned ShowHeaderIncludes : 1; ///< Show header inclusions (-H). + unsigned UsePhonyTargets : 1; ///< Include phony targets for each + /// dependency, which can avoid some 'make' + /// problems. + unsigned AddMissingHeaderDeps : 1; ///< Add missing headers to dependency list + unsigned IncludeModuleFiles : 1; ///< Include module file dependencies. + + /// Destination of cl.exe style /showIncludes info. + ShowIncludesDestination ShowIncludesDest = ShowIncludesDestination::None; + + /// The format for the dependency file. + DependencyOutputFormat OutputFormat = DependencyOutputFormat::Make; + + /// The file to write dependency output to. + std::string OutputFile; + + /// The file to write header include output to. This is orthogonal to + /// ShowHeaderIncludes (-H) and will include headers mentioned in the + /// predefines buffer. If the output file is "-", output will be sent to + /// stderr. + std::string HeaderIncludeOutputFile; + + /// A list of names to use as the targets in the dependency file; this list + /// must contain at least one entry. + std::vector Targets; + + /// A list of filenames to be used as extra dependencies for every target. + std::vector ExtraDeps; + + /// In /showIncludes mode, pretend the main TU is a header with this name. + std::string ShowIncludesPretendHeader; + + /// The file to write GraphViz-formatted header dependencies to. + std::string DOTOutputFile; + + /// The directory to copy module dependencies to when collecting them. + std::string ModuleDependencyOutputDir; + public: DependencyOutputOptions() : IncludeSystemHeaders(0), ShowHeaderIncludes(0), UsePhonyTargets(0), - AddMissingHeaderDeps(0), IncludeModuleFiles(0), - ShowIncludesDest(ShowIncludesDestination::None), - OutputFormat(DependencyOutputFormat::Make) {} + AddMissingHeaderDeps(0), IncludeModuleFiles(0) {} }; } // end namespace clang diff --git a/clang/include/clang/Frontend/FrontendOptions.def b/clang/include/clang/Frontend/FrontendOptions.def deleted file mode 100644 index c6188d9cf025..000000000000 --- a/clang/include/clang/Frontend/FrontendOptions.def +++ /dev/null @@ -1,179 +0,0 @@ -//===--- FrontendOptions.def - FileSystem option database -----*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This file defines the Frontend options. -// -//===----------------------------------------------------------------------===// - -#ifndef TYPED_FRONTENDOPT -#define TYPED_FRONTENDOPT(Type, Name, Description) -#endif - -#ifndef FRONTENDOPT -#define FRONTENDOPT(Name, Bits, Description) \ - TYPED_FRONTENDOPT(unsigned, Name, Description) -#endif - -FRONTENDOPT(DisableFree, 1, "Disable memory freeing on exit.") - -FRONTENDOPT(RelocatablePCH, 1, - "When generating PCH files, instruct the AST writer to create " - "relocatable PCH files.") - -FRONTENDOPT(ShowHelp, 1, "Show the -help text.") - -FRONTENDOPT(ShowStats, 1, "Show frontend performance metrics and statistics.") - -FRONTENDOPT(ShowTimers, 1, "Show timers for individual actions.") - -FRONTENDOPT(PrintSupportedCPUs, 1, - "print the supported cpus for the current target") - -FRONTENDOPT(TimeTrace, 1, "Output time trace profile.") - -FRONTENDOPT(ShowVersion, 1, "Show the -version text.") - -FRONTENDOPT(FixWhatYouCan, 1, "Apply fixes even if there are unfixable errors.") - -FRONTENDOPT(FixOnlyWarnings, 1, "Apply fixes only for warnings.") - -FRONTENDOPT(FixAndRecompile, 1, "Apply fixes and recompile.") - -FRONTENDOPT(FixToTemporaries, 1, "Apply fixes to temporary files.") - -FRONTENDOPT(ARCMTAction, 3, "") - -FRONTENDOPT(ARCMTMigrateEmitARCErrors, 1, - "Emit ARC errors even if the migrator can fix them.") - -FRONTENDOPT(SkipFunctionBodies, 1, - "Skip over function bodies to speed up parsing in cases you do not " - "need them (e.g. with code completion).") - -FRONTENDOPT(UseGlobalModuleIndex, 1, - "Whether we can use the global module index if available.") - -FRONTENDOPT(GenerateGlobalModuleIndex, 1, - "Whether we can generate the global module index if needed.") - -FRONTENDOPT(ASTDumpDecls, 1, - "Whether we include declaration dumps in AST dumps.") - -FRONTENDOPT(ASTDumpAll, 1, - "Whether we deserialize all decls when forming AST dumps.") - -FRONTENDOPT(ASTDumpLookups, 1, - "Whether we include lookup table dumps in AST dumps.") - -FRONTENDOPT(ASTDumpDeclTypes, 1, - "Whether we include declaration type dumps in AST dumps.") - -FRONTENDOPT(BuildingImplicitModule, 1, - "Whether we are performing an implicit module build.") - -FRONTENDOPT(ModulesEmbedAllFiles, 1, - "Whether we should embed all used files into the PCM file.") - -FRONTENDOPT(IncludeTimestamps, 1, - "Whether timestamps should be written to the produced PCH file.") - -FRONTENDOPT(UseTemporary, 1, - "Should a temporary file be used during compilation.") - -FRONTENDOPT(IsSystemModule, 1, - "When using -emit-module, treat the modulemap as a system module.") - -TYPED_FRONTENDOPT(ASTDumpOutputFormat, ASTDumpFormat, - "Specifies the output format of the AST.") - -TYPED_FRONTENDOPT(unsigned, ObjCMTAction, "") - -TYPED_FRONTENDOPT(std::string, ObjCMTWhiteListPath, "") - -TYPED_FRONTENDOPT(std::string, MTMigrateDir, "") - -TYPED_FRONTENDOPT(std::string, ARCMTMigrateReportOut, "") - -TYPED_FRONTENDOPT(InputsTy, Inputs, "The input files and their types.") - -TYPED_FRONTENDOPT( - std::string, OriginalModuleMap, - "When the input is a module map, the original module map file from which " - "that map was inferred, if any (for umbrella modules).") - -TYPED_FRONTENDOPT(std::string, OutputFile, "The output file, if any.") - -TYPED_FRONTENDOPT(std::string, FixItSuffix, - "If given, the new suffix for fix-it rewritten files.") - -TYPED_FRONTENDOPT(std::string, ASTDumpFilter, - "If given, filter dumped AST Decl nodes by this substring.") - -TYPED_FRONTENDOPT(ParsedSourceLocation, CodeCompletionAt, - "If given, enable code completion at the provided location.") - -TYPED_FRONTENDOPT(frontend::ActionKind, ProgramAction, - "The frontend action to perform.") - -TYPED_FRONTENDOPT(std::string, ActionName, - "The name of the action to run when using a plugin action.") - -TYPED_FRONTENDOPT(PluginArgsTy, PluginArgs, "Args to pass to the plugins") - -TYPED_FRONTENDOPT( - std::vector, AddPluginActions, - "The list of plugin actions to run in addition to the normal action.") - -TYPED_FRONTENDOPT(std::vector, Plugins, - "The list of plugins to load.") - -TYPED_FRONTENDOPT(std::vector>, - ModuleFileExtensions, "The list of module file extensions.") - -TYPED_FRONTENDOPT( - std::vector, ModuleMapFiles, - "The list of module map files to load before processing the input.") - -TYPED_FRONTENDOPT(std::vector, ModuleFiles, - "The list of additional prebuilt module files to load before " - "processing the input.") - -TYPED_FRONTENDOPT(std::vector, ModulesEmbedFiles, - "The list of files to embed into the compiled module file.") - -TYPED_FRONTENDOPT(std::vector, ASTMergeFiles, - "The list of AST files to merge.") - -TYPED_FRONTENDOPT( - std::vector, LLVMArgs, - "A list of arguments to forward to LLVM's option processing; this should " - "only be used for debugging and experimental features.") - -TYPED_FRONTENDOPT(std::string, OverrideRecordLayoutsFile, - "File name of the file that will provide record layouts (in " - "the format produced by -fdump-record-layouts).") - -TYPED_FRONTENDOPT(std::string, AuxTriple, - "Auxiliary triple for CUDA/HIP compilation.") - -TYPED_FRONTENDOPT(Optional, AuxTargetCPU, - "Auxiliary target CPU for CUDA/HIP compilation.") - -TYPED_FRONTENDOPT(Optional>, AuxTargetFeatures, - "Auxiliary target features for CUDA/HIP compilation.") - -TYPED_FRONTENDOPT(std::string, StatsFile, "Filename to write statistics to.") - -TYPED_FRONTENDOPT( - unsigned, TimeTraceGranularity, - "Minimum time granularity (in microseconds) traced by time profiler.") - -TYPED_FRONTENDOPT(InputKind, DashX, "Input Kind") - -#undef TYPED_FRONTENDOPT -#undef FRONTENDOPT \ No newline at end of file diff --git a/clang/include/clang/Frontend/FrontendOptions.h b/clang/include/clang/Frontend/FrontendOptions.h index 5dccdf50ca46..b2be33032c08 100644 --- a/clang/include/clang/Frontend/FrontendOptions.h +++ b/clang/include/clang/Frontend/FrontendOptions.h @@ -226,14 +226,94 @@ class FrontendInputFile { /// FrontendOptions - Options for controlling the behavior of the frontend. class FrontendOptions { public: - using PluginArgsTy = - std::unordered_map>; + /// Disable memory freeing on exit. + unsigned DisableFree : 1; - using InputsTy = llvm::SmallVector; + /// When generating PCH files, instruct the AST writer to create relocatable + /// PCH files. + unsigned RelocatablePCH : 1; + + /// Show the -help text. + unsigned ShowHelp : 1; + + /// Show frontend performance metrics and statistics. + unsigned ShowStats : 1; + + /// Show timers for individual actions. + unsigned ShowTimers : 1; + + /// print the supported cpus for the current target + unsigned PrintSupportedCPUs : 1; + + /// Output time trace profile. + unsigned TimeTrace : 1; + + /// Show the -version text. + unsigned ShowVersion : 1; + + /// Apply fixes even if there are unfixable errors. + unsigned FixWhatYouCan : 1; + + /// Apply fixes only for warnings. + unsigned FixOnlyWarnings : 1; + + /// Apply fixes and recompile. + unsigned FixAndRecompile : 1; + + /// Apply fixes to temporary files. + unsigned FixToTemporaries : 1; + + /// Emit ARC errors even if the migrator can fix them. + unsigned ARCMTMigrateEmitARCErrors : 1; + + /// Skip over function bodies to speed up parsing in cases you do not need + /// them (e.g. with code completion). + unsigned SkipFunctionBodies : 1; + + /// Whether we can use the global module index if available. + unsigned UseGlobalModuleIndex : 1; + + /// Whether we can generate the global module index if needed. + unsigned GenerateGlobalModuleIndex : 1; + + /// Whether we include declaration dumps in AST dumps. + unsigned ASTDumpDecls : 1; + + /// Whether we deserialize all decls when forming AST dumps. + unsigned ASTDumpAll : 1; + + /// Whether we include lookup table dumps in AST dumps. + unsigned ASTDumpLookups : 1; + + /// Whether we include declaration type dumps in AST dumps. + unsigned ASTDumpDeclTypes : 1; + + /// Whether we are performing an implicit module build. + unsigned BuildingImplicitModule : 1; + + /// Whether we should embed all used files into the PCM file. + unsigned ModulesEmbedAllFiles : 1; + + /// Whether timestamps should be written to the produced PCH file. + unsigned IncludeTimestamps : 1; + + /// Should a temporary file be used during compilation. + unsigned UseTemporary : 1; + + /// When using -emit-module, treat the modulemap as a system module. + unsigned IsSystemModule : 1; CodeCompleteOptions CodeCompleteOpts; - enum { ARCMT_None, ARCMT_Check, ARCMT_Modify, ARCMT_Migrate }; + /// Specifies the output format of the AST. + ASTDumpOutputFormat ASTDumpFormat = ADOF_Default; + + enum { + ARCMT_None, + ARCMT_Check, + ARCMT_Modify, + ARCMT_Migrate + } ARCMTAction = ARCMT_None; enum { ObjCMT_None = 0, @@ -280,18 +360,92 @@ class FrontendOptions { /// Enable converting setter/getter expressions to property-dot syntx. ObjCMT_PropertyDotSyntax = 0x1000, - ObjCMT_MigrateDecls = - (ObjCMT_ReadonlyProperty | ObjCMT_ReadwriteProperty | - ObjCMT_Annotation | ObjCMT_Instancetype | ObjCMT_NsMacros | - ObjCMT_ProtocolConformance | ObjCMT_NsAtomicIOSOnlyProperty | - ObjCMT_DesignatedInitializer), + ObjCMT_MigrateDecls = (ObjCMT_ReadonlyProperty | ObjCMT_ReadwriteProperty | + ObjCMT_Annotation | ObjCMT_Instancetype | + ObjCMT_NsMacros | ObjCMT_ProtocolConformance | + ObjCMT_NsAtomicIOSOnlyProperty | + ObjCMT_DesignatedInitializer), ObjCMT_MigrateAll = (ObjCMT_Literals | ObjCMT_Subscripting | ObjCMT_MigrateDecls | ObjCMT_PropertyDotSyntax) }; + unsigned ObjCMTAction = ObjCMT_None; + std::string ObjCMTWhiteListPath; + + std::string MTMigrateDir; + std::string ARCMTMigrateReportOut; + + /// The input files and their types. + SmallVector Inputs; + + /// When the input is a module map, the original module map file from which + /// that map was inferred, if any (for umbrella modules). + std::string OriginalModuleMap; + + /// The output file, if any. + std::string OutputFile; + + /// If given, the new suffix for fix-it rewritten files. + std::string FixItSuffix; + + /// If given, filter dumped AST Decl nodes by this substring. + std::string ASTDumpFilter; + + /// If given, enable code completion at the provided location. + ParsedSourceLocation CodeCompletionAt; + + /// The frontend action to perform. + frontend::ActionKind ProgramAction = frontend::ParseSyntaxOnly; + + /// The name of the action to run when using a plugin action. + std::string ActionName; + + /// Args to pass to the plugins + std::unordered_map> PluginArgs; + + /// The list of plugin actions to run in addition to the normal action. + std::vector AddPluginActions; + + /// The list of plugins to load. + std::vector Plugins; + + /// The list of module file extensions. + std::vector> ModuleFileExtensions; + + /// The list of module map files to load before processing the input. + std::vector ModuleMapFiles; + + /// The list of additional prebuilt module files to load before + /// processing the input. + std::vector ModuleFiles; + + /// The list of files to embed into the compiled module file. + std::vector ModulesEmbedFiles; + + /// The list of AST files to merge. + std::vector ASTMergeFiles; + + /// A list of arguments to forward to LLVM's option processing; this + /// should only be used for debugging and experimental features. + std::vector LLVMArgs; + + /// File name of the file that will provide record layouts + /// (in the format produced by -fdump-record-layouts). + std::string OverrideRecordLayoutsFile; + + /// Auxiliary triple for CUDA/HIP compilation. + std::string AuxTriple; + + /// Auxiliary target CPU for CUDA/HIP compilation. + Optional AuxTargetCPU; + + /// Auxiliary target features for CUDA/HIP compilation. + Optional> AuxTargetFeatures; + + /// Filename to write statistics to. + std::string StatsFile; -#define FRONTENDOPT(Name, Bits, Description) unsigned Name : Bits; -#define TYPED_FRONTENDOPT(Type, Name, Description) Type Name; -#include "clang/Frontend/FrontendOptions.def" + /// Minimum time granularity (in microseconds) traced by time profiler. + unsigned TimeTraceGranularity; public: FrontendOptions() @@ -299,14 +453,11 @@ class FrontendOptions { ShowStats(false), ShowTimers(false), TimeTrace(false), ShowVersion(false), FixWhatYouCan(false), FixOnlyWarnings(false), FixAndRecompile(false), FixToTemporaries(false), - ARCMTAction(ARCMT_None), ARCMTMigrateEmitARCErrors(false), - SkipFunctionBodies(false), UseGlobalModuleIndex(true), - GenerateGlobalModuleIndex(true), ASTDumpDecls(false), - ASTDumpLookups(false), BuildingImplicitModule(false), - ModulesEmbedAllFiles(false), IncludeTimestamps(true), - UseTemporary(true), ASTDumpFormat(ADOF_Default), - ObjCMTAction(ObjCMT_None), ProgramAction(frontend::ParseSyntaxOnly), - TimeTraceGranularity(500), DashX() {} + ARCMTMigrateEmitARCErrors(false), SkipFunctionBodies(false), + UseGlobalModuleIndex(true), GenerateGlobalModuleIndex(true), + ASTDumpDecls(false), ASTDumpLookups(false), + BuildingImplicitModule(false), ModulesEmbedAllFiles(false), + IncludeTimestamps(true), UseTemporary(true), TimeTraceGranularity(500) {} /// getInputKindForExtension - Return the appropriate input kind for a file /// extension. For example, "c" would return Language::C. diff --git a/clang/include/clang/Frontend/MigratorOptions.def b/clang/include/clang/Frontend/MigratorOptions.def deleted file mode 100644 index fbbcc6b686fd..000000000000 --- a/clang/include/clang/Frontend/MigratorOptions.def +++ /dev/null @@ -1,27 +0,0 @@ -//===--- MigratorOptions.def - Migrator option database ---------*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This file defines the migrator options. Users of this file must -// define the TYPED_MIGRATOROPT macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -#ifndef TYPED_MIGRATOROPT -#define TYPED_MIGRATOROPT(Type, Name, Description) -#endif - -#ifndef MIGRATOROPT -#define MIGRATOROPT(Name, Bits, Description) \ - TYPED_MIGRATOROPT(unsigned, Name, Description) -#endif - -MIGRATOROPT(NoNSAllocReallocError, 1, "") -MIGRATOROPT(NoFinalizeRemoval, 1, "") - -#undef TYPED_MIGRATOROPT -#undef MIGRATOROPT diff --git a/clang/include/clang/Frontend/MigratorOptions.h b/clang/include/clang/Frontend/MigratorOptions.h index f5ee9bba9dec..cf50ffcf0c4f 100644 --- a/clang/include/clang/Frontend/MigratorOptions.h +++ b/clang/include/clang/Frontend/MigratorOptions.h @@ -18,10 +18,13 @@ namespace clang { class MigratorOptions { public: -#define MIGRATOROPT(Name, Bits, Description) unsigned Name : Bits; -#include "clang/Frontend/MigratorOptions.def" - - MigratorOptions() : NoNSAllocReallocError(0), NoFinalizeRemoval(0) {} + unsigned NoNSAllocReallocError : 1; + unsigned NoFinalizeRemoval : 1; + MigratorOptions() { + NoNSAllocReallocError = 0; + NoFinalizeRemoval = 0; + } }; + } #endif diff --git a/clang/include/clang/Frontend/PreprocessorOutputOptions.def b/clang/include/clang/Frontend/PreprocessorOutputOptions.def deleted file mode 100644 index aad2f5eb7294..000000000000 --- a/clang/include/clang/Frontend/PreprocessorOutputOptions.def +++ /dev/null @@ -1,46 +0,0 @@ -//=== PreprocessorOutputOptions.def - FileSystem option database -*- C++-*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This file defines the PreprocessorOutput options. -// -//===----------------------------------------------------------------------===// - -#ifndef TYPED_PREPROCESSOR_OUTPUTOPT -#define TYPED_PREPROCESSOR_OUTPUTOPT(Type, Name, Description) -#endif - -#ifndef PREPROCESSOR_OUTPUTOPT -#define PREPROCESSOR_OUTPUTOPT(Name, Bits, Description) \ - TYPED_PREPROCESSOR_OUTPUTOPT(unsigned, Name, Description) -#endif - -PREPROCESSOR_OUTPUTOPT(ShowCPP, 1, "Print normal preprocessed output.") - -PREPROCESSOR_OUTPUTOPT(ShowComments, 1, "Show comments.") - -PREPROCESSOR_OUTPUTOPT(ShowLineMarkers, 1, "Show \#line markers.") - -PREPROCESSOR_OUTPUTOPT(UseLineDirectives, 1, - "Use \#line instead of GCC-style \# N.") - -PREPROCESSOR_OUTPUTOPT(ShowMacroComments, 1, "Show comments, even in macros.") - -PREPROCESSOR_OUTPUTOPT(ShowMacros, 1, "Print macro definitions.") - -PREPROCESSOR_OUTPUTOPT( - ShowIncludeDirectives, 1, - "Print includes, imports etc. within preprocessed output.") - -PREPROCESSOR_OUTPUTOPT(RewriteIncludes, 1, - "Preprocess include directives only.") - -PREPROCESSOR_OUTPUTOPT(RewriteImports, 1, - "Include contents of transitively-imported modules.") - -#undef TYPED_PREPROCESSOR_OUTPUTOPT -#undef PREPROCESSOR_OUTPUTOPT \ No newline at end of file diff --git a/clang/include/clang/Frontend/PreprocessorOutputOptions.h b/clang/include/clang/Frontend/PreprocessorOutputOptions.h index ab4f25e394a2..72e5ad1137fb 100644 --- a/clang/include/clang/Frontend/PreprocessorOutputOptions.h +++ b/clang/include/clang/Frontend/PreprocessorOutputOptions.h @@ -15,9 +15,15 @@ namespace clang { /// output (e.g., -E). class PreprocessorOutputOptions { public: -#define PREPROCESSOR_OUTPUTOPT(Name, Bits, Description) unsigned Name : Bits; -#define TYPED_PREPROCESSOR_OUTPUTOPT(Type, Name, Description) Type Name; -#include "clang/Frontend/PreprocessorOutputOptions.def" + unsigned ShowCPP : 1; ///< Print normal preprocessed output. + unsigned ShowComments : 1; ///< Show comments. + unsigned ShowLineMarkers : 1; ///< Show \#line markers. + unsigned UseLineDirectives : 1; ///< Use \#line instead of GCC-style \# N. + unsigned ShowMacroComments : 1; ///< Show comments, even in macros. + unsigned ShowMacros : 1; ///< Print macro definitions. + unsigned ShowIncludeDirectives : 1; ///< Print includes, imports etc. within preprocessed output. + unsigned RewriteIncludes : 1; ///< Preprocess include directives only. + unsigned RewriteImports : 1; ///< Include contents of transitively-imported modules. public: PreprocessorOutputOptions() { diff --git a/clang/include/clang/Lex/HeaderSearchOptions.def b/clang/include/clang/Lex/HeaderSearchOptions.def deleted file mode 100644 index 79fd196c8f90..000000000000 --- a/clang/include/clang/Lex/HeaderSearchOptions.def +++ /dev/null @@ -1,136 +0,0 @@ -//===--- HeaderSearchOptions.def - HeaderSearch option database -*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This file defines the header search options. Users of this file must -// define the HEADERSEARCHOPT macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -#ifndef HEADERSEARCHOPT -#define HEADERSEARCHOPT(Name, Bits, Description) \ - TYPED_HEADERSEARCHOPT(unsigned, Name, Description) -#endif - -#ifndef TYPED_HEADERSEARCHOPT -#define TYPED_HEADERSEARCHOPT(Type, Name, Description) -#endif - -TYPED_HEADERSEARCHOPT(std::string, Sysroot, - "If non-empty, the directory to use as a \"virtual " - "system root\" for include paths.") - -TYPED_HEADERSEARCHOPT(std::string, ModuleFormat, - "The module/pch container format.") - -HEADERSEARCHOPT(DisableModuleHash, 1, - "Whether we should disable the use of the hash string within " - "the module cache. Note: Only used for testing!") - -HEADERSEARCHOPT(ImplicitModuleMaps, 1, - "Implicit module maps. This option is enabld by default when " - "modules is enabled.") - -HEADERSEARCHOPT( - ModuleMapFileHomeIsCwd, 1, - "Set the 'home directory' of a module map file to the current working " - "directory (or the home directory of the module map file that contained " - "the 'extern module' directive importing this module map file if any) " - "rather than the directory containing the module map file. The home " - "directory is where we look for files named in the module map file.") - -HEADERSEARCHOPT(UseBuiltinIncludes, 1, "Include the compiler builtin includes.") - -HEADERSEARCHOPT(UseStandardSystemIncludes, 1, - "Include the system standard include search directories.") - -HEADERSEARCHOPT( - UseStandardCXXIncludes, 1, - "Include the system standard C++ library include search directories.") - -HEADERSEARCHOPT(UseLibcxx, 1, "Use libc++ instead of the default libstdc++.") - -HEADERSEARCHOPT(Verbose, 1, - "Whether header search information should be output as for -v.") - -HEADERSEARCHOPT( - ModulesValidateOncePerBuildSession, 1, - "If true, skip verifying input files used by modules if the module was " - "already verified during this build session (see BuildSessionTimestamp).") - -HEADERSEARCHOPT( - ModulesValidateSystemHeaders, 1, - "Whether to validate system input files when a module is loaded.") - -HEADERSEARCHOPT(ValidateASTInputFilesContent, 1, - "Whether the content of input files should be hashed and used " - "to validate consistency.") - -HEADERSEARCHOPT(UseDebugInfo, 1, - "Whether the module includes debug information (-gmodules).") - -HEADERSEARCHOPT(ModulesValidateDiagnosticOptions, 1, "") - -HEADERSEARCHOPT(ModulesHashContent, 1, "") - -HEADERSEARCHOPT(ModulesStrictContextHash, 1, - "Whether we should include all things that could impact the " - "module in the hash. This includes things like the full header " - "search path, and enabled diagnostics.") - -TYPED_HEADERSEARCHOPT(std::vector, UserEntries, - "User specified include entries.") - -TYPED_HEADERSEARCHOPT(std::vector, SystemHeaderPrefixes, - "User-specified system header prefixes.") - -TYPED_HEADERSEARCHOPT(std::string, ResourceDir, - "The directory which holds the compiler resource files " - "(builtin includes, etc.).") - -TYPED_HEADERSEARCHOPT(std::string, ModuleCachePath, - "The directory used for the module cache.") - -TYPED_HEADERSEARCHOPT(std::string, ModuleUserBuildPath, - "The directory used for a user build.") - -TYPED_HEADERSEARCHOPT(PrebuiltModuleFilesTy, PrebuiltModuleFiles, - "The mapping of module names to prebuilt module files.") - -TYPED_HEADERSEARCHOPT(std::vector, PrebuiltModulePaths, - "The directories used to load prebuilt module files.") - -TYPED_HEADERSEARCHOPT( - unsigned, ModuleCachePruneInterval, - "The interval (in seconds) between pruning operations. This operation is " - "expensive, because it requires Clang to walk through the directory " - "structure of the module cache, stat()'ing and removing files. The " - "default value is large, e.g., the operation runs once a week.") - -TYPED_HEADERSEARCHOPT( - unsigned, ModuleCachePruneAfter, - "The time (in seconds) after which an unused module file will be " - "considered unused and will, therefore, be pruned. When the module cache " - "is pruned, any module file that has not been accessed in this many " - "seconds will be removed. The default value is large, e.g., a month, to " - "avoid forcing infrequently-used modules to be regenerated often.") - -TYPED_HEADERSEARCHOPT( - uint64_t, BuildSessionTimestamp, - "The time in seconds when the build session started. This time is used " - "by other optimizations in header search and module loading.") - -TYPED_HEADERSEARCHOPT(ModulesIgnoreMacrosTy, ModulesIgnoreMacros, - "The set of macro names that should be ignored for the " - "purposes of computing the module hash.") - -TYPED_HEADERSEARCHOPT( - std::vector, VFSOverlayFiles, - "The set of user-provided virtual filesystem overlay files.") - -#undef HEADERSEARCHOPT -#undef TYPED_HEADERSEARCHOPT diff --git a/clang/include/clang/Lex/HeaderSearchOptions.h b/clang/include/clang/Lex/HeaderSearchOptions.h index 41a7ca915d79..3af49e175395 100644 --- a/clang/include/clang/Lex/HeaderSearchOptions.h +++ b/clang/include/clang/Lex/HeaderSearchOptions.h @@ -94,14 +94,125 @@ class HeaderSearchOptions { : Prefix(Prefix), IsSystemHeader(IsSystemHeader) {} }; - using PrebuiltModuleFilesTy = std::map>; + /// If non-empty, the directory to use as a "virtual system root" for include + /// paths. + std::string Sysroot; + + /// User specified include entries. + std::vector UserEntries; + + /// User-specified system header prefixes. + std::vector SystemHeaderPrefixes; + + /// The directory which holds the compiler resource files (builtin includes, + /// etc.). + std::string ResourceDir; - using ModulesIgnoreMacrosTy = - llvm::SmallSetVector; + /// The directory used for the module cache. + std::string ModuleCachePath; + + /// The directory used for a user build. + std::string ModuleUserBuildPath; + + /// The mapping of module names to prebuilt module files. + std::map> PrebuiltModuleFiles; + + /// The directories used to load prebuilt module files. + std::vector PrebuiltModulePaths; + + /// The module/pch container format. + std::string ModuleFormat; + + /// Whether we should disable the use of the hash string within the + /// module cache. + /// + /// Note: Only used for testing! + unsigned DisableModuleHash : 1; + + /// Implicit module maps. This option is enabld by default when + /// modules is enabled. + unsigned ImplicitModuleMaps : 1; + + /// Set the 'home directory' of a module map file to the current + /// working directory (or the home directory of the module map file that + /// contained the 'extern module' directive importing this module map file + /// if any) rather than the directory containing the module map file. + // + /// The home directory is where we look for files named in the module map + /// file. + unsigned ModuleMapFileHomeIsCwd : 1; + + /// The interval (in seconds) between pruning operations. + /// + /// This operation is expensive, because it requires Clang to walk through + /// the directory structure of the module cache, stat()'ing and removing + /// files. + /// + /// The default value is large, e.g., the operation runs once a week. + unsigned ModuleCachePruneInterval = 7 * 24 * 60 * 60; + + /// The time (in seconds) after which an unused module file will be + /// considered unused and will, therefore, be pruned. + /// + /// When the module cache is pruned, any module file that has not been + /// accessed in this many seconds will be removed. The default value is + /// large, e.g., a month, to avoid forcing infrequently-used modules to be + /// regenerated often. + unsigned ModuleCachePruneAfter = 31 * 24 * 60 * 60; + + /// The time in seconds when the build session started. + /// + /// This time is used by other optimizations in header search and module + /// loading. + uint64_t BuildSessionTimestamp = 0; + + /// The set of macro names that should be ignored for the purposes + /// of computing the module hash. + llvm::SmallSetVector ModulesIgnoreMacros; + + /// The set of user-provided virtual filesystem overlay files. + std::vector VFSOverlayFiles; + + /// Include the compiler builtin includes. + unsigned UseBuiltinIncludes : 1; + + /// Include the system standard include search directories. + unsigned UseStandardSystemIncludes : 1; + + /// Include the system standard C++ library include search directories. + unsigned UseStandardCXXIncludes : 1; + + /// Use libc++ instead of the default libstdc++. + unsigned UseLibcxx : 1; + + /// Whether header search information should be output as for -v. + unsigned Verbose : 1; + + /// If true, skip verifying input files used by modules if the + /// module was already verified during this build session (see + /// \c BuildSessionTimestamp). + unsigned ModulesValidateOncePerBuildSession : 1; + + /// Whether to validate system input files when a module is loaded. + unsigned ModulesValidateSystemHeaders : 1; -#define HEADERSEARCHOPT(Name, Bits, Description) unsigned Name : Bits; -#define TYPED_HEADERSEARCHOPT(Type, Name, Description) Type Name; -#include "clang/Lex/HeaderSearchOptions.def" + // Whether the content of input files should be hashed and used to + // validate consistency. + unsigned ValidateASTInputFilesContent : 1; + + /// Whether the module includes debug information (-gmodules). + unsigned UseDebugInfo : 1; + + unsigned ModulesValidateDiagnosticOptions : 1; + + unsigned ModulesHashContent : 1; + + /// Whether we should include all things that could impact the module in the + /// hash. + /// + /// This includes things like the full header search path, and enabled + /// diagnostics. + unsigned ModulesStrictContextHash : 1; HeaderSearchOptions(StringRef _Sysroot = "/") : Sysroot(_Sysroot), ModuleFormat("raw"), DisableModuleHash(false), @@ -112,9 +223,7 @@ class HeaderSearchOptions { ModulesValidateSystemHeaders(false), ValidateASTInputFilesContent(false), UseDebugInfo(false), ModulesValidateDiagnosticOptions(true), ModulesHashContent(false), - ModulesStrictContextHash(false), - ModuleCachePruneInterval(7 * 24 * 60 * 60), - ModuleCachePruneAfter(31 * 24 * 60 * 60), BuildSessionTimestamp(0) {} + ModulesStrictContextHash(false) {} /// AddPath - Add the \p Path path to the specified \p Group list. void AddPath(StringRef Path, frontend::IncludeDirGroup Group, diff --git a/clang/include/clang/Lex/PreprocessorOptions.def b/clang/include/clang/Lex/PreprocessorOptions.def deleted file mode 100644 index 5b9e982351a0..000000000000 --- a/clang/include/clang/Lex/PreprocessorOptions.def +++ /dev/null @@ -1,166 +0,0 @@ -//===--- PreprocessorOptions.def - Preprocessor option database -*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This file defines the preprocessor options. Users of this file must -// define the TYPED_PREPROCESSOROPT macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -#ifndef TYPED_PREPROCESSOROPT -#error Define the TYPED_PREPROCESSOROPT macro to handle target options -#endif - -TYPED_PREPROCESSOROPT(MacrosTy, Macros, "") - -TYPED_PREPROCESSOROPT(std::vector, Includes, "") - -TYPED_PREPROCESSOROPT(std::vector, MacroIncludes, "") - -TYPED_PREPROCESSOROPT( - bool, UsePredefines, - "Initialize the preprocessor with the compiler and target " - "specific predefines.") - -TYPED_PREPROCESSOROPT( - bool, DetailedRecord, - "Whether we should maintain a detailed record of all macro " - "definitions and expansions.") - -TYPED_PREPROCESSOROPT( - bool, PCHWithHdrStop, - "When true, we are creating or using a PCH where a #pragma hdrstop is " - "expected to indicate the beginning or end of the PCH.") - -TYPED_PREPROCESSOROPT( - bool, PCHWithHdrStopCreate, - "When true, we are creating a PCH or creating the PCH object " - "while expecting a #pragma hdrstop to separate the two. Allow " - "for a missing #pragma hdrstop, which generates a PCH for the " - "whole file, and creates an empty PCH object.") - -TYPED_PREPROCESSOROPT( - std::string, PCHThroughHeader, - "If non-empty, the filename used in an #include directive in the primary " - "source file (or command-line preinclude) that is used to implement " - "MSVC-style precompiled headers. When creating a PCH, after the #include " - "of this header, the PCH generation stops. When using a PCH, tokens are " - "skipped until after an #include of this header is seen.") - -TYPED_PREPROCESSOROPT( - std::string, ImplicitPCHInclude, - "The implicit PCH included at the start of the translation unit, or empty.") - -TYPED_PREPROCESSOROPT( - std::vector, ChainedIncludes, - "Headers that will be converted to chained PCHs in memory.") - -TYPED_PREPROCESSOROPT( - bool, DisablePCHValidation, - "When true, disables most of the normal validation performed " - "on precompiled headers.") - -TYPED_PREPROCESSOROPT( - bool, AllowPCHWithCompilerErrors, - "When true, a PCH with compiler errors will not be rejected.") - -TYPED_PREPROCESSOROPT( - bool, DumpDeserializedPCHDecls, - "Dump declarations that are deserialized from PCH, for testing.") - -TYPED_PREPROCESSOROPT( - std::set, DeserializedPCHDeclsToErrorOn, - "This is a set of names for decls that we do not want to be deserialized, " - "and we emit an error if they are; for testing purposes.") - -TYPED_PREPROCESSOROPT( - PrecompiledPreambleBytesTy, PrecompiledPreambleBytes, - "If non-zero, the implicit PCH include is actually a precompiled preamble " - "that covers this number of bytes in the main source file. The boolean " - "indicates whether the preamble ends at the start of a new line.") - -TYPED_PREPROCESSOROPT( - bool, GeneratePreamble, - "True indicates that a preamble is being generated. When the " - "lexer is done, one of the things that need to be preserved is " - "the conditional #if stack, so the ASTWriter/ASTReader can " - "save/restore it when processing the rest of the file.") - -TYPED_PREPROCESSOROPT( - bool, WriteCommentListToPCH, - "Whether to write comment locations into the PCH when building " - "it. Reading the comments from the PCH can be a performance " - "hit even if the clients don't use them.") - -TYPED_PREPROCESSOROPT( - bool, SingleFileParseMode, - "When enabled, preprocessor is in a mode for parsing a single " - "file only. Disables #includes of other files and if there are " - "unresolved identifiers in preprocessor directive conditions " - "it causes all blocks to be parsed so that the client can get " - "the maximum amount of information from the parser.") - -TYPED_PREPROCESSOROPT( - bool, LexEditorPlaceholders, - "When enabled, the preprocessor will construct editor placeholder tokens.") - -TYPED_PREPROCESSOROPT( - bool, RemappedFilesKeepOriginalName, - "True if the SourceManager should report the original file name for " - "contents of files that were remapped to other files. Defaults to true.") - -TYPED_PREPROCESSOROPT( - RemappedFilesTy, RemappedFiles, - "The set of file remappings, which take existing files on the system (the " - "first part of each pair) and gives them the contents of other files on " - "the system (the second part of each pair).") - -TYPED_PREPROCESSOROPT( - RemappedFileBuffersTy, RemappedFileBuffers, - "The set of file-to-buffer remappings, which take existing files on the " - "system (the first part of each pair) and gives them the contents of the " - "specified memory buffer (the second part of each pair).") - -TYPED_PREPROCESSOROPT( - bool, RetainRemappedFileBuffers, - "Whether the compiler instance should retain (i.e., not free) " - "the buffers associated with remapped files. This flag " - "defaults to false; it can be set true only through direct " - "manipulation of the compiler invocation object, in cases " - "where the compiler invocation and its buffers will be reused.") - -TYPED_PREPROCESSOROPT( - bool, RetainExcludedConditionalBlocks, - "When enabled, excluded conditional blocks retain in the main file.") - -TYPED_PREPROCESSOROPT( - ObjCXXARCStandardLibraryKind, ObjCXXARCStandardLibrary, - "The Objective-C++ ARC standard library that we should support, by " - "providing appropriate definitions to retrofit the standard library with " - "support for lifetime-qualified pointers.") - -TYPED_PREPROCESSOROPT(std::shared_ptr, FailedModules, "") - -TYPED_PREPROCESSOROPT(MacroPrefixMapTy, MacroPrefixMap, - "A prefix map for __FILE__ and __BASE_FILE__.") - -TYPED_PREPROCESSOROPT( - ExcludedPreprocessorDirectiveSkipMapping *, - ExcludedConditionalDirectiveSkipMappings, - "Contains the currently active skipped range mappings for " - "skipping excluded conditional directives. The pointer is " - "passed to the Preprocessor when it's constructed. The pointer " - "is unowned, the client is responsible for its lifetime.") - -TYPED_PREPROCESSOROPT(bool, SetUpStaticAnalyzer, - "Set up preprocessor for RunAnalysis action.") - -TYPED_PREPROCESSOROPT( - bool, DisablePragmaDebugCrash, - "Prevents intended crashes when using #pragma clang __debug. For testing.") - -#undef TYPED_PREPROCESSOROPT diff --git a/clang/include/clang/Lex/PreprocessorOptions.h b/clang/include/clang/Lex/PreprocessorOptions.h index f379d5053228..c551f87e0d7b 100644 --- a/clang/include/clang/Lex/PreprocessorOptions.h +++ b/clang/include/clang/Lex/PreprocessorOptions.h @@ -44,13 +44,114 @@ enum ObjCXXARCStandardLibraryKind { /// used in preprocessor initialization to InitializePreprocessor(). class PreprocessorOptions { public: - using MacrosTy = std::vector>; - using PrecompiledPreambleBytesTy = std::pair; - using RemappedFilesTy = std::vector>; - using RemappedFileBuffersTy = - std::vector>; - using MacroPrefixMapTy = - std::map>; + std::vector> Macros; + std::vector Includes; + std::vector MacroIncludes; + + /// Initialize the preprocessor with the compiler and target specific + /// predefines. + bool UsePredefines = true; + + /// Whether we should maintain a detailed record of all macro + /// definitions and expansions. + bool DetailedRecord = false; + + /// When true, we are creating or using a PCH where a #pragma hdrstop is + /// expected to indicate the beginning or end of the PCH. + bool PCHWithHdrStop = false; + + /// When true, we are creating a PCH or creating the PCH object while + /// expecting a #pragma hdrstop to separate the two. Allow for a + /// missing #pragma hdrstop, which generates a PCH for the whole file, + /// and creates an empty PCH object. + bool PCHWithHdrStopCreate = false; + + /// If non-empty, the filename used in an #include directive in the primary + /// source file (or command-line preinclude) that is used to implement + /// MSVC-style precompiled headers. When creating a PCH, after the #include + /// of this header, the PCH generation stops. When using a PCH, tokens are + /// skipped until after an #include of this header is seen. + std::string PCHThroughHeader; + + /// The implicit PCH included at the start of the translation unit, or empty. + std::string ImplicitPCHInclude; + + /// Headers that will be converted to chained PCHs in memory. + std::vector ChainedIncludes; + + /// When true, disables most of the normal validation performed on + /// precompiled headers. + bool DisablePCHValidation = false; + + /// When true, a PCH with compiler errors will not be rejected. + bool AllowPCHWithCompilerErrors = false; + + /// Dump declarations that are deserialized from PCH, for testing. + bool DumpDeserializedPCHDecls = false; + + /// This is a set of names for decls that we do not want to be + /// deserialized, and we emit an error if they are; for testing purposes. + std::set DeserializedPCHDeclsToErrorOn; + + /// If non-zero, the implicit PCH include is actually a precompiled + /// preamble that covers this number of bytes in the main source file. + /// + /// The boolean indicates whether the preamble ends at the start of a new + /// line. + std::pair PrecompiledPreambleBytes; + + /// True indicates that a preamble is being generated. + /// + /// When the lexer is done, one of the things that need to be preserved is the + /// conditional #if stack, so the ASTWriter/ASTReader can save/restore it when + /// processing the rest of the file. + bool GeneratePreamble = false; + + /// Whether to write comment locations into the PCH when building it. + /// Reading the comments from the PCH can be a performance hit even if the + /// clients don't use them. + bool WriteCommentListToPCH = true; + + /// When enabled, preprocessor is in a mode for parsing a single file only. + /// + /// Disables #includes of other files and if there are unresolved identifiers + /// in preprocessor directive conditions it causes all blocks to be parsed so + /// that the client can get the maximum amount of information from the parser. + bool SingleFileParseMode = false; + + /// When enabled, the preprocessor will construct editor placeholder tokens. + bool LexEditorPlaceholders = true; + + /// True if the SourceManager should report the original file name for + /// contents of files that were remapped to other files. Defaults to true. + bool RemappedFilesKeepOriginalName = true; + + /// The set of file remappings, which take existing files on + /// the system (the first part of each pair) and gives them the + /// contents of other files on the system (the second part of each + /// pair). + std::vector> RemappedFiles; + + /// The set of file-to-buffer remappings, which take existing files + /// on the system (the first part of each pair) and gives them the contents + /// of the specified memory buffer (the second part of each pair). + std::vector> RemappedFileBuffers; + + /// Whether the compiler instance should retain (i.e., not free) + /// the buffers associated with remapped files. + /// + /// This flag defaults to false; it can be set true only through direct + /// manipulation of the compiler invocation object, in cases where the + /// compiler invocation and its buffers will be reused. + bool RetainRemappedFileBuffers = false; + + /// When enabled, excluded conditional blocks retain in the main file. + bool RetainExcludedConditionalBlocks = false; + + /// The Objective-C++ ARC standard library that we should support, + /// by providing appropriate definitions to retrofit the standard library + /// with support for lifetime-qualified pointers. + ObjCXXARCStandardLibraryKind ObjCXXARCStandardLibrary = ARCXX_nolib; /// Records the set of modules class FailedModulesSet { @@ -66,21 +167,33 @@ class PreprocessorOptions { } }; -#define TYPED_PREPROCESSOROPT(Type, Name, Description) Type Name; -#include "clang/Lex/PreprocessorOptions.def" - - PreprocessorOptions() - : UsePredefines(true), DetailedRecord(false), PCHWithHdrStop(false), - PCHWithHdrStopCreate(false), DisablePCHValidation(false), - AllowPCHWithCompilerErrors(false), DumpDeserializedPCHDecls(false), - PrecompiledPreambleBytes(0, false), GeneratePreamble(false), - WriteCommentListToPCH(true), SingleFileParseMode(false), - LexEditorPlaceholders(true), RemappedFilesKeepOriginalName(true), - RetainRemappedFileBuffers(false), - RetainExcludedConditionalBlocks(false), - ObjCXXARCStandardLibrary(ARCXX_nolib), - ExcludedConditionalDirectiveSkipMappings(nullptr), - SetUpStaticAnalyzer(false), DisablePragmaDebugCrash(false) {} + /// The set of modules that failed to build. + /// + /// This pointer will be shared among all of the compiler instances created + /// to (re)build modules, so that once a module fails to build anywhere, + /// other instances will see that the module has failed and won't try to + /// build it again. + std::shared_ptr FailedModules; + + /// A prefix map for __FILE__ and __BASE_FILE__. + std::map> MacroPrefixMap; + + /// Contains the currently active skipped range mappings for skipping excluded + /// conditional directives. + /// + /// The pointer is passed to the Preprocessor when it's constructed. The + /// pointer is unowned, the client is responsible for its lifetime. + ExcludedPreprocessorDirectiveSkipMapping + *ExcludedConditionalDirectiveSkipMappings = nullptr; + + /// Set up preprocessor for RunAnalysis action. + bool SetUpStaticAnalyzer = false; + + /// Prevents intended crashes when using #pragma clang __debug. For testing. + bool DisablePragmaDebugCrash = false; + +public: + PreprocessorOptions() : PrecompiledPreambleBytes(0, false) {} void addMacroDef(StringRef Name) { Macros.emplace_back(std::string(Name), false); diff --git a/clang/include/clang/Sema/CodeCompleteOptions.def b/clang/include/clang/Sema/CodeCompleteOptions.def deleted file mode 100644 index dab8027929e5..000000000000 --- a/clang/include/clang/Sema/CodeCompleteOptions.def +++ /dev/null @@ -1,51 +0,0 @@ -//===--- CodeCompleteOptions.def - FileSystem option database ----*- C++-*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This file defines the CodeComplete options. -// -//===----------------------------------------------------------------------===// - -#ifndef TYPED_CODE_COMPLETEOPT -#define TYPED_CODE_COMPLETEOPT(Type, Name, Description) -#endif - -#ifndef CODE_COMPLETEOPT -#define CODE_COMPLETEOPT(Name, Bits, Description) \ - TYPED_CODE_COMPLETEOPT(unsigned, Name, Description); -#endif - -CODE_COMPLETEOPT(IncludeMacros, 1, "Show macros in code completion results.") - -CODE_COMPLETEOPT(IncludeCodePatterns, 1, - "Show code patterns in code completion results.") - -CODE_COMPLETEOPT(IncludeGlobals, 1, - "Show top-level decls in code completion results.") - -CODE_COMPLETEOPT(IncludeNamespaceLevelDecls, 1, - "Show decls in namespace (including the global namespace) in " - "code completion results. If this is 0, `IncludeGlobals` will " - "be ignored. Currently, this only works when completing " - "qualified IDs (i.e. `Sema::CodeCompleteQualifiedId`). FIXME: " - "consider supporting more completion cases with this option.") - -CODE_COMPLETEOPT( - IncludeBriefComments, 1, - "Show brief documentation comments in code completion results.") - -CODE_COMPLETEOPT(LoadExternal, 1, - "Hint whether to load data from the external AST to provide " - "full results. If false, namespace-level declarations and " - "macros from the preamble may be omitted.") - -CODE_COMPLETEOPT(IncludeFixIts, 1, - "Include results after corrections (small fix-its), e.g. " - "change '.' to '->' on member access, etc.") - -#undef TYPED_CODE_COMPLETEOPT -#undef CODE_COMPLETEOPT \ No newline at end of file diff --git a/clang/include/clang/Sema/CodeCompleteOptions.h b/clang/include/clang/Sema/CodeCompleteOptions.h index 28cbc94fc84c..a3403b01dcde 100644 --- a/clang/include/clang/Sema/CodeCompleteOptions.h +++ b/clang/include/clang/Sema/CodeCompleteOptions.h @@ -14,14 +14,39 @@ namespace clang { /// Options controlling the behavior of code completion. class CodeCompleteOptions { public: -#define CODE_COMPLETEOPT(Name, Bits, Description) unsigned Name : Bits; -#define TYPED_CODE_COMPLETEOPT(Type, Name, Description) Type Name; -#include "clang/Sema/CodeCompleteOptions.def" + /// Show macros in code completion results. + unsigned IncludeMacros : 1; + + /// Show code patterns in code completion results. + unsigned IncludeCodePatterns : 1; + + /// Show top-level decls in code completion results. + unsigned IncludeGlobals : 1; + + /// Show decls in namespace (including the global namespace) in code + /// completion results. If this is 0, `IncludeGlobals` will be ignored. + /// + /// Currently, this only works when completing qualified IDs (i.e. + /// `Sema::CodeCompleteQualifiedId`). + /// FIXME: consider supporting more completion cases with this option. + unsigned IncludeNamespaceLevelDecls : 1; + + /// Show brief documentation comments in code completion results. + unsigned IncludeBriefComments : 1; + + /// Hint whether to load data from the external AST to provide full results. + /// If false, namespace-level declarations and macros from the preamble may be + /// omitted. + unsigned LoadExternal : 1; + + /// Include results after corrections (small fix-its), e.g. change '.' to '->' + /// on member access, etc. + unsigned IncludeFixIts : 1; CodeCompleteOptions() : IncludeMacros(0), IncludeCodePatterns(0), IncludeGlobals(1), - IncludeNamespaceLevelDecls(1), IncludeBriefComments(0), LoadExternal(1), - IncludeFixIts(0) {} + IncludeNamespaceLevelDecls(1), IncludeBriefComments(0), + LoadExternal(1), IncludeFixIts(0) {} }; } // namespace clang diff --git a/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.def b/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.def index ff253ca15c0e..f0359d2dbb3c 100644 --- a/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.def +++ b/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.def @@ -6,10 +6,7 @@ // //===----------------------------------------------------------------------===// // -// This file defines the analyzer options avaible with -analyzer-config, using -// the ANLAYZER_OPTION and ANALYZER_OPTION_DEPENDS_ON_USER_MODE macros. -// Other analyzer options use the simpler ANALYZEROPT and TYPED_ANALYZEROPT -// macro. +// This file defines the analyzer options avaible with -analyzer-config. // //===----------------------------------------------------------------------===// @@ -32,15 +29,6 @@ define both 'ANALYZER_OPTION' and 'ANALYZER_OPTION_DEPENDS_ON_USER_MODE' macros! #endif #endif -#ifndef TYPED_ANALYZEROPT -#define TYPED_ANALYZEROPT(TYPE, NAME, DESCRIPTION) -#endif - -#ifndef ANALYZEROPT -#define ANALYZEROPT(NAME, BITS, DESCRIPTION) \ - TYPED_ANALYZEROPT(unsigned, NAME, DESCRITPTION) -#endif - #ifndef ANALYZER_OPTION /// Create a new analyzer option, but dont generate a method for it in /// AnalyzerOptions. @@ -54,8 +42,7 @@ define both 'ANALYZER_OPTION' and 'ANALYZER_OPTION_DEPENDS_ON_USER_MODE' macros! /// (-analyzer-config CMDFLAG=VALUE) /// DESC - Description of the flag. /// DEFAULT_VAL - The default value for CMDFLAG. -#define ANALYZER_OPTION(TYPE, NAME, CMDFLAG, DESC, DEFAULT_VAL) \ - TYPED_ANALYZEROPT(TYPE, NAME, DESC) +#define ANALYZER_OPTION(TYPE, NAME, CMDFLAG, DESC, DEFAULT_VAL) #endif #ifndef ANALYZER_OPTION_DEPENDS_ON_USER_MODE @@ -75,8 +62,7 @@ define both 'ANALYZER_OPTION' and 'ANALYZER_OPTION_DEPENDS_ON_USER_MODE' macros! /// DEEP_VAL - The default value for CMDFLAG, when "user-mode" was set to /// "deep". #define ANALYZER_OPTION_DEPENDS_ON_USER_MODE(TYPE, NAME, CMDFLAG, DESC, \ - SHALLOW_VAL, DEEP_VAL) \ - TYPED_ANALYZEROPT(TYPE, NAME, DESC) + SHALLOW_VAL, DEEP_VAL) #endif //===----------------------------------------------------------------------===// @@ -449,79 +435,5 @@ ANALYZER_OPTION_DEPENDS_ON_USER_MODE( "\"basic-inlining\", \"inlining\", \"dynamic\", \"dynamic-bifurcate\".", /* SHALLOW_VAL */ "inlining", /* DEEP_VAL */ "dynamic-bifurcate") -//===----------------------------------------------------------------------===// -// Other analyzer options. -//===----------------------------------------------------------------------===// - -TYPED_ANALYZEROPT(CheckersAndPackagesTy, CheckersAndPackages, - "Pairs of checker/package name and enable/disable.") - -TYPED_ANALYZEROPT( - std::vector, SilencedCheckersAndPackages, - "Vector of checker/package names which will not emit warnings.") - -TYPED_ANALYZEROPT(ConfigTable, Config, - "A key-value table of use-specified configuration values.") -TYPED_ANALYZEROPT(AnalysisStores, AnalysisStoreOpt, "") -TYPED_ANALYZEROPT(AnalysisConstraints, AnalysisConstraintsOpt, "") -TYPED_ANALYZEROPT(AnalysisDiagClients, AnalysisDiagOpt, "") -TYPED_ANALYZEROPT(AnalysisPurgeMode, AnalysisPurgeOpt, "") - -TYPED_ANALYZEROPT(std::string, AnalyzeSpecificFunction, "") - -TYPED_ANALYZEROPT(std::string, DumpExplodedGraphTo, - "File path to which the exploded graph should be dumped.") - -TYPED_ANALYZEROPT(std::string, FullCompilerInvocation, - "Store full compiler invocation for reproducible " - "instructions in the generated report.") - -TYPED_ANALYZEROPT(unsigned, maxBlockVisitOnPath, - "The maximum number of times the analyzer visits a block.") - -ANALYZEROPT( - DisableAllCheckers, 1, - "Disable all analyzer checkers. This flag allows one to disable analyzer " - "checkers on the code processed by the given analysis consumer. Note, the " - "code will get parsed and the command-line options will get checked.") - -ANALYZEROPT(ShowCheckerHelp, 1, "") -ANALYZEROPT(ShowCheckerHelpAlpha, 1, "") -ANALYZEROPT(ShowCheckerHelpDeveloper, 1, "") - -ANALYZEROPT(ShowCheckerOptionList, 1, "") -ANALYZEROPT(ShowCheckerOptionAlphaList, 1, "") -ANALYZEROPT(ShowCheckerOptionDeveloperList, 1, "") - -ANALYZEROPT(ShowEnabledCheckerList, 1, "") -ANALYZEROPT(ShowConfigOptionsList, 1, "") -ANALYZEROPT(ShouldEmitErrorsOnInvalidConfigValue, 1, "") -ANALYZEROPT(AnalyzeAll, 1, "") -ANALYZEROPT(AnalyzerDisplayProgress, 1, "") -ANALYZEROPT(AnalyzeNestedBlocks, 1, "") - -ANALYZEROPT(eagerlyAssumeBinOpBifurcation, 1, "") - -ANALYZEROPT(TrimGraph, 1, "") -ANALYZEROPT(visualizeExplodedGraphWithGraphViz, 1, "") -ANALYZEROPT(UnoptimizedCFG, 1, "") -ANALYZEROPT(PrintStats, 1, "") - -ANALYZEROPT( - NoRetryExhausted, 1, - "Do not re-analyze paths leading to exhausted nodes with a different " - "strategy. We get better code coverage when retry is enabled.") - -ANALYZEROPT(AnalyzerWerror, 1, "Emit analyzer warnings as errors.") - -TYPED_ANALYZEROPT(unsigned, InlineMaxStackDepth, - "The inlining stack depth limit. Cap the stack depth at 4 " - "calls (5 stack frames, base + 4 calls).") - -TYPED_ANALYZEROPT(AnalysisInliningMode, InliningMode, - "The mode of function selection used during inlining.") - #undef ANALYZER_OPTION_DEPENDS_ON_USER_MODE #undef ANALYZER_OPTION -#undef TYPED_ANALYZEROPT -#undef ANALYZEROPT diff --git a/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h b/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h index 8d81f9029417..4907b0757a8a 100644 --- a/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h +++ b/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h @@ -162,7 +162,6 @@ enum UserModeKind { class AnalyzerOptions : public RefCountedBase { public: using ConfigTable = llvm::StringMap; - using CheckersAndPackagesTy = std::vector>; /// Retrieves the list of checkers generated from Checkers.td. This doesn't /// contain statically linked but non-generated checkers and plugin checkers! @@ -196,9 +195,86 @@ class AnalyzerOptions : public RefCountedBase { size_t InitialPad, size_t EntryWidth, size_t MinLineWidth = 0); -#define ANALYZEROPT(NAME, BITS, DESCRIPTION) unsigned NAME : BITS; -#define TYPED_ANALYZEROPT(TYPE, NAME, DESCRIPTION) TYPE NAME; + /// Pairs of checker/package name and enable/disable. + std::vector> CheckersAndPackages; + + /// Vector of checker/package names which will not emit warnings. + std::vector SilencedCheckersAndPackages; + + /// A key-value table of use-specified configuration values. + // TODO: This shouldn't be public. + ConfigTable Config; + AnalysisStores AnalysisStoreOpt = RegionStoreModel; + AnalysisConstraints AnalysisConstraintsOpt = RangeConstraintsModel; + AnalysisDiagClients AnalysisDiagOpt = PD_HTML; + AnalysisPurgeMode AnalysisPurgeOpt = PurgeStmt; + + std::string AnalyzeSpecificFunction; + + /// File path to which the exploded graph should be dumped. + std::string DumpExplodedGraphTo; + + /// Store full compiler invocation for reproducible instructions in the + /// generated report. + std::string FullCompilerInvocation; + + /// The maximum number of times the analyzer visits a block. + unsigned maxBlockVisitOnPath; + + /// Disable all analyzer checkers. + /// + /// This flag allows one to disable analyzer checkers on the code processed by + /// the given analysis consumer. Note, the code will get parsed and the + /// command-line options will get checked. + unsigned DisableAllCheckers : 1; + + unsigned ShowCheckerHelp : 1; + unsigned ShowCheckerHelpAlpha : 1; + unsigned ShowCheckerHelpDeveloper : 1; + + unsigned ShowCheckerOptionList : 1; + unsigned ShowCheckerOptionAlphaList : 1; + unsigned ShowCheckerOptionDeveloperList : 1; + + unsigned ShowEnabledCheckerList : 1; + unsigned ShowConfigOptionsList : 1; + unsigned ShouldEmitErrorsOnInvalidConfigValue : 1; + unsigned AnalyzeAll : 1; + unsigned AnalyzerDisplayProgress : 1; + unsigned AnalyzeNestedBlocks : 1; + + unsigned eagerlyAssumeBinOpBifurcation : 1; + + unsigned TrimGraph : 1; + unsigned visualizeExplodedGraphWithGraphViz : 1; + unsigned UnoptimizedCFG : 1; + unsigned PrintStats : 1; + + /// Do not re-analyze paths leading to exhausted nodes with a different + /// strategy. We get better code coverage when retry is enabled. + unsigned NoRetryExhausted : 1; + + /// Emit analyzer warnings as errors. + unsigned AnalyzerWerror : 1; + + /// The inlining stack depth limit. + // Cap the stack depth at 4 calls (5 stack frames, base + 4 calls). + unsigned InlineMaxStackDepth = 5; + + /// The mode of function selection used during inlining. + AnalysisInliningMode InliningMode = NoRedundancy; + + // Create a field for each -analyzer-config option. +#define ANALYZER_OPTION_DEPENDS_ON_USER_MODE(TYPE, NAME, CMDFLAG, DESC, \ + SHALLOW_VAL, DEEP_VAL) \ + ANALYZER_OPTION(TYPE, NAME, CMDFLAG, DESC, SHALLOW_VAL) + +#define ANALYZER_OPTION(TYPE, NAME, CMDFLAG, DESC, DEFAULT_VAL) \ + TYPE NAME; + #include "clang/StaticAnalyzer/Core/AnalyzerOptions.def" +#undef ANALYZER_OPTION +#undef ANALYZER_OPTION_DEPENDS_ON_USER_MODE // Create an array of all -analyzer-config command line options. Sort it in // the constructor. @@ -223,19 +299,15 @@ class AnalyzerOptions : public RefCountedBase { } AnalyzerOptions() - : AnalysisStoreOpt(RegionStoreModel), - AnalysisConstraintsOpt(RangeConstraintsModel), AnalysisDiagOpt(PD_HTML), - AnalysisPurgeOpt(PurgeStmt), DisableAllCheckers(false), - ShowCheckerHelp(false), ShowCheckerHelpAlpha(false), - ShowCheckerHelpDeveloper(false), ShowCheckerOptionList(false), - ShowCheckerOptionAlphaList(false), + : DisableAllCheckers(false), ShowCheckerHelp(false), + ShowCheckerHelpAlpha(false), ShowCheckerHelpDeveloper(false), + ShowCheckerOptionList(false), ShowCheckerOptionAlphaList(false), ShowCheckerOptionDeveloperList(false), ShowEnabledCheckerList(false), ShowConfigOptionsList(false), AnalyzeAll(false), AnalyzerDisplayProgress(false), AnalyzeNestedBlocks(false), eagerlyAssumeBinOpBifurcation(false), TrimGraph(false), visualizeExplodedGraphWithGraphViz(false), UnoptimizedCFG(false), - PrintStats(false), NoRetryExhausted(false), AnalyzerWerror(false), - InlineMaxStackDepth(5), InliningMode(NoRedundancy) { + PrintStats(false), NoRetryExhausted(false), AnalyzerWerror(false) { llvm::sort(AnalyzerConfigCmdFlags); } diff --git a/clang/lib/Basic/CodeGenOptions.cpp b/clang/lib/Basic/CodeGenOptions.cpp index 9e04b5ced2bb..4fc7a535c9eb 100644 --- a/clang/lib/Basic/CodeGenOptions.cpp +++ b/clang/lib/Basic/CodeGenOptions.cpp @@ -10,9 +10,8 @@ #include namespace clang { -CodeGenOptions::CodeGenOptions() - : FPDenormalMode(llvm::DenormalMode::getIEEE()), - FP32DenormalMode(llvm::DenormalMode::getIEEE()), Argv0(nullptr) { + +CodeGenOptions::CodeGenOptions() { #define CODEGENOPT(Name, Bits, Default) Name = Default; #define ENUM_CODEGENOPT(Name, Type, Bits, Default) set##Name(Default); #include "clang/Basic/CodeGenOptions.def" diff --git a/clang/lib/Basic/LangOptions.cpp b/clang/lib/Basic/LangOptions.cpp index 344d326a92e4..c08670c87fb6 100644 --- a/clang/lib/Basic/LangOptions.cpp +++ b/clang/lib/Basic/LangOptions.cpp @@ -14,8 +14,7 @@ using namespace clang; -LangOptions::LangOptions() - : CFRuntime(CoreFoundationABI::Unspecified), IsHeaderFile(false) { +LangOptions::LangOptions() { #define LANGOPT(Name, Bits, Default, Description) Name = Default; #define ENUM_LANGOPT(Name, Type, Bits, Default, Description) set##Name(Default); #include "clang/Basic/LangOptions.def"