All of lore.kernel.org
 help / color / mirror / Atom feed
* TARGET_FPU not getting populated for powerpc 405/440 fpu-hard targets
@ 2012-08-24 16:27 Elvis Dowson
  2012-08-24 16:35 ` Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Elvis Dowson @ 2012-08-24 16:27 UTC (permalink / raw)
  To: Yocto Discussion Mailing List

[-- Attachment #1: Type: text/plain, Size: 3221 bytes --]

Hi,
       I just observed that TARGET_FPU is not getting populated, when you do a build for fpu-hard targets. For fpu-soft targets, it displays TARGET_FPU = "soft", but for fpu-hard targets, it display TARGET_FPU = "".

For example, for my tune-ppc440e.inc file

DEFAULTTUNE ?= "ppc440e"

require conf/machine/include/powerpc/arch-powerpc.inc

TUNEVALID[ppc440e] = "Enable ppc440e specific processor optimizations"
TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "ppc440e", "-mcpu=440fp", "", d)}"

AVAILTUNES += "ppc440e"
TUNE_FEATURES_tune-ppc440e = "m32 ppc440e fpu-hard"
TUNE_PKGARCH_tune-ppc440e = "ppc440e"
PACKAGE_EXTRA_ARCHS_tune-ppc440e = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppc440e"

# glibc configure options to get ppc440e specific library (for sqrt)
GLIBC_EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "ppc440e", "-with-cpu=440fp", "", d)}"

it is empty:

uild Configuration:
BB_VERSION        = "1.15.3"
TARGET_ARCH       = "powerpc"
TARGET_OS         = "linux"
MACHINE           = "virtex5"
DISTRO            = "poky"
DISTRO_VERSION    = "1.2+snapshot-20120824"
TUNE_FEATURES     = "m32 ppc440e fpu-hard"
TARGET_FPU        = ""
meta              
meta-yocto        = "(nobranch):77192ec8ed3563920b969306aaa7609d05184255"
toolchain-layer   = "(nobranch):3fd2bf4c5e6c3a353aff9795294b7c25f5f50c49"
meta-xilinx       = "master-xilinx-ml507-gcc-4.5:18ab4890b00d12c58f750008688d2e97687e33da"

Similarily, for my tune-ppc405e.inc file:

DEFAULTTUNE ?= "ppc405e"

require conf/machine/include/powerpc/arch-powerpc.inc

TUNEVALID[ppc405e] = "Enable ppc405e specific processor optimizations"
TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "ppc405e", "-mcpu=405fp", "", d)}"

AVAILTUNES += "ppc405e"
TUNE_FEATURES_tune-ppc405e = "m32 ppc405e fpu-hard"
TUNE_PKGARCH_tune-ppc405e = "ppc405e"
PACKAGE_EXTRA_ARCHS_tune-ppc405e = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppc405e"

# glibc configure options to get ppc405e specific library (for sqrt)
GLIBC_EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "ppc405e", "-with-cpu=405fp", "", d)}"

it is empty:

Build Configuration:
BB_VERSION        = "1.15.3"
TARGET_ARCH       = "powerpc"
TARGET_OS         = "linux"
MACHINE           = "virtex5"
DISTRO            = "poky"
DISTRO_VERSION    = "1.2+snapshot-20120824"
TUNE_FEATURES     = "m32 ppc405e fpu-hard"
TARGET_FPU        = ""
meta              
meta-yocto        = "(nobranch):77192ec8ed3563920b969306aaa7609d05184255"
toolchain-layer   = "(nobranch):3fd2bf4c5e6c3a353aff9795294b7c25f5f50c49"
meta-xilinx       = "master-xilinx-ml507-gcc-4.5:18ab4890b00d12c58f750008688d2e97687e33da"

The PowerPC405 and 440 processors are on a Xilinx Virtex-4 and Virtex-5 FGPA, and as such can be attached to a hardware floating point unit. 

There is a special gcc compiler option for this situation, which is  

-mxilinx-fpu

Perform optimizations for the floating-point unit on Xilinx PPC 405/440. See RS/6000 and PowerPC Options - Using the GNU Compiler Collection (GCC) for more information.

What should I do to get TARGET_FPU to fill correctly for hardware floating point units ? 

Best regards,

Elvis Dowson



[-- Attachment #2: Type: text/html, Size: 8858 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: TARGET_FPU not getting populated for powerpc 405/440 fpu-hard targets
  2012-08-24 16:27 TARGET_FPU not getting populated for powerpc 405/440 fpu-hard targets Elvis Dowson
@ 2012-08-24 16:35 ` Khem Raj
  2012-08-24 16:49   ` Elvis Dowson
  0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2012-08-24 16:35 UTC (permalink / raw)
  To: Elvis Dowson; +Cc: Yocto Discussion Mailing List

On Fri, Aug 24, 2012 at 9:27 AM, Elvis Dowson <elvis.dowson@gmail.com> wrote:
>        I just observed that TARGET_FPU is not getting populated, when you do
> a build for fpu-hard targets. For fpu-soft targets, it displays TARGET_FPU =
> "soft", but for fpu-hard targets, it display TARGET_FPU = "".

that means default is hard for this architecture. This option is
essentially used to configure gcc
unless your fpu is special like fsl one's you are good here.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: TARGET_FPU not getting populated for powerpc 405/440 fpu-hard targets
  2012-08-24 16:35 ` Khem Raj
@ 2012-08-24 16:49   ` Elvis Dowson
  2012-08-24 16:52     ` Khem Raj
  2012-08-24 16:55     ` Mark Hatle
  0 siblings, 2 replies; 5+ messages in thread
From: Elvis Dowson @ 2012-08-24 16:49 UTC (permalink / raw)
  To: Khem Raj; +Cc: Yocto Discussion Mailing List

[-- Attachment #1: Type: text/plain, Size: 1290 bytes --]

Hi Khem,

On Aug 24, 2012, at 8:35 PM, Khem Raj wrote:

> On Fri, Aug 24, 2012 at 9:27 AM, Elvis Dowson <elvis.dowson@gmail.com> wrote:
>> I just observed that TARGET_FPU is not getting populated, when you do
>> a build for fpu-hard targets. For fpu-soft targets, it displays TARGET_FPU =
>> "soft", but for fpu-hard targets, it display TARGET_FPU = "".
> 
> that means default is hard for this architecture. This option is
> essentially used to configure gcc
> unless your fpu is special like fsl one's you are good here.

The FPU unit is an IP core, that is attached to a generic PowerPC405 or PowerPC440 embedded processor core on the FPGA, which by default doesn't contain an FPU unit. 

In the Xilinx FPGA hardware project, I have to add this FPU unit, and there are some additional options that I can see relevant to this setup with the FPU unit, such as -mxilinx-fpu and -mfpu=dp_full

Should I specify them in TUNE_CCARGS (as shown below) or TUNE_FEATURES_tune-ppc405e (not done below) or specify the same values for both variables ?

TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "ppc405e", "-mcpu=405fp -mxilinx-fpu -mfpu=dp_full", "", d)}"

AVAILTUNES += "ppc405e"
TUNE_FEATURES_tune-ppc405e = "m32 ppc405e fpu-hard"

Best regards,

Elvis Dowson

[-- Attachment #2: Type: text/html, Size: 2128 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: TARGET_FPU not getting populated for powerpc 405/440 fpu-hard targets
  2012-08-24 16:49   ` Elvis Dowson
@ 2012-08-24 16:52     ` Khem Raj
  2012-08-24 16:55     ` Mark Hatle
  1 sibling, 0 replies; 5+ messages in thread
From: Khem Raj @ 2012-08-24 16:52 UTC (permalink / raw)
  To: Elvis Dowson; +Cc: Yocto Discussion Mailing List

On Fri, Aug 24, 2012 at 9:49 AM, Elvis Dowson <elvis.dowson@gmail.com> wrote:
>
> Should I specify them in TUNE_CCARGS (as shown below) or
> TUNE_FEATURES_tune-ppc405e (not done below) or specify the same values for
> both variables ?
>
> TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "ppc405e",
> "-mcpu=405fp -mxilinx-fpu -mfpu=dp_full", "", d)}"

yes. However if there are some special ABI extentions becasue of FP
that gcc should configure itself with
then that should be specified in TARGET_FPU. I havent looked into gcc
code to check if it knows about xilinx-fpu
at configure time


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: TARGET_FPU not getting populated for powerpc 405/440 fpu-hard targets
  2012-08-24 16:49   ` Elvis Dowson
  2012-08-24 16:52     ` Khem Raj
@ 2012-08-24 16:55     ` Mark Hatle
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Hatle @ 2012-08-24 16:55 UTC (permalink / raw)
  To: yocto

On 8/24/12 11:49 AM, Elvis Dowson wrote:
> Hi Khem,
>
> On Aug 24, 2012, at 8:35 PM, Khem Raj wrote:
>
>> On Fri, Aug 24, 2012 at 9:27 AM, Elvis Dowson <elvis.dowson@gmail.com
>> <mailto:elvis.dowson@gmail.com>> wrote:
>>> I just observed that TARGET_FPU is not getting populated, when you do
>>> a build for fpu-hard targets. For fpu-soft targets, it displays TARGET_FPU =
>>> "soft", but for fpu-hard targets, it display TARGET_FPU = "".
>>
>> that means default is hard for this architecture. This option is
>> essentially used to configure gcc
>> unless your fpu is special like fsl one's you are good here.
>
> The FPU unit is an IP core, that is attached to a generic PowerPC405 or
> PowerPC440 embedded processor core on the FPGA, which by default doesn't contain
> an FPU unit.
>
> In the Xilinx FPGA hardware project, I have to add this FPU unit, and there are
> some additional options that I can see relevant to this setup with the FPU unit,
> such as -mxilinx-fpu and -mfpu=dp_full
>
> Should I specify them in TUNE_CCARGS (as shown below)
> or TUNE_FEATURES_tune-ppc405e (not done below) or specify the same values for
> both variables ?
>
> TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "ppc405e", "-mcpu=405fp
> -mxilinx-fpu -mfpu=dp_full", "", d)}"
>
> AVAILTUNES += "ppc405e"
> TUNE_FEATURES_tune-ppc405e = "m32 ppc405e fpu-hard"

fpu-hard is the classic PowerPC FPU unit.  If that is what these ip blocks 
implement then there is nothing further required.

If the unit does NOT include a classic PowerPC FPU, then you should not be using 
fpu-hard.

If it -also- implements additional FPU instructions via the -m...fpu stuff 
specific to the IP blocks, then that is where the target_fpu comes in and some 
other changes will be necessary.... It's been a while since I worked through 
this, but the e500 stuff may be a reasonable example of how to implement it.

--Mark

> Best regards,
>
> Elvis Dowson
>
>
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-08-24 16:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-24 16:27 TARGET_FPU not getting populated for powerpc 405/440 fpu-hard targets Elvis Dowson
2012-08-24 16:35 ` Khem Raj
2012-08-24 16:49   ` Elvis Dowson
2012-08-24 16:52     ` Khem Raj
2012-08-24 16:55     ` Mark Hatle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.