Question about fpu_cog
Reinhard
Posts: 489
Hello Forum,
in the html - documentation for simpletools library v0.96.1 I read something about fpu_cog.
not so in the v0.98.
Is this functionality supported ?
I try this, after I read the source of fpucog.c
but the build was not successful
Seems that libsimpletools.a not include this code ?
Or what do I wrong ?
in the html - documentation for simpletools library v0.96.1 I read something about fpu_cog.
not so in the v0.98.
Is this functionality supported ?
I try this, after I read the source of fpucog.c
#include "simpletools.h" int main(void) { int cog = start_fpu_cog(); int32_t A = asInt(0.5); int32_t B = asInt(2.0); uint64_t C = doCmdxx( A, B, CMD_FMUL; double D = asDouble(C); stop_fpu_cog(); return 0; }
but the build was not successful
/tmp/ccuTpTEU.o: In function `_main': (.text+0x3): undefined reference to `_start_fpu_cog' /tmp/ccuTpTEU.o: In function `_main': (.text+0xb): undefined reference to `_asInt' /tmp/ccuTpTEU.o: In function `_main': (.text+0x17): undefined reference to `_asInt' /tmp/ccuTpTEU.o: In function `_main': (.text+0x1f): undefined reference to `_doCmdxx' /tmp/ccuTpTEU.o: In function `_main': (.text+0x27): undefined reference to `_asDouble' /tmp/ccuTpTEU.o: In function `_main': (.text+0x2a): undefined reference to `_stop_fpu_cog' collect2: ld returned 1 exit status Done. Build Failed!
Seems that libsimpletools.a not include this code ?
Or what do I wrong ?
Comments
To include fpucog.c support today, it must be added to the project.
The other thing is that fpucog.c functions are not meant to be called. They should be included automatically to speed up floating point and reduce code size.
But one issue is not clear for me If I start a new fpucog, whence know the cog what I will do (add,sub,mul,somewhat) ?
What is the interface for operations ?
The interface is the fpucog.c constructor function. Everything that requires floating point operations defined in the file will use those functions. Without fpucog.c in the project, the default floating point library will be used.
In simple;-)) words for my understand:
If the fpucog is started, any line of code like
res = 0.5 * 2.0
is performed by the fpu coprocessor.
brilliant
.