]> granicus.if.org Git - clang/commitdiff
[mips] Added -mfp64 and -mfp32 options.
authorDaniel Sanders <daniel.sanders@imgtec.com>
Thu, 17 Oct 2013 14:55:58 +0000 (14:55 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Thu, 17 Oct 2013 14:55:58 +0000 (14:55 +0000)
These options specify 64-bit FP registers and 32-bit FP registers respectively.

When using -mfp32, the FPU has 16x double-precision registers overlapping with
the 32x single-precision registers (each double-precision register overlaps
two single-precision registers).

When using -mfp64, the FPU has 32x double-precision registers overlapping with
the 32x single-precision registers (each double-precision register overlaps
with one single-precision register and has an additional 32-bits).

MSA requires -mfp64.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192899 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/Options.td
lib/Driver/Tools.cpp
test/Driver/mips-features.c

index 5404edea216117c8d24d6501d900bbf8b483f079..b2f75179c93e6e20fe6857ceb270a51643d6ad29 100644 (file)
@@ -1104,6 +1104,10 @@ def mmsa : Flag<["-"], "mmsa">, Group<m_Group>,
   HelpText<"Enable MSA ASE (MIPS only)">;
 def mno_msa : Flag<["-"], "mno-msa">, Group<m_Group>,
   HelpText<"Disable MSA ASE (MIPS only)">;
+def mfp64 : Flag<["-"], "mfp64">, Group<m_Group>,
+  HelpText<"Use 64-bit floating point registers (MIPS only)">;
+def mfp32 : Flag<["-"], "mfp32">, Group<m_Group>,
+  HelpText<"Use 32-bit floating point registers (MIPS only)">;
 def mnan_EQ : Joined<["-"], "mnan=">, Group<m_Group>;
 def mips32 : Flag<["-"], "mips32">,
   Alias<march_EQ>, AliasArgs<["mips32"]>,
index 68a5fe8f9a03154e50a02b0caa895d7726809203..d6ddd02443729d4e56a8d79bb2c09d2ebe3f2227 100644 (file)
@@ -982,6 +982,8 @@ static void getMIPSTargetFeatures(const Driver &D, const ArgList &Args,
                    "dspr2");
   AddTargetFeature(Args, Features, options::OPT_mmsa, options::OPT_mno_msa,
                    "msa");
+  AddTargetFeature(Args, Features, options::OPT_mfp64, options::OPT_mfp32,
+                   "fp64");
 }
 
 void Clang::AddMIPSTargetArgs(const ArgList &Args,
index 8de26d4cbc7602a9258969477a24c52bb0e3afb2..d663e6651e5341e15785da318c9988593374b29c 100644 (file)
 // RUN:   | FileCheck --check-prefix=CHECK-NOMMSA %s
 // CHECK-NOMMSA: "-target-feature" "-msa"
 //
+// -mfp64
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN:     -mfp32 -mfp64 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-MFP64 %s
+// CHECK-MFP64: "-target-feature" "+fp64"
+//
+// -mfp32
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN:     -mfp64 -mfp32 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-NOMFP64 %s
+// CHECK-NOMFP64: "-target-feature" "-fp64"
+//
 // -mxgot
 // RUN: %clang -target mips-linux-gnu -### -c %s \
 // RUN:     -mno-xgot -mxgot 2>&1 \