aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorFrancois H. Theron <francois.theron@netronome.com>2018-11-13 12:33:16 +0200
committerFrancois H. Theron <francois.theron@netronome.com>2018-11-13 15:33:21 +0200
commit97b3f39201efc9029a9a27d65f13674964c51503 (patch)
tree9456973ddda4674581b7a06d151b083da98a2162 /opcodes
parent497d849d28d933016ae0ad388c86b08bb16dd504 (diff)
downloadbinutils-97b3f39201efc9029a9a27d65f13674964c51503.zip
binutils-97b3f39201efc9029a9a27d65f13674964c51503.tar.gz
binutils-97b3f39201efc9029a9a27d65f13674964c51503.tar.bz2
opcodes/nfp: Fix disassembly of crc[] with swapped operands.
The decoding of the CRC operation in alu instructions was using bits from the instruction word directly, instead of srcA which would be different if the swap bit was set. Signed-off-by: Francois H. Theron <francois.theron@netronome.com>
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog4
-rw-r--r--opcodes/nfp-dis.c12
2 files changed, 10 insertions, 6 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 01eaa75..bfdca28 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,7 @@
+2018-11-13 Francois H. Theron <francois.theron@netronome.com>
+
+ * nfp-dis.c: Fix crc[] disassembly if operands are swapped.
+
2018-11-12 Sudakshina Das <sudi.das@arm.com>
* aarch64-opc.c (aarch64_sys_regs_dc): New entries for
diff --git a/opcodes/nfp-dis.c b/opcodes/nfp-dis.c
index 03139ec..38390a9 100644
--- a/opcodes/nfp-dis.c
+++ b/opcodes/nfp-dis.c
@@ -1325,8 +1325,8 @@ nfp_me27_28_print_alu (uint64_t instr, unsigned int pred_cc,
case 18:
do_close_bracket = 0;
dinfo->fprintf_func (dinfo->stream, "crc_%s[",
- _BTST (instr, 3) ? "le" : "be");
- if (!nfp_me27_28_crc_op[_BF (instr, 7, 5)])
+ _BTST (srcA, 3) ? "le" : "be");
+ if (!nfp_me27_28_crc_op[_BF (srcA, 7, 5)])
{
dinfo->fprintf_func (dinfo->stream, _(", <invalid CRC operator>, "));
err = TRUE;
@@ -1334,7 +1334,7 @@ nfp_me27_28_print_alu (uint64_t instr, unsigned int pred_cc,
else
{
dinfo->fprintf_func (dinfo->stream, "%s, ",
- nfp_me27_28_crc_op[_BF (instr, 7, 5)]);
+ nfp_me27_28_crc_op[_BF (srcA, 7, 5)]);
}
/* Dest operand. */
@@ -1351,10 +1351,10 @@ nfp_me27_28_print_alu (uint64_t instr, unsigned int pred_cc,
num_ctx, src_lmext, dinfo);
dinfo->fprintf_func (dinfo->stream, "]");
- if (_BF (instr, 2, 0))
+ if (_BF (srcA, 2, 0))
dinfo->fprintf_func (dinfo->stream, ", %s",
- nfp_me27_28_crc_bytes[_BF (instr, 2, 0)]);
- if (_BTST (instr, 4))
+ nfp_me27_28_crc_bytes[_BF (srcA, 2, 0)]);
+ if (_BTST (srcA, 4))
dinfo->fprintf_func (dinfo->stream, ", bit_swap");
break;