* Monta Vista Linux Supporting Floating Point operations
@ 2002-10-23 7:37 Vishwanath
2002-10-23 7:39 ` Eugene Surovegin
2002-10-23 13:28 ` Mark Hatle
0 siblings, 2 replies; 3+ messages in thread
From: Vishwanath @ 2002-10-23 7:37 UTC (permalink / raw)
To: linuxppc-embedded
Hi All,
I am working on 440GP using Monta Vista Linux 2.1. I need floating point
operation support (for eg. function sqrt() for calculating square root of
given float variable) on Linux. I didn't find math emualtion on the Linux.
Can anyone tell me how can I get floating point support ?
Thanks in advance.
Regards,
Vishwanath
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Monta Vista Linux Supporting Floating Point operations
2002-10-23 7:37 Monta Vista Linux Supporting Floating Point operations Vishwanath
@ 2002-10-23 7:39 ` Eugene Surovegin
2002-10-23 13:28 ` Mark Hatle
1 sibling, 0 replies; 3+ messages in thread
From: Eugene Surovegin @ 2002-10-23 7:39 UTC (permalink / raw)
To: Vishwanath; +Cc: linuxppc-embedded
At 12:37 AM 10/23/2002, you wrote:
>I am working on 440GP using Monta Vista Linux 2.1. I need floating point
>operation support (for eg. function sqrt() for calculating square root of
>given float variable) on Linux. I didn't find math emualtion on the Linux.
This is strange.
Floating point emulation IS available in MVL2.1 on 440.
You probably forgot to link with libm.
I just typed trivial test and ran it on our custom 440 board:
main.cpp:
----------------------------------------------
#include <stdio.h>
#include <math.h>
int main(int argc, char* argv[]){
printf("sqrt(10) = %f\n", sqrt(10.0));
return 0;
}
----------------------------------------------
Compile and run:
# gcc test.cpp -lm
# ./a.out
sqrt(10) = 3.162278
#
Regards,
Eugene Surovegin <mailto:ebs@innocent.com>
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Monta Vista Linux Supporting Floating Point operations
2002-10-23 7:37 Monta Vista Linux Supporting Floating Point operations Vishwanath
2002-10-23 7:39 ` Eugene Surovegin
@ 2002-10-23 13:28 ` Mark Hatle
1 sibling, 0 replies; 3+ messages in thread
From: Mark Hatle @ 2002-10-23 13:28 UTC (permalink / raw)
To: Vishwanath; +Cc: linuxppc-embedded
Vishwanath wrote:
> Hi All,
>
> I am working on 440GP using Monta Vista Linux 2.1. I need floating point
> operation support (for eg. function sqrt() for calculating square root of
> given float variable) on Linux. I didn't find math emualtion on the Linux.
> Can anyone tell me how can I get floating point support ?
Floating point support in MontaVista Linux is handled by the compiler and _NOT_
the kernel. In architecting our system we have weighed the tradeoffs between
soft-floating point, or hard-floating point using kernel exceptions.
Soft-floating point was found to be superior so we use it on all platforms
without a hardware FPU.
One thing to note, because of this the ABI is slightly different then the
binaries you would download off of a random community website. You need to use
our compiler (or a community compiler configured appropriatly) to build
soft-float. (On a non-MontaVista compiler, you usually need to pass
-msoft-float on the command line to gcc.)
--Mark
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-10-23 13:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-23 7:37 Monta Vista Linux Supporting Floating Point operations Vishwanath
2002-10-23 7:39 ` Eugene Surovegin
2002-10-23 13:28 ` Mark Hatle
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.