+2020-01-13 Alan Modra <amodra@gmail.com>
+
+ * config/tc-tic4x.c (tic4x_operands_match): Correct tic3x trap
+ insertion.
+
2020-01-10 Alan Modra <amodra@gmail.com>
* testsuite/gas/elf/pr14891.s: Don't start directives in first column.
}
else if (exp->X_add_number < 32 && IS_CPU_TIC3X (tic4x_cpu))
{
- INSERTU (opcode, exp->X_add_number | 0x20, 4, 0);
+ INSERTU (opcode, exp->X_add_number | 0x20, 5, 0);
continue;
}
else
+2020-01-13 Alan Modra <amodra@gmail.com>
+
+ * opcode/tic4x.h (EXTR): Delete.
+ (EXTRU, EXTRS, INSERTU, INSERTS): Rewrite without zero/sign
+ extension using shifts. Do trim INSERTU value to specified bitfield.
+
2020-01-10 Alan Modra <amodra@gmail.com>
* opcode/spu.h: Formatting.
#define IS_CPU_TIC4X(v) ((v) == 0 || (v) == 40 || (v) == 44)
/* Define some bitfield extraction/insertion macros. */
-#define EXTR(inst, m, l) ((inst) << (31 - (m)) >> (31 - ((m) - (l))))
-#define EXTRU(inst, m, l) EXTR ((unsigned long)(inst), (m), (l))
-#define EXTRS(inst, m, l) EXTR ((long)(inst), (m), (l))
-#define INSERTU(inst, val, m, l) (inst |= ((val) << (l)))
-#define INSERTS(inst, val, m, l) INSERTU (inst, ((val) & ((1 << ((m) - (l) + 1)) - 1)), m, l)
+#define EXTRU(inst, m, l) \
+ (((inst) >> (l)) & ((2u << ((m) - (l))) - 1))
+#define EXTRS(inst, m, l) \
+ ((int) ((EXTRU (inst, m, l) ^ (1u << ((m) - (l)))) - (1u << ((m) - (l)))))
+#define INSERTU(inst, val, m, l) \
+ ((inst) |= ((val) & ((2u << ((m) - (l))) - 1)) << (l))
+#define INSERTS INSERTU
/* Define register numbers. */
typedef enum
= (tic4x_register_t *)(tic4x_registers + i);
}
}
- if (regno > (IS_CPU_TIC4X (tic4x_version) ? TIC4X_REG_MAX : TIC3X_REG_MAX)
- || registertable[regno] == NULL)
+ if (regno > (IS_CPU_TIC4X (tic4x_version) ? TIC4X_REG_MAX : TIC3X_REG_MAX))
return 0;
if (info != NULL)
(*info->fprintf_func) (info->stream, "%s", registertable[regno]->name);