|
|
01917d |
commit 8514e4db84ccafaf3be07e842be2fa2001ba876e
|
|
|
01917d |
Author: Alan Modra <amodra@gmail.com>
|
|
|
01917d |
Date: Fri Nov 28 13:21:52 2014 +1030
|
|
|
01917d |
|
|
|
01917d |
Don't deprecate powerpc mftb insn
|
|
|
01917d |
|
|
|
01917d |
mftb is marked phased out in the architecture manual, but we can keep
|
|
|
01917d |
it as an extended mnemonic for mftbl.
|
|
|
01917d |
|
|
|
01917d |
* ppc-opc.c (powerpc_opcodes <mftb>): Don't deprecate for power7.
|
|
|
01917d |
(TB): Delete.
|
|
|
01917d |
(insert_tbr, extract_tbr): Validate tbr number.
|
|
|
01917d |
|
|
|
01917d |
### a/opcodes/ChangeLog
|
|
|
01917d |
### b/opcodes/ChangeLog
|
|
|
01917d |
## -1,3 +1,9 @@
|
|
|
01917d |
+2014-11-28 Alan Modra <amodra@gmail.com>
|
|
|
01917d |
+
|
|
|
01917d |
+ * ppc-opc.c (powerpc_opcodes <mftb>): Don't deprecate for power7.
|
|
|
01917d |
+ (TB): Delete.
|
|
|
01917d |
+ (insert_tbr, extract_tbr): Validate tbr number.
|
|
|
01917d |
+
|
|
|
01917d |
2014-11-24 H.J. Lu <hongjiu.lu@intel.com>
|
|
|
01917d |
|
|
|
01917d |
* configure: Regenerated.
|
|
|
01917d |
--- a/opcodes/ppc-opc.c
|
|
|
01917d |
+++ b/opcodes/ppc-opc.c
|
|
|
01917d |
@@ -1872,28 +1872,30 @@ extract_sprg (unsigned long insn,
|
|
|
01917d |
much, since the architecture manual does not define mftb as
|
|
|
01917d |
accepting any values other than 268 or 269. */
|
|
|
01917d |
|
|
|
01917d |
-#define TB (268)
|
|
|
01917d |
-
|
|
|
01917d |
static unsigned long
|
|
|
01917d |
insert_tbr (unsigned long insn,
|
|
|
01917d |
long value,
|
|
|
01917d |
ppc_cpu_t dialect ATTRIBUTE_UNUSED,
|
|
|
01917d |
- const char **errmsg ATTRIBUTE_UNUSED)
|
|
|
01917d |
+ const char **errmsg)
|
|
|
01917d |
{
|
|
|
01917d |
if (value == 0)
|
|
|
01917d |
- value = TB;
|
|
|
01917d |
+ value = 268;
|
|
|
01917d |
+ if (value != 268 && value != 269)
|
|
|
01917d |
+ *errmsg = _("invalid tbr number");
|
|
|
01917d |
return insn | ((value & 0x1f) << 16) | ((value & 0x3e0) << 6);
|
|
|
01917d |
}
|
|
|
01917d |
|
|
|
01917d |
static long
|
|
|
01917d |
extract_tbr (unsigned long insn,
|
|
|
01917d |
ppc_cpu_t dialect ATTRIBUTE_UNUSED,
|
|
|
01917d |
- int *invalid ATTRIBUTE_UNUSED)
|
|
|
01917d |
+ int *invalid)
|
|
|
01917d |
{
|
|
|
01917d |
long ret;
|
|
|
01917d |
|
|
|
01917d |
ret = ((insn >> 16) & 0x1f) | ((insn >> 6) & 0x3e0);
|
|
|
01917d |
- if (ret == TB)
|
|
|
01917d |
+ if (ret != 268 && ret != 269)
|
|
|
01917d |
+ *invalid = 1;
|
|
|
01917d |
+ if (ret == 268)
|
|
|
01917d |
ret = 0;
|
|
|
01917d |
return ret;
|
|
|
01917d |
}
|
|
|
01917d |
@@ -5051,7 +5053,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
|
|
|
01917d |
|
|
|
01917d |
{"mftbl", XSPR(31,371,268), XSPR_MASK, PPC, NO371, {RT}},
|
|
|
01917d |
{"mftbu", XSPR(31,371,269), XSPR_MASK, PPC, NO371, {RT}},
|
|
|
01917d |
-{"mftb", X(31,371), X_MASK, PPC|PPCA2, NO371|POWER7, {RT, TBR}},
|
|
|
01917d |
+{"mftb", X(31,371), X_MASK, PPC|PPCA2, NO371, {RT, TBR}},
|
|
|
01917d |
|
|
|
01917d |
{"lwaux", X(31,373), X_MASK, PPC64|PPCVLE, PPCNONE, {RT, RAL, RB}},
|
|
|
01917d |
|