Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274217
b: refs/heads/master
c: d5755e6
h: refs/heads/master
i:
  274215: f103e5b
v: v3
  • Loading branch information
Liu Yu authored and Kumar Gala committed Oct 7, 2011
1 parent 257a9df commit d3c6df4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b430abc4d10537992a5ba38eff6c46b3c9009a19
refs/heads/master: d5755e6f3a412f012377e28b655d89eff3311f1c
11 changes: 10 additions & 1 deletion trunk/arch/powerpc/math-emu/math_efp.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,13 +676,20 @@ int speround_handler(struct pt_regs *regs)
type = insn_type(speinsn & 0x7ff);
if (type == XCR) return -ENOSYS;

__FPU_FPSCR = mfspr(SPRN_SPEFSCR);
pr_debug("speinsn:%08lx spefscr:%08lx\n", speinsn, __FPU_FPSCR);

/* No need to round if the result is exact */
if (!(__FPU_FPSCR & FP_EX_INEXACT))
return 0;

fc = (speinsn >> 21) & 0x1f;
s_lo = regs->gpr[fc] & SIGN_BIT_S;
s_hi = current->thread.evr[fc] & SIGN_BIT_S;
fgpr.wp[0] = current->thread.evr[fc];
fgpr.wp[1] = regs->gpr[fc];

__FPU_FPSCR = mfspr(SPRN_SPEFSCR);
pr_debug("round fgpr: %08x %08x\n", fgpr.wp[0], fgpr.wp[1]);

switch ((speinsn >> 5) & 0x7) {
/* Since SPE instructions on E500 core can handle round to nearest
Expand Down Expand Up @@ -722,6 +729,8 @@ int speround_handler(struct pt_regs *regs)
current->thread.evr[fc] = fgpr.wp[0];
regs->gpr[fc] = fgpr.wp[1];

pr_debug(" to fgpr: %08x %08x\n", fgpr.wp[0], fgpr.wp[1]);

return 0;
}

Expand Down

0 comments on commit d3c6df4

Please sign in to comment.