Index: lib/MC/SubtargetFeature.cpp =================================================================== --- lib/MC/SubtargetFeature.cpp +++ lib/MC/SubtargetFeature.cpp @@ -261,6 +261,21 @@ } } + // Cancel out the disabled features which are explicitly re-enabled later on. + FeatureBitset ExplicitlyEnabled; + for (auto Feature = Features.rbegin(); + Feature != Features.rend(); + ++Feature) { + const SubtargetFeatureKV *FeatureEntry = + Find(StripFlag(*Feature), FeatureTable); + if (FeatureEntry) { + if ((ExplicitlyEnabled & FeatureEntry->Value).any()) + Features.erase(std::next(Feature).base()); + else if (isEnabled(*Feature)) + ExplicitlyEnabled |= FeatureEntry->Value; + } + } + // Iterate through each feature for (auto &Feature : Features) { // Check for help Index: test/MC/ARM/fullfp16-neon.s =================================================================== --- test/MC/ARM/fullfp16-neon.s +++ test/MC/ARM/fullfp16-neon.s @@ -1,4 +1,4 @@ -@ RUN: llvm-mc -triple armv8a-none-eabi -mattr=+fullfp16,+neon -show-encoding < %s | FileCheck %s --check-prefix=ARM +@ RUN: llvm-mc -triple armv8a-none-eabi -mattr=+fullfp16,-fp-armv8,+fp-armv8,+neon -show-encoding < %s | FileCheck %s --check-prefix=ARM @ RUN: llvm-mc -triple thumbv8a-none-eabi -mattr=+fullfp16,+neon -show-encoding < %s | FileCheck %s --check-prefix=THUMB vadd.f16 d0, d1, d2