[clang] [llvm] [X86] Support apxf in attribute target (PR #184078)

Phoebe Wang via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 3 06:06:07 PST 2026


================
@@ -257,21 +258,11 @@ void x86::getX86TargetFeatures(const Driver &D, const llvm::Triple &Triple,
 
     if (A->getOption().matches(options::OPT_mapxf) ||
         A->getOption().matches(options::OPT_mno_apxf)) {
-      if (IsNegative) {
-        Features.insert(Features.end(),
-                        {"-egpr", "-ndd", "-ccmp", "-nf", "-zu"});
-        if (!Triple.isOSWindows())
-          Features.insert(Features.end(), {"-push2pop2", "-ppx"});
-      } else {
-        Features.insert(Features.end(),
-                        {"+egpr", "+ndd", "+ccmp", "+nf", "+zu"});
-        if (!Triple.isOSWindows())
-          Features.insert(Features.end(), {"+push2pop2", "+ppx"});
-
-        if (Not64Bit)
-          D.Diag(diag::err_drv_unsupported_opt_for_target)
-              << StringRef("-mapxf") << Triple.getTriple();
-      }
+      llvm::X86::expandAPXFeatures(IsNegative ? "-apxf" : "+apxf", Triple,
----------------
phoebewang wrote:

We should avoid constract and pass the strings. Just bool `IsNegative` is better.

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


More information about the cfe-commits mailing list