[PATCH 3/6] target/microblaze: Use hswap_i32() in SWAPH opcode

Philippe Mathieu-Daudé posted 6 patches 2 years, 5 months ago
[PATCH 3/6] target/microblaze: Use hswap_i32() in SWAPH opcode
Posted by Philippe Mathieu-Daudé 2 years, 5 months ago
Commit 46be8425ff ("tcg: Implement tcg_gen_{h,w}swap_{i32,i64}")
introduced the generic hswap_i32(). Use it instead of open-coding
it as gen_swaph().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/microblaze/translate.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
index 7e7f837c63..83fd1161f0 100644
--- a/target/microblaze/translate.c
+++ b/target/microblaze/translate.c
@@ -608,13 +608,8 @@ DO_TYPEA0(sra, false, gen_sra)
 DO_TYPEA0(src, false, gen_src)
 DO_TYPEA0(srl, false, gen_srl)
 
-static void gen_swaph(TCGv_i32 out, TCGv_i32 ina)
-{
-    tcg_gen_rotri_i32(out, ina, 16);
-}
-
 DO_TYPEA0(swapb, false, tcg_gen_bswap32_i32)
-DO_TYPEA0(swaph, false, gen_swaph)
+DO_TYPEA0(swaph, false, tcg_gen_hswap_i32)
 
 static bool trans_wdic(DisasContext *dc, arg_wdic *a)
 {
-- 
2.41.0


Re: [PATCH 3/6] target/microblaze: Use hswap_i32() in SWAPH opcode
Posted by Richard Henderson 2 years, 5 months ago
On 8/22/23 04:01, Philippe Mathieu-Daudé wrote:
> Commit 46be8425ff ("tcg: Implement tcg_gen_{h,w}swap_{i32,i64}")
> introduced the generic hswap_i32(). Use it instead of open-coding
> it as gen_swaph().
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   target/microblaze/translate.c | 7 +------
>   1 file changed, 1 insertion(+), 6 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~