[PATCH] [AArch64] Refactor AArch64NamedImmMapper to become dependent on subtarget features.

Vladimir Sukharev vladimir.sukharev at arm.com
Tue Mar 24 04:37:32 PDT 2015


Hi James, 
thank you for comments. I will update the revision with

2. Changing the AsmParser to take a string for barriers etc

and then provide two more patches for

1. Adding SubTargetFeatureBits everywhere.
2. Re-bikeshedding (Pair->Mapper, if/else -> ?:)

Thanks, Vladimir


REPOSITORY
  rL LLVM

================
Comment at: lib/Target/AArch64/Utils/AArch64BaseInfo.h:305
@@ +304,3 @@
+  bool hasFeature(uint64_t SubTargetFeature) const {
+    return SubTargetFeature == 0 || (SubTargetFeature & FeatureBits) != 0;
+  }
----------------
jmolloy wrote:
> Why "SubTargetFeature == 0"? This seems strange. I would have expected just:
> 
>     return SubTargetFeature & FeatureBits;
> 
> 
It is intended way to use for vast majority of Mappers, that don't depend on any subtargetfeature , and are present permanently. For those, SubTargetFeature field will be as default, i.e. 0. and no FeatureBits equal to 0. This makes all current mappers to remain correct, like 
DAIFClr :   {"daifclr", DAIFClr} 
will mean  
struct Mapping {
 const char *Name = "daifclr";
 uint32_t Value = DAIFClr;
 uint64_t SubTargetFeature = 0;
 };
and this hasFeature will always return true, no matter of subtargetfeatures

http://reviews.llvm.org/D8496

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list