aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-02-20 19:02:24 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-03-20 04:13:48 -0500
commit4e74ae800bafe79d4aaa529bc5d52425757c0115 (patch)
treeb6d0a52da8a316eadaa5651ffa73ea3e3435d59e
parentf5deb807b8cd5c8fe48cbb4f7f5dd70cfbdb1178 (diff)
[SPARC64]: Handle unimplemented FPU square-root on Niagara.
The math-emu code only expects unfinished fpop traps when emulating FPU sqrt instructions on pre-Niagara chips. On Niagara we can get unimplemented fpop, so handle that. Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--arch/sparc64/math-emu/math.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/arch/sparc64/math-emu/math.c b/arch/sparc64/math-emu/math.c
index 2ae05cd7b773..a93a3664c854 100644
--- a/arch/sparc64/math-emu/math.c
+++ b/arch/sparc64/math-emu/math.c
@@ -206,9 +206,30 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f)
206 case FSTOQ: TYPE(3,3,1,1,1,0,0); break; 206 case FSTOQ: TYPE(3,3,1,1,1,0,0); break;
207 case FDTOQ: TYPE(3,3,1,2,1,0,0); break; 207 case FDTOQ: TYPE(3,3,1,2,1,0,0); break;
208 case FQTOI: TYPE(3,1,0,3,1,0,0); break; 208 case FQTOI: TYPE(3,1,0,3,1,0,0); break;
209
210 /* We can get either unimplemented or unfinished
211 * for these cases. Pre-Niagara systems generate
212 * unfinished fpop for SUBNORMAL cases, and Niagara
213 * always gives unimplemented fpop for fsqrt{s,d}.
214 */
215 case FSQRTS: {
216 unsigned long x = current_thread_info()->xfsr[0];
217
218 x = (x >> 14) & 0xf;
219 TYPE(x,1,1,1,1,0,0);
220 printk("math-emu: type is %08x\n", type);
221 break;
222 }
223
224 case FSQRTD: {
225 unsigned long x = current_thread_info()->xfsr[0];
226
227 x = (x >> 14) & 0xf;
228 TYPE(x,2,1,2,1,0,0);
229 break;
230 }
231
209 /* SUBNORMAL - ftt == 2 */ 232 /* SUBNORMAL - ftt == 2 */
210 case FSQRTS: TYPE(2,1,1,1,1,0,0); break;
211 case FSQRTD: TYPE(2,2,1,2,1,0,0); break;
212 case FADDD: 233 case FADDD:
213 case FSUBD: 234 case FSUBD:
214 case FMULD: 235 case FMULD: