[clang] [AArch64]: Refactor target parser to use BitVector. (PR #65423)

via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 6 01:30:55 PDT 2023


================

----------------
sdesmalen-arm wrote:

Would it have been possible to change ARMCPUTestParams to give it two constructors, one taking a uint64_t mask (for the ARM features), and the other constructor taking a BitVector (for the AArch64 features), and then to have the classes work on a BitVector under the hood?

For example, it's possible to convert a bitmask -> BitVector with a simple loop:
```uint64_t Mask = ... // the mask you want to convert to a BitVector
BitVector V(64);
for (unsigned I=0; I<64; ++I) {
  if ((Mask >> I) & 1)
    V.set(I);
}
```

https://github.com/llvm/llvm-project/pull/65423


More information about the cfe-commits mailing list