Skip to contentSkip to conversation

mpc5200b and floating point

DISCUSSION Sascha Hauer 4 participants 6 messages Mar 31, 2006 – Apr 3, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

I'm working with a mpc5200b custom board and I'm trying to run an application with floating point. All floating point variables seem to zero all the time. Since I'm not very familiar with powerpc it might be something stupid I have overlooked.
Any hints?

Thank you,

Sascha Hauer

#1 lore raw
Quoted 6 lines · Sascha Hauer

Hi,

I'm working with a mpc5200b custom board and I'm trying to run an application with floating point. All floating point variables seem to zero all the time. Since I'm not very familiar with powerpc it might be something stupid I have overlooked.

Since a lot of PowerPC do not have floating point processor your tools might be setup to compile without it (compare with sse2 on x86).

Check your compiler flags again.
Define -mcpu= and -mhard-float
Undefine -msoft-float

/RogerL

#2 lore raw
Quoted 2 lines · Roger Larsson

Since a lot of PowerPC do not have floating point processor your tools might be setup to compile without it (compare with sse2 on x86).

Nearly all of the PowerPC do have floating point, only a few do not. It's highly unlikely to find a PowerPC tool set that was custom built to not enable floating point. Don't forget that the compiler flags are only a small part of the picture, you need matching compiler run time support and application libraries as well. Just using the compiler flags and not selecting the proper libraries will not be a positive experience.

	-- Dan
#3 lore raw
In reply to Sascha Hauer

Am Fri, 31 Mar 2006 15:36:20 +0200 schrieb Sascha Hauer <[email protected]> :

Please check your Toolchain.
Have you build it ?

Do you use glibc or something like uclibc ?

At my beginning with mpc5200 i hat simular problems.

I had the wrong Compilerflags during build of my ToolChain. (uclibc).

Good Luck.

Quoted 17 lines

Hi,

I'm working with a mpc5200b custom board and I'm trying to run an application with floating point. All floating point variables seem to zero all the time. Since I'm not very familiar with powerpc it might be something stupid I have overlooked.
Any hints?

Thank you,

Sascha Hauer

_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

#4 lore raw
Quoted 5 lines · White

Am Fri, 31 Mar 2006 15:36:20 +0200 schrieb Sascha Hauer <[email protected]> :

Please check your Toolchain.
Have you build it ?

I have built it with crosstool 0.38

Quoted 2 lines

Do you use glibc or something like uclibc ?

glibc

With -msoft-float everything is working fine, but with softfloat. Without flags or with -mhard-float my toolchain (which is btw a gcc-4.0.2, glibc 2.3.6) generates floating point instructions which I can see in the objdump.
Since this seems more like a toolchain related problem, maybe the crosstool ml is a better place for this.

Sascha

#5 lore raw
In reply to Sascha Hauer
Quoted 7 lines · Sascha Hauer

Hi,

I'm working with a mpc5200b custom board and I'm trying to run an application with floating point. All floating point variables seem to zero all the time. Since I'm not very familiar with powerpc it might be something stupid I have overlooked.
Any hints?

The problem turned out to be toolchain related. We chrooted into the rootfs on an Ibook, same problem there. I'll take a closer look in my toochain.

Thank you for your replies,

Sascha Hauer