================ @@ -69,6 +70,26 @@ std::string FormatExtensionFlags(uint64_t Flags) { return llvm::join(Features, ", "); } +std::string SerializeExtensionFlags(Bitset<AArch64::AEK_EXTENSIONS_MAX> Flags) { + static_assert((AArch64::AEK_EXTENSIONS_MAX % 4 == 0), + "AArch64::AEK_EXTENSIONS_MAX shoubld be divisible by 4"); + + std::string SerializedFlags; + int HexValue = 0; + for (unsigned int i = 0; i < AArch64::AEK_EXTENSIONS_MAX; i++) { + HexValue <<= 1; + HexValue |= (int)Flags[i]; + if ((i + 1) % 4 == 0) { + std::ostringstream ss; ---------------- sdesmalen-arm wrote:
Is it worth creating the std::ostringstream once and use that instead of SerializedFlags, rather than what you're doing here? https://github.com/llvm/llvm-project/pull/65423 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits