diff --color -uNar llvm-12.0.0rc2.src/lib/Target/Mips/AsmParser/MipsAsmParser.cpp llvm-12.0.0rc2.src-gs464v/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
--- llvm-12.0.0rc2.src/lib/Target/Mips/AsmParser/MipsAsmParser.cpp	2021-02-24 11:17:21.000000000 +0800
+++ llvm-12.0.0rc2.src-gs464v/lib/Target/Mips/AsmParser/MipsAsmParser.cpp	2021-03-03 21:02:42.780083424 +0800
@@ -127,7 +127,7 @@
     Mips::FeatureMips64, Mips::FeatureMips64r2, Mips::FeatureMips64r3,
     Mips::FeatureMips64r5, Mips::FeatureMips64r6, Mips::FeatureCnMips,
     Mips::FeatureCnMipsP, Mips::FeatureFP64Bit, Mips::FeatureGP64Bit,
-    Mips::FeatureNaN2008
+    Mips::FeatureNaNLegacy
 };
 
 namespace {
diff --color -uNar llvm-12.0.0rc2.src/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp llvm-12.0.0rc2.src-gs464v/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
--- llvm-12.0.0rc2.src/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp	2021-02-24 11:17:21.000000000 +0800
+++ llvm-12.0.0rc2.src-gs464v/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp	2021-03-03 20:58:56.072999354 +0800
@@ -856,7 +856,7 @@
     EFlags |= ELF::EF_MIPS_MACH_OCTEON;
 
   // Other options.
-  if (Features[Mips::FeatureNaN2008])
+  if (!Features[Mips::FeatureNaNLegacy])
     EFlags |= ELF::EF_MIPS_NAN2008;
 
   MCA.setELFHeaderEFlags(EFlags);
diff --color -uNar llvm-12.0.0rc2.src/lib/Target/Mips/MipsSubtarget.cpp llvm-12.0.0rc2.src-gs464v/lib/Target/Mips/MipsSubtarget.cpp
--- llvm-12.0.0rc2.src/lib/Target/Mips/MipsSubtarget.cpp	2021-02-24 11:17:21.000000000 +0800
+++ llvm-12.0.0rc2.src-gs464v/lib/Target/Mips/MipsSubtarget.cpp	2021-03-03 20:37:06.373050534 +0800
@@ -73,7 +73,7 @@
     : MipsGenSubtargetInfo(TT, CPU, /*TuneCPU*/ CPU, FS),
       MipsArchVersion(MipsDefault), IsLittle(little), IsSoftFloat(false),
       IsSingleFloat(false), IsFPXX(false), NoABICalls(false), Abs2008(false),
-      IsFP64bit(false), UseOddSPReg(true), IsNaN2008bit(false),
+      IsFP64bit(false), UseOddSPReg(true), IsNaN2008bit(true),
       IsGP64bit(false), HasVFPU(false), HasCnMips(false), HasCnMipsP(false),
       HasMips3_32(false), HasMips3_32r2(false), HasMips4_32(false),
       HasMips4_32r2(false), HasMips5_32r2(false), InMips16Mode(false),
diff --color -uNar llvm-12.0.0rc2.src/lib/Target/Mips/Mips.td llvm-12.0.0rc2.src-gs464v/lib/Target/Mips/Mips.td
--- llvm-12.0.0rc2.src/lib/Target/Mips/Mips.td	2021-02-24 11:17:21.000000000 +0800
+++ llvm-12.0.0rc2.src-gs464v/lib/Target/Mips/Mips.td	2021-03-03 20:51:19.279607848 +0800
@@ -67,8 +67,8 @@
                                 "Support 64-bit FP registers">;
 def FeatureFPXX        : SubtargetFeature<"fpxx", "IsFPXX", "true",
                                 "Support for FPXX">;
-def FeatureNaN2008     : SubtargetFeature<"nan2008", "IsNaN2008bit", "true",
-                                "IEEE 754-2008 NaN encoding">;
+def FeatureNaNLegacy   : SubtargetFeature<"nanlegacy", "IsNaN2008bit", "false",
+                                "MIPS legacy NaN encoding">;
 def FeatureAbs2008     : SubtargetFeature<"abs2008", "Abs2008", "true",
                                           "Disable IEEE 754-2008 abs.fmt mode">;
 def FeatureSingleFloat : SubtargetFeature<"single-float", "IsSingleFloat",
@@ -130,7 +130,7 @@
                                 "Mips32r6",
                                 "Mips32r6 ISA Support [experimental]",
                                 [FeatureMips32r5, FeatureFP64Bit,
-                                 FeatureNaN2008, FeatureAbs2008]>;
+                                 FeatureAbs2008]>;
 def FeatureMips64      : SubtargetFeature<"mips64", "MipsArchVersion",
                                 "Mips64", "Mips64 ISA Support",
                                 [FeatureMips5, FeatureMips32]>;
@@ -147,7 +147,7 @@
                                 "Mips64r6",
                                 "Mips64r6 ISA Support [experimental]",
                                 [FeatureMips32r6, FeatureMips64r5,
-                                 FeatureNaN2008, FeatureAbs2008]>;
+                                 FeatureAbs2008]>;
 def FeatureSym32       : SubtargetFeature<"sym32", "HasSym32", "true",
                                           "Symbols are 32 bit on Mips64">;
 
diff --color -uNar llvm-12.0.0rc2.src/tools/clang/lib/Basic/Targets/Mips.h llvm-12.0.0rc2.src-gs464v/tools/clang/lib/Basic/Targets/Mips.h
--- llvm-12.0.0rc2.src/tools/clang/lib/Basic/Targets/Mips.h	2021-02-24 11:17:21.000000000 +0800
+++ llvm-12.0.0rc2.src-gs464v/tools/clang/lib/Basic/Targets/Mips.h	2021-03-03 20:47:35.294747138 +0800
@@ -308,7 +308,7 @@
                             DiagnosticsEngine &Diags) override {
     IsMips16 = false;
     IsMicromips = false;
-    IsNan2008 = isIEEE754_2008Default();
+    IsNan2008 = true;  // HACK for GS464V
     IsAbs2008 = isIEEE754_2008Default();
     IsSingleFloat = false;
     FloatABI = HardFloat;
@@ -338,9 +338,9 @@
         FPMode = FP32;
       else if (Feature == "+fpxx")
         FPMode = FPXX;
-      else if (Feature == "+nan2008")
+      else if (Feature == "-nanlegacy")
         IsNan2008 = true;
-      else if (Feature == "-nan2008")
+      else if (Feature == "+nanlegacy")
         IsNan2008 = false;
       else if (Feature == "+abs2008")
         IsAbs2008 = true;
diff --color -uNar llvm-12.0.0rc2.src/tools/clang/lib/Driver/ToolChains/Arch/Mips.cpp llvm-12.0.0rc2.src-gs464v/tools/clang/lib/Driver/ToolChains/Arch/Mips.cpp
--- llvm-12.0.0rc2.src/tools/clang/lib/Driver/ToolChains/Arch/Mips.cpp	2021-02-24 11:17:21.000000000 +0800
+++ llvm-12.0.0rc2.src-gs464v/tools/clang/lib/Driver/ToolChains/Arch/Mips.cpp	2021-03-03 20:43:32.270411647 +0800
@@ -292,16 +292,16 @@
     StringRef Val = StringRef(A->getValue());
     if (Val == "2008") {
       if (mips::getIEEE754Standard(CPUName) & mips::Std2008)
-        Features.push_back("+nan2008");
+        Features.push_back("-nanlegacy");
       else {
-        Features.push_back("-nan2008");
+        Features.push_back("+nanlegacy");
         D.Diag(diag::warn_target_unsupported_nan2008) << CPUName;
       }
     } else if (Val == "legacy") {
       if (mips::getIEEE754Standard(CPUName) & mips::Legacy)
-        Features.push_back("-nan2008");
+        Features.push_back("+nanlegacy");
       else {
-        Features.push_back("+nan2008");
+        Features.push_back("-nanlegacy");
         D.Diag(diag::warn_target_unsupported_nanlegacy) << CPUName;
       }
     } else
@@ -446,7 +446,10 @@
     return llvm::StringSwitch<bool>(NaNArg->getValue())
         .Case("2008", true)
         .Case("legacy", false)
-        .Default(false);
+        .Default(true);
+
+  // HACK: NaN2008 is the default for GS464V
+  return true;
 
   // NaN2008 is the default for MIPS32r6/MIPS64r6.
   return llvm::StringSwitch<bool>(getCPUName(Args, Triple))
