Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It is surprising that gcc doesn't support this natively as the code is clearly available in the source within a directory called <code>soft-fp</code>. It's possible to compile that library manually:</p> <pre><code>$ svn co svn://gcc.gnu.org/svn/gcc/trunk/libgcc/ libgcc $ cd libgcc/soft-fp/ $ gcc -c -O2 -msoft-float -m32 -I../config/arm/ -I.. *.c $ ar -crv libsoft-fp.a *.o </code></pre> <p>There are a few c files which don't compile due to errors but the majority does compile. After copying <code>libsoft-fp.a</code> into the directory with our source files they now compile fine with <code>-msoft-float</code>:</p> <pre><code>$ gcc -g -m32 -msoft-float test.c -lsoft-fp -L. </code></pre> <p>A quick inspection using</p> <pre><code>$ objdump -D --disassembler-options=intel a.out | less </code></pre> <p>shows that as expected no x87 floating point instructions are called and the code runs considerably slower as well, by a factor of 8 in my example which uses lots of division.</p> <p><strong>Note:</strong> I would've preferred to compile the soft-float library with</p> <pre><code>$ gcc -c -O2 -msoft-float -m32 -I../config/i386/ -I.. *.c </code></pre> <p>but that results in loads of error messages like</p> <pre><code>adddf3.c: In function '__adddf3': adddf3.c:46: error: unknown register name 'st(1)' in 'asm' </code></pre> <p>Seems like the <code>i386</code> version is not well maintained as <code>st(1)</code> points to one of the x87 registers which are obviously not available when using <code>-msoft-float</code>. Strangely or luckily the <code>arm</code> version compiles fine on an <code>i386</code> and seems to work just fine.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload