def mrdseed : Flag<["-"], "mrdseed">, Group<m_x86_Features_Group>;
def mips16 : Flag<["-"], "mips16">, Group<m_Group>;
def mno_mips16 : Flag<["-"], "mno-mips16">, Group<m_Group>;
+def mmicromips : Flag<["-"], "mmicromips">, Group<m_Group>;
+def mno_micromips : Flag<["-"], "mno-micromips">, Group<m_Group>;
def mxgot : Flag<["-"], "mxgot">, Group<m_Group>;
def mno_xgot : Flag<["-"], "mno-xgot">, Group<m_Group>;
def mdsp : Flag<["-"], "mdsp">, Group<m_Group>;
static const Builtin::Info BuiltinInfo[];
std::string CPU;
bool IsMips16;
+ bool IsMicromips;
bool IsSingleFloat;
enum MipsFloatABI {
HardFloat, SoftFloat
: TargetInfo(triple),
CPU(CPUStr),
IsMips16(false),
+ IsMicromips(false),
IsSingleFloat(false),
FloatABI(HardFloat),
DspRev(NoDSP),
if (IsMips16)
Builder.defineMacro("__mips16", Twine(1));
+ if (IsMicromips)
+ Builder.defineMacro("__mips_micromips", Twine(1));
+
switch (DspRev) {
default:
break;
Name == "o32" || Name == "n32" || Name == "n64" || Name == "eabi" ||
Name == "mips32" || Name == "mips32r2" ||
Name == "mips64" || Name == "mips64r2" ||
- Name == "mips16" || Name == "dsp" || Name == "dspr2") {
+ Name == "mips16" || Name == "micromips" ||
+ Name == "dsp" || Name == "dspr2") {
Features[Name] = Enabled;
return true;
} else if (Name == "32") {
virtual void HandleTargetFeatures(std::vector<std::string> &Features) {
IsMips16 = false;
+ IsMicromips = false;
IsSingleFloat = false;
FloatABI = HardFloat;
DspRev = NoDSP;
FloatABI = SoftFloat;
else if (*it == "+mips16")
IsMips16 = true;
+ else if (*it == "+micromips")
+ IsMicromips = true;
else if (*it == "+dsp")
DspRev = std::max(DspRev, DSP1);
else if (*it == "+dspr2")
AddTargetFeature(Args, CmdArgs,
options::OPT_mips16, options::OPT_mno_mips16,
"mips16");
+ AddTargetFeature(Args, CmdArgs,
+ options::OPT_mmicromips, options::OPT_mno_micromips,
+ "micromips");
AddTargetFeature(Args, CmdArgs,
options::OPT_mdsp, options::OPT_mno_dsp,
"dsp");
// RUN: | FileCheck --check-prefix=CHECK-NOMIPS16 %s
// CHECK-NOMIPS16: "-target-feature" "-mips16"
//
+// -mmicromips
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN: -mno-micromips -mmicromips 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-MICROMIPS %s
+// CHECK-MICROMIPS: "-target-feature" "+micromips"
+//
+// -mno-micromips
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN: -mmicromips -mno-micromips 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NOMICROMIPS %s
+// CHECK-NOMICROMIPS: "-target-feature" "-micromips"
+//
// -mdsp
// RUN: %clang -target mips-linux-gnu -### -c %s \
// RUN: -mno-dsp -mdsp 2>&1 \
// RUN: | FileCheck -check-prefix NOMIPS16 %s
// NOMIPS16-NOT:#define __mips16 1
//
+// RUN: %clang_cc1 -target-feature +micromips \
+// RUN: -E -dM -triple=mips-none-none < /dev/null \
+// RUN: | FileCheck -check-prefix MICROMIPS %s
+// MICROMIPS:#define __mips_micromips 1
+//
+// RUN: %clang_cc1 -target-feature -micromips \
+// RUN: -E -dM -triple=mips-none-none < /dev/null \
+// RUN: | FileCheck -check-prefix NOMICROMIPS %s
+// NOMICROMIPS-NOT:#define __mips_micromips 1
+//
// RUN: %clang_cc1 -target-feature +dsp \
// RUN: -E -dM -triple=mips-none-none < /dev/null \
// RUN: | FileCheck -check-prefix MIPS-DSP %s