Is Math lib available that can fit the RL78/G10 flash size like 1KB or 2KB (CC-RL/GNU e2studio) ?

It seems the math library takes like 2KB+. I am just wondering if there is anyway to implement it in a more compact size.

  • TK,

    Your compiler will only include the functions that you used, from the library, into your code.
    Unless you managed to use every single math function in the library, It seems unlikely that it will add 2k to your code.

    The best way to see this is to compile your code using the library and look at the size of the compiled code.

    If size is still an issue you may try turning on compiler optimizations. This can make debugging the finished code more difficult.

    Mike Clements
    RenesasRulz Moderator

  • Hi Mike, Thank you for the answer!
    After that, I checked with a simple code that includes sin() on RL78/G13 and it turned out that the math lib requires 2.7KB ROM. So my conclusion is that RL78/G10 1KB/2KB would not be able to have the math lib at least for sin() given that G13 and G10 libs are the same size. (Level of optimization: Default Optimization/Code Size Preference --- .RLIB 1077 Bytes .SLIB 1594 Bytes = Total 2671 Bytes)
  • In reply to TK:

    TK,

    Unfortunately the trig functions can not be compressed/optimized because they include a lookup table of the entire function.

    Mike Clements
    RenesasRulz Moderator