ZA-YA / P-OS

MIT License
5 stars 0 forks source link

Remove (or make optional) floating point operations (float variables) from Adaptive Scheduler #59

Open p-os opened 8 years ago

p-os commented 8 years ago

Adaptive Task scheduler includes some floating point operations. This operation may not increase code size of Adaptive Task Implementation dramatically.
On the other hand, they needs some libraries for that operations. These libraries are

From the memory map

  Code (inc. data)   RO Data    RW Data    ZI Data      Debug   Object Name

   776         34          4          0        116       5492   adaptivescheduler.o

   176          0          0          0          0        140   fadd.o
   124          0          0          0          0         88   fdiv.o
   110          0          0          0          0        168   fepilogue.o
    50          0          0          0          0         68   ffixi.o
    40          0          0          0          0         68   ffixui.o
    18          0          0          0          0         68   fflti.o
    10          0          0          0          0         68   ffltui.o
   100          0          0          0          0         76   fmul.o

----------------------------------------------------------------------

Cost of Floating point libraries are hundreds of bytes.

If we convert this operations to integer operations we may save floating point library overheads.

To do that, we need to specify a precision (for example just evaluate 3 numbers after point) and we need to shift integer value using precision.

Example; If 3 numbers after point is enough for us ( e.g. 3,14159265 35897932 -> 3,141) We can keep a floating number in integer like that. int piNumber = 3141; // 3,141