+2020-01-13 Alan Modra <amodra@gmail.com>
+
+ * xgate-dis.c (print_insn): Don't left shift signed value.
+ (ripBits): Formatting, use 1u.
+
2020-01-10 Alan Modra <amodra@gmail.com>
* tilepro-opc.c (parse_insn_tilepro): Make opval unsigned.
relAddr = XGATE_NINE_BITS >> 1; /* Clip sign bit. */
relAddr = ~relAddr; /* Make signed. */
relAddr |= (raw_code & 0xFF) + 1; /* Apply our value. */
- relAddr <<= 1; /* Multiply by two as per processor docs. */
+ relAddr *= 2; /* Multiply by two as per processor docs. */
}
else
{
relAddr = raw_code & 0xff;
- relAddr = (relAddr << 1) + 2;
+ relAddr = relAddr * 2 + 2;
}
(*info->fprintf_func)(info->stream, " *%d", relAddr);
(*info->fprintf_func)(info->stream, " Abs* 0x");
relAddr = XGATE_TEN_BITS >> 1; /* Clip sign bit. */
relAddr = ~relAddr; /* Make signed. */
relAddr |= (raw_code & 0x1FF) + 1; /* Apply our value. */
- relAddr <<= 1; /* Multiply by two as per processor docs. */
+ relAddr *= 2; /* Multiply by two as per processor docs. */
}
else
{
relAddr = raw_code & 0x1FF;
- relAddr = (relAddr << 1) + 2;
+ relAddr = relAddr * 2 + 2;
}
(*info->fprintf_func)(info->stream, " *%d", relAddr);
(*info->fprintf_func)(info->stream, " Abs* 0x");
unsigned int memory)
{
unsigned int currentBit;
- int operand;
+ unsigned int operand = 0;
int numBitsFound;
- for (operand = 0, numBitsFound = 0, currentBit = 1
- << ((opcodePTR->size * 8) - 1);
- (numBitsFound < numBitsRequested) && currentBit; currentBit >>= 1)
+ for (numBitsFound = 0, currentBit = 1u << ((opcodePTR->size * 8) - 1);
+ numBitsFound < numBitsRequested && currentBit != 0;
+ currentBit >>= 1)
{
if (currentBit & *operandBitsRemaining)
{