qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: [Qemu-devel] [PATCH 05/11] target-arm: Recognize UXTB, UXTH, LSR, LSL
Date: Thu, 19 Feb 2015 13:14:23 -0800	[thread overview]
Message-ID: <1424380469-20138-6-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1424380469-20138-1-git-send-email-rth@twiddle.net>

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target-arm/translate-a64.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c
index 0cb60a2..54290ad 100644
--- a/target-arm/translate-a64.c
+++ b/target-arm/translate-a64.c
@@ -3057,6 +3057,23 @@ static void disas_bitfield(DisasContext *s, uint32_t insn)
             tcg_gen_sari_i64(tcg_rd, tcg_tmp, ri);
             goto done;
         }
+    } else if (opc == 2) { /* UBFM */
+        if (ri == 0) { /* UXTB, UXTH, plus non-canonical AND */
+            tcg_gen_andi_i64(tcg_rd, tcg_tmp, bitmask64(si + 1));
+            return;
+        }
+        if (si == 63 || (si == 31 && ri <= si)) { /* LSR */
+            if (si == 31) {
+                tcg_gen_ext32u_i64(tcg_tmp, tcg_tmp);
+            }
+            tcg_gen_shri_i64(tcg_rd, tcg_tmp, ri);
+            return;
+        }
+        if (si + 1 == ri && si != bitsize - 1) { /* LSL */
+            int shift = bitsize - 1 - si;
+            tcg_gen_shli_i64(tcg_rd, tcg_tmp, shift);
+            goto done;
+        }
     }
 
     if (opc != 1) { /* SBFM or UBFM */
-- 
2.1.0

  parent reply	other threads:[~2015-02-19 21:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-19 21:14 [Qemu-devel] [PATCH 00/11] target-aarch64 fix and improvments Richard Henderson
2015-02-19 21:14 ` [Qemu-devel] [PATCH 01/11] target-arm: Introduce DisasCompare Richard Henderson
2015-02-19 21:14 ` [Qemu-devel] [PATCH 02/11] target-arm: Extend NZCF to 64 bits Richard Henderson
2015-03-10 16:08   ` Peter Maydell
2015-03-10 18:18     ` Richard Henderson
2015-02-19 21:14 ` [Qemu-devel] [PATCH 03/11] target-arm: Handle always condition codes within arm_test_cc Richard Henderson
2015-02-19 21:14 ` [Qemu-devel] [PATCH 04/11] target-arm: Recognize SXTB, SXTH, SXTW, ASR Richard Henderson
2015-02-19 21:14 ` Richard Henderson [this message]
2015-02-19 21:14 ` [Qemu-devel] [PATCH 06/11] target-arm: Eliminate unnecessary zero-extend in disas_bitfield Richard Henderson
2015-02-19 21:14 ` [Qemu-devel] [PATCH 07/11] target-arm: Recognize ROR Richard Henderson
2015-02-19 21:14 ` [Qemu-devel] [PATCH 08/11] target-arm: Use setcond and movcond for csel Richard Henderson
2015-02-19 21:14 ` [Qemu-devel] [PATCH 09/11] target-arm: Implement ccmp branchless Richard Henderson
2015-02-19 21:14 ` [Qemu-devel] [PATCH 10/11] target-arm: Implement fccmp branchless Richard Henderson
2015-02-20 13:57   ` Laurent Desnogues
2015-02-20 15:53     ` Richard Henderson
2015-02-23  7:43       ` Laurent Desnogues
2015-02-19 21:14 ` [Qemu-devel] [PATCH 11/11] target-arm: Implement fcsel with movcond Richard Henderson
2015-02-19 23:52 ` [Qemu-devel] [PATCH 00/11] target-aarch64 fix and improvments Peter Maydell
2015-02-20 16:50   ` Alex Bennée
2015-02-20 17:50     ` Alex Bennée
2015-02-20 10:00 ` Laurent Desnogues
2015-02-20 10:54   ` Laurent Desnogues
2015-02-23  7:49 ` Laurent Desnogues

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=1424380469-20138-6-git-send-email-rth@twiddle.net \
    --to=rth@twiddle.net \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).