aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/math-emu/math.c
diff options
context:
space:
mode:
authorKevin Hao <haokexin@gmail.com>2013-07-16 07:57:15 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-08-14 00:59:19 -0400
commite05c0e81b0628808a7490c35d1803644a18b0405 (patch)
tree868072fd1f5564e1d194704e0a0c88abb715f4f5 /arch/powerpc/math-emu/math.c
parent3a3b5aa63fad4911e239055c2c0a89ce2dac62ce (diff)
powerpc: split She math emulation into two parts
For some SoC (such as the FSL BookE) even though there does have a hardware FPU, but not all floating point instructions are implemented. Unfortunately some versions of gcc do use these unimplemented instructions. Then we have to enable the math emulation to workaround this issue. It seems a little redundant to have the support to emulate all the floating point instructions in this case. So split the math emulation into two parts. One is for the SoC which doesn't have FPU at all and the other for the SoC which does have the hardware FPU and only need some special floating point instructions to be emulated. Signed-off-by: Kevin Hao <haokexin@gmail.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/math-emu/math.c')
-rw-r--r--arch/powerpc/math-emu/math.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/arch/powerpc/math-emu/math.c b/arch/powerpc/math-emu/math.c
index f9ef34746f16..49eb2ac08fd3 100644
--- a/arch/powerpc/math-emu/math.c
+++ b/arch/powerpc/math-emu/math.c
@@ -13,6 +13,20 @@
13 13
14#define FLOATFUNC(x) extern int x(void *, void *, void *, void *) 14#define FLOATFUNC(x) extern int x(void *, void *, void *, void *)
15 15
16/* The instructions list which may be not implemented by a hardware FPU */
17FLOATFUNC(fre);
18FLOATFUNC(frsqrtes);
19FLOATFUNC(fsqrt);
20FLOATFUNC(fsqrts);
21FLOATFUNC(mtfsf);
22FLOATFUNC(mtfsfi);
23
24#ifdef CONFIG_MATH_EMULATION_HW_UNIMPLEMENTED
25#undef FLOATFUNC(x)
26#define FLOATFUNC(x) static inline int x(void *op1, void *op2, void *op3, \
27 void *op4) { }
28#endif
29
16FLOATFUNC(fadd); 30FLOATFUNC(fadd);
17FLOATFUNC(fadds); 31FLOATFUNC(fadds);
18FLOATFUNC(fdiv); 32FLOATFUNC(fdiv);
@@ -42,8 +56,6 @@ FLOATFUNC(mcrfs);
42FLOATFUNC(mffs); 56FLOATFUNC(mffs);
43FLOATFUNC(mtfsb0); 57FLOATFUNC(mtfsb0);
44FLOATFUNC(mtfsb1); 58FLOATFUNC(mtfsb1);
45FLOATFUNC(mtfsf);
46FLOATFUNC(mtfsfi);
47 59
48FLOATFUNC(lfd); 60FLOATFUNC(lfd);
49FLOATFUNC(lfs); 61FLOATFUNC(lfs);
@@ -58,13 +70,9 @@ FLOATFUNC(fnabs);
58FLOATFUNC(fneg); 70FLOATFUNC(fneg);
59 71
60/* Optional */ 72/* Optional */
61FLOATFUNC(fre);
62FLOATFUNC(fres); 73FLOATFUNC(fres);
63FLOATFUNC(frsqrte); 74FLOATFUNC(frsqrte);
64FLOATFUNC(frsqrtes);
65FLOATFUNC(fsel); 75FLOATFUNC(fsel);
66FLOATFUNC(fsqrt);
67FLOATFUNC(fsqrts);
68 76
69 77
70#define OP31 0x1f /* 31 */ 78#define OP31 0x1f /* 31 */