diff mbox series

[01/35] target/mips: Raise a RI when given fs is n/a from CTC1

Message ID 20180620120620.12806-2-yongbok.kim@mips.com
State New
Headers show
Series nanoMIPS | expand

Commit Message

Yongbok Kim June 20, 2018, 12:05 p.m. UTC
From: Yongbok Kim <yongbok.kim@imgtec.com>

Fix to raise a Reserved Instruction exception when given fs is not
available from CTC1.

Signed-off-by: Yongbok Kim <yongbok.kim@mips.com>
---
 target/mips/op_helper.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Aleksandar Markovic June 22, 2018, 1:45 p.m. UTC | #1
> From: Yongbok Kim <yongbok.kim@imgtec.com>
>
> Fix to raise a Reserved Instruction exception when given fs is not
> available from CTC1.
>
> Signed-off-by: Yongbok Kim <yongbok.kim@mips.com>

Reviewed-by: Aleksandar Markovic <aleksandar.markovic@mips.com>

> ---
>  target/mips/op_helper.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c
> index 9025f42..41d3634 100644
> --- a/target/mips/op_helper.c
> +++ b/target/mips/op_helper.c
> @@ -2627,6 +2627,9 @@ void helper_ctc1(CPUMIPSState *env, target_ulong arg1, uint32_t fs, uint32_t rt)
>                 (env->active_fpu.fcr31 & ~(env->active_fpu.fcr31_rw_bitmask));
>          break;
>      default:
> +        if (env->insn_flags & ISA_MIPS32R6) {
> +            do_raise_exception(env, EXCP_RI, GETPC());
> +        }
>          return;
>      }
>      restore_fp_status(env);
> --
> 1.9.1
diff mbox series

Patch

diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c
index 9025f42..41d3634 100644
--- a/target/mips/op_helper.c
+++ b/target/mips/op_helper.c
@@ -2627,6 +2627,9 @@  void helper_ctc1(CPUMIPSState *env, target_ulong arg1, uint32_t fs, uint32_t rt)
                (env->active_fpu.fcr31 & ~(env->active_fpu.fcr31_rw_bitmask));
         break;
     default:
+        if (env->insn_flags & ISA_MIPS32R6) {
+            do_raise_exception(env, EXCP_RI, GETPC());
+        }
         return;
     }
     restore_fp_status(env);