r192899 - [mips] Added -mfp64 and -mfp32 options.
Daniel Sanders
daniel.sanders at imgtec.com
Thu Oct 17 07:55:58 PDT 2013
Author: dsanders
Date: Thu Oct 17 09:55:58 2013
New Revision: 192899
URL: http://llvm.org/viewvc/llvm-project?rev=192899&view=rev
Log:
[mips] Added -mfp64 and -mfp32 options.
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.
Modified:
cfe/trunk/include/clang/Driver/Options.td
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/mips-features.c
Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=192899&r1=192898&r2=192899&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Thu Oct 17 09:55:58 2013
@@ -1104,6 +1104,10 @@ def mmsa : Flag<["-"], "mmsa">, Group<m_
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"]>,
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=192899&r1=192898&r2=192899&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Oct 17 09:55:58 2013
@@ -982,6 +982,8 @@ static void getMIPSTargetFeatures(const
"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,
Modified: cfe/trunk/test/Driver/mips-features.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mips-features.c?rev=192899&r1=192898&r2=192899&view=diff
==============================================================================
--- cfe/trunk/test/Driver/mips-features.c (original)
+++ cfe/trunk/test/Driver/mips-features.c Thu Oct 17 09:55:58 2013
@@ -60,6 +60,18 @@
// 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 \
More information about the cfe-commits
mailing list