Patchwork [RFC] Make ppce300c3 tune hard-float by default

login
register
mail settings
Submitter Mats Kärrman
Date March 28, 2014, 4:43 p.m.
Message ID <ED3E0BCACD909541BA94A34C4A164D4C5B3A7EBE@post.tritech.se>
Download mbox | patch
Permalink /patch/69589/
State New
Headers show

Comments

Mats Kärrman - March 28, 2014, 4:43 p.m.
The tuning file for PowerPC e300c3 is soft-float. In OE-classic it was hard-float
and it should be as the c3 has an fpu. I have modified the tuning file to include
both a hard-float version (using the existing ppce300c3 name) and an optional
soft-float version (called ppce300c3-nf).

The following patch also passes a "--with-cpu=e300c3" argument to GLIBC.
For this to have any effect an "Implies" file must be added to the glibc/eglibc
source (tested with eglibc 2.18).
./ports/sysdeps/powerpc/powerpc32/e300c3/fpu/Implies:
------------------------------------------------------------------------------
# e300c3 is a variant of 603e so use the same optimizations for sqrt
powerpc/powerpc32/603e/fpu
------------------------------------------------------------------------------

Thanks to Khem Raj and Mark Hatle for their previous comments.
Khem Raj - April 1, 2014, 5:37 a.m.
Mats

On Fri, Mar 28, 2014 at 9:43 AM, Mats Kärrman <Mats.Karrman@tritech.se> wrote:
> +# glibc configure options to make use of 603e specific sqrt/sqrtf routines
> +GLIBC_EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "ppce300c3", "--with-cpu=e300c3", "", d)}"

looks good, may be the comment above can be more explanatory saying that
glibc aliases e300c3 sqrt/sqrtf to 600e versions
Mats Kärrman - April 1, 2014, 7:54 a.m.
Hi Khem,

Thanks for your feedback!

On Tuesday, April 01, 2014 7:37 AM, Khem Raj wrote:
> On Fri, Mar 28, 2014 at 9:43 AM, Mats Kärrman <Mats.Karrman@tritech.se> wrote:
>> +# glibc configure options to make use of 603e specific sqrt/sqrtf routines
>> +GLIBC_EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "ppce300c3", "--with-cpu=e300c3", "", d)}"
>
> looks good, may be the comment above can be more explanatory saying that
> glibc aliases e300c3 sqrt/sqrtf to 600e versions

The above statement depends on an added "Implies" file in eglibc and,
more important on a previous patch adding support for 603e/fpu sqrt.

How is the new Implies file best added, as a patch to the previous patch
or as a new patch?

BR // Mats
Richard Purdie - April 1, 2014, 10:48 a.m.
On Tue, 2014-04-01 at 07:54 +0000, Mats Kärrman wrote:
> Hi Khem,
> 
> Thanks for your feedback!
> 
> On Tuesday, April 01, 2014 7:37 AM, Khem Raj wrote:
> > On Fri, Mar 28, 2014 at 9:43 AM, Mats Kärrman <Mats.Karrman@tritech.se> wrote:
> >> +# glibc configure options to make use of 603e specific sqrt/sqrtf routines
> >> +GLIBC_EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "ppce300c3", "--with-cpu=e300c3", "", d)}"
> >
> > looks good, may be the comment above can be more explanatory saying that
> > glibc aliases e300c3 sqrt/sqrtf to 600e versions
> 
> The above statement depends on an added "Implies" file in eglibc and,
> more important on a previous patch adding support for 603e/fpu sqrt.
> 
> How is the new Implies file best added, as a patch to the previous patch
> or as a new patch?

Since this hasn't merge yet please send another patch. If it had merged,
an incremental one would be needed.

Cheers,

Richard
Mats Kärrman - April 1, 2014, 11:44 a.m.
Hi Richard,

On Tuesday, April 01, 2014 12:48 PM, Richard Purdie wrote:
> On Tue, 2014-04-01 at 07:54 +0000, Mats Kärrman wrote:
>> Hi Khem,
>>
>> Thanks for your feedback!
>>
>> On Tuesday, April 01, 2014 7:37 AM, Khem Raj wrote:
>> > On Fri, Mar 28, 2014 at 9:43 AM, Mats Kärrman <Mats.Karrman@tritech.se> wrote:
>> >> +# glibc configure options to make use of 603e specific sqrt/sqrtf routines
>> >> +GLIBC_EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "ppce300c3", "--with-cpu=e300c3", "", d)}"
>> >
>> > looks good, may be the comment above can be more explanatory saying that
>> > glibc aliases e300c3 sqrt/sqrtf to 600e versions
>>
>> The above statement depends on an added "Implies" file in eglibc and,
>> more important on a previous patch adding support for 603e/fpu sqrt.
>>
>> How is the new Implies file best added, as a patch to the previous patch
>> or as a new patch?
>
>Since this hasn't merge yet please send another patch. If it had merged,
>an incremental one would be needed.
>

Sorry if I was unclear. The patch I meant is "glibc.fix_sqrt2.patch" which
is part of both Dora and master OE-core. This patch adds the sqrt routines
I'm after and also adds Implies for relevant CPU's. What I need is one more
Implies that makes sure this code is used for e300c3 also.

Or did you mean merged upstream?

BR // Mats
Richard Purdie - April 1, 2014, 12:02 p.m.
On Tue, 2014-04-01 at 11:44 +0000, Mats Kärrman wrote:
> Hi Richard,
> 
> On Tuesday, April 01, 2014 12:48 PM, Richard Purdie wrote:
> > On Tue, 2014-04-01 at 07:54 +0000, Mats Kärrman wrote:
> >> Hi Khem,
> >>
> >> Thanks for your feedback!
> >>
> >> On Tuesday, April 01, 2014 7:37 AM, Khem Raj wrote:
> >> > On Fri, Mar 28, 2014 at 9:43 AM, Mats Kärrman <Mats.Karrman@tritech.se> wrote:
> >> >> +# glibc configure options to make use of 603e specific sqrt/sqrtf routines
> >> >> +GLIBC_EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "ppce300c3", "--with-cpu=e300c3", "", d)}"
> >> >
> >> > looks good, may be the comment above can be more explanatory saying that
> >> > glibc aliases e300c3 sqrt/sqrtf to 600e versions
> >>
> >> The above statement depends on an added "Implies" file in eglibc and,
> >> more important on a previous patch adding support for 603e/fpu sqrt.
> >>
> >> How is the new Implies file best added, as a patch to the previous patch
> >> or as a new patch?
> >
> >Since this hasn't merge yet please send another patch. If it had merged,
> >an incremental one would be needed.
> >
> 
> Sorry if I was unclear. The patch I meant is "glibc.fix_sqrt2.patch" which
> is part of both Dora and master OE-core. This patch adds the sqrt routines
> I'm after and also adds Implies for relevant CPU's. What I need is one more
> Implies that makes sure this code is used for e300c3 also.
> 
> Or did you mean merged upstream?

Sorry, its me who misunderstood. Please send a patch which updates that
patch file with the extra information.

Cheers,

Richard

Patch

diff --git a/meta/conf/machine/include/tune-ppce300c3.inc b/meta/conf/machine/include/tune-ppce300c3.inc
index 9431222..d11522b 100644
--- a/meta/conf/machine/include/tune-ppce300c3.inc
+++ b/meta/conf/machine/include/tune-ppce300c3.inc
@@ -2,10 +2,22 @@  DEFAULTTUNE ?= "ppce300c3"
 
 require conf/machine/include/powerpc/arch-powerpc.inc
 
+AVAILTUNES += "ppce300c3 ppce300c3-nf"
+
+# hard-float
 TUNEVALID[ppce300c3] = "Enable ppce300c3 specific processor optimizations"
+TUNE_FEATURES_tune-ppce300c3 = "${TUNE_FEATURES_tune-powerpc} ppce300c3"
+TUNE_PKGARCH_tune-ppce300c3 = "ppce300c3"
+PACKAGE_EXTRA_ARCHS_tune-ppce300c3 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppce300c3"
 TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "ppce300c3", " -mcpu=e300c3", "", d)}"
 
-AVAILTUNES += "ppce300c3"
-TUNE_FEATURES_tune-ppce300c3 = "m32 fpu-soft ppce300c3"
-TUNE_PKGARCH_tune-ppce300c3 = "ppce300c3"
-PACKAGE_EXTRA_ARCHS_tune-ppce300c3 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc-nf} ppce300c3"
+# glibc configure options to make use of 603e specific sqrt/sqrtf routines
+GLIBC_EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "ppce300c3", "--with-cpu=e300c3", "", d)}"
+
+# soft-float
+TUNEVALID[ppce300c3-nf] = "Enable ppce300c3 specific processor optimizations (no fpu)"
+TUNE_FEATURES_tune-ppce300c3-nf = "${TUNE_FEATURES_tune-powerpc-nf} ppce300c3-nf"
+TUNE_PKGARCH_tune-ppce300c3-nf = "ppce300c3-nf"
+PACKAGE_EXTRA_ARCHS_tune-ppce300c3-nf = "${PACKAGE_EXTRA_ARCHS_tune-powerpc-nf} ppce300c3-nf"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "ppce300c3-nf", " -mcpu=e300c3", "", d)}"
+