Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[pandora-kernel.git] / arch / powerpc / math-emu / math.c
index 5891534..381306b 100644 (file)
@@ -2,7 +2,6 @@
  * Copyright (C) 1999  Eddie C. Dost  (ecd@atecom.com)
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/sched.h>
 
@@ -408,11 +407,16 @@ do_mathemu(struct pt_regs *regs)
 
        case XE:
                idx = (insn >> 16) & 0x1f;
-               if (!idx)
-                       goto illegal;
-
                op0 = (void *)&current->thread.fpr[(insn >> 21) & 0x1f];
-               op1 = (void *)(regs->gpr[idx] + regs->gpr[(insn >> 11) & 0x1f]);
+               if (!idx) {
+                       if (((insn >> 1) & 0x3ff) == STFIWX)
+                               op1 = (void *)(regs->gpr[(insn >> 11) & 0x1f]);
+                       else
+                               goto illegal;
+               } else {
+                       op1 = (void *)(regs->gpr[idx] + regs->gpr[(insn >> 11) & 0x1f]);
+               }
+
                break;
 
        case XEU: