aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-11-28 13:21:52 +1030
committerAlan Modra <amodra@gmail.com>2014-11-30 13:47:55 +1030
commit51a0e41ca956e6bdf072aea6a7e15c4e7269c2d0 (patch)
treeb0ee45b8ac16c9c574f55602492b0c7bedf2f90b /opcodes
parentbdaf8f8eb88bfbd434a016bbdc9869d7d5d29a82 (diff)
downloadgdb-51a0e41ca956e6bdf072aea6a7e15c4e7269c2d0.zip
gdb-51a0e41ca956e6bdf072aea6a7e15c4e7269c2d0.tar.gz
gdb-51a0e41ca956e6bdf072aea6a7e15c4e7269c2d0.tar.bz2
Don't deprecate powerpc mftb insn
mftb is marked phased out in the architecture manual, but we can keep it as an extended mnemonic for mftbl. * ppc-opc.c (powerpc_opcodes <mftb>): Don't deprecate for power7. (TB): Delete. (insert_tbr, extract_tbr): Validate tbr number.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog6
-rw-r--r--opcodes/ppc-opc.c16
2 files changed, 15 insertions, 7 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index d4a7408..9f03529 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,9 @@
+2014-11-28 Alan Modra <amodra@gmail.com>
+
+ * ppc-opc.c (powerpc_opcodes <mftb>): Don't deprecate for power7.
+ (TB): Delete.
+ (insert_tbr, extract_tbr): Validate tbr number.
+
2014-11-17 Ilya Tocar <ilya.tocar@intel.com>
* i386-dis-evex.c (evex_table): Add vpermi2b, vpermt2b, vpermb,
diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c
index bcc0ca0..4427465 100644
--- a/opcodes/ppc-opc.c
+++ b/opcodes/ppc-opc.c
@@ -1872,28 +1872,30 @@ extract_sprg (unsigned long insn,
much, since the architecture manual does not define mftb as
accepting any values other than 268 or 269. */
-#define TB (268)
-
static unsigned long
insert_tbr (unsigned long insn,
long value,
ppc_cpu_t dialect ATTRIBUTE_UNUSED,
- const char **errmsg ATTRIBUTE_UNUSED)
+ const char **errmsg)
{
if (value == 0)
- value = TB;
+ value = 268;
+ if (value != 268 && value != 269)
+ *errmsg = _("invalid tbr number");
return insn | ((value & 0x1f) << 16) | ((value & 0x3e0) << 6);
}
static long
extract_tbr (unsigned long insn,
ppc_cpu_t dialect ATTRIBUTE_UNUSED,
- int *invalid ATTRIBUTE_UNUSED)
+ int *invalid)
{
long ret;
ret = ((insn >> 16) & 0x1f) | ((insn >> 6) & 0x3e0);
- if (ret == TB)
+ if (ret != 268 && ret != 269)
+ *invalid = 1;
+ if (ret == 268)
ret = 0;
return ret;
}
@@ -5051,7 +5053,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{"mftbl", XSPR(31,371,268), XSPR_MASK, PPC, NO371, {RT}},
{"mftbu", XSPR(31,371,269), XSPR_MASK, PPC, NO371, {RT}},
-{"mftb", X(31,371), X_MASK, PPC|PPCA2, NO371|POWER7, {RT, TBR}},
+{"mftb", X(31,371), X_MASK, PPC|PPCA2, NO371, {RT, TBR}},
{"lwaux", X(31,373), X_MASK, PPC64|PPCVLE, PPCNONE, {RT, RAL, RB}},