================
@@ -332,4 +350,43 @@ void x86::getX86TargetFeatures(const Driver &D, const 
llvm::Triple &Triple,
     if (A->getOption().matches(options::OPT_m3dnow))
       D.Diag(diag::warn_drv_clang_unsupported) << A->getAsString(Args);
   }
+
+  // Handle features corresponding to "-ffixed-X" options
+#define RESERVE_REG(REG)                                                       
\
+  if (Args.hasArg(options::OPT_ffixed_##REG))                                  
\
+    Features.push_back("+reserve-" #REG);
+  RESERVE_REG(r8)
+  RESERVE_REG(r9)
+  RESERVE_REG(r10)
+  RESERVE_REG(r11)
+  RESERVE_REG(r12)
+  RESERVE_REG(r13)
+  RESERVE_REG(r14)
+  RESERVE_REG(r15)
+#define RESERVE_EGPR(REG)                                                     \
+  if (Args.hasArg(options::OPT_ffixed_##REG)) {                               \
+    if (!HasEGPR)                                                             \
+      D.Diag(diag::err_drv_unsupported_opt_for_target)                        \
+          << "-ffixed-" #REG << Triple.getTriple();                           \
+    else                                                                      \
+      Features.push_back("+reserve-" #REG);                                   \
+  }
+  RESERVE_EGPR(r16)
+  RESERVE_EGPR(r17)
+  RESERVE_EGPR(r18)
+  RESERVE_EGPR(r19)
+  RESERVE_EGPR(r20)
+  RESERVE_EGPR(r21)
+  RESERVE_EGPR(r22)
+  RESERVE_EGPR(r23)
+  RESERVE_EGPR(r24)
+  RESERVE_EGPR(r25)
+  RESERVE_EGPR(r26)
+  RESERVE_EGPR(r27)
+  RESERVE_EGPR(r28)
+  RESERVE_EGPR(r29)
+  RESERVE_EGPR(r30)
+  RESERVE_EGPR(r31)
+#undef RESERVE_EGPR
+#undef RESERVE_REG
----------------
RKSimon wrote:

clang-format this to appease the CI?

https://github.com/llvm/llvm-project/pull/180242
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to