diff mbox

[v2,03/20] target-mips: remove duplicated mips/ieee mapping function

Message ID 1414546928-54642-4-git-send-email-yongbok.kim@imgtec.com
State New
Headers show

Commit Message

Yongbok Kim Oct. 29, 2014, 1:41 a.m. UTC
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
---
 target-mips/cpu.h       |    4 ++++
 target-mips/gdbstub.c   |    7 -------
 target-mips/op_helper.c |    4 ++--
 3 files changed, 6 insertions(+), 9 deletions(-)

Comments

James Hogan Oct. 29, 2014, 10:04 a.m. UTC | #1
On Wed, Oct 29, 2014 at 01:41:51AM +0000, Yongbok Kim wrote:
> 
> Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>

A more verbose commit message wouldn't hurt. I.e. this patch does two
things, it removes the duplicate ieee_rm in gdbstub.c, but it also makes
ieee_ex_to_mips() available to msa_helper.c as well as op_helper.c.

Otherwise,
Reviewed-by: James Hogan <james.hogan@imgtec.com>

Cheers
James

> ---
>  target-mips/cpu.h       |    4 ++++
>  target-mips/gdbstub.c   |    7 -------
>  target-mips/op_helper.c |    4 ++--
>  3 files changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/target-mips/cpu.h b/target-mips/cpu.h
> index fb5abda..6d3db79 100644
> --- a/target-mips/cpu.h
> +++ b/target-mips/cpu.h
> @@ -760,6 +760,10 @@ hwaddr cpu_mips_translate_address (CPUMIPSState *env, target_ulong address,
>  #endif
>  target_ulong exception_resume_pc (CPUMIPSState *env);
>  
> +/* op_helper.c */
> +extern unsigned int ieee_rm[];
> +int ieee_ex_to_mips(int xcpt);
> +
>  static inline void cpu_get_tb_cpu_state(CPUMIPSState *env, target_ulong *pc,
>                                          target_ulong *cs_base, int *flags)
>  {
> diff --git a/target-mips/gdbstub.c b/target-mips/gdbstub.c
> index 5b72d58..f65fec2 100644
> --- a/target-mips/gdbstub.c
> +++ b/target-mips/gdbstub.c
> @@ -73,13 +73,6 @@ int mips_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
>      return 0;
>  }
>  
> -/* convert MIPS rounding mode in FCR31 to IEEE library */
> -static unsigned int ieee_rm[] = {
> -    float_round_nearest_even,
> -    float_round_to_zero,
> -    float_round_up,
> -    float_round_down
> -};
>  #define RESTORE_ROUNDING_MODE \
>      set_float_rounding_mode(ieee_rm[env->active_fpu.fcr31 & 3], \
>                              &env->active_fpu.fp_status)
> diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
> index 0c75ec8..7cbf4cf 100644
> --- a/target-mips/op_helper.c
> +++ b/target-mips/op_helper.c
> @@ -2340,7 +2340,7 @@ void mips_cpu_unassigned_access(CPUState *cs, hwaddr addr,
>  #define FP_TO_INT64_OVERFLOW 0x7fffffffffffffffULL
>  
>  /* convert MIPS rounding mode in FCR31 to IEEE library */
> -static unsigned int ieee_rm[] = {
> +unsigned int ieee_rm[] = {
>      float_round_nearest_even,
>      float_round_to_zero,
>      float_round_up,
> @@ -2461,7 +2461,7 @@ void helper_ctc1(CPUMIPSState *env, target_ulong arg1, uint32_t fs, uint32_t rt)
>          do_raise_exception(env, EXCP_FPE, GETPC());
>  }
>  
> -static inline int ieee_ex_to_mips(int xcpt)
> +int ieee_ex_to_mips(int xcpt)
>  {
>      int ret = 0;
>      if (xcpt) {
> -- 
> 1.7.4
> 
>
Leon Alrae Oct. 29, 2014, 10:55 p.m. UTC | #2
On 29/10/14 01:41, Yongbok Kim wrote:
> 
> Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
> ---
>  target-mips/cpu.h       |    4 ++++
>  target-mips/gdbstub.c   |    7 -------
>  target-mips/op_helper.c |    4 ++--
>  3 files changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/target-mips/cpu.h b/target-mips/cpu.h
> index fb5abda..6d3db79 100644
> --- a/target-mips/cpu.h
> +++ b/target-mips/cpu.h
> @@ -760,6 +760,10 @@ hwaddr cpu_mips_translate_address (CPUMIPSState *env, target_ulong address,
>  #endif
>  target_ulong exception_resume_pc (CPUMIPSState *env);
>  
> +/* op_helper.c */
> +extern unsigned int ieee_rm[];
> +int ieee_ex_to_mips(int xcpt);
> +
>  static inline void cpu_get_tb_cpu_state(CPUMIPSState *env, target_ulong *pc,
>                                          target_ulong *cs_base, int *flags)
>  {
> diff --git a/target-mips/gdbstub.c b/target-mips/gdbstub.c
> index 5b72d58..f65fec2 100644
> --- a/target-mips/gdbstub.c
> +++ b/target-mips/gdbstub.c
> @@ -73,13 +73,6 @@ int mips_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
>      return 0;
>  }
>  
> -/* convert MIPS rounding mode in FCR31 to IEEE library */
> -static unsigned int ieee_rm[] = {
> -    float_round_nearest_even,
> -    float_round_to_zero,
> -    float_round_up,
> -    float_round_down
> -};
>  #define RESTORE_ROUNDING_MODE \
>      set_float_rounding_mode(ieee_rm[env->active_fpu.fcr31 & 3], \
>                              &env->active_fpu.fp_status)
> diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
> index 0c75ec8..7cbf4cf 100644
> --- a/target-mips/op_helper.c
> +++ b/target-mips/op_helper.c
> @@ -2340,7 +2340,7 @@ void mips_cpu_unassigned_access(CPUState *cs, hwaddr addr,
>  #define FP_TO_INT64_OVERFLOW 0x7fffffffffffffffULL
>  
>  /* convert MIPS rounding mode in FCR31 to IEEE library */
> -static unsigned int ieee_rm[] = {
> +unsigned int ieee_rm[] = {
>      float_round_nearest_even,
>      float_round_to_zero,
>      float_round_up,
> @@ -2461,7 +2461,7 @@ void helper_ctc1(CPUMIPSState *env, target_ulong arg1, uint32_t fs, uint32_t rt)
>          do_raise_exception(env, EXCP_FPE, GETPC());
>  }
>  
> -static inline int ieee_ex_to_mips(int xcpt)
> +int ieee_ex_to_mips(int xcpt)
>  {
>      int ret = 0;
>      if (xcpt) {

Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
diff mbox

Patch

diff --git a/target-mips/cpu.h b/target-mips/cpu.h
index fb5abda..6d3db79 100644
--- a/target-mips/cpu.h
+++ b/target-mips/cpu.h
@@ -760,6 +760,10 @@  hwaddr cpu_mips_translate_address (CPUMIPSState *env, target_ulong address,
 #endif
 target_ulong exception_resume_pc (CPUMIPSState *env);
 
+/* op_helper.c */
+extern unsigned int ieee_rm[];
+int ieee_ex_to_mips(int xcpt);
+
 static inline void cpu_get_tb_cpu_state(CPUMIPSState *env, target_ulong *pc,
                                         target_ulong *cs_base, int *flags)
 {
diff --git a/target-mips/gdbstub.c b/target-mips/gdbstub.c
index 5b72d58..f65fec2 100644
--- a/target-mips/gdbstub.c
+++ b/target-mips/gdbstub.c
@@ -73,13 +73,6 @@  int mips_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
     return 0;
 }
 
-/* convert MIPS rounding mode in FCR31 to IEEE library */
-static unsigned int ieee_rm[] = {
-    float_round_nearest_even,
-    float_round_to_zero,
-    float_round_up,
-    float_round_down
-};
 #define RESTORE_ROUNDING_MODE \
     set_float_rounding_mode(ieee_rm[env->active_fpu.fcr31 & 3], \
                             &env->active_fpu.fp_status)
diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index 0c75ec8..7cbf4cf 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -2340,7 +2340,7 @@  void mips_cpu_unassigned_access(CPUState *cs, hwaddr addr,
 #define FP_TO_INT64_OVERFLOW 0x7fffffffffffffffULL
 
 /* convert MIPS rounding mode in FCR31 to IEEE library */
-static unsigned int ieee_rm[] = {
+unsigned int ieee_rm[] = {
     float_round_nearest_even,
     float_round_to_zero,
     float_round_up,
@@ -2461,7 +2461,7 @@  void helper_ctc1(CPUMIPSState *env, target_ulong arg1, uint32_t fs, uint32_t rt)
         do_raise_exception(env, EXCP_FPE, GETPC());
 }
 
-static inline int ieee_ex_to_mips(int xcpt)
+int ieee_ex_to_mips(int xcpt)
 {
     int ret = 0;
     if (xcpt) {