Patchwork [mips] Do not make -Os the default with mips-mti-elf target.

login
register
mail settings
Submitter Steve Ellcey
Date Nov. 7, 2012, 11:32 p.m.
Message ID <eac1aafa-a6d7-41c9-9ac6-b6abf69ed93b@EXCHHUB01.MIPS.com>
Download mbox | patch
Permalink /patch/197738/
State New
Headers show

Comments

Steve Ellcey - Nov. 7, 2012, 11:32 p.m.
I noticed that because my new mips-mti-elf target includes config/mt-sde
it uses the -Os option by default when building runtime libraries.  I would
like to remove the use of -Os so that the runtime performance for the
mips-mti-elf target is improved.  If users want the -Os flag they can use
the existing --enable-target-optspace configure option to get it.

This patch creates config/mt-mti that is like mt-sde but without -Os and
changes the mips*-mti-elf* target to use that include file instead of mt-sde.

Tested with the mips-mti-elf target.

OK to checkin?

Steve Ellcey
sellcey@mips.com


2012-11-07  Steve Ellcey  <sellcey@mips.com>

	* config/mt-mti: New file.
	* configure.ac (mips*-mti-elf*): Use config/mt-mti.
	* configure: Regenerate.
Richard Sandiford - Nov. 8, 2012, 7:58 a.m.
"Steve Ellcey " <sellcey@mips.com> writes:
> I noticed that because my new mips-mti-elf target includes config/mt-sde
> it uses the -Os option by default when building runtime libraries.  I would
> like to remove the use of -Os so that the runtime performance for the
> mips-mti-elf target is improved.  If users want the -Os flag they can use
> the existing --enable-target-optspace configure option to get it.
>
> This patch creates config/mt-mti that is like mt-sde but without -Os and
> changes the mips*-mti-elf* target to use that include file instead of mt-sde.
>
> Tested with the mips-mti-elf target.
>
> OK to checkin?

OK with me, thanks.

Just for the record, the SDE configuration is also effectively owned by MTI,
so if you think the same reasoning applies there, we could change mt-sde
instead.  But if you want to keep SDE the way it is now then the patch is OK.

Richard

Patch

diff --git a/config/mt-mti b/config/mt-mti
new file mode 100644
index 0000000..85ad9e7
--- /dev/null
+++ b/config/mt-mti
@@ -0,0 +1,13 @@ 
+# We use -minterlink-mips16 so that the non-MIPS16 libraries can still be
+# linked against partly-MIPS16 code.  The -mcode-readable=pcrel option allows
+# MIPS16 libraries to run on Harvard-style split I/D memories, so long
+# as they have the D-to-I redirect for PC-relative loads.  -mno-gpopt
+# has two purposes: it allows libraries to be used in situations where
+# $gp != our _gp, and it allows them to be built with -G8 while
+# retaining link compatibility with -G0 and -G4.
+#
+# We do not default to -Os like mt-sde does, users who want that can configure
+# with --enable-target-optspace.
+
+CFLAGS_FOR_TARGET += -minterlink-mips16 -mcode-readable=pcrel -mno-gpopt
+CXXFLAGS_FOR_TARGET += -minterlink-mips16 -mcode-readable=pcrel -mno-gpopt
diff --git a/configure.ac b/configure.ac
index c346c2c..a87185a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2299,9 +2299,12 @@  case "${target}" in
   spu-*-*)
     target_makefile_frag="config/mt-spu"
     ;;
-  mips*-sde-elf* | mips*-mti-elf*)
+  mips*-sde-elf*)
     target_makefile_frag="config/mt-sde"
     ;;
+  mips*-mti-elf*)
+    target_makefile_frag="config/mt-mti"
+    ;;
   mipsisa*-*-elfoabi*)
     target_makefile_frag="config/mt-mips-elfoabi"
     ;;