PPC sync instruction accepts invalid and incompatible operands
authorPeter Bergner <bergner@vnet.ibm.com>
Mon, 22 Jun 2015 19:55:24 +0000 (14:55 -0500)
committerPeter Bergner <bergner@vnet.ibm.com>
Mon, 22 Jun 2015 19:55:24 +0000 (14:55 -0500)
commit7b9341139a693eac8d316275004b2d752b1f0cb8
tree3d0d75ff67564cf13e7760a6b928dceb208a0cf1
parentbdc4de1b24353c4213e404029252ec75065499de
PPC sync instruction accepts invalid and incompatible operands

ISA 2.07 added a new category called Elemental Memory Barriers that modifies
the sync instruction to accept an additional operand ESYNC.  Edmar added
support for this insruction varient here:

    https://sourceware.org/ml/binutils/2012-02/msg00221.html

Looking at this closer, I see that the insert_ls() function is misnamed
(since it's attached to the ESYNC operand, not the LS operand) but more
importantly, it is silently modifying the LS operand value behind the
users back when the LS operand is either invalid or is incompatible with
the new ESYNC operand.  The ISA 2.07 doc has an Assembler Note that clearly
states that assemblers that support the ESYNC operand should report all
invalid uses of LS and ESYNC.  This patch changes the assembler to
error out on invalid and incompatible operand usage.

opcodes/
* ppc-opc.c (insert_ls): Test for invalid LS operands.
(insert_esync): New function.
(LS, WC): Use insert_ls.
(ESYNC): Use insert_esync.

gas/testsuite/
* gas/ppc/e6500.s <sync>: Fix invalid test.
* gas/ppc/e6500.d: Likewise.
gas/testsuite/ChangeLog
gas/testsuite/gas/ppc/e6500.d
gas/testsuite/gas/ppc/e6500.s
opcodes/ChangeLog
opcodes/ppc-opc.c
This page took 0.025829 seconds and 4 git commands to generate.