qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, qemu-arm@nongnu.org, laurent@vivier.eu,
	ysato@users.sourceforge.jp, kbastian@mail.uni-paderborn.de,
	jcmvbkbc@gmail.com
Subject: Re: [PATCH 3/7] target/i386: Use tcg_gen_ext_tl
Date: Thu, 19 Oct 2023 23:57:09 +0200	[thread overview]
Message-ID: <5f54e3e1-1c90-0249-04f4-df522e292abe@linaro.org> (raw)
In-Reply-To: <20231019182921.1772928-4-richard.henderson@linaro.org>

On 19/10/23 20:29, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/i386/tcg/translate.c | 28 +++-------------------------
>   1 file changed, 3 insertions(+), 25 deletions(-)
> 
> diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
> index 0c81e066de..d420ed8f0a 100644
> --- a/target/i386/tcg/translate.c
> +++ b/target/i386/tcg/translate.c
> @@ -701,33 +701,11 @@ static inline void gen_op_movl_T0_Dshift(DisasContext *s, MemOp ot)
>   
>   static TCGv gen_ext_tl(TCGv dst, TCGv src, MemOp size, bool sign)
>   {
> -    switch (size) {
> -    case MO_8:
> -        if (sign) {
> -            tcg_gen_ext8s_tl(dst, src);
> -        } else {
> -            tcg_gen_ext8u_tl(dst, src);
> -        }
> -        return dst;
> -    case MO_16:
> -        if (sign) {
> -            tcg_gen_ext16s_tl(dst, src);
> -        } else {
> -            tcg_gen_ext16u_tl(dst, src);
> -        }
> -        return dst;
> -#ifdef TARGET_X86_64
> -    case MO_32:
> -        if (sign) {
> -            tcg_gen_ext32s_tl(dst, src);
> -        } else {
> -            tcg_gen_ext32u_tl(dst, src);
> -        }
> -        return dst;
> -#endif
> -    default:
> +    if (memop_size(size) == TARGET_LONG_BITS) {
>           return src;
>       }
> +    tcg_gen_ext_tl(dst, src, size | (sign ? MO_SIGN : 0));
> +    return dst;
>   }

While here, I'd rename 'size' -> 'mop'. Regardless,

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


  reply	other threads:[~2023-10-19 21:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-19 18:29 [PATCH 0/7] tcg: Expose tcg_gen_ext_{i32,i64,tl} Richard Henderson
2023-10-19 18:29 ` [PATCH 1/7] tcg: Export tcg_gen_ext_{i32,i64,tl} Richard Henderson
2023-10-19 21:50   ` Philippe Mathieu-Daudé
2023-10-19 18:29 ` [PATCH 2/7] target/arm: Use tcg_gen_ext_i64 Richard Henderson
2023-10-23 15:09   ` Philippe Mathieu-Daudé
2023-10-19 18:29 ` [PATCH 3/7] target/i386: Use tcg_gen_ext_tl Richard Henderson
2023-10-19 21:57   ` Philippe Mathieu-Daudé [this message]
2023-10-21  7:59     ` Paolo Bonzini
2023-10-22  1:29       ` Richard Henderson
2023-10-22 10:22         ` Paolo Bonzini
2023-10-19 18:29 ` [PATCH 4/7] target/m68k: Use tcg_gen_ext_i32 Richard Henderson
2023-10-19 21:54   ` Philippe Mathieu-Daudé
2023-10-19 18:29 ` [PATCH 5/7] target/rx: " Richard Henderson
2023-10-19 21:54   ` Philippe Mathieu-Daudé
2023-10-21 13:45   ` Yoshinori Sato
2023-10-19 18:29 ` [PATCH 6/7] target/tricore: Use tcg_gen_*extract_tl Richard Henderson
2023-10-20 12:42   ` Bastian Koppelmann
2023-10-23 15:07   ` Philippe Mathieu-Daudé
2023-10-19 18:29 ` [PATCH 7/7] target/xtensa: Use tcg_gen_sextract_i32 Richard Henderson
2023-10-22  2:25   ` Max Filippov
2023-10-23 15:10   ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5f54e3e1-1c90-0249-04f4-df522e292abe@linaro.org \
    --to=philmd@linaro.org \
    --cc=jcmvbkbc@gmail.com \
    --cc=kbastian@mail.uni-paderborn.de \
    --cc=laurent@vivier.eu \
    --cc=pbonzini@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=ysato@users.sourceforge.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).