0

I currently use -mfloat-abi=softfp -mfpu=vfp

I think the above line requires ARMV6 device with real VFP support.

What if I use -mfloat-abi=soft ? Would that work on ARMV6 devices without a real VFP support but be faster than not even specifying mfloat-abi?

(I don't want to create a fat binary with 2 .so files)

frankish
  • 6,738
  • 9
  • 49
  • 100
  • what's vfp ? is it a different architecture? – android developer Aug 16 '13 at 19:35
  • As you know some devices has a chip that makes floating point calculations and this speeds up math based processes like encoding/decoding media. If this is absent on ARMv6 devices, my app won't work smoothly because software calculations of heavy floating points will use more cpu and will slow down the application. I was trying to find out if there is a way to simulate VFP on the software side, but as far as I see, it does not exist and probably non-sense. – frankish Aug 16 '13 at 21:22
  • i see. thanks for teaching me about it. what does VFP stand for ? last words are probably floating point, but what's the V ? – android developer Aug 16 '13 at 21:45
  • Vector Floating Point – frankish Aug 17 '13 at 07:47

1 Answers1

0

The gcc info page says:

Specifying soft causes GCC to generate output containing library calls for floating-point operations. softfp allows the generation of code using hardware floating-point instructions, but still uses the soft-float calling conventions. hard allows generation of floating-point instructions and uses FPU-specific calling conventions.

So using soft isn't what you want for targets with an FPU.

Most currently-shipping devices have an ARMv7-A or better CPU, so unless you are targeting a specific device I'm not sure how much value there is in building two shared libs.

Update: There's actually a lot of devices shipping with older CPUs. All the high-end stuff is ARMv7-A, but there's a lot of volume in low-end devices.

ARMv6 + VFP is not a configuration supported by the Play Store -- the goal was to keep the set of configurations as small as possible. You'll need to use a fat binary, or (as it sounds like you're doing) configure your build carefully and list specific devices in Play Store.

fadden
  • 51,356
  • 5
  • 116
  • 166
  • While having a Galaxy S3, just to support Android 2.2+ I purchased a new Samsung Galaxy Ace for testing. It has ARMV6 (and VFP). As I don't know the list of ARMV6 devices without VFP, I am unable to make a decision. Meanwhile I am trying to filter out ARMV6 w/o VFP devices from Android Play Store. – frankish Aug 14 '13 at 17:36
  • I accepted this answer since it really anwers the main question: Can we simulate VFP on the software and make it faster than a non-VFP environment? The answer is: no – frankish Aug 16 '13 at 21:24