================
@@ -4267,20 +4267,22 @@ bool AArch64AsmParser::parseSyspAlias(StringRef Name, 
SMLoc NameLoc,
     const AArch64TLBIP::TLBIP *TLBIPorig = AArch64TLBIP::lookupTLBIPByName(Op);
     if (!TLBIPorig)
       return TokError("invalid operand for TLBIP instruction");
-    if (!getSTI().hasFeature(AArch64::FeatureD128) &&
-        !getSTI().hasFeature(AArch64::FeatureAll))
-      return TokError("instruction requires: d128");
     const AArch64TLBIP::TLBIP TLBIP(
         TLBIPorig->Name, TLBIPorig->Encoding | (HasnXSQualifier ? (1 << 7) : 
0),
-        TLBIPorig->NeedsReg, TLBIPorig->OptionalReg,
+        TLBIPorig->NeedsReg, TLBIPorig->OptionalReg, TLBIPorig->AllowTLBID,
         HasnXSQualifier
             ? TLBIPorig->FeaturesRequired | FeatureBitset({AArch64::FeatureXS})
             : TLBIPorig->FeaturesRequired);
     if (!TLBIP.haveFeatures(getSTI().getFeatureBits())) {
----------------
Lukacma wrote:

If I am not missing smth, I think this whole logic can be simplified like this:
```
std::string Str("instruction requires: ");
FeatureBitset Missing = TLBIP.getRequiredFeatures() & ~Active;
setRequiredFeatureString(Missing, Str);
Str += "and d128"  TLBIP.allowTLBID() ? " or tlbid" : "" ;
``` 

I am also wondering if it might be better to have the check also return 
features that are missing so we don't need to get reuqired features again, but 
I am on the fence here so I am fine either way.

https://github.com/llvm/llvm-project/pull/178913
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to