public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* powerpc parse_cpu
@ 2007-12-18  1:54 Ryan Mansfield
  2008-01-07  0:44 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Ryan Mansfield @ 2007-12-18  1:54 UTC (permalink / raw)
  To: binutils

Is it an intentional requirement that -maltivec or -mspe be specified 
after the cpu type? If one specifies -mspe or -maltivec (or equivalent 
pseudo opt) before the cpu type, the altivec/spe opcode flag will be 
overridden.

For example:

$ cat foo.s
dssall
rfid
$ ntoppc-as-2.18 -mppc64 -maltivec foo.s
$ ntoppc-as-2.18 -maltivec -mppc64 foo.s
foo.s: Assembler messages:
foo.s:1: Error: Unrecognized opcode: `dssall'

In parse_cpu:

     867   else if (strcmp (arg, "altivec") == 0)
     868     {
     869       if (ppc_cpu == 0)
     870         ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | 
PPC_OPCODE_ALTIVEC;
     871       else
     872         ppc_cpu |= PPC_OPCODE_ALTIVEC;
     873     }
...
     890   else if (strcmp (arg, "ppc64") == 0 || strcmp (arg, "620") == 0)
     891     {
     892       ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | 
PPC_OPCODE_64;
     893     }

If this is the expected behavior, is it documented anywhere?

Regards,

Ryan Mansfield

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: powerpc parse_cpu
  2007-12-18  1:54 powerpc parse_cpu Ryan Mansfield
@ 2008-01-07  0:44 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2008-01-07  0:44 UTC (permalink / raw)
  To: Ryan Mansfield; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 883 bytes --]

Hi Ryan,

> Is it an intentional requirement that -maltivec or -mspe be specified 
> after the cpu type?

No I do not believe so.  I think that it is just that this case was never checked.

I am going to check in the attached patch which fixes this behaviour and which 
adds a test to the gas testsuite to make sure that the problem does not arise 
again in the future.

Cheers
   Nick

gas/ChangeLog
2008-01-04  Nick Clifton  <nickc@redhat.com>

	* config/tc-ppc.c (parse_cpu): Preserve the settings of the
	PPC_OPCODE_ALTIVEC and PPC_OPCODE_SPE flags.

gas/testsuite/ChangeLog
2008-01-04  Nick Clifton  <nickc@redhat.com>

	* 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

[-- Attachment #2: altivec_spe.patch.bz2 --]
[-- Type: application/x-bzip2, Size: 1295 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-01-04 14:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-18  1:54 powerpc parse_cpu Ryan Mansfield
2008-01-07  0:44 ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).