From af1d2ff66233ec8b3d0670abe95a8c1fc35ef1b5 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Mon, 29 May 2023 01:04:57 +0300 Subject: [PATCH] ppc/svp64: support optional operands disassembly --- opcodes/ppc-svp64-opc.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/opcodes/ppc-svp64-opc.c b/opcodes/ppc-svp64-opc.c index 8c64d95dc39..1c9392913f7 100644 --- a/opcodes/ppc-svp64-opc.c +++ b/opcodes/ppc-svp64-opc.c @@ -42,8 +42,29 @@ svp64_extra_desc (const struct svp64_desc *desc, ppc_opindex_t opindex) {svp64_desc_cr_in2_opindex, desc->extra_idx_cr_in2}, {svp64_desc_cr_out_opindex, desc->extra_idx_cr_out}, }; + static const struct { + int origin; + int target; + } aliases[] = { + {OBF, BF}, + {PRA0, RA0}, + {PRAQ, RA}, + {RAOPT, RA}, + {RBOPT, RB}, + {RSO, RS}, + {TBR, SPR}, + }; + + for (i = 0; i < ARRAY_SIZE (aliases); ++i) + { + if (opindex == aliases[i].origin) + { + opindex = aliases[i].target; + break; + } + } - for (i = 0; i < (sizeof (table) / sizeof (table[0])); ++i) + for (i = 0; i < ARRAY_SIZE (table); ++i) { enum svp64_extra extra = table[i].extra; -- 2.30.2