[yocto] [PATCH 1/5] gcc: Add gcc configure for PowerPC e500v2/SPE embedded floating point ABI

Khem Raj raj.khem at gmail.com
Tue Jul 19 08:02:10 PDT 2011


On Mon, Jul 18, 2011 at 11:47 PM, Kumar Gala <galak at kernel.crashing.org> wrote:
>
> On Jul 19, 2011, at 1:04 AM, Khem Raj wrote:
>
>> On Mon, Jul 18, 2011 at 10:21 PM, Kumar Gala <galak at kernel.crashing.org> wrote:
>>> The e500v2 core utilizes a unique floating point programming model / ABI.
>>> We utilize TARGET_FPU = "spe" to distinguish this choice.  When building
>>> the toolchain for this ABI we need configure gcc with --enable-e500_double.
>>>
>>> Signed-off-by: Kumar Gala <galak at kernel.crashing.org>
>>> ---
>>>  meta/recipes-devtools/gcc/gcc-4.6.inc    |    2 +-
>>>  meta/recipes-devtools/gcc/gcc-common.inc |    2 ++
>>>  2 files changed, 3 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/meta/recipes-devtools/gcc/gcc-4.6.inc b/meta/recipes-devtools/gcc/gcc-4.6.inc
>>> index 56064b5..b719155 100644
>>> --- a/meta/recipes-devtools/gcc/gcc-4.6.inc
>>> +++ b/meta/recipes-devtools/gcc/gcc-4.6.inc
>>> @@ -1,6 +1,6 @@
>>>  require gcc-common.inc
>>>
>>> -PR = "r8"
>>> +PR = "r9"
>>>
>>>  # Third digit in PV should be incremented after a minor release
>>>  # happens from this branch on gcc e.g. currently its 4.6.0
>>> diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc
>>> index 7bf036c..409ad01 100644
>>> --- a/meta/recipes-devtools/gcc/gcc-common.inc
>>> +++ b/meta/recipes-devtools/gcc/gcc-common.inc
>>> @@ -12,6 +12,8 @@ FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/gcc-${PV}"
>>>  def get_gcc_fpu_setting(bb, d):
>>>     if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
>>>         return "--with-float=soft"
>>> +    if bb.data.getVar('TARGET_FPU', d, 1) in [ 'spe' ]:
>>> +        return "--enable-e500_double"
>>>     return ""
>>>
>>
>> this will enable e500_double even for e500v1 which IIRC does not have
>> DFP support
>> have you tried building for e500v1 with this ?
>
> I think you are correct.  Any suggestions on how to distinguish e500v1 vs e500v2?  Utilizing BASE_PACKAGE_ARCH has problems w/native builds since it seems to get set to x86_64 at some point.
>
> I could do:
>
> TARGET_FPU = "ppc-efs"  [Embedded scalar single-precision floating-point]
> TARGET_FPU = "ppc-efd"  [Embedded scalar double-precision floating-point]

thats fine. using spfp or dpfp is another option.
however you have to make sure that TARGET_FPU is not checking for spe
anywhere in whole tree

>
> Than meta/recipes-devtools/gcc/gcc-common.inc:
>
>  def get_gcc_fpu_setting(bb, d):
>    if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
>        return "--with-float=soft"
> +    if bb.data.getVar('TARGET_FPU', d, 1) in [ 'ppc-efd' ]:
> +        return "--enable-e500_double"
>    return ""
>
> And meta/conf/distro/include/tclibc-*libc.inc:
>
> TARGET_OS_powerpc = "linux${@['','-gnuspe'][bb.data.getVar('TARGET_FPU',d,1) in ['ppc-efs', 'ppc-efd']]}"
>
> thoughts?
>
> - k



More information about the yocto mailing list