[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 07/31] target/arm: Rearrange decode in disas_data
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH v3 07/31] target/arm: Rearrange decode in disas_data_proc_1src |
Date: |
Wed, 9 Jan 2019 08:31:05 +1000 |
Now properly signals unallocated for REV64 with SF=0.
Allows for the opcode2 field to be decoded shortly.
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
target/arm/translate-a64.c | 31 ++++++++++++++++++++++---------
1 file changed, 22 insertions(+), 9 deletions(-)
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index b72aea3e97..dac61a3c3a 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -4563,38 +4563,51 @@ static void handle_rev16(DisasContext *s, unsigned int
sf,
*/
static void disas_data_proc_1src(DisasContext *s, uint32_t insn)
{
- unsigned int sf, opcode, rn, rd;
+ unsigned int sf, opcode, opcode2, rn, rd;
- if (extract32(insn, 29, 1) || extract32(insn, 16, 5)) {
+ if (extract32(insn, 29, 1)) {
unallocated_encoding(s);
return;
}
sf = extract32(insn, 31, 1);
opcode = extract32(insn, 10, 6);
+ opcode2 = extract32(insn, 16, 5);
rn = extract32(insn, 5, 5);
rd = extract32(insn, 0, 5);
- switch (opcode) {
- case 0: /* RBIT */
+#define MAP(SF, O2, O1) ((SF) | (O1 << 1) | (O2 << 7))
+
+ switch (MAP(sf, opcode2, opcode)) {
+ case MAP(0, 0x00, 0x00): /* RBIT */
+ case MAP(1, 0x00, 0x00):
handle_rbit(s, sf, rn, rd);
break;
- case 1: /* REV16 */
+ case MAP(0, 0x00, 0x01): /* REV16 */
+ case MAP(1, 0x00, 0x01):
handle_rev16(s, sf, rn, rd);
break;
- case 2: /* REV32 */
+ case MAP(0, 0x00, 0x02): /* REV/REV32 */
+ case MAP(1, 0x00, 0x02):
handle_rev32(s, sf, rn, rd);
break;
- case 3: /* REV64 */
+ case MAP(1, 0x00, 0x03): /* REV64 */
handle_rev64(s, sf, rn, rd);
break;
- case 4: /* CLZ */
+ case MAP(0, 0x00, 0x04): /* CLZ */
+ case MAP(1, 0x00, 0x04):
handle_clz(s, sf, rn, rd);
break;
- case 5: /* CLS */
+ case MAP(0, 0x00, 0x05): /* CLS */
+ case MAP(1, 0x00, 0x05):
handle_cls(s, sf, rn, rd);
break;
+ default:
+ unallocated_encoding(s);
+ break;
}
+
+#undef MAP
}
static void handle_div(DisasContext *s, bool is_signed, unsigned int sf,
--
2.17.2
- [Qemu-devel] [PATCH v3 01/31] target/arm: Add state for the ARMv8.3-PAuth extension, (continued)
- [Qemu-devel] [PATCH v3 01/31] target/arm: Add state for the ARMv8.3-PAuth extension, Richard Henderson, 2019/01/08
- [Qemu-devel] [PATCH v3 02/31] target/arm: Add SCTLR bits through ARMv8.5, Richard Henderson, 2019/01/08
- [Qemu-devel] [PATCH v3 03/31] target/arm: Add PAuth active bit to tbflags, Richard Henderson, 2019/01/08
- [Qemu-devel] [PATCH v3 04/31] target/arm: Introduce raise_exception_ra, Richard Henderson, 2019/01/08
- [Qemu-devel] [PATCH v3 05/31] target/arm: Add PAuth helpers, Richard Henderson, 2019/01/08
- [Qemu-devel] [PATCH v3 06/31] target/arm: Decode PAuth within system hint space, Richard Henderson, 2019/01/08
- [Qemu-devel] [PATCH v3 07/31] target/arm: Rearrange decode in disas_data_proc_1src,
Richard Henderson <=
- [Qemu-devel] [PATCH v3 08/31] target/arm: Decode PAuth within disas_data_proc_1src, Richard Henderson, 2019/01/08
- [Qemu-devel] [PATCH v3 09/31] target/arm: Decode PAuth within disas_data_proc_2src, Richard Henderson, 2019/01/08
- [Qemu-devel] [PATCH v3 11/31] target/arm: Add new_pc argument to helper_exception_return, Richard Henderson, 2019/01/08
- [Qemu-devel] [PATCH v3 10/31] target/arm: Move helper_exception_return to helper-a64.c, Richard Henderson, 2019/01/08
- [Qemu-devel] [PATCH v3 12/31] target/arm: Rearrange decode in disas_uncond_b_reg, Richard Henderson, 2019/01/08
- [Qemu-devel] [PATCH v3 13/31] target/arm: Decode PAuth within disas_uncond_b_reg, Richard Henderson, 2019/01/08
- [Qemu-devel] [PATCH v3 16/31] target/arm: Introduce arm_mmu_idx, Richard Henderson, 2019/01/08
- [Qemu-devel] [PATCH v3 14/31] target/arm: Decode Load/store register (pac), Richard Henderson, 2019/01/08