Forum Discussion
Altera_Forum
Honored Contributor
14 years agoGCC and FPU
Hello everyone, I am porting some legacy code which uses double precision floating point. Changing double to single fp or fixed point would require a major rewrite which I want to avoid. ...
Altera_Forum
Honored Contributor
14 years agoLooking at the gcc codebase it seems far from trivial to start fiddling with it.
I wouldn't dare (for now) to think about async ops. Llvm looks much better in this regard. There is a unfinished nios2 port at ellcc.org, did anyone check it out? Following is a sample code generated by gcc for nios2 and powerpc: double x3(double x) { return x*x*x; } -- nios2-elf-gcc -O2 (v3.4.6) mov r6,r4 mov r7,r5 custom 0,zero,r6,r7 (fwrx) custom 15,r5,r6,r7 (fmuld) custom 4,r4,zero,zero (frdy) custom 0,zero,r4,r5 (fwrx) custom 15,r5,r6,r7 (fmuld) custom 4,r4,zero,zero (frdy) mov r2,r4 mov r3,r5 ret -- powerpc-eabi-gcc -O2 (v3.3.6) fmul f0,f1,f1 fmul f0,f0,f1 fmr f1,f0 blr