• Maybe the FLOAT_ABI_HARD won't be needed for all espruino code.

    It seems hard to mix, but if you can find a solution I'm open to it - in a way I'd prefer not to change.

    But it is only for Bangle.js 2 - I've kept everything else as softfp to avoid things getting broken.

    But I did a quick test with:

    function m() {
      for (y=0;y<32;y++) {
        line="";
        for (x=0;x<32;x++) {
          var Xr=0;
          var Xi=0;
          var Cr=(4.0*x/32)-2.0;
          var Ci=(4.0*y/32)-2.0;
          var i=0;
          while ((i<8) && ((Xr*Xr+Xi*Xi)<4)) {
            var t=Xr*Xr - Xi*Xi + Cr;
            Xi=2*Xr*Xi+Ci;
            Xr=t;
            i++;
          }
          if (i&1)
    	  line += "*";
          else
              line += " ";
         }
       //  print(line);
      }
    }
    
    t=getTime();m();print(getTime()-t);
    

    And as far as I can tell, hardfp is faster - maybe 5.5s vs 5.7s so not a lot, but it's noticeable and reproducible. Seems a shame to have everything running slower just for the extremely rare case of floats + inline C that I'd argue literally only you currently uses (and you make your own builds anyway!)

About

Avatar for Gordon @Gordon started