diff options
Diffstat (limited to 'arch/powerpc/math-emu/math.c')
-rw-r--r-- | arch/powerpc/math-emu/math.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/powerpc/math-emu/math.c b/arch/powerpc/math-emu/math.c index 69058b2873de..381306bb1590 100644 --- a/arch/powerpc/math-emu/math.c +++ b/arch/powerpc/math-emu/math.c | |||
@@ -407,11 +407,16 @@ do_mathemu(struct pt_regs *regs) | |||
407 | 407 | ||
408 | case XE: | 408 | case XE: |
409 | idx = (insn >> 16) & 0x1f; | 409 | idx = (insn >> 16) & 0x1f; |
410 | if (!idx) | ||
411 | goto illegal; | ||
412 | |||
413 | op0 = (void *)¤t->thread.fpr[(insn >> 21) & 0x1f]; | 410 | op0 = (void *)¤t->thread.fpr[(insn >> 21) & 0x1f]; |
414 | op1 = (void *)(regs->gpr[idx] + regs->gpr[(insn >> 11) & 0x1f]); | 411 | if (!idx) { |
412 | if (((insn >> 1) & 0x3ff) == STFIWX) | ||
413 | op1 = (void *)(regs->gpr[(insn >> 11) & 0x1f]); | ||
414 | else | ||
415 | goto illegal; | ||
416 | } else { | ||
417 | op1 = (void *)(regs->gpr[idx] + regs->gpr[(insn >> 11) & 0x1f]); | ||
418 | } | ||
419 | |||
415 | break; | 420 | break; |
416 | 421 | ||
417 | case XEU: | 422 | case XEU: |