aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-ppc.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2008-01-04 14:53:50 +0000
committerNick Clifton <nickc@redhat.com>2008-01-04 14:53:50 +0000
commitb0e34bfe9355cb32fb19d0f05fb18925f5bfdc0a (patch)
tree58e70ce8417e8d71ba44ccfa19b75a6d44cd5dbd /gas/config/tc-ppc.c
parentec4d452564d7d4cc88bd03cf3f2bbf666dff233d (diff)
downloadgdb-b0e34bfe9355cb32fb19d0f05fb18925f5bfdc0a.zip
gdb-b0e34bfe9355cb32fb19d0f05fb18925f5bfdc0a.tar.gz
gdb-b0e34bfe9355cb32fb19d0f05fb18925f5bfdc0a.tar.bz2
* config/tc-ppc.c (parse_cpu): Preserve the settings of the
PPC_OPCODE_ALTIVEC and PPC_OPCODE_SPE flags. * gas/ppc/altivec_and_spe.s: New test - checks that ISA extension command line options (-maltivec, -mspe) can be specified before CPU selection command line options. * gas/ppc/altivec_and_spe.d: Expected disassembly. * gas/ppc/ppc.exp: Run the new test
Diffstat (limited to 'gas/config/tc-ppc.c')
-rw-r--r--gas/config/tc-ppc.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 4ded149..8b3b2ee 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -825,6 +825,8 @@ const size_t md_longopts_size = sizeof (md_longopts);
static int
parse_cpu (const char *arg)
{
+ unsigned long altivec_or_spe = ppc_cpu & (PPC_OPCODE_ALTIVEC | PPC_OPCODE_SPE);
+
/* -mpwrx and -mpwr2 mean to assemble for the IBM POWER/2
(RIOS2). */
if (strcmp (arg, "pwrx") == 0 || strcmp (arg, "pwr2") == 0)
@@ -867,9 +869,9 @@ parse_cpu (const char *arg)
else if (strcmp (arg, "altivec") == 0)
{
if (ppc_cpu == 0)
- ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_ALTIVEC;
- else
- ppc_cpu |= PPC_OPCODE_ALTIVEC;
+ ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC;
+
+ altivec_or_spe |= PPC_OPCODE_ALTIVEC;
}
else if (strcmp (arg, "e500") == 0 || strcmp (arg, "e500x2") == 0)
{
@@ -881,9 +883,9 @@ parse_cpu (const char *arg)
else if (strcmp (arg, "spe") == 0)
{
if (ppc_cpu == 0)
- ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_SPE | PPC_OPCODE_EFS;
- else
- ppc_cpu |= PPC_OPCODE_SPE;
+ ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_EFS;
+
+ altivec_or_spe |= PPC_OPCODE_SPE;
}
/* -mppc64 and -m620 mean to assemble for the 64-bit PowerPC
620. */
@@ -941,6 +943,8 @@ parse_cpu (const char *arg)
else
return 0;
+ /* Make sure the the Altivec and SPE bits are not lost. */
+ ppc_cpu |= altivec_or_spe;
return 1;
}