Menu

float.fs missing f- and f+

2023-11-22
2023-11-24
  • Bernard Mentink

    Bernard Mentink - 2023-11-22

    Tried to compile float.fs for the pic24, but fails due to missing f- and f+, are these somewhere else, and should it then be noted in the header as a dependancy?

     
  • Bernard Mentink

    Bernard Mentink - 2023-11-22

    Ahh, I see you have to set FLOATS=1 in p24fj_ga_config.inc (for nano) however I get the following compile error:

    Info: Project is using a large data memory model when small data memory model is sufficient.
    
    make[2]: Leaving directory '/Users/bernardmentink/My_Work/Arduino/flashforth/pic24/FF_24-30-33.X'
    make[1]: Leaving directory '/Users/bernardmentink/My_Work/Arduino/flashforth/pic24/FF_24-30-33.X'
    ../src/ff-pic24-30-33.s:7163: undefined reference to `___addsf3'
    build/default/production/_ext/1360937237/ff-pic24-30-33.o(.text+0x2318):../src/ff-pic24-30-33.s:7163: undefined reference to `___addsf3'
    build/default/production/_ext/1360937237/ff-pic24-30-33.o(.text+0x232e): In function `CFSUB_':
    ../src/ff-pic24-30-33.s:7163: undefined reference to `___subsf3'
    build/default/production/_ext/1360937237/ff-pic24-30-33.o(.text+0x2330):../src/ff-pic24-30-33.s:7163: undefined reference to `___subsf3'
    build/default/production/_ext/1360937237/ff-pic24-30-33.o(.text+0x2346): In function `CFMUL_':
    ../src/ff-pic24-30-33.s:7163: undefined reference to `___mulsf3'
    build/default/production/_ext/1360937237/ff-pic24-30-33.o(.text+0x2348):../src/ff-pic24-30-33.s:7163: undefined reference to `___mulsf3'
    build/default/production/_ext/1360937237/ff-pic24-30-33.o(.text+0x235e): In function `CFDIV_':
    ../src/ff-pic24-30-33.s:7163: undefined reference to `___divsf3'
    build/default/production/_ext/1360937237/ff-pic24-30-33.o(.text+0x2360):../src/ff-pic24-30-33.s:7163: undefined reference to `___divsf3'
    

    etc etc ..

    EDIT: I presume I need the Microchip maths lib, where do I get that?
    EDIT2: Microcip webiste says the floating point lib is included free with the compiler. So not sure why this error ..

     

    Last edit: Bernard Mentink 2023-11-23
  • Mikael Nordman

    Mikael Nordman - 2023-11-23

    In xc16-ld you have to link with -lm and include the standard libraries by clearing the Exclude standard libraries tickbox.

     
  • Bernard Mentink

    Bernard Mentink - 2023-11-23

    Great, thanks. That worked. Maybe some instructions in the header of float.fs would be useful

     

    Last edit: Bernard Mentink 2023-11-23
  • Mikael Nordman

    Mikael Nordman - 2023-11-24

    Here are some examples of use.

    1e f. 1.00000  ok
    2.3456e10 f. 23456000000.  ok
    2.3456e10 fe. 23.4560e9  ok
    2.3456e10 fs. 2.34560e10  ok
    2.3e-9 4.7e-12 f* fe. 10.8100e-21  ok
    
     
    👍
    1

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.