qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 06/18] target/i386: accept full MemOp in gen_ext_tl


From: Richard Henderson
Subject: Re: [PATCH 06/18] target/i386: accept full MemOp in gen_ext_tl
Date: Tue, 17 Oct 2023 18:32:05 -0700
User-agent: Mozilla Thunderbird

On 10/14/23 03:01, Paolo Bonzini wrote:
Use MO_SIGN to indicate signed vs. unsigned extension, and filter out
bits other than MO_SIGN and MO_SIZE.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
  target/i386/tcg/translate.c | 30 +++++++++++++++---------------
  1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index 4f6f9fa7e52..d7d6c85877d 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -699,18 +699,18 @@ static inline void gen_op_movl_T0_Dshift(DisasContext *s, 
MemOp ot)
      tcg_gen_shli_tl(s->T0, s->T0, ot);
  };
-static TCGv gen_ext_tl(TCGv dst, TCGv src, MemOp size, bool sign)
+static TCGv gen_ext_tl(TCGv dst, TCGv src, MemOp ot)
  {
-    switch (size) {
+    switch (ot & MO_SIZE) {
      case MO_8:
-        if (sign) {
+        if (ot & MO_SIGN) {
              tcg_gen_ext8s_tl(dst, src);
          } else {
              tcg_gen_ext8u_tl(dst, src);
          }
          return dst;
      case MO_16:
-        if (sign) {
+        if (ot & MO_SIGN) {
              tcg_gen_ext16s_tl(dst, src);
          } else {
              tcg_gen_ext16u_tl(dst, src);

A reminder yet again that I should make this generic -- we've several copies in the code base...

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


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]