target/mips: FPU and other cleanups and improvements
v4 cover target/mips: FPU and other cleanups and improvements
This series contains mostly cosmetic FPU cleanups aimed to make source code recognition easier for tools like gdb, gcov, calgrind, and others.
There is also a patch that refactors conversion from ieee to mips fp exception flags. This refactoring will improve the performance of almost all fp-related mips instructions, albait very modestly (less that one percent).
There is a patch that introduces some logging in mips_malta.c.
There is a patch on change of Aleksandar Rikalo's email.
Finally, there is a patch on renaming some files in hw/mips folder.
v3->v4:
- corrected some spelling and style mistakes in commit messages
- added a patch on renaming some files in hw/mips
v2->v3:
- changed Malta patch to perform logging
- added change of Aleksandar Rikalo's email
v1->v2:
- added more demacroing
Aleksandar Markovic (19):
target/mips: fpu: Demacro ADD.<D|S|PS> target/mips: fpu: Demacro SUB.<D|S|PS> target/mips: fpu: Demacro MUL.<D|S|PS> target/mips: fpu: Demacro DIV.<D|S|PS> target/mips: fpu: Remove now unused macro FLOAT_BINOP target/mips: fpu: Demacro MADD.<D|S|PS> target/mips: fpu: Demacro MSUB.<D|S|PS> target/mips: fpu: Demacro NMADD.<D|S|PS> target/mips: fpu: Demacro NMSUB.<D|S|PS>
target/mips: fpu: Remove now unused UNFUSED_FMA and FLOAT_FMA macros target/mips: fpu: Demacro CLASS.<D|S>
target/mips: fpu: Remove now unused FLOAT_CLASS macro target/mips: fpu: Demacro RINT.<D|S>
target/mips: fpu: Remove now unused FLOAT_RINT macro target/mips: fpu: Name better paired-single variables target/mips: fpu: Refactor conversion from ieee to mips exception
flags
hw/mips: Add some logging for bad register offset cases
MAINTAINERS: Change Aleksandar Rikalo's email address hw/mips: Rename malta/mipssim/r4k/jazz files in hw/mips
.mailmap | 3 +-
MAINTAINERS | 12 +-
hw/mips/Makefile.objs | 8 +-
hw/mips/{mips_jazz.c => jazz.c} | 0
hw/mips/{mips_malta.c => malta.c} | 14 +-
hw/mips/{mips_mipssim.c => mipssim.c} | 0
hw/mips/{mips_r4k.c => r4k.c} | 0
target/mips/fpu_helper.c | 658 ++++++++++++++++++--------
target/mips/internal.h | 1 -
target/mips/msa_helper.c | 77 ++-
10 files changed, 523 insertions(+), 250 deletions(-)
rename hw/mips/{mips_jazz.c => jazz.c} (100%)
rename hw/mips/{mips_malta.c => malta.c} (99%)
rename hw/mips/{mips_mipssim.c => mipssim.c} (100%)
rename hw/mips/{mips_r4k.c => r4k.c} (100%)Signature · 1 line
2.20.1
PATCH v4 1/19 target/mips: fpu: Demacro ADD.<D|S|PS>
This is just a cosmetic change to enable tools like gcov, gdb, callgrind, etc. to better display involved source code.
--- target/mips/fpu_helper.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-)
target/mips/fpu_helper.c +37 -1
@@ -1208,12 +1208,48 @@ uint64_t helper_float_ ## name ## _ps(CPUMIPSState *env, \return ((uint64_t )wth2 <<32 ) | wt2; \ } -FLOAT_BINOP (add) FLOAT_BINOP(sub) FLOAT_BINOP(mul) FLOAT_BINOP(div)#undef FLOAT_BINOP +uint64_t helper_float_add_d (CPUMIPSState *env, +uint64_t fdt0,uint64_t fdt1) +{ +uint64_t dt2; + + dt2 =float64_add (fdt0, fdt1, &env->active_fpu.fp_status); +update_fcr31 (env,GETPC ()); +return dt2; +} + +uint32_t helper_float_add_s (CPUMIPSState *env, +uint32_t fst0,uint32_t fst1) +{ +uint32_t wt2; + + wt2 =float32_sub (fst0, fst1, &env->active_fpu.fp_status); +update_fcr31 (env,GETPC ()); +return wt2; +} + +uint64_t helper_float_add_ps (CPUMIPSState *env, +uint64_t fdt0,uint64_t fdt1) +{ +uint32_t fstl0 = fdt0 &0XFFFFFFFF ; +uint32_t fsth0 = fdt0 >>32 ; +uint32_t fstl1 = fdt1 &0XFFFFFFFF ; +uint32_t fsth1 = fdt1 >>32 ; +uint32_t wtl2; +uint32_t wth2; + + wtl2 =float32_add (fstl0, fstl1, &env->active_fpu.fp_status); + wth2 =float32_add (fsth0, fsth1, &env->active_fpu.fp_status); +update_fcr31 (env,GETPC ()); +return ((uint64_t )wth2 <<32 ) | wtl2; +} + +/* MIPS specific binary operations */ uint64_t helper_float_recip2_d (CPUMIPSState *env,uint64_t fdt0,uint64_t fdt2) {
Signature · 1 line
2.20.1
PATCH v4 2/19 target/mips: fpu: Demacro SUB.<D|S|PS>
In reply to Aleksandar MarkovicThis is just a cosmetic change to enable tools like gcov, gdb, callgrind, etc. to better display involved source code.
--- target/mips/fpu_helper.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-)
target/mips/fpu_helper.c +36 -1
@@ -1208,7 +1208,6 @@ uint64_t helper_float_ ## name ## _ps(CPUMIPSState *env, \return ((uint64_t )wth2 <<32 ) | wt2; \ } -FLOAT_BINOP(sub) FLOAT_BINOP(mul) FLOAT_BINOP(div)#undef FLOAT_BINOP
@@ -1249,6 +1248,42 @@ uint64_t helper_float_add_ps(CPUMIPSState *env,return ((uint64_t )wth2 <<32 ) | wtl2; } +uint64_t helper_float_sub_d (CPUMIPSState *env, +uint64_t fdt0,uint64_t fdt1) +{ +uint64_t dt2; + + dt2 =float64_sub (fdt0, fdt1, &env->active_fpu.fp_status); +update_fcr31 (env,GETPC ()); +return dt2; +} + +uint32_t helper_float_sub_s (CPUMIPSState *env, +uint32_t fst0,uint32_t fst1) +{ +uint32_t wt2; + + wt2 =float32_sub (fst0, fst1, &env->active_fpu.fp_status); +update_fcr31 (env,GETPC ()); +return wt2; +} + +uint64_t helper_float_sub_ps (CPUMIPSState *env, +uint64_t fdt0,uint64_t fdt1) +{ +uint32_t fstl0 = fdt0 &0XFFFFFFFF ; +uint32_t fsth0 = fdt0 >>32 ; +uint32_t fstl1 = fdt1 &0XFFFFFFFF ; +uint32_t fsth1 = fdt1 >>32 ; +uint32_t wtl2; +uint32_t wth2; + + wtl2 =float32_sub (fstl0, fstl1, &env->active_fpu.fp_status); + wth2 =float32_sub (fsth0, fsth1, &env->active_fpu.fp_status); +update_fcr31 (env,GETPC ()); +return ((uint64_t )wth2 <<32 ) | wtl2; +} +/* MIPS specific binary operations */ uint64_t helper_float_recip2_d (CPUMIPSState *env,uint64_t fdt0,uint64_t fdt2)
Signature · 1 line
2.20.1
PATCH v4 3/19 target/mips: fpu: Demacro MUL.<D|S|PS>
In reply to Aleksandar MarkovicThis is just a cosmetic change to enable tools like gcov, gdb, callgrind, etc. to better display involved source code.
--- target/mips/fpu_helper.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-)
target/mips/fpu_helper.c +36 -1
@@ -1208,7 +1208,6 @@ uint64_t helper_float_ ## name ## _ps(CPUMIPSState *env, \return ((uint64_t )wth2 <<32 ) | wt2; \ } -FLOAT_BINOP(mul)FLOAT_BINOP (div) #undef FLOAT_BINOP
@@ -1284,6 +1283,42 @@ uint64_t helper_float_sub_ps(CPUMIPSState *env,return ((uint64_t )wth2 <<32 ) | wtl2; } +uint64_t helper_float_mul_d (CPUMIPSState *env, +uint64_t fdt0,uint64_t fdt1) +{ +uint64_t dt2; + + dt2 =float64_mul (fdt0, fdt1, &env->active_fpu.fp_status); +update_fcr31 (env,GETPC ()); +return dt2; +} + +uint32_t helper_float_mul_s (CPUMIPSState *env, +uint32_t fst0,uint32_t fst1) +{ +uint32_t wt2; + + wt2 =float32_mul (fst0, fst1, &env->active_fpu.fp_status); +update_fcr31 (env,GETPC ()); +return wt2; +} + +uint64_t helper_float_mul_ps (CPUMIPSState *env, +uint64_t fdt0,uint64_t fdt1) +{ +uint32_t fstl0 = fdt0 &0XFFFFFFFF ; +uint32_t fsth0 = fdt0 >>32 ; +uint32_t fstl1 = fdt1 &0XFFFFFFFF ; +uint32_t fsth1 = fdt1 >>32 ; +uint32_t wtl2; +uint32_t wth2; + + wtl2 =float32_mul (fstl0, fstl1, &env->active_fpu.fp_status); + wth2 =float32_mul (fsth0, fsth1, &env->active_fpu.fp_status); +update_fcr31 (env,GETPC ()); +return ((uint64_t )wth2 <<32 ) | wtl2; +} +/* MIPS specific binary operations */ uint64_t helper_float_recip2_d (CPUMIPSState *env,uint64_t fdt0,uint64_t fdt2)
Signature · 1 line
2.20.1
PATCH v4 4/19 target/mips: fpu: Demacro DIV.<D|S|PS>
In reply to Aleksandar MarkovicThis is just a cosmetic change to enable tools like gcov, gdb, callgrind, etc. to better display involved source code.
--- target/mips/fpu_helper.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-)
target/mips/fpu_helper.c +36 -1
@@ -1208,7 +1208,6 @@ uint64_t helper_float_ ## name ## _ps(CPUMIPSState *env, \return ((uint64_t )wth2 <<32 ) | wt2; \ } -FLOAT_BINOP(div)#undef FLOAT_BINOP uint64_t helper_float_add_d(CPUMIPSState *env,
@@ -1319,6 +1318,42 @@ uint64_t helper_float_mul_ps(CPUMIPSState *env,return ((uint64_t )wth2 <<32 ) | wtl2; } +uint64_t helper_float_div_d (CPUMIPSState *env, +uint64_t fdt0,uint64_t fdt1) +{ +uint64_t dt2; + + dt2 =float64_div (fdt0, fdt1, &env->active_fpu.fp_status); +update_fcr31 (env,GETPC ()); +return dt2; +} + +uint32_t helper_float_div_s (CPUMIPSState *env, +uint32_t fst0,uint32_t fst1) +{ +uint32_t wt2; + + wt2 =float32_div (fst0, fst1, &env->active_fpu.fp_status); +update_fcr31 (env,GETPC ()); +return wt2; +} + +uint64_t helper_float_div_ps (CPUMIPSState *env, +uint64_t fdt0,uint64_t fdt1) +{ +uint32_t fstl0 = fdt0 &0XFFFFFFFF ; +uint32_t fsth0 = fdt0 >>32 ; +uint32_t fstl1 = fdt1 &0XFFFFFFFF ; +uint32_t fsth1 = fdt1 >>32 ; +uint32_t wtl2; +uint32_t wth2; + + wtl2 =float32_div (fstl0, fstl1, &env->active_fpu.fp_status); + wth2 =float32_div (fsth0, fsth1, &env->active_fpu.fp_status); +update_fcr31 (env,GETPC ()); +return ((uint64_t )wth2 <<32 ) | wtl2; +} +/* MIPS specific binary operations */ uint64_t helper_float_recip2_d (CPUMIPSState *env,uint64_t fdt0,uint64_t fdt2)
Signature · 1 line
2.20.1
PATCH v4 5/19 target/mips: fpu: Remove now unused macro FLOAT_BINOP
In reply to Aleksandar MarkovicAfter demacroing <ADD|SUB|MUL|DIV>.<D|S|PS>, this macro is not needed anymore.
--- target/mips/fpu_helper.c | 39 --------------------------------------- 1 file changed, 39 deletions(-)
target/mips/fpu_helper.c +0 -39
@@ -1170,45 +1170,6 @@ FLOAT_CLASS(class_d, 64)#undef FLOAT_CLASS/* binary operations */ -#define FLOAT_BINOP (name) \ -uint64_t helper_float_ ## name ## _d(CPUMIPSState *env, \ - uint64_t fdt0, uint64_t fdt1) \ -{ \ - uint64_t dt2; \ - \ - dt2 = float64_ ## name(fdt0, fdt1, &env->active_fpu.fp_status);\ - update_fcr31(env, GETPC()); \ - return dt2; \ -} \ - \ -uint32_t helper_float_ ## name ## _s(CPUMIPSState *env, \ - uint32_t fst0, uint32_t fst1) \ -{ \ - uint32_t wt2; \ - \ - wt2 = float32_ ## name(fst0, fst1, &env->active_fpu.fp_status);\ - update_fcr31(env, GETPC()); \ - return wt2; \ -} \ - \ -uint64_t helper_float_ ## name ## _ps(CPUMIPSState *env, \ - uint64_t fdt0, \ - uint64_t fdt1) \ -{ \ - uint32_t fst0 = fdt0 & 0XFFFFFFFF; \ - uint32_t fsth0 = fdt0 >> 32; \ - uint32_t fst1 = fdt1 & 0XFFFFFFFF; \ - uint32_t fsth1 = fdt1 >> 32; \ - uint32_t wt2; \ - uint32_t wth2; \ - \ - wt2 = float32_ ## name(fst0, fst1, &env->active_fpu.fp_status); \ - wth2 = float32_ ## name(fsth0, fsth1, &env->active_fpu.fp_status); \ - update_fcr31(env, GETPC()); \ - return ((uint64_t)wth2 << 32) | wt2; \ -} - -#undef FLOAT_BINOPuint64_t helper_float_add_d (CPUMIPSState *env,uint64_t fdt0,uint64_t fdt1)
Signature · 1 line
2.20.1
PATCH v4 6/19 target/mips: fpu: Demacro MADD.<D|S|PS>
In reply to Aleksandar MarkovicThis is just a cosmetic change to enable tools like gcov, gdb, callgrind, etc. to better display involved source code.
--- target/mips/fpu_helper.c | 41 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-)
target/mips/fpu_helper.c +40 -1
@@ -1495,12 +1495,51 @@ uint64_t helper_float_ ## name ## _ps(CPUMIPSState *env, \update_fcr31 (env,GETPC ()); \return ((uint64_t )fsth0 <<32 ) | fst0; \ } -FLOAT_FMA(madd, 0) FLOAT_FMA(msub, float_muladd_negate_c) FLOAT_FMA(nmadd, float_muladd_negate_result) FLOAT_FMA(nmsub, float_muladd_negate_result | float_muladd_negate_c)#undef FLOAT_FMA +uint64_t helper_float_madd_d (CPUMIPSState *env,uint64_t fst0, +uint64_t fst1,uint64_t fst2) +{ + fst0 =float64_mul (fst0, fst1, &env->active_fpu.fp_status); + fst0 =float64_add (fst0, fst2, &env->active_fpu.fp_status); + +update_fcr31 (env,GETPC ()); +return fst0; +} + +uint32_t helper_float_madd_s (CPUMIPSState *env,uint32_t fst0, +uint32_t fst1,uint32_t fst2) +{ + fst0 =float32_mul (fst0, fst1, &env->active_fpu.fp_status); + fst0 =float32_add (fst0, fst2, &env->active_fpu.fp_status); + +update_fcr31 (env,GETPC ()); +return fst0; +} + +uint64_t helper_float_madd_ps (CPUMIPSState *env,uint64_t fdt0, +uint64_t fdt1,uint64_t fdt2) +{ +uint32_t fstl0 = fdt0 &0XFFFFFFFF ; +uint32_t fsth0 = fdt0 >>32 ; +uint32_t fstl1 = fdt1 &0XFFFFFFFF ; +uint32_t fsth1 = fdt1 >>32 ; +uint32_t fstl2 = fdt2 &0XFFFFFFFF ; +uint32_t fsth2 = fdt2 >>32 ; + + fstl0 =float32_mul (fstl0, fstl1, &env->active_fpu.fp_status); + fstl0 =float32_add (fstl0, fstl2, &env->active_fpu.fp_status); + fsth0 =float32_mul (fsth0, fsth1, &env->active_fpu.fp_status); + fsth0 =float32_add (fsth0, fsth2, &env->active_fpu.fp_status); + +update_fcr31 (env,GETPC ()); +return ((uint64_t )fsth0 <<32 ) | fstl0; +} + +#define FLOAT_FMADDSUB (name, bits, muladd_arg) \ uint ## bits ## _t helper_float_ ## name(CPUMIPSState *env, \ uint ## bits ## _t fs, \
Signature · 1 line
2.20.1
PATCH v4 7/19 target/mips: fpu: Demacro MSUB.<D|S|PS>
In reply to Aleksandar MarkovicThis is just a cosmetic change to enable tools like gcov, gdb, callgrind, etc. to better display involved source code.
--- target/mips/fpu_helper.c | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-)
target/mips/fpu_helper.c +39 -1
@@ -1495,7 +1495,6 @@ uint64_t helper_float_ ## name ## _ps(CPUMIPSState *env, \update_fcr31 (env,GETPC ()); \return ((uint64_t )fsth0 <<32 ) | fst0; \ } -FLOAT_FMA(msub, float_muladd_negate_c) FLOAT_FMA(nmadd, float_muladd_negate_result) FLOAT_FMA(nmsub, float_muladd_negate_result | float_muladd_negate_c)#undef FLOAT_FMA
@@ -1539,6 +1538,45 @@ uint64_t helper_float_madd_ps(CPUMIPSState *env, uint64_t fdt0,return ((uint64_t )fsth0 <<32 ) | fstl0; } +uint64_t helper_float_msub_d (CPUMIPSState *env,uint64_t fst0, +uint64_t fst1,uint64_t fst2) +{ + fst0 =float64_mul (fst0, fst1, &env->active_fpu.fp_status); + fst0 =float64_sub (fst0, fst2, &env->active_fpu.fp_status); + +update_fcr31 (env,GETPC ()); +return fst0; +} + +uint32_t helper_float_msub_s (CPUMIPSState *env,uint32_t fst0, +uint32_t fst1,uint32_t fst2) +{ + fst0 =float32_mul (fst0, fst1, &env->active_fpu.fp_status); + fst0 =float32_sub (fst0, fst2, &env->active_fpu.fp_status); + +update_fcr31 (env,GETPC ()); +return fst0; +} + +uint64_t helper_float_msub_ps (CPUMIPSState *env,uint64_t fdt0, +uint64_t fdt1,uint64_t fdt2) +{ +uint32_t fstl0 = fdt0 &0XFFFFFFFF ; +uint32_t fsth0 = fdt0 >>32 ; +uint32_t fstl1 = fdt1 &0XFFFFFFFF ; +uint32_t fsth1 = fdt1 >>32 ; +uint32_t fstl2 = fdt2 &0XFFFFFFFF ; +uint32_t fsth2 = fdt2 >>32 ; + + fstl0 =float32_mul (fstl0, fstl1, &env->active_fpu.fp_status); + fstl0 =float32_sub (fstl0, fstl2, &env->active_fpu.fp_status); + fsth0 =float32_mul (fsth0, fsth1, &env->active_fpu.fp_status); + fsth0 =float32_sub (fsth0, fsth2, &env->active_fpu.fp_status); + +update_fcr31 (env,GETPC ()); +return ((uint64_t )fsth0 <<32 ) | fstl0; +} +#define FLOAT_FMADDSUB (name, bits, muladd_arg) \ uint ## bits ## _t helper_float_ ## name(CPUMIPSState *env, \
Signature · 1 line
2.20.1
PATCH v4 8/19 target/mips: fpu: Demacro NMADD.<D|S|PS>
In reply to Aleksandar MarkovicThis is just a cosmetic change to enable tools like gcov, gdb, callgrind, etc. to better display involved source code.
--- target/mips/fpu_helper.c | 44 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-)
target/mips/fpu_helper.c +43 -1
@@ -1495,7 +1495,6 @@ uint64_t helper_float_ ## name ## _ps(CPUMIPSState *env, \update_fcr31 (env,GETPC ()); \return ((uint64_t )fsth0 <<32 ) | fst0; \ } -FLOAT_FMA(nmadd, float_muladd_negate_result) FLOAT_FMA(nmsub, float_muladd_negate_result | float_muladd_negate_c)#undef FLOAT_FMA
@@ -1577,6 +1576,49 @@ uint64_t helper_float_msub_ps(CPUMIPSState *env, uint64_t fdt0,return ((uint64_t )fsth0 <<32 ) | fstl0; } +uint64_t helper_float_nmadd_d (CPUMIPSState *env,uint64_t fst0, +uint64_t fst1,uint64_t fst2) +{ + fst0 =float64_mul (fst0, fst1, &env->active_fpu.fp_status); + fst0 =float64_add (fst0, fst2, &env->active_fpu.fp_status); + fst0 =float64_chs (fst0); + +update_fcr31 (env,GETPC ()); +return fst0; +} + +uint32_t helper_float_nmadd_s (CPUMIPSState *env,uint32_t fst0, +uint32_t fst1,uint32_t fst2) +{ + fst0 =float32_mul (fst0, fst1, &env->active_fpu.fp_status); + fst0 =float32_add (fst0, fst2, &env->active_fpu.fp_status); + fst0 =float32_chs (fst0); + +update_fcr31 (env,GETPC ()); +return fst0; +} + +uint64_t helper_float_nmadd_ps (CPUMIPSState *env,uint64_t fdt0, +uint64_t fdt1,uint64_t fdt2) +{ +uint32_t fstl0 = fdt0 &0XFFFFFFFF ; +uint32_t fsth0 = fdt0 >>32 ; +uint32_t fstl1 = fdt1 &0XFFFFFFFF ; +uint32_t fsth1 = fdt1 >>32 ; +uint32_t fstl2 = fdt2 &0XFFFFFFFF ; +uint32_t fsth2 = fdt2 >>32 ; + + fstl0 =float32_mul (fstl0, fstl1, &env->active_fpu.fp_status); + fstl0 =float32_add (fstl0, fstl2, &env->active_fpu.fp_status); + fstl0 =float32_chs (fstl0); + fsth0 =float32_mul (fsth0, fsth1, &env->active_fpu.fp_status); + fsth0 =float32_add (fsth0, fsth2, &env->active_fpu.fp_status); + fsth0 =float32_chs (fsth0); + +update_fcr31 (env,GETPC ()); +return ((uint64_t )fsth0 <<32 ) | fstl0; +} +#define FLOAT_FMADDSUB (name, bits, muladd_arg) \ uint ## bits ## _t helper_float_ ## name(CPUMIPSState *env, \
Signature · 1 line
2.20.1
PATCH v4 9/19 target/mips: fpu: Demacro NMSUB.<D|S|PS>
In reply to Aleksandar MarkovicThis is just a cosmetic change to enable tools like gcov, gdb, callgrind, etc. to better display involved source code.
--- target/mips/fpu_helper.c | 44 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-)
target/mips/fpu_helper.c +43 -1
@@ -1495,7 +1495,6 @@ uint64_t helper_float_ ## name ## _ps(CPUMIPSState *env, \update_fcr31 (env,GETPC ()); \return ((uint64_t )fsth0 <<32 ) | fst0; \ } -FLOAT_FMA(nmsub, float_muladd_negate_result | float_muladd_negate_c)#undef FLOAT_FMA uint64_t helper_float_madd_d(CPUMIPSState *env, uint64_t fst0,
@@ -1619,6 +1618,49 @@ uint64_t helper_float_nmadd_ps(CPUMIPSState *env, uint64_t fdt0,return ((uint64_t )fsth0 <<32 ) | fstl0; } +uint64_t helper_float_nmsub_d (CPUMIPSState *env,uint64_t fst0, +uint64_t fst1,uint64_t fst2) +{ + fst0 =float64_mul (fst0, fst1, &env->active_fpu.fp_status); + fst0 =float64_sub (fst0, fst2, &env->active_fpu.fp_status); + fst0 =float64_chs (fst0); + +update_fcr31 (env,GETPC ()); +return fst0; +} + +uint32_t helper_float_nmsub_s (CPUMIPSState *env,uint32_t fst0, +uint32_t fst1,uint32_t fst2) +{ + fst0 =float32_mul (fst0, fst1, &env->active_fpu.fp_status); + fst0 =float32_sub (fst0, fst2, &env->active_fpu.fp_status); + fst0 =float32_chs (fst0); + +update_fcr31 (env,GETPC ()); +return fst0; +} + +uint64_t helper_float_nmsub_ps (CPUMIPSState *env,uint64_t fdt0, +uint64_t fdt1,uint64_t fdt2) +{ +uint32_t fstl0 = fdt0 &0XFFFFFFFF ; +uint32_t fsth0 = fdt0 >>32 ; +uint32_t fstl1 = fdt1 &0XFFFFFFFF ; +uint32_t fsth1 = fdt1 >>32 ; +uint32_t fstl2 = fdt2 &0XFFFFFFFF ; +uint32_t fsth2 = fdt2 >>32 ; + + fstl0 =float32_mul (fstl0, fstl1, &env->active_fpu.fp_status); + fstl0 =float32_sub (fstl0, fstl2, &env->active_fpu.fp_status); + fstl0 =float32_chs (fstl0); + fsth0 =float32_mul (fsth0, fsth1, &env->active_fpu.fp_status); + fsth0 =float32_sub (fsth0, fsth2, &env->active_fpu.fp_status); + fsth0 =float32_chs (fsth0); + +update_fcr31 (env,GETPC ()); +return ((uint64_t )fsth0 <<32 ) | fstl0; +} +#define FLOAT_FMADDSUB (name, bits, muladd_arg) \ uint ## bits ## _t helper_float_ ## name(CPUMIPSState *env, \
Signature · 1 line
2.20.1
PATCH v4 10/19 target/mips: fpu: Remove now unused UNFUSED_FMA and FLOAT_FMA macros
In reply to Aleksandar MarkovicAfter demacroing <MADD|MSUB|NMADD|NMSUB>.<D|S|PS>, these macros are not needed anymore.
--- target/mips/fpu_helper.c | 50 ---------------------------------------- 1 file changed, 50 deletions(-)
target/mips/fpu_helper.c +0 -50
@@ -1446,56 +1446,6 @@ FLOAT_MINMAX(mina_d, 64, minnummag)#undef FLOAT_MINMAX/* ternary operations */ -#define UNFUSED_FMA (prefix, a, b, c, flags) \ -{ \ - a = prefix##_mul(a, b, &env->active_fpu.fp_status); \ - if ((flags) & float_muladd_negate_c) { \ - a = prefix##_sub(a, c, &env->active_fpu.fp_status); \ - } else { \ - a = prefix##_add(a, c, &env->active_fpu.fp_status); \ - } \ - if ((flags) & float_muladd_negate_result) { \ - a = prefix##_chs(a); \ - } \ -} - -/* FMA based operations */ -#define FLOAT_FMA (name, type) \ -uint64_t helper_float_ ## name ## _d(CPUMIPSState *env, \ - uint64_t fdt0, uint64_t fdt1, \ - uint64_t fdt2) \ -{ \ - UNFUSED_FMA(float64, fdt0, fdt1, fdt2, type); \ - update_fcr31(env, GETPC()); \ - return fdt0; \ -} \ - \ -uint32_t helper_float_ ## name ## _s(CPUMIPSState *env, \ - uint32_t fst0, uint32_t fst1, \ - uint32_t fst2) \ -{ \ - UNFUSED_FMA(float32, fst0, fst1, fst2, type); \ - update_fcr31(env, GETPC()); \ - return fst0; \ -} \ - \ -uint64_t helper_float_ ## name ## _ps(CPUMIPSState *env, \ - uint64_t fdt0, uint64_t fdt1, \ - uint64_t fdt2) \ -{ \ - uint32_t fst0 = fdt0 & 0XFFFFFFFF; \ - uint32_t fsth0 = fdt0 >> 32; \ - uint32_t fst1 = fdt1 & 0XFFFFFFFF; \ - uint32_t fsth1 = fdt1 >> 32; \ - uint32_t fst2 = fdt2 & 0XFFFFFFFF; \ - uint32_t fsth2 = fdt2 >> 32; \ - \ - UNFUSED_FMA(float32, fst0, fst1, fst2, type); \ - UNFUSED_FMA(float32, fsth0, fsth1, fsth2, type); \ - update_fcr31(env, GETPC()); \ - return ((uint64_t)fsth0 << 32) | fst0; \ -} -#undef FLOAT_FMAuint64_t helper_float_madd_d (CPUMIPSState *env,uint64_t fst0,uint64_t fst1,uint64_t fst2)
Signature · 1 line
2.20.1
PATCH v4 11/19 target/mips: fpu: Demacro CLASS.<D|S>
In reply to Aleksandar MarkovicThis is just a cosmetic change to enable tools like gcov, gdb, callgrind, etc. to better display involved source code.
--- target/mips/fpu_helper.c | 70 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 2 deletions(-)
target/mips/fpu_helper.c +68 -2
@@ -1165,10 +1165,76 @@ uint ## bits ## _t helper_float_ ## name(CPUMIPSState *env, \ return float_ ## name(arg, &env->active_fpu.fp_status); \ } -FLOAT_CLASS(class_s, 32) -FLOAT_CLASS(class_d, 64)#undef FLOAT_CLASS +uint64_t float_class_d (uint64_t arg,float_status *status) +{ +if (float64_is_signaling_nan (arg, status)) { +return FLOAT_CLASS_SIGNALING_NAN ; + }else if (float64_is_quiet_nan (arg, status)) { +return FLOAT_CLASS_QUIET_NAN ; + }else if (float64_is_neg (arg)) { +if (float64_is_infinity (arg)) { +return FLOAT_CLASS_NEGATIVE_INFINITY ; + }else if (float64_is_zero (arg)) { +return FLOAT_CLASS_NEGATIVE_ZERO ; + }else if (float64_is_zero_or_denormal (arg)) { +return FLOAT_CLASS_NEGATIVE_SUBNORMAL ; + }else { +return FLOAT_CLASS_NEGATIVE_NORMAL ; + } + }else { +if (float64_is_infinity (arg)) { +return FLOAT_CLASS_POSITIVE_INFINITY ; + }else if (float64_is_zero (arg)) { +return FLOAT_CLASS_POSITIVE_ZERO ; + }else if (float64_is_zero_or_denormal (arg)) { +return FLOAT_CLASS_POSITIVE_SUBNORMAL ; + }else { +return FLOAT_CLASS_POSITIVE_NORMAL ; + } + } +} + +uint64_t helper_float_class_d (CPUMIPSState *env,uint64_t arg) +{ +return float_class_d (arg, &env->active_fpu.fp_status); +} + +uint32_t float_class_s (uint32_t arg,float_status *status) +{ +if (float32_is_signaling_nan (arg, status)) { +return FLOAT_CLASS_SIGNALING_NAN ; + }else if (float32_is_quiet_nan (arg, status)) { +return FLOAT_CLASS_QUIET_NAN ; + }else if (float32_is_neg (arg)) { +if (float32_is_infinity (arg)) { +return FLOAT_CLASS_NEGATIVE_INFINITY ; + }else if (float32_is_zero (arg)) { +return FLOAT_CLASS_NEGATIVE_ZERO ; + }else if (float32_is_zero_or_denormal (arg)) { +return FLOAT_CLASS_NEGATIVE_SUBNORMAL ; + }else { +return FLOAT_CLASS_NEGATIVE_NORMAL ; + } + }else { +if (float32_is_infinity (arg)) { +return FLOAT_CLASS_POSITIVE_INFINITY ; + }else if (float32_is_zero (arg)) { +return FLOAT_CLASS_POSITIVE_ZERO ; + }else if (float32_is_zero_or_denormal (arg)) { +return FLOAT_CLASS_POSITIVE_SUBNORMAL ; + }else { +return FLOAT_CLASS_POSITIVE_NORMAL ; + } + } +} + +uint32_t helper_float_class_s (CPUMIPSState *env,uint32_t arg) +{ +return float_class_s (arg, &env->active_fpu.fp_status); +} +/* binary operations */ uint64_t helper_float_add_d(CPUMIPSState *env,
Signature · 1 line
2.20.1
PATCH v4 12/19 target/mips: fpu: Remove now unused FLOAT_CLASS macro
In reply to Aleksandar MarkovicAfter demacroing CLASS.<D|S>, this macro is not needed anymore.
--- target/mips/fpu_helper.c | 39 --------------------------------------- 1 file changed, 39 deletions(-)
target/mips/fpu_helper.c +0 -39
@@ -1128,45 +1128,6 @@ FLOAT_RINT(rint_d, 64)#define FLOAT_CLASS_POSITIVE_SUBNORMAL 0x100#define FLOAT_CLASS_POSITIVE_ZERO 0x200 -#define FLOAT_CLASS (name, bits) \ -uint ## bits ## _t float_ ## name(uint ## bits ## _t arg, \ - float_status *status) \ -{ \ - if (float ## bits ## _is_signaling_nan(arg, status)) { \ - return FLOAT_CLASS_SIGNALING_NAN; \ - } else if (float ## bits ## _is_quiet_nan(arg, status)) { \ - return FLOAT_CLASS_QUIET_NAN; \ - } else if (float ## bits ## _is_neg(arg)) { \ - if (float ## bits ## _is_infinity(arg)) { \ - return FLOAT_CLASS_NEGATIVE_INFINITY; \ - } else if (float ## bits ## _is_zero(arg)) { \ - return FLOAT_CLASS_NEGATIVE_ZERO; \ - } else if (float ## bits ## _is_zero_or_denormal(arg)) { \ - return FLOAT_CLASS_NEGATIVE_SUBNORMAL; \ - } else { \ - return FLOAT_CLASS_NEGATIVE_NORMAL; \ - } \ - } else { \ - if (float ## bits ## _is_infinity(arg)) { \ - return FLOAT_CLASS_POSITIVE_INFINITY; \ - } else if (float ## bits ## _is_zero(arg)) { \ - return FLOAT_CLASS_POSITIVE_ZERO; \ - } else if (float ## bits ## _is_zero_or_denormal(arg)) { \ - return FLOAT_CLASS_POSITIVE_SUBNORMAL; \ - } else { \ - return FLOAT_CLASS_POSITIVE_NORMAL; \ - } \ - } \ -} \ - \ -uint ## bits ## _t helper_float_ ## name(CPUMIPSState *env, \ - uint ## bits ## _t arg) \ -{ \ - return float_ ## name(arg, &env->active_fpu.fp_status); \ -} - -#undef FLOAT_CLASS -uint64_t float_class_d (uint64_t arg,float_status *status) {if (float64_is_signaling_nan (arg, status)) {
Signature · 1 line
2.20.1
PATCH v4 13/19 target/mips: fpu: Demacro RINT.<D|S>
In reply to Aleksandar MarkovicThis is just a cosmetic change to enable tools like gcov, gdb, callgrind, etc. to better display involved source code.
--- target/mips/fpu_helper.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
target/mips/fpu_helper.c +18 -2
@@ -1113,10 +1113,26 @@ uint ## bits ## _t helper_float_ ## name(CPUMIPSState *env, \return fdret; \ } -FLOAT_RINT(rint_s, 32) -FLOAT_RINT(rint_d, 64)#undef FLOAT_RINT +uint64_t helper_float_rint_d (CPUMIPSState *env,uint64_t fs) +{ +uint64_t fdret; + + fdret =float64_round_to_int (fs, &env->active_fpu.fp_status); +update_fcr31 (env,GETPC ()); +return fdret; +} + +uint32_t helper_float_rint_s (CPUMIPSState *env,uint32_t fs) +{ +uint32_t fdret; + + fdret =float32_round_to_int (fs, &env->active_fpu.fp_status); +update_fcr31 (env,GETPC ()); +return fdret; +} +#define FLOAT_CLASS_SIGNALING_NAN 0x001#define FLOAT_CLASS_QUIET_NAN 0x002#define FLOAT_CLASS_NEGATIVE_INFINITY 0x004
Signature · 1 line
2.20.1
PATCH v4 14/19 target/mips: fpu: Remove now unused FLOAT_RINT macro
In reply to Aleksandar MarkovicAfter demacroing RINT.<D|S>, this macro is not needed anymore.
--- target/mips/fpu_helper.c | 13 ------------- 1 file changed, 13 deletions(-)
target/mips/fpu_helper.c +0 -13
@@ -1102,19 +1102,6 @@ uint64_t helper_float_rsqrt1_ps(CPUMIPSState *env, uint64_t fdt0)return ((uint64_t )fsth2 <<32 ) | fst2; } -#define FLOAT_RINT (name, bits) \ -uint ## bits ## _t helper_float_ ## name(CPUMIPSState *env, \ - uint ## bits ## _t fs) \ -{ \ - uint ## bits ## _t fdret; \ - \ - fdret = float ## bits ## _round_to_int(fs, &env->active_fpu.fp_status); \ - update_fcr31(env, GETPC()); \ - return fdret; \ -} - -#undef FLOAT_RINT -uint64_t helper_float_rint_d (CPUMIPSState *env,uint64_t fs) {uint64_t fdret;
Signature · 1 line
2.20.1
PATCH v4 15/19 target/mips: fpu: Name better paired-single variables
In reply to Aleksandar MarkovicUse consistently 'l' and 'h' for low and high halves.
--- target/mips/fpu_helper.c | 62 ++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 31 deletions(-)
target/mips/fpu_helper.c +31 -31
@@ -1059,14 +1059,14 @@ uint32_t helper_float_recip1_s(CPUMIPSState *env, uint32_t fst0)uint64_t helper_float_recip1_ps (CPUMIPSState *env,uint64_t fdt0) { -uint32_t fst2; +uint32_t fstl2;uint32_t fsth2; - fst2 =float32_div (float32_one, fdt0 &0XFFFFFFFF , - &env->active_fpu.fp_status); + fstl2 =float32_div (float32_one, fdt0 &0XFFFFFFFF , + &env->active_fpu.fp_status); fsth2 =float32_div (float32_one, fdt0 >>32 , &env->active_fpu.fp_status);update_fcr31 (env,GETPC ()); -return ((uint64_t )fsth2 <<32 ) | fst2; +return ((uint64_t )fsth2 <<32 ) | fstl2; }uint64_t helper_float_rsqrt1_d (CPUMIPSState *env,uint64_t fdt0)
@@ -1091,15 +1091,15 @@ uint32_t helper_float_rsqrt1_s(CPUMIPSState *env, uint32_t fst0)uint64_t helper_float_rsqrt1_ps (CPUMIPSState *env,uint64_t fdt0) { -uint32_t fst2; +uint32_t fstl2;uint32_t fsth2; - fst2 =float32_sqrt (fdt0 &0XFFFFFFFF , &env->active_fpu.fp_status); + fstl2 =float32_sqrt (fdt0 &0XFFFFFFFF , &env->active_fpu.fp_status); fsth2 =float32_sqrt (fdt0 >>32 , &env->active_fpu.fp_status); - fst2 =float32_div (float32_one, fst2, &env->active_fpu.fp_status); + fstl2 =float32_div (float32_one, fstl2, &env->active_fpu.fp_status); fsth2 =float32_div (float32_one, fsth2, &env->active_fpu.fp_status);update_fcr31 (env,GETPC ()); -return ((uint64_t )fsth2 <<32 ) | fst2; +return ((uint64_t )fsth2 <<32 ) | fstl2; }uint64_t helper_float_rint_d (CPUMIPSState *env,uint64_t fs)
@@ -1367,19 +1367,19 @@ uint32_t helper_float_recip2_s(CPUMIPSState *env, uint32_t fst0, uint32_t fst2)uint64_t helper_float_recip2_ps (CPUMIPSState *env,uint64_t fdt0,uint64_t fdt2) { -uint32_t fst0 = fdt0 &0XFFFFFFFF ; +uint32_t fstl0 = fdt0 &0XFFFFFFFF ;uint32_t fsth0 = fdt0 >>32 ; -uint32_t fst2 = fdt2 &0XFFFFFFFF ; +uint32_t fstl2 = fdt2 &0XFFFFFFFF ;uint32_t fsth2 = fdt2 >>32 ; - fst2 =float32_mul (fst0, fst2, &env->active_fpu.fp_status); + fstl2 =float32_mul (fstl0, fstl2, &env->active_fpu.fp_status); fsth2 =float32_mul (fsth0, fsth2, &env->active_fpu.fp_status); - fst2 =float32_chs (float32_sub (fst2, float32_one, + fstl2 =float32_chs (float32_sub (fstl2, float32_one, &env->active_fpu.fp_status)); fsth2 =float32_chs (float32_sub (fsth2, float32_one, &env->active_fpu.fp_status));update_fcr31 (env,GETPC ()); -return ((uint64_t )fsth2 <<32 ) | fst2; +return ((uint64_t )fsth2 <<32 ) | fstl2; }uint64_t helper_float_rsqrt2_d (CPUMIPSState *env,uint64_t fdt0,uint64_t fdt2)
@@ -1404,51 +1404,51 @@ uint32_t helper_float_rsqrt2_s(CPUMIPSState *env, uint32_t fst0, uint32_t fst2)uint64_t helper_float_rsqrt2_ps (CPUMIPSState *env,uint64_t fdt0,uint64_t fdt2) { -uint32_t fst0 = fdt0 &0XFFFFFFFF ; +uint32_t fstl0 = fdt0 &0XFFFFFFFF ;uint32_t fsth0 = fdt0 >>32 ; -uint32_t fst2 = fdt2 &0XFFFFFFFF ; +uint32_t fstl2 = fdt2 &0XFFFFFFFF ;uint32_t fsth2 = fdt2 >>32 ; - fst2 =float32_mul (fst0, fst2, &env->active_fpu.fp_status); + fstl2 =float32_mul (fstl0, fstl2, &env->active_fpu.fp_status); fsth2 =float32_mul (fsth0, fsth2, &env->active_fpu.fp_status); - fst2 =float32_sub (fst2, float32_one, &env->active_fpu.fp_status); + fstl2 =float32_sub (fstl2, float32_one, &env->active_fpu.fp_status); fsth2 =float32_sub (fsth2, float32_one, &env->active_fpu.fp_status); - fst2 =float32_chs (float32_div (fst2,FLOAT_TWO32 , + fstl2 =float32_chs (float32_div (fstl2,FLOAT_TWO32 , &env->active_fpu.fp_status)); fsth2 =float32_chs (float32_div (fsth2,FLOAT_TWO32 , &env->active_fpu.fp_status));update_fcr31 (env,GETPC ()); -return ((uint64_t )fsth2 <<32 ) | fst2; +return ((uint64_t )fsth2 <<32 ) | fstl2; }uint64_t helper_float_addr_ps (CPUMIPSState *env,uint64_t fdt0,uint64_t fdt1) { -uint32_t fst0 = fdt0 &0XFFFFFFFF ; +uint32_t fstl0 = fdt0 &0XFFFFFFFF ;uint32_t fsth0 = fdt0 >>32 ; -uint32_t fst1 = fdt1 &0XFFFFFFFF ; +uint32_t fstl1 = fdt1 &0XFFFFFFFF ;uint32_t fsth1 = fdt1 >>32 ; -uint32_t fst2; +uint32_t fstl2;uint32_t fsth2; - fst2 =float32_add (fst0, fsth0, &env->active_fpu.fp_status); - fsth2 =float32_add (fst1, fsth1, &env->active_fpu.fp_status); + fstl2 =float32_add (fstl0, fsth0, &env->active_fpu.fp_status); + fsth2 =float32_add (fstl1, fsth1, &env->active_fpu.fp_status);update_fcr31 (env,GETPC ()); -return ((uint64_t )fsth2 <<32 ) | fst2; +return ((uint64_t )fsth2 <<32 ) | fstl2; }uint64_t helper_float_mulr_ps (CPUMIPSState *env,uint64_t fdt0,uint64_t fdt1) { -uint32_t fst0 = fdt0 &0XFFFFFFFF ; +uint32_t fstl0 = fdt0 &0XFFFFFFFF ;uint32_t fsth0 = fdt0 >>32 ; -uint32_t fst1 = fdt1 &0XFFFFFFFF ; +uint32_t fstl1 = fdt1 &0XFFFFFFFF ;uint32_t fsth1 = fdt1 >>32 ; -uint32_t fst2; +uint32_t fstl2;uint32_t fsth2; - fst2 =float32_mul (fst0, fsth0, &env->active_fpu.fp_status); - fsth2 =float32_mul (fst1, fsth1, &env->active_fpu.fp_status); + fstl2 =float32_mul (fstl0, fsth0, &env->active_fpu.fp_status); + fsth2 =float32_mul (fstl1, fsth1, &env->active_fpu.fp_status);update_fcr31 (env,GETPC ()); -return ((uint64_t )fsth2 <<32 ) | fst2; +return ((uint64_t )fsth2 <<32 ) | fstl2; }#define FLOAT_MINMAX (name, bits, minmaxfunc) \
Signature · 1 line
2.20.1
PATCH v4 16/19 target/mips: fpu: Refactor conversion from ieee to mips exception flags
In reply to Aleksandar MarkovicThe original coversion function is used for regular and MSA floating point instructions handling. Since there are some nuanced differences between regular and MSA floating point exception handling, provide two instances of the conversion function, rather than just a single common one. Inline both instances of this function instances for the sake of performance. Improve variable naming in surrounding code for clarity.
--- target/mips/fpu_helper.c | 55 +++++++++++++++------------- target/mips/internal.h | 1 - target/mips/msa_helper.c | 77 +++++++++++++++++++++++++++------------- 3 files changed, 82 insertions(+), 51 deletions(-)
target/mips/fpu_helper.c +30 -25
@@ -189,43 +189,48 @@ void helper_ctc1(CPUMIPSState *env, target_ulong arg1, uint32_t fs, uint32_t rt) } } -int ieee_ex_to_mips (int xcpt) +static inline int ieee_to_mips_xcpt (int ieee_xcpt) { -int ret =0 ; -if (xcpt) { -if (xcpt & float_flag_invalid) { - ret |=FP_INVALID ; - } -if (xcpt & float_flag_overflow) { - ret |=FP_OVERFLOW ; - } -if (xcpt & float_flag_underflow) { - ret |=FP_UNDERFLOW ; - } -if (xcpt & float_flag_divbyzero) { - ret |=FP_DIV0 ; - } -if (xcpt & float_flag_inexact) { - ret |=FP_INEXACT ; - } +int mips_xcpt =0 ; + +if (ieee_xcpt & float_flag_invalid) { + mips_xcpt |=FP_INVALID ; + } +if (ieee_xcpt & float_flag_overflow) { + mips_xcpt |=FP_OVERFLOW ; } -return ret; +if (ieee_xcpt & float_flag_underflow) { + mips_xcpt |=FP_UNDERFLOW ; + } +if (ieee_xcpt & float_flag_divbyzero) { + mips_xcpt |=FP_DIV0 ; + } +if (ieee_xcpt & float_flag_inexact) { + mips_xcpt |=FP_INEXACT ; + } + +return mips_xcpt; }static inline void update_fcr31 (CPUMIPSState *env,uintptr_t pc) { -int tmp =ieee_ex_to_mips (get_float_exception_flags ( - &env->active_fpu.fp_status)); +int ieee_exception_flags =get_float_exception_flags ( + &env->active_fpu.fp_status); +int mips_exception_flags =0 ; + +if (ieee_exception_flags) { + mips_exception_flags =ieee_to_mips_xcpt (ieee_exception_flags); + } -SET_FP_CAUSE (env->active_fpu.fcr31, tmp); +SET_FP_CAUSE (env->active_fpu.fcr31, mips_exception_flags); -if (tmp) { +if (mips_exception_flags) {set_float_exception_flags (0 , &env->active_fpu.fp_status); -if (GET_FP_ENABLE (env->active_fpu.fcr31) & tmp) { +if (GET_FP_ENABLE (env->active_fpu.fcr31) & mips_exception_flags) {do_raise_exception (env,EXCP_FPE , pc); }else { -UPDATE_FP_FLAGS (env->active_fpu.fcr31, tmp); +UPDATE_FP_FLAGS (env->active_fpu.fcr31, mips_exception_flags); } } }
target/mips/internal.h +0 -1
@@ -224,7 +224,6 @@ uint32_t float_class_s(uint32_t arg, float_status *fst);uint64_t float_class_d (uint64_t arg,float_status *fst);extern unsigned int ieee_rm[]; -int ieee_ex_to_mips (int xcpt);void update_pagemask (CPUMIPSState *env,target_ulong arg1,int32_t *pagemask);static inline void restore_rounding_mode (CPUMIPSState *env)
target/mips/msa_helper.c +52 -25
135 lines not on this page · raw message
Signature · 1 line
2.20.1
PATCH v4 17/19 hw/mips: Add some logging for bad register offset cases
In reply to Aleksandar MarkovicLog the cases where a guest attempts read or write using bad register offset.
--- hw/mips/mips_malta.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
hw/mips/mips_malta.c +6 -8
@@ -427,10 +427,9 @@ static uint64_t malta_fpga_read(void *opaque, hwaddr addr,break ;default : -#if 0 -printf ("malta_fpga_read: Bad register offset 0x" TARGET_FMT_lx"\n" , - addr); -#endif +qemu_log_mask (LOG_GUEST_ERROR , +"malta_fpga_read: Bad register offset 0x" + TARGET_FMT_lx"\n" , addr);break ; }return val;
@@ -515,10 +514,9 @@ static void malta_fpga_write(void *opaque, hwaddr addr,break ;default : -#if 0 -printf ("malta_fpga_write: Bad register offset 0x" TARGET_FMT_lx"\n" , - addr); -#endif +qemu_log_mask (LOG_GUEST_ERROR , +"malta_fpga_write: Bad register offset 0x" + TARGET_FMT_lx"\n" , addr);break ; } }
Signature · 1 line
2.20.1
PATCH v4 18/19 MAINTAINERS: Change Aleksandar Rikalo's email address
In reply to Aleksandar MarkovicAleksandar Rikalo wants to use a different email address from now on.
--- .mailmap | 3 ++- MAINTAINERS | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-)
.mailmap +2 -1
@@ -42,7 +42,8 @@ Justin Terry (VM) <[email protected]> Justin Terry (VM) via Qemu-devel <qemu Aleksandar Markovic <[email protected]> <[email protected]> Aleksandar Markovic <[email protected]> <[email protected]> Aleksandar Markovic <[email protected]> <[email protected]> -Aleksandar Rikalo <[email protected]> <[email protected]> +Aleksandar Rikalo <[email protected]> <[email protected]> +Aleksandar Rikalo <[email protected]> <[email protected]> Anthony Liguori <[email protected]> Anthony Liguori <[email protected]> James Hogan <[email protected]> <[email protected]> Leif Lindholm <[email protected]> <[email protected]>
MAINTAINERS +6 -6
@@ -212,7 +212,7 @@ F: disas/microblaze.c MIPS TCG CPUs M: Aleksandar Markovic <[email protected]> R: Aurelien Jarno <[email protected]> -R: Aleksandar Rikalo <[email protected]> +R: Aleksandar Rikalo <[email protected]> S: Maintained F: target/mips/ F: default-configs/*mips*
@@ -1041,7 +1041,7 @@ MIPS Machines ------------- Jazz M: Hervé Poussineau <[email protected]> -R: Aleksandar Rikalo <[email protected]> +R: Aleksandar Rikalo <[email protected]> S: Maintained F: hw/mips/mips_jazz.c F: hw/display/jazz_led.c
@@ -1062,7 +1062,7 @@ F: tests/acceptance/machine_mips_malta.py Mipssim M: Aleksandar Markovic <[email protected]> -R: Aleksandar Rikalo <[email protected]> +R: Aleksandar Rikalo <[email protected]> S: Odd Fixes F: hw/mips/mips_mipssim.c F: hw/net/mipsnet.c
@@ -1070,7 +1070,7 @@ F: hw/net/mipsnet.c R4000 M: Aleksandar Markovic <[email protected]> R: Aurelien Jarno <[email protected]> -R: Aleksandar Rikalo <[email protected]> +R: Aleksandar Rikalo <[email protected]> S: Obsolete F: hw/mips/mips_r4k.c
@@ -1085,7 +1085,7 @@ F: include/hw/isa/vt82c686.h Boston M: Paul Burton <[email protected]> -R: Aleksandar Rikalo <[email protected]> +R: Aleksandar Rikalo <[email protected]> S: Maintained F: hw/core/loader-fit.c F: hw/mips/boston.c
@@ -2582,7 +2582,7 @@ F: disas/i386.c MIPS TCG target M: Aleksandar Markovic <[email protected]> R: Aurelien Jarno <[email protected]> -R: Aleksandar Rikalo <[email protected]> +R: Aleksandar Rikalo <[email protected]> S: Maintained F: tcg/mips/
Signature · 1 line
2.20.1
Re: [PATCH v4 18/19] MAINTAINERS: Change Aleksandar Rikalo's email address
Quoted 4 lines · Aleksandar Markovic
Aleksandar Rikalo wants to use a different email address from now on.
Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Quoted 79 lines
Signed-off-by Aleksandar Markovic <[email protected]>--- .mailmap | 3 ++- MAINTAINERS | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-).mailmap +2
-1@@ -42,7 +42,8 @@ Justin Terry (VM) <[email protected]> Justin Terry (VM) via Qemu-devel <qemu Aleksandar Markovic <[email protected]> <[email protected]> Aleksandar Markovic <[email protected]> <[email protected]> Aleksandar Markovic <[email protected]> <[email protected]> -Aleksandar Rikalo <[email protected]> <[email protected]> +Aleksandar Rikalo <[email protected]> <[email protected]> +Aleksandar Rikalo <[email protected]> <[email protected]> Anthony Liguori <[email protected]> Anthony Liguori <[email protected]> James Hogan <[email protected]> <[email protected]> Leif Lindholm <[email protected]> <[email protected]>MAINTAINERS +6
-6@@ -212,7 +212,7 @@ F: disas/microblaze.c MIPS TCG CPUs M: Aleksandar Markovic <[email protected]> R: Aurelien Jarno <[email protected]> -R: Aleksandar Rikalo <[email protected]> +R: Aleksandar Rikalo <[email protected]> S: Maintained F: target/mips/ F: default-configs/*mips*@@ -1041,7 +1041,7 @@ MIPS Machines ------------- Jazz M: Hervé Poussineau <[email protected]> -R: Aleksandar Rikalo <[email protected]> +R: Aleksandar Rikalo <[email protected]> S: Maintained F: hw/mips/mips_jazz.c F: hw/display/jazz_led.c@@ -1062,7 +1062,7 @@ F: tests/acceptance/machine_mips_malta.py Mipssim M: Aleksandar Markovic <[email protected]> -R: Aleksandar Rikalo <[email protected]> +R: Aleksandar Rikalo <[email protected]> S: Odd Fixes F: hw/mips/mips_mipssim.c F: hw/net/mipsnet.c@@ -1070,7 +1070,7 @@ F: hw/net/mipsnet.c R4000 M: Aleksandar Markovic <[email protected]> R: Aurelien Jarno <[email protected]> -R: Aleksandar Rikalo <[email protected]> +R: Aleksandar Rikalo <[email protected]> S: Obsolete F: hw/mips/mips_r4k.c@@ -1085,7 +1085,7 @@ F: include/hw/isa/vt82c686.h Boston M: Paul Burton <[email protected]> -R: Aleksandar Rikalo <[email protected]> +R: Aleksandar Rikalo <[email protected]> S: Maintained F: hw/core/loader-fit.c F: hw/mips/boston.c@@ -2582,7 +2582,7 @@ F: disas/i386.c MIPS TCG target M: Aleksandar Markovic <[email protected]> R: Aurelien Jarno <[email protected]> -R: Aleksandar Rikalo <[email protected]> +R: Aleksandar Rikalo <[email protected]> S: Maintained F: tcg/mips/
PATCH v4 19/19 hw/mips: Rename malta/mipssim/r4k/jazz files in hw/mips
In reply to Aleksandar MarkovicMachine file names should not have prefix "mips_".
Folong2 machine source file will be handled in a separate patch, to avoid conflicts. That patch is pending integration into the main tree.
---
hw/mips/Makefile.objs | 8 ++++----
hw/mips/{mips_jazz.c => jazz.c} | 0
hw/mips/{mips_malta.c => malta.c} | 0
hw/mips/{mips_mipssim.c => mipssim.c} | 0
hw/mips/{mips_r4k.c => r4k.c} | 0
5 files changed, 4 insertions(+), 4 deletions(-)
rename hw/mips/{mips_jazz.c => jazz.c} (100%)
rename hw/mips/{mips_malta.c => malta.c} (100%)
rename hw/mips/{mips_mipssim.c => mipssim.c} (100%)
rename hw/mips/{mips_r4k.c => r4k.c} (100%)hw/mips/Makefile.objs +4 -4
@@ -1,8 +1,8 @@ obj-y += addr.o mips_int.o -obj-$(CONFIG_R4K) += mips_r4k.o -obj-$(CONFIG_MALTA) += gt64xxx_pci.o mips_malta.o -obj-$(CONFIG_MIPSSIM) += mips_mipssim.o -obj-$(CONFIG_JAZZ) += mips_jazz.o +obj-$(CONFIG_R4K) += r4k.o +obj-$(CONFIG_MALTA) += gt64xxx_pci.o malta.o +obj-$(CONFIG_MIPSSIM) += mipssim.o +obj-$(CONFIG_JAZZ) += jazz.o obj-$(CONFIG_FULONG) += mips_fulong2e.o obj-$(CONFIG_MIPS_CPS) += cps.o obj-$(CONFIG_MIPS_BOSTON) += boston.o
hw/mips/jazz.c renamed from hw/mips/mips_jazz.c +0 -0
hw/mips/malta.c renamed from hw/mips/mips_malta.c +0 -0
hw/mips/mipssim.c renamed from hw/mips/mips_mipssim.c +0 -0
hw/mips/r4k.c renamed from hw/mips/mips_r4k.c +0 -0
Signature · 1 line
2.20.1
Re: [PATCH v4 19/19] hw/mips: Rename malta/mipssim/r4k/jazz files in hw/mips
Hi Aleksandar,
Quoted 3 lines · Aleksandar Markovic
Machine file names should not have prefix "
mips_".Folong2 machine source file will be handled in a separate patch,
Typo: "Fuloong2e"
Quoted 12 lines
to avoid conflicts. That patch is pending integration into the main tree.
Signed-off-by Aleksandar Markovic <[email protected]>CC Philippe Mathieu-Daudé <[email protected]>--- hw/mips/Makefile.objs | 8 ++++---- hw/mips/{mips_jazz.c => jazz.c} | 0 hw/mips/{mips_malta.c => malta.c} | 0 hw/mips/{mips_mipssim.c => mipssim.c} | 0 hw/mips/{mips_r4k.c => r4k.c} | 0 5 files changed, 4 insertions(+), 4 deletions(-)
Quoted 4 lines
rename
hw/mips/{mips_jazz.c=>jazz.c} (100%) renamehw/mips/{mips_malta.c=>malta.c} (100%) renamehw/mips/{mips_mipssim.c=>mipssim.c} (100%) renamehw/mips/{mips_r4k.c=>r4k.c} (100%)
Thanks for cleaning this, appreciated!
You missed MAINTAINERS:
-- >8 --
MAINTAINERS +4 -4
@@ -1045,3 +1045,3 @@ R: Aleksandar Rikalo <[email protected]> S: Maintained -F: hw/mips/mips_jazz.c +F: hw/mips/jazz.c F: hw/display/jazz_led.c
@@ -1056,3 +1056,3 @@ F: hw/isa/piix4.c F: hw/acpi/piix4.c -F: hw/mips/mips_malta.c +F: hw/mips/malta.c F: hw/mips/gt64xxx_pci.c
@@ -1066,3 +1066,3 @@ R: Aleksandar Rikalo <[email protected]> S: Odd Fixes -F: hw/mips/mips_mipssim.c +F: hw/mips/mipssim.c F: hw/net/mipsnet.c
@@ -1074,3 +1074,3 @@ R: Aleksandar Rikalo <[email protected]> S: Obsolete -F: hw/mips/mips_r4k.c +F: hw/mips/r4k.c
---
With this snippet amended:
Regards,
Phil.
Quoted 35 lines
hw/mips/Makefile.objs +4
-4@@ -1,8 +1,8 @@ obj-y += addr.o mips_int.o -obj-$(CONFIG_R4K) += mips_r4k.o -obj-$(CONFIG_MALTA) += gt64xxx_pci.o mips_malta.o -obj-$(CONFIG_MIPSSIM) += mips_mipssim.o -obj-$(CONFIG_JAZZ) += mips_jazz.o +obj-$(CONFIG_R4K) += r4k.o +obj-$(CONFIG_MALTA) += gt64xxx_pci.o malta.o +obj-$(CONFIG_MIPSSIM) += mipssim.o +obj-$(CONFIG_JAZZ) += jazz.o obj-$(CONFIG_FULONG) += mips_fulong2e.o obj-$(CONFIG_MIPS_CPS) += cps.o obj-$(CONFIG_MIPS_BOSTON) += boston.ohw/mips/jazz.c renamed from hw/mips/mips_jazz.c +0
-0hw/mips/malta.c renamed from hw/mips/mips_malta.c +0
-0hw/mips/mipssim.c renamed from hw/mips/mips_mipssim.c +0
-0hw/mips/r4k.c renamed from hw/mips/mips_r4k.c +0
-0
Re: [PATCH v4 19/19] hw/mips: Rename malta/mipssim/r4k/jazz files in hw/mips
нед, 17. мај 2020. у 15:19 Philippe Mathieu-Daudé <[email protected]> је написао/ла:
Quoted 27 lines
Hi Aleksandar,
Quoted 3 lines · Aleksandar Markovic
Machine file names should not have prefix "
mips_".Folong2 machine source file will be handled in a separate patch,
Typo: "Fuloong2e"
Quoted 12 lines
to avoid conflicts. That patch is pending integration into the main tree.
Signed-off-by Aleksandar Markovic <[email protected]>CC Philippe Mathieu-Daudé <[email protected]>--- hw/mips/Makefile.objs | 8 ++++---- hw/mips/{mips_jazz.c => jazz.c} | 0 hw/mips/{mips_malta.c => malta.c} | 0 hw/mips/{mips_mipssim.c => mipssim.c} | 0 hw/mips/{mips_r4k.c => r4k.c} | 0 5 files changed, 4 insertions(+), 4 deletions(-)Quoted 4 lines
rename
hw/mips/{mips_jazz.c=>jazz.c} (100%) renamehw/mips/{mips_malta.c=>malta.c} (100%) renamehw/mips/{mips_mipssim.c=>mipssim.c} (100%) renamehw/mips/{mips_r4k.c=>r4k.c} (100%)
Quoted 4 lines
Thanks for cleaning this, appreciated!
You missed
MAINTAINERS:
Ouch! You are right. Will be fixed..
Thanks,
Aleksandar
Quoted 71 lines
-- >8 --
MAINTAINERS +4
-5@@ -1045,3 +1045,3 @@ R: Aleksandar Rikalo <[email protected]> S: Maintained -F: hw/mips/mips_jazz.c +F: hw/mips/jazz.c F: hw/display/jazz_led.c@@ -1056,3 +1056,3 @@ F: hw/isa/piix4.c F: hw/acpi/piix4.c -F: hw/mips/mips_malta.c +F: hw/mips/malta.c F: hw/mips/gt64xxx_pci.c@@ -1066,3 +1066,3 @@ R: Aleksandar Rikalo <[email protected]> S: Odd Fixes -F: hw/mips/mips_mipssim.c +F: hw/mips/mipssim.c F: hw/net/mipsnet.c@@ -1074,3 +1074,3 @@ R: Aleksandar Rikalo <[email protected]> S: Obsolete -F: hw/mips/mips_r4k.c +F: hw/mips/r4k.c ---With this snippet amended:
Reviewed-by Philippe Mathieu-Daudé <[email protected]>Regards,
Phil.
Quoted 35 lines
hw/mips/Makefile.objs +4
-4@@ -1,8 +1,8 @@ obj-y += addr.o mips_int.o -obj-$(CONFIG_R4K) += mips_r4k.o -obj-$(CONFIG_MALTA) += gt64xxx_pci.o mips_malta.o -obj-$(CONFIG_MIPSSIM) += mips_mipssim.o -obj-$(CONFIG_JAZZ) += mips_jazz.o +obj-$(CONFIG_R4K) += r4k.o +obj-$(CONFIG_MALTA) += gt64xxx_pci.o malta.o +obj-$(CONFIG_MIPSSIM) += mipssim.o +obj-$(CONFIG_JAZZ) += jazz.o obj-$(CONFIG_FULONG) += mips_fulong2e.o obj-$(CONFIG_MIPS_CPS) += cps.o obj-$(CONFIG_MIPS_BOSTON) += boston.ohw/mips/jazz.c renamed from hw/mips/mips_jazz.c +0
-0hw/mips/malta.c renamed from hw/mips/mips_malta.c +0
-0hw/mips/mipssim.c renamed from hw/mips/mips_mipssim.c +0
-0hw/mips/r4k.c renamed from hw/mips/mips_r4k.c +0
-0
Quoted 61 lines
This series contains mostly cosmetic FPU cleanups aimed to make source code recognition easier for tools like gdb, gcov, calgrind, and others.
There is also a patch that refactors conversion from ieee to mips fp exception flags. This refactoring will improve the performance of almost all fp-related mips instructions, albait very modestly (less that one percent).
There is a patch that introduces some logging in
mips_malta.c.There is a patch on change of Aleksandar Rikalo's email.
Finally, there is a patch on renaming some files in hw/mips folder.
v3->v4:- corrected some spelling and style mistakes in commit messages
- added a patch on renaming some files in hw/mips
v2->v3:- changed Malta patch to perform logging
- added change of Aleksandar Rikalo's email
v1->v2:- added more demacroing
Aleksandar Markovic (19):
target/mips: fpu: Demacro ADD.<D|S|PS> target/mips: fpu: Demacro SUB.<D|S|PS> target/mips: fpu: Demacro MUL.<D|S|PS> target/mips: fpu: Demacro DIV.<D|S|PS> target/mips: fpu: Remove now unused macro FLOAT_BINOP target/mips: fpu: Demacro MADD.<D|S|PS> target/mips: fpu: Demacro MSUB.<D|S|PS> target/mips: fpu: Demacro NMADD.<D|S|PS> target/mips: fpu: Demacro NMSUB.<D|S|PS>target/mips: fpu: Remove now unused
UNFUSED_FMAandFLOAT_FMAmacros target/mips: fpu: Demacro CLASS.<D|S>
target/mips: fpu: Remove now unusedFLOAT_CLASSmacro target/mips: fpu: Demacro RINT.<D|S>
target/mips: fpu: Remove now unusedFLOAT_RINTmacro target/mips: fpu: Name better paired-single variables target/mips: fpu: Refactor conversion from ieee to mips exception flags
hw/mips: Add some logging for bad register offset cases
MAINTAINERS: Change Aleksandar Rikalo's email address hw/mips: Rename malta/mipssim/r4k/jazz files in hw/mips.mailmap | 3 +-
MAINTAINERS | 12 +- hw/mips/Makefile.objs | 8 +-hw/mips/{mips_jazz.c=> jazz.c} | 0hw/mips/{mips_malta.c=> malta.c} | 14 +-hw/mips/{mips_mipssim.c=>mipssim.c} | 0hw/mips/{mips_r4k.c=> r4k.c} | 0 target/mips/fpu_helper.c | 658 ++++++++++++++++++-------- target/mips/internal.h | 1 - target/mips/msa_helper.c | 77 ++-
Quoted 9 lines
10 files changed, 523 insertions(+), 250 deletions(-)rename
hw/mips/{mips_jazz.c=>jazz.c} (100%) renamehw/mips/{mips_malta.c=>malta.c} (99%) renamehw/mips/{mips_mipssim.c=>mipssim.c} (100%) renamehw/mips/{mips_r4k.c=>r4k.c} (100%)--
2.20.1
For patches 1-16 and 18:
Please make sure you rerun our MIPS FPU regression tests after the series is applied.
Thanks,
Aleksandar Rikalo
пон, 18. мај 2020. у 13:01 Aleksandar Rikalo
<[email protected]> је написао/ла:
Quoted 68 lines
Quoted 68 lines
This series contains mostly cosmetic FPU cleanups aimed to make source code recognition easier for tools like gdb, gcov, calgrind, and others.
There is also a patch that refactors conversion from ieee to mips fp exception flags. This refactoring will improve the performance of almost all fp-related mips instructions, albait very modestly (less that one percent).
There is a patch that introduces some logging in
mips_malta.c.There is a patch on change of Aleksandar Rikalo's email.
Finally, there is a patch on renaming some files in hw/mips folder.
v3->v4:- corrected some spelling and style mistakes in commit messages
- added a patch on renaming some files in hw/mips
v2->v3:- changed Malta patch to perform logging
- added change of Aleksandar Rikalo's email
v1->v2:- added more demacroing
Aleksandar Markovic (19):
target/mips: fpu: Demacro ADD.<D|S|PS> target/mips: fpu: Demacro SUB.<D|S|PS> target/mips: fpu: Demacro MUL.<D|S|PS> target/mips: fpu: Demacro DIV.<D|S|PS> target/mips: fpu: Remove now unused macro FLOAT_BINOP target/mips: fpu: Demacro MADD.<D|S|PS> target/mips: fpu: Demacro MSUB.<D|S|PS> target/mips: fpu: Demacro NMADD.<D|S|PS> target/mips: fpu: Demacro NMSUB.<D|S|PS>target/mips: fpu: Remove now unused
UNFUSED_FMAandFLOAT_FMAmacros target/mips: fpu: Demacro CLASS.<D|S>
target/mips: fpu: Remove now unusedFLOAT_CLASSmacro target/mips: fpu: Demacro RINT.<D|S>
target/mips: fpu: Remove now unusedFLOAT_RINTmacro target/mips: fpu: Name better paired-single variables target/mips: fpu: Refactor conversion from ieee to mips exception
flags
hw/mips: Add some logging for bad register offset cases
MAINTAINERS: Change Aleksandar Rikalo's email address hw/mips: Rename malta/mipssim/r4k/jazz files in hw/mips.mailmap | 3 +- MAINTAINERS | 12 +- hw/mips/Makefile.objs | 8 +- hw/mips/{mips_jazz.c => jazz.c} | 0 hw/mips/{mips_malta.c => malta.c} | 14 +- hw/mips/{mips_mipssim.c => mipssim.c} | 0 hw/mips/{mips_r4k.c => r4k.c} | 0 target/mips/fpu_helper.c | 658 ++++++++++++++++++-------- target/mips/internal.h | 1 - target/mips/msa_helper.c | 77 ++- 10 files changed, 523 insertions(+), 250 deletions(-) rename hw/mips/{mips_jazz.c => jazz.c} (100%) rename hw/mips/{mips_malta.c => malta.c} (99%) rename hw/mips/{mips_mipssim.c => mipssim.c} (100%) rename hw/mips/{mips_r4k.c => r4k.c} (100%)
Quoted 8 lines
Quoted 3 lines
--
2.20.1For patches 1-16 and 18:
Reviewed-by Aleksandar Rikalo <[email protected]>
Patches 1-16 applied to MIPS queue.
Patch 18 is already upstream.
Tthanks,
Aleksandar M.
Quoted 6 lines
Please make sure you rerun our MIPS FPU regression tests after the series is applied.
Thanks,
Aleksandar Rikalo