kernel module and float

Jean-Yves Moulin jean-yves.moulin at
Mon Mar 3 18:38:39 UTC 2008

Roland Smith wrote:
> Floating point arithmetic isn't used in the kernel for performance
> reasons.[1] The kernel is compiled with -msoft-float which prevents gcc
> from generating floating point instructions. In this case it uses
> routines that are part of libgcc. As far as I can tell, the kernel isn't
> linked with libgcc. 

Of course, kernel isn't linked  :) But why this code can be compiled and 
ran in i386 and not in amd64  ?

When I compile on amd64, using <>, I have  -mfpmath=387 and 
-msoft-float in my gcc flags. So, I was thinking I could use simple 
floating point operation. This two flags doesn't appear on i386.

Thanks for your reply! I will change my code.


More information about the freebsd-amd64 mailing list