================
@@ -1590,23 +1590,28 @@ DisassemblerLLVMC::DisassemblerLLVMC(const ArchSpec
&arch,
}
if (triple.isRISCV() && !cpu_or_features_overriden) {
- uint32_t arch_flags = arch.GetFlags();
- if (arch_flags & ArchSpec::eRISCV_rvc)
- features_str += "+c,";
- if (arch_flags & ArchSpec::eRISCV_rve)
- features_str += "+e,";
- if ((arch_flags & ArchSpec::eRISCV_float_abi_single) ==
- ArchSpec::eRISCV_float_abi_single)
- features_str += "+f,";
- if ((arch_flags & ArchSpec::eRISCV_float_abi_double) ==
- ArchSpec::eRISCV_float_abi_double)
- features_str += "+f,+d,";
- if ((arch_flags & ArchSpec::eRISCV_float_abi_quad) ==
- ArchSpec::eRISCV_float_abi_quad)
- features_str += "+f,+d,+q,";
- // FIXME: how do we detect features such as `+a`, `+m`?
- // Turn them on by default now, since everyone seems to use them
- features_str += "+a,+m,";
+ auto subtarget_features = arch.GetSubtargetFeatures().getString();
+ if (!subtarget_features.empty()) {
+ features_str += subtarget_features;
+ } else {
+ uint32_t arch_flags = arch.GetFlags();
+ if (arch_flags & ArchSpec::eRISCV_rvc)
+ features_str += "+c,";
----------------
topperc wrote:
Nevermind, I guess this only gets used when .riscv_attributes isn't present?
https://github.com/llvm/llvm-project/pull/173047
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits