public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: David Daney <ddaney@caviumnetworks.com>
To: "Maciej W. Rozycki" <macro@codesourcery.com>
Cc: Richard Sandiford <rdsandiford@googlemail.com>,
	 binutils@sourceware.org,  "Pinski,
	Andrew" <Andrew.Pinski@caviumnetworks.com>
Subject: Re: [PATCH] MIPS: Opcode membership proposal
Date: Mon, 20 Dec 2010 18:15:00 -0000	[thread overview]
Message-ID: <4D0F9522.5040404@caviumnetworks.com> (raw)
In-Reply-To: <alpine.DEB.1.10.1012181108290.4142@tp.orcam.me.uk>

On 12/18/2010 03:42 AM, Maciej W. Rozycki wrote:
> Hi,
>
>   While working on the microMIPS change I have stumbled across the GAS hack
> to support ISA subsetting for the Octeon processors, used to exclude some
> of the CP0 operations.  I decided to implement this properly, based on my
> previous experiments in this area.
>
>   Here's my proposal.  It adds an "exclusions" field to the mips_opcode
> structure.  The new field defines a set of CPU membership flags to exclude
> an opcode for just like they are used with the "membership" field,
> overriding the membership information in the latter field.  Currently only
> CPU_OCTEON has been made to work like this and flags may be added in the
> future as a need arises.  An ISA flag could be handled in a similar way,
> although one is unlikely to be ever needed here.
>
>   The advantage of this approach compared to the current one is not only
> GAS correctly excludes the unsupported opcodes, but `objdump' does as
> well.  And it scales easily, requiring no changes outside opcodes.
> Finally, it makes it clear which opcodes are really unsupported on Octeon
> -- with the current approach it is a bit buried down within code.
>
>   As I've thought adding a trailing zero to initialise the new field
> explicitly throughout the opcode tables would be unnecessary obfuscation
> I've decided to initialise it to a non-zero value for opcodes that require
> it only and allow the source files defining the MIPS opcode tables to have
> uninitialised structure members with the -Wno-missing-field-initializers
> GCC option.  I think it is a good compromise -- these tables are validated
> at run time too and the files contain no other code.
>
>   I have decided to retain the CP pinfo flag defined with the change that
> introduced the current Octeon opcode exclusion code.  The flag is not used
> anymore, but the effort previously taken to annotate the relevant opcodes
> may be useful for something else in the future.
>
>   No regressions for mips-sde-elf nor mips-linux-gnu.  Applies on top of
> the microMIPS change.
>

For the record, this seems like a sane approach.  I have not gone 
through the patch with a fine toothed comb, but it seems like an 
improvement over the current approach.

Andrew Pinski may want to take a look, but from my point of view, if 
Richard likes it, I think it should be committed.

Thanks,
David Daney

  reply	other threads:[~2010-12-20 17:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-18 12:55 Maciej W. Rozycki
2010-12-20 18:15 ` David Daney [this message]
2010-12-20 18:33   ` Andrew Pinski
2011-10-31 12:47 ` Maciej W. Rozycki
2011-11-17 18:45   ` Richard Sandiford
2012-08-10 11:08     ` Maciej W. Rozycki
2012-08-12 18:33       ` Richard Sandiford
2012-08-13 14:56         ` Maciej W. Rozycki
2013-06-17 11:51       ` Alan Modra
2013-06-17 15:18         ` Maciej W. Rozycki
2013-06-17 19:53           ` Richard Sandiford
2013-06-17 22:30             ` Maciej W. Rozycki
2013-06-18  0:27           ` Alan Modra
2013-06-24 14:28             ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D0F9522.5040404@caviumnetworks.com \
    --to=ddaney@caviumnetworks.com \
    --cc=Andrew.Pinski@caviumnetworks.com \
    --cc=binutils@sourceware.org \
    --cc=macro@codesourcery.com \
    --cc=rdsandiford@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).