[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 16/65] target-mips: Use the new extract op
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 16/65] target-mips: Use the new extract op |
Date: |
Fri, 23 Dec 2016 19:59:53 -0800 |
Use extract for EXT and DEXT.
Reviewed-by: 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 57b824f..8deffa1 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -4488,11 +4488,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)
@@ -4507,10 +4508,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.9.3
- [Qemu-devel] [PATCH 10/65] tcg/s390: Expose host facilities to tcg-target.h, (continued)
- [Qemu-devel] [PATCH 10/65] tcg/s390: Expose host facilities to tcg-target.h, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 13/65] target-alpha: Use deposit and extract ops, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 15/65] target-i386: Use new deposit and extract ops, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 14/65] target-arm: Use new deposit and extract ops, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 17/65] target-ppc: Use the new deposit and extract ops, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 18/65] target-s390x: Use the new deposit and extract ops, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 19/65] tcg/optimize: Fold movcond 0/1 into setcond, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 21/65] tcg: Transition flat op_defs array to a target callback, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 20/65] tcg: Add markup for output requires new register, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 23/65] tcg: Allow an operand to be matching or a constant, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 16/65] target-mips: Use the new extract op,
Richard Henderson <=
- [Qemu-devel] [PATCH 25/65] disas/i386.c: Handle tzcnt, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 26/65] disas/ppc: Handle popcnt and cnttz, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 22/65] tcg: Pass the opcode width to target_parse_constraint, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 27/65] target-alpha: Use the ctz and clz opcodes, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 29/65] target-microblaze: Use clz opcode, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 30/65] target-mips: Use clz opcode, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 24/65] tcg: Add clz and ctz opcodes, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 28/65] target-cris: Use clz opcode, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 36/65] target-unicore32: Use clz opcode, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 32/65] target-ppc: Use clz and ctz opcodes, Richard Henderson, 2016/12/23