[AArch64] Reject invalid immediate operands to MSR UAO
authorMatthew Wahab <matthew.wahab@arm.com>
Wed, 20 Jan 2016 14:25:46 +0000 (14:25 +0000)
committerMatthew Wahab <matthew.wahab@arm.com>
Wed, 20 Jan 2016 14:25:46 +0000 (14:25 +0000)
commit0bff6e2d6942690d81ce1f33728de07835b0f5b7
tree15c9baf6f1575296541d02768113d0247191194c
parentb12e5614fbbaf658019e9c2962f013b068e5cb3c
[AArch64] Reject invalid immediate operands to MSR UAO

In the instruction to write to the ARMv8.2 PSTATE field UAO,
MSR UAO, #<imm>, the immediate should be either 0 or 1 but GAS accepts
any unsigned 4-bit integer.

This patch implements the constraint on the immediate, generating an
error if the immediate operand is invalid, and adds tests for the
illegal forms.

opcodes/
2016-01-20  Matthew Wahab  <matthew.wahab@arm.com>

* aarch64-opc.c (operand_general_constraint_met_p): Check validity
of MSR UAO immediate operand.

gas/
2016-01-20  Matthew Wahab  <matthew.wahab@arm.com>

* testsuite/gas/aarch64/armv8_2-a-illegal.d: New.
* testsuite/gas/aarch64/armv8_2-a-illegal.l: New.
* testsuite/gas/aarch64/armv8_2-a-illegal.s: New.

Change-Id: Ibdec4967c00b1ef3be9dbc43d23b2c70d1a0b28c
gas/ChangeLog
gas/testsuite/gas/aarch64/armv8_2-a-illegal.d [new file with mode: 0644]
gas/testsuite/gas/aarch64/armv8_2-a-illegal.l [new file with mode: 0644]
gas/testsuite/gas/aarch64/armv8_2-a-illegal.s [new file with mode: 0644]
opcodes/ChangeLog
opcodes/aarch64-opc.c