Skip to content

Commit

Permalink
MIPS: Handle MIPS IV, V and R2 FPU instructions on MIPS R6 as well
Browse files Browse the repository at this point in the history
MIPS R2 FPU instructions are also present in MIPS R6 so amend the
preprocessor definitions to take MIPS R6 into consideration.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
  • Loading branch information
Markos Chandras committed Feb 17, 2015
1 parent 7c151d3 commit e0d32f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion arch/mips/include/asm/cpu-features.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@
#define cpu_has_mips_4_5_r (cpu_has_mips_4 | cpu_has_mips_5_r)
#define cpu_has_mips_5_r (cpu_has_mips_5 | cpu_has_mips_r)

#define cpu_has_mips_4_5_r2 (cpu_has_mips_4_5 | cpu_has_mips_r2)
#define cpu_has_mips_4_5_r2_r6 (cpu_has_mips_4_5 | cpu_has_mips_r2 | \
cpu_has_mips_r6)

#define cpu_has_mips32 (cpu_has_mips32r1 | cpu_has_mips32r2 | cpu_has_mips32r6)
#define cpu_has_mips64 (cpu_has_mips64r1 | cpu_has_mips64r2 | cpu_has_mips64r6)
Expand Down
8 changes: 4 additions & 4 deletions arch/mips/math-emu/cp1emu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1561,14 +1561,14 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
* achieve full IEEE-754 accuracy - however this emulator does.
*/
case frsqrt_op:
if (!cpu_has_mips_4_5_r2)
if (!cpu_has_mips_4_5_r2_r6)
return SIGILL;

handler.u = fpemu_sp_rsqrt;
goto scopuop;

case frecip_op:
if (!cpu_has_mips_4_5_r2)
if (!cpu_has_mips_4_5_r2_r6)
return SIGILL;

handler.u = fpemu_sp_recip;
Expand Down Expand Up @@ -1763,13 +1763,13 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
* achieve full IEEE-754 accuracy - however this emulator does.
*/
case frsqrt_op:
if (!cpu_has_mips_4_5_r2)
if (!cpu_has_mips_4_5_r2_r6)
return SIGILL;

handler.u = fpemu_dp_rsqrt;
goto dcopuop;
case frecip_op:
if (!cpu_has_mips_4_5_r2)
if (!cpu_has_mips_4_5_r2_r6)
return SIGILL;

handler.u = fpemu_dp_recip;
Expand Down

0 comments on commit e0d32f3

Please sign in to comment.