From ef5a96d564a22a25d31533c7377eede42c12b25c Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 3 Jul 2015 10:56:26 +0930 Subject: [PATCH] Remove ppc860, ppc750cl, ppc7450 insns from common ppc. Back in the day support for these processors was added, we probably didn't want to waste PPC_OPCODE bits on minor variations. I've had a complaint that disassembly of mfspr/mtspr was wrong for power8. This patch fixes that problem. Note that since -m860/-m850/-m821 are new gas options enabling the mpc8xx specific mfspr/mtspr variants it is possible that this change will break some mpc8xx assembly code. ie. you might need to modify makefiles to pass -m860 to gas. include/opcode/ * ppc.h (PPC_OPCODE_750, PPC_OPCODE_7450, PPC_OPCODE_860): Define. opcodes/ * ppc-opc.c (PPC750, PPC7450, PPC860): Define using PPC_OPCODE_*. * ppc-dis.c (ppc_opts): Add 821, 850 and 860 entries. Add PPC_OPCODE_7450 to 7450 entry. Add PPC_OPCODE_750 to 750cl entry. gas/ * config/tc-ppc.c (md_show_usage): Add -m821, -m850, -m860. * doc/c-ppc.texi (PowerPC-Opts): Likewise. gas/testsuite/ * gas/ppc/titan.d: Correct mfmcsrr0 disassembly. --- gas/ChangeLog | 5 +++++ gas/config/tc-ppc.c | 3 ++- gas/doc/c-ppc.texi | 3 +++ gas/testsuite/ChangeLog | 4 ++++ gas/testsuite/gas/ppc/titan.d | 4 ++-- include/opcode/ChangeLog | 4 ++++ include/opcode/ppc.h | 9 +++++++++ opcodes/ChangeLog | 6 ++++++ opcodes/ppc-dis.c | 10 ++++++++-- opcodes/ppc-opc.c | 6 +++--- 10 files changed, 46 insertions(+), 8 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index b18637fdbe7..f9d4892f948 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2015-07-03 Alan Modra + + * config/tc-ppc.c (md_show_usage): Add -m821, -m850, -m860. + * doc/c-ppc.texi (PowerPC-Opts): Likewise. + 2015-07-01 Sandra Loosemore Cesar Philippidis diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 18a11bedbbd..ce3257f8aaf 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -1281,7 +1281,8 @@ PowerPC options:\n\ -m476 generate code for PowerPC 476\n\ -m7400, -m7410, -m7450, -m7455\n\ generate code for PowerPC 7400/7410/7450/7455\n\ --m750cl generate code for PowerPC 750cl\n")); +-m750cl generate code for PowerPC 750cl\n\ +-m821, -m850, -m860 generate code for PowerPC 821/850/860\n")); fprintf (stream, _("\ -mppc64, -m620 generate code for PowerPC 620/625/630\n\ -mppc64bridge generate code for PowerPC 64, including bridge insns\n\ diff --git a/gas/doc/c-ppc.texi b/gas/doc/c-ppc.texi index 8e4fce33ca8..d318c96352f 100644 --- a/gas/doc/c-ppc.texi +++ b/gas/doc/c-ppc.texi @@ -75,6 +75,9 @@ Generate code for PowerPC 7400/7410/7450/7455. @item -m750cl Generate code for PowerPC 750CL. +@item -m821, -m850, -m860 +Generate code for PowerPC 821/850/860. + @item -mppc64, -m620 Generate code for PowerPC 620/625/630. diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 210a0d1b59a..a045c852065 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-07-03 Alan Modra + + * gas/ppc/titan.d: Correct mfmcsrr0 disassembly. + 2015-07-01 Sandra Loosemore Cesar Philippidis diff --git a/gas/testsuite/gas/ppc/titan.d b/gas/testsuite/gas/ppc/titan.d index 45c41bb7f39..e54715a7488 100644 --- a/gas/testsuite/gas/ppc/titan.d +++ b/gas/testsuite/gas/ppc/titan.d @@ -229,8 +229,8 @@ Disassembly of section \.text: 36c: (7c 9f 62 a6|a6 62 9f 7c) mfivor15 r4 370: (7c 93 82 a6|a6 82 93 7c) mfivor35 r4 374: (7c 93 82 a6|a6 82 93 7c) mfivor35 r4 - 378: (7c 9a 8a a6|a6 8a 9a 7c) mfdc_dat r4 - 37c: (7c 9a 8a a6|a6 8a 9a 7c) mfdc_dat r4 + 378: (7c 9a 8a a6|a6 8a 9a 7c) mfmcsrr0 r4 + 37c: (7c 9a 8a a6|a6 8a 9a 7c) mfmcsrr0 r4 380: (7c 9b 8a a6|a6 8a 9b 7c) mfmcsrr1 r4 384: (7c 9b 8a a6|a6 8a 9b 7c) mfmcsrr1 r4 388: (7c 9c 8a a6|a6 8a 9c 7c) mfmcsr r4 diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog index def21317806..2f86116691e 100644 --- a/include/opcode/ChangeLog +++ b/include/opcode/ChangeLog @@ -1,3 +1,7 @@ +2015-07-03 Alan Modra + + * ppc.h (PPC_OPCODE_750, PPC_OPCODE_7450, PPC_OPCODE_860): Define. + 2015-07-01 Sandra Loosemore Cesar Philippidis diff --git a/include/opcode/ppc.h b/include/opcode/ppc.h index 52463653250..6106dec4267 100644 --- a/include/opcode/ppc.h +++ b/include/opcode/ppc.h @@ -195,6 +195,15 @@ extern const int vle_num_opcodes; that isn't a superset of POWER8, we can define this to its own mask. */ #define PPC_OPCODE_HTM PPC_OPCODE_POWER8 +/* Opcode is supported by ppc750cl. */ +#define PPC_OPCODE_750 0x4000000000ull + +/* Opcode is supported by ppc7450. */ +#define PPC_OPCODE_7450 0x8000000000ull + +/* Opcode is supported by ppc821/850/860. */ +#define PPC_OPCODE_860 0x10000000000ull + /* A macro to extract the major opcode from an instruction. */ #define PPC_OP(i) (((i) >> 26) & 0x3f) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index a3fbc43a2fc..cf446b458c3 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2015-07-03 Alan Modra + + * ppc-opc.c (PPC750, PPC7450, PPC860): Define using PPC_OPCODE_*. + * ppc-dis.c (ppc_opts): Add 821, 850 and 860 entries. Add + PPC_OPCODE_7450 to 7450 entry. Add PPC_OPCODE_750 to 750cl entry. + 2015-07-01 Sandra Loosemore Cesar Philippidis diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c index 581d342cefb..797e1e31ca9 100644 --- a/opcodes/ppc-dis.c +++ b/opcodes/ppc-dis.c @@ -76,12 +76,18 @@ struct ppc_mopt ppc_opts[] = { 0 }, { "7410", (PPC_OPCODE_PPC | PPC_OPCODE_ALTIVEC), 0 }, - { "7450", (PPC_OPCODE_PPC | PPC_OPCODE_ALTIVEC), + { "7450", (PPC_OPCODE_PPC | PPC_OPCODE_7450 | PPC_OPCODE_ALTIVEC), 0 }, { "7455", (PPC_OPCODE_PPC | PPC_OPCODE_ALTIVEC), 0 }, - { "750cl", (PPC_OPCODE_PPC | PPC_OPCODE_PPCPS) + { "750cl", (PPC_OPCODE_PPC | PPC_OPCODE_750 | PPC_OPCODE_PPCPS) , 0 }, + { "821", (PPC_OPCODE_PPC | PPC_OPCODE_860), + 0 }, + { "850", (PPC_OPCODE_PPC | PPC_OPCODE_860), + 0 }, + { "860", (PPC_OPCODE_PPC | PPC_OPCODE_860), + 0 }, { "a2", (PPC_OPCODE_PPC | PPC_OPCODE_ISEL | PPC_OPCODE_POWER4 | PPC_OPCODE_POWER5 | PPC_OPCODE_CACHELCK | PPC_OPCODE_64 | PPC_OPCODE_A2), diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c index 601ec2f7c42..a4aef913490 100644 --- a/opcodes/ppc-opc.c +++ b/opcodes/ppc-opc.c @@ -2747,9 +2747,9 @@ extract_vleil (unsigned long insn, #define PPC440 PPC_OPCODE_440 #define PPC464 PPC440 #define PPC476 PPC_OPCODE_476 -#define PPC750 PPC -#define PPC7450 PPC -#define PPC860 PPC +#define PPC750 PPC_OPCODE_750 +#define PPC7450 PPC_OPCODE_7450 +#define PPC860 PPC_OPCODE_860 #define PPCPS PPC_OPCODE_PPCPS #define PPCVEC PPC_OPCODE_ALTIVEC #define PPCVEC2 PPC_OPCODE_ALTIVEC2