[PATCH] target/mips: Remove duplicated check_cp1_enabled() calls in Loongson EXT

Philippe Mathieu-Daudé posted 1 patch 2 years, 9 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210816001031.1720432-1-f4bug@amsat.org
Maintainers: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Aurelien Jarno <aurelien@aurel32.net>, Jiaxun Yang <jiaxun.yang@flygoat.com>
target/mips/tcg/translate.c | 2 --
1 file changed, 2 deletions(-)
[PATCH] target/mips: Remove duplicated check_cp1_enabled() calls in Loongson EXT
Posted by Philippe Mathieu-Daudé 2 years, 9 months ago
We already call check_cp1_enabled() earlier in the "pre-conditions"
checks for GSLWXC1 and GSLDXC1 in gen_loongson_lsdc2() prologue.
Remove the duplicated calls.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/mips/tcg/translate.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
index 5b03545f099..268460d63ee 100644
--- a/target/mips/tcg/translate.c
+++ b/target/mips/tcg/translate.c
@@ -4777,7 +4777,6 @@ static void gen_loongson_lsdc2(DisasContext *ctx, int rt,
         break;
 #endif
     case OPC_GSLWXC1:
-        check_cp1_enabled(ctx);
         gen_base_offset_addr(ctx, t0, rs, offset);
         if (rd) {
             gen_op_addr_add(ctx, t0, cpu_gpr[rd], t0);
@@ -4790,7 +4789,6 @@ static void gen_loongson_lsdc2(DisasContext *ctx, int rt,
         break;
 #if defined(TARGET_MIPS64)
     case OPC_GSLDXC1:
-        check_cp1_enabled(ctx);
         gen_base_offset_addr(ctx, t0, rs, offset);
         if (rd) {
             gen_op_addr_add(ctx, t0, cpu_gpr[rd], t0);
-- 
2.31.1

Re: [PATCH] target/mips: Remove duplicated check_cp1_enabled() calls in Loongson EXT
Posted by Philippe Mathieu-Daudé 2 years, 8 months ago
On 8/16/21 2:10 AM, Philippe Mathieu-Daudé wrote:
> We already call check_cp1_enabled() earlier in the "pre-conditions"
> checks for GSLWXC1 and GSLDXC1 in gen_loongson_lsdc2() prologue.
> Remove the duplicated calls.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  target/mips/tcg/translate.c | 2 --
>  1 file changed, 2 deletions(-)

Thanks, applied to mips-next.

Re: [PATCH] target/mips: Remove duplicated check_cp1_enabled() calls in Loongson EXT
Posted by Huacai Chen 2 years, 9 months ago
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>

On Mon, Aug 16, 2021 at 8:10 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> We already call check_cp1_enabled() earlier in the "pre-conditions"
> checks for GSLWXC1 and GSLDXC1 in gen_loongson_lsdc2() prologue.
> Remove the duplicated calls.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  target/mips/tcg/translate.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
> index 5b03545f099..268460d63ee 100644
> --- a/target/mips/tcg/translate.c
> +++ b/target/mips/tcg/translate.c
> @@ -4777,7 +4777,6 @@ static void gen_loongson_lsdc2(DisasContext *ctx, int rt,
>          break;
>  #endif
>      case OPC_GSLWXC1:
> -        check_cp1_enabled(ctx);
>          gen_base_offset_addr(ctx, t0, rs, offset);
>          if (rd) {
>              gen_op_addr_add(ctx, t0, cpu_gpr[rd], t0);
> @@ -4790,7 +4789,6 @@ static void gen_loongson_lsdc2(DisasContext *ctx, int rt,
>          break;
>  #if defined(TARGET_MIPS64)
>      case OPC_GSLDXC1:
> -        check_cp1_enabled(ctx);
>          gen_base_offset_addr(ctx, t0, rs, offset);
>          if (rd) {
>              gen_op_addr_add(ctx, t0, cpu_gpr[rd], t0);
> --
> 2.31.1
>