User avatar
cnxsoft
Posts: 190
Joined: Sat Oct 15, 2011 2:33 pm
Location: Chiang Mai, Thailand
Contact: Website

Re: FPU CFLAGS for ARM1176

Fri Jan 27, 2012 3:05 pm

I'm compiling some program where I would like to enable the FPU.

I'm now trying the program in qemu with ARM1176. I'm using Emdebian toolchain, but I guess the flags should be the same for all cross-compilers.

In the emulator if I use:

CFLAGS="-march=armv6 -mfpu=vfp -mfloat-abi=softfp"

The program will exit with "illegal instruction". Even a simple "hello world" type program accessing to float will crash.

if i use CFLAGS="-march=armv6 -mfpu=vfp"

It will work.

Which cflags should I use to make use of the FPU in Broadcom BCM2835 ?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 17772
Joined: Sat Jul 30, 2011 7:41 pm

Re: FPU CFLAGS for ARM1176

Fri Jan 27, 2012 3:47 pm

cnxsoft said:


I"m compiling some program where I would like to enable the FPU.

I"m now trying the program in qemu with ARM1176. I"m using Emdebian toolchain, but I guess the flags should be the same for all cross-compilers.

In the emulator if I use:

CFLAGS="-march=armv6 -mfpu=vfp -mfloat-abi=softfp"

The program will exit with "illegal instruction". Even a simple "hello world" type program accessing to float will crash.

if i use CFLAGS="-march=armv6 -mfpu=vfp"

It will work.

Which cflags should I use to make use of the FPU in Broadcom BCM2835 ?


I think the performance section in the Wiki has the settings I used on the Alpha boards.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

User avatar
cnxsoft
Posts: 190
Joined: Sat Oct 15, 2011 2:33 pm
Location: Chiang Mai, Thailand
Contact: Website

Re: FPU CFLAGS for ARM1176

Sat Jan 28, 2012 1:14 am

I could not it in the Wiki (which has changed a lot recently), but I found a forum post.  (floating point search provides better results than fpu...)

http://www.raspberrypi.org/for.....erformance

You used:

gcc -O3 -mfloat-abi=softfp

I'm also interested in hardfloat, because have seen some impressive benchmarks on pandaboard (gzip 5 to 6 times faster with hardfloat vs softfloat).

In the same forum post, it seems Redhat might do a "Fedora armv6hl build" which would be great.

Metzelmaennchen
Posts: 4
Joined: Sun Jun 24, 2012 11:34 pm

Re: FPU CFLAGS for ARM1176

Mon Jul 02, 2012 7:24 pm

has anyone found a solution in the meantime?

Code: Select all

int main()
{
  float f;
  f = 1.0;    // illegal instruction here
  return 0;
}
as soon as I specify float abi to softfp I get the illegal instructions. Something with alignment but I don't get it :(
Using memcpy it works and it also works when using a packed struct to copy to the float. But to be honest, can someone tell me why the float isn't aligned correctly?

Return to “Other projects”

Who is online

Users browsing this forum: No registered users and 5 guests