[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 5/9] target/ppc: Use tcg_gen_extract_i32
From: |
Nicholas Piggin |
Subject: |
Re: [PATCH v2 5/9] target/ppc: Use tcg_gen_extract_i32 |
Date: |
Wed, 25 Oct 2023 17:10:41 +1000 |
On Wed Oct 25, 2023 at 2:58 AM AEST, Philippe Mathieu-Daudé wrote:
> Inspired-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
> ---
> target/ppc/translate.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/target/ppc/translate.c b/target/ppc/translate.c
> index 329da4d518..c696fedbcc 100644
> --- a/target/ppc/translate.c
> +++ b/target/ppc/translate.c
> @@ -4802,16 +4802,14 @@ static void gen_mtcrf(DisasContext *ctx)
> TCGv_i32 temp = tcg_temp_new_i32();
> crn = ctz32(crm);
> tcg_gen_trunc_tl_i32(temp, cpu_gpr[rS(ctx->opcode)]);
> - tcg_gen_shri_i32(temp, temp, crn * 4);
> - tcg_gen_andi_i32(cpu_crf[7 - crn], temp, 0xf);
> + tcg_gen_extract_i32(cpu_crf[7 - crn], temp, crn * 4, 4);
> }
> } else {
> TCGv_i32 temp = tcg_temp_new_i32();
> tcg_gen_trunc_tl_i32(temp, cpu_gpr[rS(ctx->opcode)]);
> for (crn = 0 ; crn < 8 ; crn++) {
> if (crm & (1 << crn)) {
> - tcg_gen_shri_i32(cpu_crf[7 - crn], temp, crn * 4);
> - tcg_gen_andi_i32(cpu_crf[7 - crn], cpu_crf[7 - crn],
> 0xf);
> + tcg_gen_extract_i32(cpu_crf[7 - crn], temp, crn * 4, 4);
> }
> }
> }
- [PATCH v2 0/9] tcg: Use tcg_gen_[s]extract_{i32,i64,tl}, Philippe Mathieu-Daudé, 2023/10/24
- [PATCH v2 1/9] target/avr: Use tcg_gen_extract_tl, Philippe Mathieu-Daudé, 2023/10/24
- [PATCH v2 2/9] target/cris: Use tcg_gen_extract_tl, Philippe Mathieu-Daudé, 2023/10/24
- [PATCH v2 3/9] target/i386: Use tcg_gen_extract_tl, Philippe Mathieu-Daudé, 2023/10/24
- [PATCH v2 4/9] target/mips: Use tcg_gen_extract_i32, Philippe Mathieu-Daudé, 2023/10/24
- [PATCH v2 5/9] target/ppc: Use tcg_gen_extract_i32, Philippe Mathieu-Daudé, 2023/10/24
- Re: [PATCH v2 5/9] target/ppc: Use tcg_gen_extract_i32,
Nicholas Piggin <=
- [PATCH v2 6/9] target/sparc: Use tcg_gen_extract_tl, Philippe Mathieu-Daudé, 2023/10/24
- [PATCH v2 7/9] target/xtensa: Use tcg_gen_extract_i32, Philippe Mathieu-Daudé, 2023/10/24
- [PATCH v2 8/9] target/mips: Use tcg_gen_ext16s_tl, Philippe Mathieu-Daudé, 2023/10/24
- [PATCH v2 9/9] target/mips: Use tcg_gen_ext*u_tl, Philippe Mathieu-Daudé, 2023/10/24