[yocto] [meta-raspberrypi] Why not enable hard floating point?

Mike Looijmans mike.looijmans at topic.nl
Thu Jan 15 01:06:02 PST 2015


On 15-01-15 01:11, J. Tang wrote:
>
> On Jan 14, 2015, at 15:36 , Andrei Gherzan <andrei at gherzan.ro> wrote:
>
>> On Sat, Jan 10, 2015 at 10:38:50AM -0500, J. Tang wrote:
>>> The upstream meta-raspberrypi recipe builds an arm6 toolchain with only soft floating point. As an experiment, I enabled hard floating point by setting my DEFAULTTUNE to “armv6hf”. My code still ran correctly. Is there a reason why the meta-raspberrypi layer does not enable hard floating point?
>>>
>>
>> Well we played a little with this in the past. And we realised that, at that
>> time at least, switching to hf didn't add any performace improvements. Did you
>> test anything that proves the contrary?
>
> In my case, I was re-compiling MAME for the Raspberry Pi. The code has a dependency on hf. Furthermore, Rasbian is built with hf.

If the CPU has actual hard-float support, then enabling it should increase 
floating point performance by an order of magnitude (e.g. 100x faster or so).

If you don't see any real world performance improvements, My guess would be 
one of these cases:

-1- The compiler is already creating FPU instructions, based on other 
properties of the target platform. The "hf" tune only changes the ABI, so that 
floating point values are passed to/from libraries in normal registers instead 
of FPU registers. This has very little impact on performance (unless you have 
some very badly designed libs). You can check if this is the case by examining 
disassember output for a bit of FPU code, if you see instructions starting 
with "F" in there, it's using the ARM VFP.

-2- The CPU doesn't actually have floating point support and the kernel is 
emulating it for you. This allows the platform to run "hf" binaries, at a 
minor performance cost compared to completely doing the emulation in user 
space (libc).



Met vriendelijke groet / kind regards,

Mike Looijmans
System Expert


TOPIC Embedded Systems
Eindhovenseweg 32-C, NL-5683 KH Best
Postbus 440, NL-5680 AK Best
Telefoon: (+31) (0) 499 33 69 79
Telefax:  (+31) (0) 499 33 69 70
E-mail: mike.looijmans at topic.nl
Website: www.topic.nl

Please consider the environment before printing this e-mail

Topic zoekt gedreven (embedded) software specialisten!
http://topic.nl/vacatures/topic-zoekt-software-engineers/




More information about the yocto mailing list