This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, RFC] Allow for optional operands with non-zero default values

On Thu, Jun 18, 2015 at 09:40:18PM -0500, Peter Bergner wrote:
> ISA 2.07 (ie, POWER8) added the rfebb instruction which takes one operand
> with the value of either a 0 or 1.  It also defines an extended mnemonic
> with no operands (ie, "rfebb") that is supposed to be equivalent to "rfebb 1".
> I implemented rfebb's lone operand with PPC_OPERAND_OPTIONAL, but the
> problem is, optional operands that are ommitted always default to the
> value 0, which is wrong in this case.  I have added support for allowing
> non-zero default values by adding an additional flag PPC_OPERAND_OPTIONAL_VALUE
> that specifies that the default operand value to be used is stored in the
> SHIFT field of the operand field immediately following this one.
> This fixes the rfebb issue.  I also fixed the mftb and mfcr instructions
> so they use the same mechanism.  This allows us to flag invalid uses of
> mfcr where we explicitly pass in a zero FXM value, like the use in a2.[sd].
> Alan, what do you think of this solution?

Looks good to me.  I wonder how many uses of mfcr r,0 this finds?  :)

Alan Modra
Australia Development Lab, IBM

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]