Patchwork [1/1] tune-mips32: Update the default MIPS tuning to be mips32

login
register
mail settings
Submitter Mark Hatle
Date April 9, 2012, 11:31 p.m.
Message ID <a608dd6d5aec06056da9c20078b5cd171d6b6470.1334014014.git.mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/25479/
State New
Headers show

Comments

Mark Hatle - April 9, 2012, 11:31 p.m.
Previously the default mips tuning was defined as "mips1"
internally in the compiler.  Revise this and change to "mips32".

This eliminates the need for the mips32 specific tunings, which were
not being used anyway.  (They exists and were used, but were not
Phil Blundell - April 10, 2012, 12:35 p.m.
On Mon, 2012-04-09 at 18:31 -0500, Mark Hatle wrote:
> Previously the default mips tuning was defined as "mips1"
> internally in the compiler.  Revise this and change to "mips32".
> 
> This eliminates the need for the mips32 specific tunings, which were
> not being used anyway.  (They exists and were used, but were not
> differentiated by package arch prior to a recent commit.)

This change is slightly more far-reaching than the description above
suggests, in that it isn't just changing the default tuning: it seems
actually to remove the ability to tune for pre-mips32 altogether.
Obviously there's nothing to stop anybody creating tune files for
earlier MIPS in some other BSP layer, but this is a feature that exists
in oe-core today and would be removed by this patch.

Also, the second paragraph of your checkin message above doesn't make a
lot of sense.  In the first sentence you say that the mips32 tunings
were not being used, and then in the second sentence you say that they
were.  It doesn't seem that both those statements can logically be true.

And, finally, the checkin message doesn't make it entirely clear why
this change represents an improvement, i.e. why MIPS32 is a better
default tune than MIPS I.

p.
Phil Blundell - April 10, 2012, 12:37 p.m.
On Tue, 2012-04-10 at 13:35 +0100, Phil Blundell wrote:
> On Mon, 2012-04-09 at 18:31 -0500, Mark Hatle wrote:
> > Previously the default mips tuning was defined as "mips1"
> > internally in the compiler.  Revise this and change to "mips32".
> > 
> > This eliminates the need for the mips32 specific tunings, which were
> > not being used anyway.  (They exists and were used, but were not
> > differentiated by package arch prior to a recent commit.)
> 
> This change is slightly more far-reaching than the description above
> suggests, in that it isn't just changing the default tuning: it seems
> actually to remove the ability to tune for pre-mips32 altogether.
> Obviously there's nothing to stop anybody creating tune files for
> earlier MIPS in some other BSP layer, but this is a feature that exists
> in oe-core today and would be removed by this patch.

I also meant to ask: just to be absolutely clear, will MIPS32-tuned code
still run on older cores?  That is, if someone is targetting (say) MIPS
IV today, is this going to break their system?

p.

Patch

differentiated by package arch prior to a recent commit.)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/conf/machine/include/mips/arch-mips.inc |   13 +++++++++----
 meta/conf/machine/include/tune-mips32.inc    |   24 +-----------------------
 2 files changed, 10 insertions(+), 27 deletions(-)

diff --git a/meta/conf/machine/include/mips/arch-mips.inc b/meta/conf/machine/include/mips/arch-mips.inc
index 8758ecd..c7768a1 100644
--- a/meta/conf/machine/include/mips/arch-mips.inc
+++ b/meta/conf/machine/include/mips/arch-mips.inc
@@ -28,6 +28,11 @@  TUNEVALID[fpu-hard] = "Use hardware FPU"
 TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "fpu-hard", "-mhard-float", "-msoft-float", d)}"
 TARGET_FPU = "${@bb.utils.contains("TUNE_FEATURES", "fpu-hard", "", "soft", d)}"
 
+# mips32 is the default o32 tuning
+TUNEVALID[mips32] = "Enable mips32 specific processor optimizations"
+TUNE_CONFLICTS[mips32] = "n64 n32"
+TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "mips32", "-march=mips32", "", d)}"
+
 # Package naming
 MIPSPKGSFX_ENDIAN = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", "", "el", d)}"
 MIPSPKGSFX_BYTE = "${@bb.utils.contains("TUNE_FEATURES", "n64" , "64", "", d)}"
@@ -40,7 +45,7 @@  TUNE_PKGARCH = "${MIPSPKGSFX_VARIANT_tune-${DEFAULTTUNE}}${MIPSPKGSFX_FPU}${MIPS
 
 # Base tunes
 AVAILTUNES += "mips mips64-n32 mips64 mipsel mips64el-n32 mips64el mips-nf mips64-nf-n32 mips64-nf mipsel-nf mips64el-nf-n32 mips64el-nf"
-TUNE_FEATURES_tune-mips = "o32 bigendian fpu-hard"
+TUNE_FEATURES_tune-mips = "mips32 o32 bigendian fpu-hard"
 BASE_LIB_tune-mips = "lib"
 MIPSPKGSFX_VARIANT_tune-mips = "${TUNE_ARCH}"
 PACKAGE_EXTRA_ARCHS_tune-mips = "mips"
@@ -55,7 +60,7 @@  BASE_LIB_tune-mips64 = "lib64"
 MIPSPKGSFX_VARIANT_tune-mips64 = "${TUNE_ARCH}"
 PACKAGE_EXTRA_ARCHS_tune-mips64 = "mips64"
 
-TUNE_FEATURES_tune-mipsel = "o32 fpu-hard"
+TUNE_FEATURES_tune-mipsel = "mips32 o32 fpu-hard"
 BASE_LIB_tune-mipsel = "lib"
 MIPSPKGSFX_VARIANT_tune-mipsel = "${TUNE_ARCH}"
 PACKAGE_EXTRA_ARCHS_tune-mipsel = "mipsel"
@@ -70,7 +75,7 @@  BASE_LIB_tune-mips64el = "lib64"
 MIPSPKGSFX_VARIANT_tune-mips64el = "${TUNE_ARCH}"
 PACKAGE_EXTRA_ARCHS_tune-mips64el = "mips64el"
 
-TUNE_FEATURES_tune-mips-nf = "o32 bigendian"
+TUNE_FEATURES_tune-mips-nf = "mips32 o32 bigendian"
 BASE_LIB_tune-mips-nf = "lib"
 MIPSPKGSFX_VARIANT_tune-mips-nf = "${TUNE_ARCH}"
 PACKAGE_EXTRA_ARCHS_tune-mips-nf = "mips-nf"
@@ -85,7 +90,7 @@  BASE_LIB_tune-mips64-nf = "lib64"
 MIPSPKGSFX_VARIANT_tune-mips64-nf = "${TUNE_ARCH}"
 PACKAGE_EXTRA_ARCHS_tune-mips64-nf = "mips64-nf"
 
-TUNE_FEATURES_tune-mipsel-nf = "o32"
+TUNE_FEATURES_tune-mipsel-nf = "mips32 o32"
 BASE_LIB_tune-mipsel-nf = "lib"
 MIPSPKGSFX_VARIANT_tune-mipsel-nf = "${TUNE_ARCH}"
 PACKAGE_EXTRA_ARCHS_tune-mipsel-nf = "mipsel-nf"
diff --git a/meta/conf/machine/include/tune-mips32.inc b/meta/conf/machine/include/tune-mips32.inc
index 93ed5ee..f7bad90 100644
--- a/meta/conf/machine/include/tune-mips32.inc
+++ b/meta/conf/machine/include/tune-mips32.inc
@@ -1,25 +1,3 @@ 
-DEFAULTTUNE ?= "mips32"
+DEFAULTTUNE ?= "mips"
 
 require conf/machine/include/mips/arch-mips.inc
-
-TUNEVALID[mips32] = "Enable mips32 specific processor optimizations"
-TUNE_CONFLICTS[mips32] = "n64 n32"
-TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "mips32", "-march=mips32", "", d)}"
-
-AVAILTUNES += "mips32 mips32el mips32-nf mips32el-nf"
-
-TUNE_FEATURES_tune-mips32 = "${TUNE_FEATURES_tune-mips} mips32"
-MIPSPKGSFX_VARIANT_tune-mips32 = "mips32"
-PACKAGE_EXTRA_ARCHS_tune-mips32 = "mips mips32"
-
-TUNE_FEATURES_tune-mips32el = "${TUNE_FEATURES_tune-mipsel} mips32"
-MIPSPKGSFX_VARIANT_tune-mips32el = "mips32el"
-PACKAGE_EXTRA_ARCHS_tune-mips32el = "mipsel mips32el"
-
-TUNE_FEATURES_tune-mips32-nf = "${TUNE_FEATURES_tune-mips-nf} mips32"
-MIPSPKGSFX_VARIANT_tune-mips32-nf = "mips32"
-PACKAGE_EXTRA_ARCHS_tune-mips32-nf = "mips-nf mips32-nf"
-
-TUNE_FEATURES_tune-mips32el-nf = "${TUNE_FEATURES_tune-mipsel-nf} mips32"
-MIPSPKGSFX_VARIANT_tune-mips32el-nf = "mips32el"
-PACKAGE_EXTRA_ARCHS_tune-mips32el-nf = "mipsel-nf mips32el-nf"