aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-ppc.c
diff options
context:
space:
mode:
authorPeter Bergner <bergner@vnet.ibm.com>2009-04-01 01:41:07 +0000
committerPeter Bergner <bergner@vnet.ibm.com>2009-04-01 01:41:07 +0000
commit42240548bff3ab683ff48c8eb0de53d1a9068aa4 (patch)
tree6f27e47a29a67fb709f7ccc438e7eef408305699 /gas/config/tc-ppc.c
parent1aa34cc52cb0b371e8663b77100bb7a26627c41c (diff)
downloadgdb-42240548bff3ab683ff48c8eb0de53d1a9068aa4.zip
gdb-42240548bff3ab683ff48c8eb0de53d1a9068aa4.tar.gz
gdb-42240548bff3ab683ff48c8eb0de53d1a9068aa4.tar.bz2
gas/
* config/tc-ppc.c (ppc_handle_align): Handle power7's group ending nop. gas/testsuite/ * gas/ppc/power7.d ("ori", ".p2align"): Add tests for group ending nop. * gas/ppc/power7.s: Likewise. * gas/ppc/power6.d: Likewise. * gas/ppc/power6.s: Likewise.
Diffstat (limited to 'gas/config/tc-ppc.c')
-rw-r--r--gas/config/tc-ppc.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 537b676..0b0edbd 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -5687,13 +5687,14 @@ ppc_handle_align (struct frag *fragP)
fragP->fr_var = 4;
md_number_to_chars (dest, 0x60000000, 4);
- if ((ppc_cpu & PPC_OPCODE_POWER6) != 0)
+ if ((ppc_cpu & PPC_OPCODE_POWER6) != 0
+ || (ppc_cpu & PPC_OPCODE_POWER7) != 0)
{
- /* For power6, we want the last nop to be a group terminating
- one, "ori 1,1,0". Do this by inserting an rs_fill frag
- immediately after this one, with its address set to the last
- nop location. This will automatically reduce the number of
- nops in the current frag by one. */
+ /* For power6 and power7, we want the last nop to be a group
+ terminating one. Do this by inserting an rs_fill frag immediately
+ after this one, with its address set to the last nop location.
+ This will automatically reduce the number of nops in the current
+ frag by one. */
if (count > 4)
{
struct frag *group_nop = xmalloc (SIZEOF_STRUCT_FRAG + 4);
@@ -5707,7 +5708,12 @@ ppc_handle_align (struct frag *fragP)
dest = group_nop->fr_literal;
}
- md_number_to_chars (dest, 0x60210000, 4);
+ if ((ppc_cpu & PPC_OPCODE_POWER7) != 0)
+ /* power7 group terminating nop: "ori 2,2,0". */
+ md_number_to_chars (dest, 0x60420000, 4);
+ else
+ /* power6 group terminating nop: "ori 1,1,0". */
+ md_number_to_chars (dest, 0x60210000, 4);
}
}
}