[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 13/15] target-mips: Use tcg_gen_extract_*
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 13/15] target-mips: Use tcg_gen_extract_* |
Date: |
Sat, 15 Oct 2016 20:37:48 -0700 |
Use the new primitives for EXT and DEXT.
Cc: Yongbok Kim <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
target-mips/translate.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/target-mips/translate.c b/target-mips/translate.c
index d8dde7a..cf79aa4 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -4484,11 +4484,12 @@ static void gen_bitops (DisasContext *ctx, uint32_t
opc, int rt,
if (lsb + msb > 31) {
goto fail;
}
- tcg_gen_shri_tl(t0, t1, lsb);
if (msb != 31) {
- tcg_gen_andi_tl(t0, t0, (1U << (msb + 1)) - 1);
+ tcg_gen_extract_tl(t0, t1, lsb, msb + 1);
} else {
- tcg_gen_ext32s_tl(t0, t0);
+ /* The two checks together imply that lsb == 0,
+ so this is a simple sign-extension. */
+ tcg_gen_ext32s_tl(t0, t1);
}
break;
#if defined(TARGET_MIPS64)
@@ -4503,10 +4504,7 @@ static void gen_bitops (DisasContext *ctx, uint32_t opc,
int rt,
if (lsb + msb > 63) {
goto fail;
}
- tcg_gen_shri_tl(t0, t1, lsb);
- if (msb != 63) {
- tcg_gen_andi_tl(t0, t0, (1ULL << (msb + 1)) - 1);
- }
+ tcg_gen_extract_tl(t0, t1, lsb, msb + 1);
break;
#endif
case OPC_INS:
--
2.7.4
- [Qemu-devel] [PATCH 04/15] tcg/arm: Move isa detection to tcg-target.h, (continued)
- [Qemu-devel] [PATCH 04/15] tcg/arm: Move isa detection to tcg-target.h, Richard Henderson, 2016/10/15
- [Qemu-devel] [PATCH 05/15] tcg/arm: Implement field extraction opcodes, Richard Henderson, 2016/10/15
- [Qemu-devel] [PATCH 06/15] tcg/i386: Implement field extraction opcodes, Richard Henderson, 2016/10/15
- [Qemu-devel] [PATCH 07/15] tcg/mips: Implement field extraction opcodes, Richard Henderson, 2016/10/15
- [Qemu-devel] [PATCH 08/15] tcg/ppc: Implement field extraction opcodes, Richard Henderson, 2016/10/15
- [Qemu-devel] [PATCH 09/15] tcg/s390: Implement field extraction opcodes, Richard Henderson, 2016/10/15
- [Qemu-devel] [PATCH 10/15] target-alpha: Use deposit and extract ops, Richard Henderson, 2016/10/15
- [Qemu-devel] [PATCH 11/15] target-arm: Use tcg_gen_*extract, Richard Henderson, 2016/10/15
- [Qemu-devel] [PATCH 12/15] target-i386: Use tcg_gen_extract_tl, Richard Henderson, 2016/10/15
- [Qemu-devel] [PATCH 13/15] target-mips: Use tcg_gen_extract_*,
Richard Henderson <=
- [Qemu-devel] [PATCH 14/15] target-ppc: Use tcg_gen_extract_*, Richard Henderson, 2016/10/15
- [Qemu-devel] [PATCH 15/15] target-s390: Use tcg_gen_extract_i64, Richard Henderson, 2016/10/15
- Re: [Qemu-devel] [PATCH 00/15] tcg field extract primitives, no-reply, 2016/10/16