mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Floating point computations in kernel modules
@ 2007-09-17 14:06 Ram
  2007-09-17 14:13 ` Trond Myklebust
  2007-09-17 14:17 ` Markus Rechberger
  0 siblings, 2 replies; 3+ messages in thread
From: Ram @ 2007-09-17 14:06 UTC (permalink / raw)
  To: linux-kernel

Hi,

   I am trying to write a driver which uses double, float. I am using
an arm11 with gcc 3.4.4

   When i try to compile my modules (with float variables) i get the error

   WARNING: "__extendsfdf2" undefined!
   WARNING: "__mulsf3"undefined!
   WARNING: "__fixsfsi"undefined!
   WARNING: "__floatsisf"undefined!

   Can we use float, double in kernel modules?.

  Obviously it is a linking error, I am using soft-float. I tried with
-msoft-float but got the same   result.

  I suspect that its a toolchain issue.  However i am able to compile
my applications
  with float, double variables.


  Please do advice.


Regards,
sriram

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Floating point computations in kernel modules
  2007-09-17 14:06 Floating point computations in kernel modules Ram
@ 2007-09-17 14:13 ` Trond Myklebust
  2007-09-17 14:17 ` Markus Rechberger
  1 sibling, 0 replies; 3+ messages in thread
From: Trond Myklebust @ 2007-09-17 14:13 UTC (permalink / raw)
  To: Ram; +Cc: linux-kernel

On Mon, 2007-09-17 at 19:36 +0530, Ram wrote:
> Hi,
> 
>    I am trying to write a driver which uses double, float. I am using
> an arm11 with gcc 3.4.4
> 
>    When i try to compile my modules (with float variables) i get the error
> 
>    WARNING: "__extendsfdf2" undefined!
>    WARNING: "__mulsf3"undefined!
>    WARNING: "__fixsfsi"undefined!
>    WARNING: "__floatsisf"undefined!
> 
>    Can we use float, double in kernel modules?.
> 
>   Obviously it is a linking error, I am using soft-float. I tried with
> -msoft-float but got the same   result.
> 
>   I suspect that its a toolchain issue.  However i am able to compile
> my applications
>   with float, double variables.
> 
> 
>   Please do advice.
> 
> 
> Regards,
> sriram
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

Feel free to peruse the Documentation directory before posting. More
specifically, Documentation/DocBook/kernel-hacking.tmpl has a chapter
called 'Some Basic Rules' which addresses your question.

Trond


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Floating point computations in kernel modules
  2007-09-17 14:06 Floating point computations in kernel modules Ram
  2007-09-17 14:13 ` Trond Myklebust
@ 2007-09-17 14:17 ` Markus Rechberger
  1 sibling, 0 replies; 3+ messages in thread
From: Markus Rechberger @ 2007-09-17 14:17 UTC (permalink / raw)
  To: Ram; +Cc: linux-kernel

Hi,

On 9/17/07, Ram <vshrirama@gmail.com> wrote:
> Hi,
>
>    I am trying to write a driver which uses double, float. I am using
> an arm11 with gcc 3.4.4
>
>    When i try to compile my modules (with float variables) i get the error
>
>    WARNING: "__extendsfdf2" undefined!
>    WARNING: "__mulsf3"undefined!
>    WARNING: "__fixsfsi"undefined!
>    WARNING: "__floatsisf"undefined!
>
>    Can we use float, double in kernel modules?.
>

in general you shouldn't use floating point in the kernel since there's no
portable way which will work among different architectures.

>   Obviously it is a linking error, I am using soft-float. I tried with
> -msoft-float but got the same   result.
>
>   I suspect that its a toolchain issue.  However i am able to compile
> my applications
>   with float, double variables.
>
>
>   Please do advice.
>

if you need a solution inkernel best would be to try to get around by converting
your algorithm to integer.

although you might have a look at:
http://www.fi.muni.cz/~xslaby/unpr.html
http://www.mail-archive.com/linuxppc-embedded%40ozlabs.org/msg01291.html

Markus

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-09-17 14:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-17 14:06 Floating point computations in kernel modules Ram
2007-09-17 14:13 ` Trond Myklebust
2007-09-17 14:17 ` Markus Rechberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®