aboutsummaryrefslogtreecommitdiff
path: root/target-arm
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2015-09-14 14:39:48 +0100
committerPeter Maydell <peter.maydell@linaro.org>2015-09-14 14:39:48 +0100
commit9924e85829fe21b5f38a5d267c9aea44c5d478ac (patch)
tree6fb102a857fe258e1d0b1d1c146c04619a72c5c8 /target-arm
parentef60151bee9a95e3a5cc98b345a19ed7eb435ddb (diff)
downloadqemu-9924e85829fe21b5f38a5d267c9aea44c5d478ac.zip
qemu-9924e85829fe21b5f38a5d267c9aea44c5d478ac.tar.gz
qemu-9924e85829fe21b5f38a5d267c9aea44c5d478ac.tar.bz2
target-arm: Recognize UXTB, UXTH, LSR, LSL
These are all special case aliases of UBFM. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net> Message-id: 1441909103-24666-9-git-send-email-rth@twiddle.net Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target-arm')
-rw-r--r--target-arm/translate-a64.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c
index 8ae6814..f2f8443 100644
--- a/target-arm/translate-a64.c
+++ b/target-arm/translate-a64.c
@@ -3038,6 +3038,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 */