This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[bfin] Add option -mfast-fp
- From: Jie Zhang <jzhang918 at gmail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Bernd Schmidt <bernds_cb1 at t-online dot de>
- Date: Thu, 23 Aug 2007 14:40:37 +0800
- Subject: [bfin] Add option -mfast-fp
This is the patch for GCC 4.1 to add -mfast-fp for Blackfin port.GCC
will link with a fast Blackfin floating-point library if this option is
added in command line. That library is available from
http://blackfin.uclinux.org
Is it OK to commit?
Jie
* config/bfin/bfin.opt (mfast-fp): Add.
* config/bfin/linux.h (LINK_GCC_C_SEQUENCE_SPEC): Let
libbffastfp override libgcc if -mfast-fp.
* config/bfin/bfin.h (LINK_GCC_C_SEQUENCE_SPEC): Likewise.
* doc/invoke.texi (Option Summary): Mention -mfast-fp.
(Blackfin Options): Document -mfast-fp.
Index: doc/invoke.texi
===================================================================
--- doc/invoke.texi (revision 127728)
+++ doc/invoke.texi (working copy)
@@ -450,7 +450,7 @@ Objective-C and Objective-C++ Dialects}.
-mstack-check-l1 -mid-shared-library -mno-id-shared-library @gol
-mshared-library-id=@var{n} -mleaf-id-shared-library @gol
-mno-leaf-id-shared-library -msep-data -mno-sep-data -mlong-calls @gol
--mno-long-calls}
+-mno-long-calls -mfast-fp}
@emph{CRIS Options}
@gccoptlist{-mcpu=@var{cpu} -march=@var{cpu} -mtune=@var{cpu} @gol
@@ -8612,6 +8612,12 @@ This feature is not enabled by default.
@option{-mno-long-calls} will restore the default behavior. Note these
switches have no effect on how the compiler generates code to handle
function calls via function pointers.
+
+@item -mfast-fp
+@opindex mfast-fp
+Link with the fast floating-point library. This library relaxes some of
+the IEEE floating-point standard's rules for checking inputs against
+Not-a-Number (NAN), in the interest of performance.
@end table
@node CRIS Options
Index: config/bfin/bfin.opt
===================================================================
--- config/bfin/bfin.opt (revision 127728)
+++ config/bfin/bfin.opt (working copy)
@@ -64,6 +64,10 @@ mlong-calls
Target Report Mask(LONG_CALLS)
Avoid generating pc-relative calls; use indirection
+mfast-fp
+Target Report Mask(FAST_FP)
+Link with the fast floating-point library
+
mfdpic
Target Report Mask(FDPIC)
Enable Function Descriptor PIC mode
Index: config/bfin/linux.h
===================================================================
--- config/bfin/linux.h (revision 127728)
+++ config/bfin/linux.h (working copy)
@@ -35,7 +35,8 @@ asm (TEXT_SECTION_ASM_OP);
#undef LINK_GCC_C_SEQUENCE_SPEC
#define LINK_GCC_C_SEQUENCE_SPEC \
- "%{mfast-fp:-lbffastfp} %{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+ "%{static:--start-group} %{mfast-fp:-lbffastfp} %G %L %{static:--end-group} \
+ %{!static:%{mfast-fp:-lbffastfp} %G}"
#undef LINK_SPEC
#define LINK_SPEC "\
Index: config/bfin/bfin.h
===================================================================
--- config/bfin/bfin.h (revision 127728)
+++ config/bfin/bfin.h (working copy)
@@ -89,9 +89,9 @@ extern int target_flags;
# define SUBTARGET_DRIVER_SELF_SPECS
#endif
-#define LINK_GCC_C_SEQUENCE_SPEC \
- "%{mfdpic:%{!static: %L} %{static: %G %L %G}} \
- %{!mfdpic:%G %L %G}"
+#define LINK_GCC_C_SEQUENCE_SPEC "\
+ %{mfast-fp:-lbffastfp} %G %L %{mfast-fp:-lbffastfp} %G \
+"
/* A C string constant that tells the GCC driver program options to pass to
the assembler. It can also specify how to translate options you give to GNU