* tilepro-opc.c (parse_insn_tilepro): Make opval unsigned.
* tilegx-opc.c (parse_insn_tilegx): Likewise. Delete raw_opval.
+2020-01-10 Alan Modra <amodra@gmail.com>
+
+ * tilepro-opc.c (parse_insn_tilepro): Make opval unsigned.
+ * tilegx-opc.c (parse_insn_tilegx): Likewise. Delete raw_opval.
+
2020-01-10 Alan Modra <amodra@gmail.com>
* m10300-dis.c (disassemble): Move extraction of DREG, AREG, RREG,
{
const struct tilegx_operand *op =
&tilegx_operands[opc->operands[pipe][i]];
- int raw_opval = op->extract (bits);
- long long opval;
+ unsigned int opval = op->extract (bits);
if (op->is_signed)
{
/* Sign-extend the operand. */
unsigned int sign = 1u << (op->num_bits - 1);
- raw_opval = ((raw_opval & (sign + sign - 1)) ^ sign) - sign;
+ opval = ((opval & (sign + sign - 1)) ^ sign) - sign;
}
/* Adjust PC-relative scaled branch offsets. */
if (op->type == TILEGX_OP_TYPE_ADDRESS)
- opval = (raw_opval * TILEGX_BUNDLE_SIZE_IN_BYTES) + pc;
- else
- opval = raw_opval;
+ opval = opval * TILEGX_BUNDLE_SIZE_IN_BYTES + pc;
/* Record the final value. */
d->operands[i] = op;
{
const struct tilepro_operand *op =
&tilepro_operands[opc->operands[pipe][i]];
- int opval = op->extract (bits);
+ unsigned int opval = op->extract (bits);
if (op->is_signed)
{
/* Adjust PC-relative scaled branch offsets. */
if (op->type == TILEPRO_OP_TYPE_ADDRESS)
- {
- opval *= TILEPRO_BUNDLE_SIZE_IN_BYTES;
- opval += (int)pc;
- }
+ opval = opval * TILEPRO_BUNDLE_SIZE_IN_BYTES + pc;
/* Record the final value. */
d->operands[i] = op;