[clang] [clang][Mips] Use the ISA features instead of CPU name checks (PR #245672)

Ying Huang via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 25 23:57:42 PST 2026


================
@@ -290,20 +274,17 @@ bool MipsTargetInfo::validateTarget(DiagnosticsEngine &Diags) const {
     return false;
   }
   // Mips revision 6 and -mfp32 are incompatible
-  if (FPMode != FP64 && FPMode != FPXX &&
-      (CPU == "mips32r6" || CPU == "mips64r6" || CPU == "i6400" ||
-       CPU == "i6500")) {
+  if (FPMode != FP64 && FPMode != FPXX && ISARev == 6) {
     Diags.Report(diag::err_opt_not_valid_with_opt) << "-mfp32" << CPU;
     return false;
   }
   // Option -mfp64 permitted on Mips32 iff revision 2 or higher is present
-  if (FPMode == FP64 && (CPU == "mips1" || CPU == "mips2" ||
-      getISARev() < 2) && ABI == "o32") {
+  if (FPMode == FP64 && ISARev < 2 && ABI == "o32") {
----------------
yingopq wrote:

Is it missing ISALevel<= 2?

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


More information about the cfe-commits mailing list