Re: Using floating point calculations in kernel module (x86/amd64)

Paolo Mantegazza <[email protected]>
Newsgroups gmane.linux.real-time.rtai
Message-ID <VI1PR06MB1471170A50E74A3BD8DD2CB0901E0@VI1PR06MB1471.eurprd06.prod.outlook.com>
Even if by the nowadays standard ot seems strange, I suspect that you have no hard floating point support in you processor.
In fact __adddf3 and __muldf3 seem to be a soft implementation for floating point add and multiply support, while __floatunsidf is related to int to float conversions.
They are services provided at a very low level, possible at the compiler one.to emulate floating point 
RTAI has found a similar problem  in supporting complex math at the kernel level.
I solved it by  using what made available by LLVM.ORG, but the functions I needed rely on the availability of a hard FPU support for add/mul/div. A fact that may the matter far simpler.
Yours, instead, seem at the core of the basic FPU emulation, which is another matter.

Paolo
________________________________________
From: Rtai [[email protected]] on behalf of Paolo Mantegazza [[email protected]]
Sent: Thursday, August 11, 2016 11:03 AM
To: Wilfried Holzke; [email protected]
Subject: Re: [Rtai] Using floating point calculations in kernel module  (x86/amd64)

Does your CPU support floating point?
Have you configured RTAI for FP support in kernel space with NEWLIB-UCLIB-MUSL?
Can you run the test in "showroom/v3.x/kernel/math"?

Paolo
________________________________________
From: Rtai [[email protected]] on behalf of Wilfried Holzke [[email protected]]
Sent: Wednesday, August 10, 2016 7:15 PM
To: [email protected]
Subject: [Rtai] Using floating point calculations in kernel module      (x86/amd64)

Hi,

I am trying to build a module with floating point support, but I get the
following missing symbols:

__adddf3
__floatunsidf
__muldf3

In RTAI I found support for FP, but this is only for saving the state
bevor calling a procedure which uses FP(?). The procedure, in the module
I try to build, should be called from a RTAI Task or interrupt procedure.

Searching with google I found only old hints and examples for ARM CPUs.
Is there an example how to compile a module for x86/amd64 (flags for
gcc) or the kbuild makefiles
(https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt)?

Thanks for any hints and help.

regards

   W. Holzke
_______________________________________________
Rtai mailing list
[email protected]
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
_______________________________________________
Rtai mailing list
[email protected]
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
_______________________________________________
Rtai mailing list
[email protected]
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.