0 Replies Latest reply on Dec 25, 2013 5:26 PM by savin.zlobec

    sourceryg++-2013.05-88-nios2 custom FPU patch

    savin.zlobec
      Had some time lately to test this - patch attached.

      > A simple test case: > > double f2d(float x) { return (double)x; } > > compiled with -O2 ... -mcustom-frdy=2 ... -mcustom-fextsd=37 > > Gcc will generate the following code: > >   0:     2009c972      custom     37,r4,r4,zero >   4:     0009c0b2      custom     2,r4,zero,zero >   8:     2005883a      mov     r2,r4 >   c:     2807883a      mov     r3,r5 >  10:     f800283a      ret > > Which is obviously wrong. This is due to a bug in nios2.c:nios2_fpu_insn_asm.
      > In SF->DF mode op1 should be "%D0" and not "%0" - just like in DF->DF mode.