summaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorPeter Bergner <bergner@vnet.ibm.com>2015-06-22 14:55:24 -0500
committerPeter Bergner <bergner@vnet.ibm.com>2015-06-22 14:55:24 -0500
commit7b9341139a693eac8d316275004b2d752b1f0cb8 (patch)
tree3d0d75ff67564cf13e7760a6b928dceb208a0cf1 /gas
parentbdc4de1b24353c4213e404029252ec75065499de (diff)
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.
Diffstat (limited to 'gas')
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/ppc/e6500.d2
-rw-r--r--gas/testsuite/gas/ppc/e6500.s6
3 files changed, 9 insertions, 4 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 22434897bb..d469d4c0b5 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-22 Peter Bergner <bergner@vnet.ibm.com>
+
+ * gas/ppc/e6500.s <sync>: Fix invalid test.
+ * gas/ppc/e6500.d: Likewise.
+
2015-06-22 Nick Clifton <nickc@redhat.com>
* gas/arm/backslash-at.s: Add extra .byte directives so that the
diff --git a/gas/testsuite/gas/ppc/e6500.d b/gas/testsuite/gas/ppc/e6500.d
index 48b0001236..c8d8f57e34 100644
--- a/gas/testsuite/gas/ppc/e6500.d
+++ b/gas/testsuite/gas/ppc/e6500.d
@@ -62,7 +62,7 @@ Disassembly of section \.text:
d0: (7c 00 04 ac|ac 04 00 7c) sync
d4: (7c 00 04 ac|ac 04 00 7c) sync
d8: (7c 20 04 ac|ac 04 20 7c) lwsync
- dc: (7c 00 04 ac|ac 04 00 7c) sync
+ dc: (7c 21 04 ac|ac 04 21 7c) sync 1,1
e0: (7c 07 04 ac|ac 04 07 7c) sync 0,7
e4: (7c 28 04 ac|ac 04 28 7c) sync 1,8
e8: (7c 00 00 c3|c3 00 00 7c) dni 0,0
diff --git a/gas/testsuite/gas/ppc/e6500.s b/gas/testsuite/gas/ppc/e6500.s
index ceee7776b3..2167cc60b6 100644
--- a/gas/testsuite/gas/ppc/e6500.s
+++ b/gas/testsuite/gas/ppc/e6500.s
@@ -56,9 +56,9 @@ start:
sync
sync 0,0
sync 1,0
- sync 2,0
- sync 3,7
- sync 3,8
+ sync 1,1
+ sync 0,7
+ sync 1,8
dni 0,0
dni 31,31
dcblq. 2,0,1