This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH, RFC] Allow for optional operands with non-zero default values
- From: Alan Modra <amodra at gmail dot com>
- To: Peter Bergner <bergner at vnet dot ibm dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Fri, 19 Jun 2015 15:13:08 +0930
- Subject: Re: [PATCH, RFC] Allow for optional operands with non-zero default values
- Authentication-results: sourceware.org; auth=none
- References: <1434681618 dot 5306 dot 7 dot camel at otta>
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