Is hardware floating point on armv6 (VFPv2) devices possible?

404 views
Skip to first unread message

Clapfoot

unread,
Jun 1, 2011, 9:51:15 AM6/1/11
to android-ndk
There are quite a few Android phones out there with ARMv6 cpus that
have optional FPUs. For example, the MSM7227 (HTC Legend, HTC Wildfire
S, etc) is one such CPU. ARMv6 uses VFPv2 for floating point but there
is no mention of this format in the NDK docs. Only VFPv3 for ARMv7
chips are documented. Does this mean that its not possible to have
floating point support on chips such as the MSM7227?

Zoran Angelov

unread,
Jun 1, 2011, 10:28:12 AM6/1/11
to andro...@googlegroups.com
Hi,
as far as i know ndk for armv6 uses soft-float calling convention, so if there is FPU, the runtime library will use FPU for the function being called, otherwise it will use emulation.



--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


David Turner

unread,
Jun 1, 2011, 11:13:01 AM6/1/11
to andro...@googlegroups.com
On Wed, Jun 1, 2011 at 3:51 PM, Clapfoot <mark...@gmail.com> wrote:
It means you can't generate VFPv2-compatible machine code by default with the NDK.

You could still play with compiler flags to do that, but then you will have to ensure, by runtime probing,
that the device supports it (and provide alternate fallbacks otherwise). The Android Market also only
filters between armeabi and armeabi-v7a (not that armeabi-v7a is *not* compatible with VFPv2).

So you will have to build this machine code only when targetting armeabi.

NOTE: I have no idea how well VFPv2 is supported, if at all, by the toolchain.

David Turner

unread,
Jun 1, 2011, 11:13:55 AM6/1/11
to andro...@googlegroups.com
On Wed, Jun 1, 2011 at 4:28 PM, Zoran Angelov <bal...@gmail.com> wrote:
Hi,
as far as i know ndk for armv6 uses soft-float calling convention, so if there is FPU, the runtime library will use FPU for the function being called, otherwise it will use emulation.

This is incorrect, armeabi targets ARMv5TE, so all FPU operations will be performed in software. libgcc.a doesn't provide FPU-optimized routines for ARMv6. 
Reply all
Reply to author
Forward
0 new messages