TARGET_FPU not getting populated for powerpc 405/440 fpu-hard targets


Elvis Dowson
 

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



Khem Raj
 

On Fri, Aug 24, 2012 at 9:27 AM, Elvis Dowson <elvis.dowson@...> 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.


Elvis Dowson
 

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@...> 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


Khem Raj
 

On Fri, Aug 24, 2012 at 9:49 AM, Elvis Dowson <elvis.dowson@...> 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


Mark Hatle <mark.hatle@...>
 

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@...
<mailto:elvis.dowson@...>> 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@...
https://lists.yoctoproject.org/listinfo/yocto