?? 00000015.htm
字號:
<?xml version="1.0" encoding="gb2312"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"/><title>linux for ppc chapter 14 jacobw </title></head><body><center><h1>BBS 水木清華站∶精華區</h1></center><a name="top"></a>發信人: plato (純真年代), 信區: Embedded <br />標 題: linux for ppc chapter 14 <br />發信站: BBS 水木清華站 (Wed May 30 23:20:24 2001) <br /> <br />Next Previous Contents <br />---------------------------------------------------------------------------- <br />---- <br />14. Floating Point <br />Some of the embedded PowerPC processors do not have a floating point unit, a <br />nd so must perform all floating point operations in software. Others do have <br /> a hardware floating point unit, and may perform operations in hardware. <br />14.1 Software <br />If your application has very intensive floating point requirements, you may <br />need to switch to fixed point or choose a target processor which does have a <br />n FPU. <br />Floating point can be performed either by instruction emulation in the kerne <br />l, or by compiling everything with -msoft-float. In particular, it's importa <br />nt that all the libraries, whether dynamically or statically linked are comp <br />iled with the same options as the binaries that use them. Unless you're usin <br />g a toolkit where this has already been done for you, this will generally me <br />an that if you wish to use -msoft-float to gain maximum performance, you nee <br />d to (re)compile everything, including: <br />All static and shared libraries <br />The compiler's internal libraries, such as libgcc.a <br />All executables <br />You will almost certainly not get this right first time. The primary symptom <br /> is that printf gives bogus numbers for simple floating point values. <br />However, if you succeed, you can save space by configuring the kernel withou <br />t floating point emulation. <br />See: <a href="http://lists.linuxppc.org/listarcs/linuxppc-embedded/199911/msg00056.ht">http://lists.linuxppc.org/listarcs/linuxppc-embedded/199911/msg00056.ht</a> <br />ml <br />To add kernel math emulation to the 2.2.13 kernel, see: <a href="http://lists.linuxpp">http://lists.linuxpp</a> <br />c.org/listarcs/linuxppc-embedded/199912/msg00017.html <br />The "paranoia" test should give no complaints if everything is working corre <br />ctly. See: <a href="http://www.enseeiht.fr/NetLib/paranoia/index.html">http://www.enseeiht.fr/NetLib/paranoia/index.html</a> <br />14.2 Hardware <br />If your CPU has an FPU, you'll want to use it. Make sure that everything is <br />consistently compiled for hardware floating point, especially if you've asse <br />mbled your toolkit yourself, or are using an 8xx toolkit to compile for the <br />8260. <br />Programs compiled for hardware floating point can still run on a CPU without <br /> an FPU, provided the kernel is built with the floating point instruction em <br />ulator. This incurs a further performance penalty on CPUs lacking an FPU. <br />14.3 Mixed <br />If you are using a single set of shared libraries, you cannot mix the two te <br />chniques in the one system. If you link statically or try really hard by cre <br />ating two sets of shared libraries, the two can co-exist since programs comp <br />iled with -msoft-float never generate floating point instructions requiring <br />kernel emulation. <br />In general, you're better off choosing one or the other; and choosing hardwa <br />re floating point with kernel instruction emulation is much easier to get wo <br />rking correctly. <br />---------------------------------------------------------------------------- <br />---- <br />Next Previous Contents <br /> <br />-- <br /> <br />※ 來源:·BBS 水木清華站 smth.org·[FROM: 166.111.161.8] <br /><a href="00000014.htm">上一篇</a><a href="javascript:history.go(-1)">返回上一頁</a><a href="index.htm">回到目錄</a><a href="#top">回到頁首</a><a href="00000016.htm">下一篇</a></h1></center><center><h1>BBS 水木清華站∶精華區</h1></center></body></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -