[clang] [Hexagon] Forward target features to the external assembler (PR #212474)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 18 12:04:25 PST 2026
================
@@ -241,11 +242,16 @@ void hexagon::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-fsyntax-only");
}
- if (Arg *A = Args.getLastArg(options::OPT_mhexagon_hvx_ieee_fp,
- options::OPT_mno_hexagon_hvx_ieee_fp)) {
- if (A->getOption().matches(options::OPT_mhexagon_hvx_ieee_fp))
- CmdArgs.push_back("-mhvx-ieee-fp");
- }
+ // Forward the target features (e.g. HVX, HVX length, HVX qfloat/ieee-fp) to
+ // the external assembler so that its behavior matches the integrated
+ // assembler. getHexagonTargetFeatures() computes the same feature list that
+ // the compiler and integrated assembler use, and llvm-mc consumes it via
+ // -mattr=.
+ std::vector<StringRef> Features;
+ hexagon::getHexagonTargetFeatures(D, HTC.getTriple(), Args, Features);
+ if (!Features.empty())
+ CmdArgs.push_back(
+ Args.MakeArgString("-mattr=" + llvm::join(Features, ",")));
if (Args.hasFlag(options::OPT_mhexagon_hmx, options::OPT_mno_hexagon_hmx,
----------------
Ris-Bali wrote:
Done.
https://github.com/llvm/llvm-project/pull/212474
More information about the cfe-commits
mailing list