title: Speeding up floating point operations (Android ARMv6)
body: <p>I'm doing some image compression in Android using native code.  For various reasons, I can't use a pre-built library.</p>
  
  <p>I profiled my code using the android-ndk-profiler and found that the bottleneck is -- surprisingly -- floating point operations!  Here's the profile output:</p>
  
  <pre><code>Flat profile:
  
  Each sample counts as 0.01 seconds.
    %   cumulative   self              self     total           
   time   seconds   seconds    calls  ms/call  ms/call  name    
   40.37      0.44     0.44                             __addsf3
   11.93      0.57     0.13     7200     0.02     0.03  EncodeBlock
    6.42      0.64     0.07   535001     0.00     0.00  BitsOut
    6.42      0.71     0.07                             __aeabi_fdiv
    6.42      0.78     0.07                             __gnu_mcount_nc
    5.50      0.84     0.06                             __aeabi_fmul
    5.50      0.90     0.06                             __floatdisf
    ...
  </code></pre>
  
  <p>I googled __addsf3 and apparently it is a software floating point operation.  Yuck.  I did more research on the ARMv6 architecture core, and unless I missed something, it doesn't have hardware floating point support.  So what can I do here to speed this up?  Fixed-point?  I know that's normally done with integers, but I'm not really sure how to convert my code to do that.  Is there a compiler flag I could set so it will do that?  Other suggestions welcome.</p>