RE: [ixp1200] Doubt reg. Floating Point Operations support in IXP 1200
![](https://secure.gravatar.com/avatar/16d7a944b770f44d9e751445eda6bfda.jpg?s=120&d=mm&r=g)
Hello,
From: romit dasgupta [mailto:romit@myrealbox.com] Sent: Tuesday, March 09, 2004 6:30 AM
[ about doing floating point computations on IXP1200 core ]
If you are talking about userland, then libm is your friend. If you are talking about kernel space then you may compile your kernel with CONFIG_FPE_NWFPE or CONFIG_FPE_FASTFPE.
Romit, I think you have been confused by the fact the CONFIG_FPE_NWFPE and
CONFIG_FPE_FASTFPE are kernel options. In fact, once enabled, they provide
floating point emulation for *user* application.
BTW, if you want fast floating point computations, it appears that there is
a patch floating around (no pun intended) for gcc that implements floating
point emulation at the compilation toolchain level. According to linux-arm
developers, it is much faster than kernel level emulation. However, this
patch requires to recompile all the libraries, including the glibc.
On 2004-03-08, in an email entitled "SoftFloat Benchmarks" on arm-linux
mailing list, Eric BENARD / Free [ebenard@free.fr] has posted a comparison
of the different solutions:
--- email included ---
I've run some benchs in order to compare FP solutions on an IXP425 (rev0)
running at 533 MHz with Linux 2.4.21-rmk1-ds3 (with NWFPE patches from the
arm-kernel ML).
Test softwares are : nbench v2 and flops 2.0
Test compilers are :
- gcc 3.3.3 + glibc 2.3.2 => using kernel emulation NWFPE or FFPE
- gcc 3.3.3 + Nico's patches + glibc 2.3.2
Compiler options are :
-O3 -fomit-frame-pointer -mcpu=xscale -mtune=xscale -mbig-endian
-static
Results :
*** nbench, Floating Point Index (vs P90 / vs K6/233) :
NWFPE : 0.028 / 0.015
FFPE : 0.062 / 0.031 = NWFPE * 2.2
NICO : 0.260 / 0.144 = NWFPE * 9.3
*** flops, mean of the 4 MFLOPS values returned by the test :
NWFPE : 0.52
FFPE : 1.89 = NWFPE * 3.63
NICO : 3.91 = NWFPE * 7.52
--- end of email included ---
If you want fast floating point anyway, you'd better do fix point
computations on integers.
It is not allowed by linux kernel developpers to do floating point
computations in the kernel.
Sharmila, if you want more information on floating point and arm, look at
arm-linux mailing list archive. This has been discussed numerous times.
Yours,
david
--
David Mentré
![](https://secure.gravatar.com/avatar/cf97a8db13533c481f622657ca13b9d3.jpg?s=120&d=mm&r=g)
Hello David, Thanks for your mail. Once I did a division operation in the kernel and I got an error given by the assembler. I enabled CONFIG_FPE_FASTFPE and the error vanished. You are right we are not supposed to do FP operations in Kernel but my understanding is that, if we do really need FP operations in kernel we have to explicitly save the FP context. Correct me if I am wrong. By the way, if we dont enable CONFIG_FPE_FASTFPE, cant we still use libm from userspace? Regards, -Romit David Mentre wrote:
Hello,
From: romit dasgupta [mailto:romit@myrealbox.com] Sent: Tuesday, March 09, 2004 6:30 AM
[ about doing floating point computations on IXP1200 core ]
If you are talking about userland, then libm is your friend. If you are talking about kernel space then you may compile your kernel with CONFIG_FPE_NWFPE or CONFIG_FPE_FASTFPE.
Romit, I think you have been confused by the fact the CONFIG_FPE_NWFPE and CONFIG_FPE_FASTFPE are kernel options. In fact, once enabled, they provide floating point emulation for *user* application.
BTW, if you want fast floating point computations, it appears that there is a patch floating around (no pun intended) for gcc that implements floating point emulation at the compilation toolchain level. According to linux-arm developers, it is much faster than kernel level emulation. However, this patch requires to recompile all the libraries, including the glibc.
On 2004-03-08, in an email entitled "SoftFloat Benchmarks" on arm-linux mailing list, Eric BENARD / Free [ebenard@free.fr] has posted a comparison of the different solutions: --- email included --- I've run some benchs in order to compare FP solutions on an IXP425 (rev0) running at 533 MHz with Linux 2.4.21-rmk1-ds3 (with NWFPE patches from the arm-kernel ML).
Test softwares are : nbench v2 and flops 2.0 Test compilers are : - gcc 3.3.3 + glibc 2.3.2 => using kernel emulation NWFPE or FFPE - gcc 3.3.3 + Nico's patches + glibc 2.3.2 Compiler options are : -O3 -fomit-frame-pointer -mcpu=xscale -mtune=xscale -mbig-endian -static
Results : *** nbench, Floating Point Index (vs P90 / vs K6/233) : NWFPE : 0.028 / 0.015 FFPE : 0.062 / 0.031 = NWFPE * 2.2 NICO : 0.260 / 0.144 = NWFPE * 9.3
*** flops, mean of the 4 MFLOPS values returned by the test : NWFPE : 0.52 FFPE : 1.89 = NWFPE * 3.63 NICO : 3.91 = NWFPE * 7.52 --- end of email included ---
If you want fast floating point anyway, you'd better do fix point computations on integers.
It is not allowed by linux kernel developpers to do floating point computations in the kernel.
Sharmila, if you want more information on floating point and arm, look at arm-linux mailing list archive. This has been discussed numerous times.
Yours, david
![](https://secure.gravatar.com/avatar/f650550750685b294d9eff6e5ba85371.jpg?s=120&d=mm&r=g)
Le Mardi 9 Mars 2004 10:04, romit dasgupta a écrit :
By the way, if we dont enable CONFIG_FPE_FASTFPE, cant we still use libm from userspace?
Yes if you compile all your filesystem (including libraries) with a toolchain using softfloat. Eric
participants (3)
-
David Mentre
-
Eric BENARD / Free
-
romit dasgupta