diff options
author | Matthew Wahab <matthew.wahab@arm.com> | 2016-01-20 14:25:46 +0000 |
---|---|---|
committer | Matthew Wahab <matthew.wahab@arm.com> | 2016-01-20 14:25:46 +0000 |
commit | 0bff6e2d6942690d81ce1f33728de07835b0f5b7 (patch) | |
tree | 15c9baf6f1575296541d02768113d0247191194c /gas | |
parent | b12e5614fbbaf658019e9c2962f013b068e5cb3c (diff) | |
download | gdb-0bff6e2d6942690d81ce1f33728de07835b0f5b7.zip gdb-0bff6e2d6942690d81ce1f33728de07835b0f5b7.tar.gz gdb-0bff6e2d6942690d81ce1f33728de07835b0f5b7.tar.bz2 |
[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
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/aarch64/armv8_2-a-illegal.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/aarch64/armv8_2-a-illegal.l | 9 | ||||
-rw-r--r-- | gas/testsuite/gas/aarch64/armv8_2-a-illegal.s | 5 |
4 files changed, 23 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 75bee53..5a85d1f 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +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. + 2016-01-20 Mickael Guene <mickael.guene@st.com> Terry Guo <terry.guo@arm.com> diff --git a/gas/testsuite/gas/aarch64/armv8_2-a-illegal.d b/gas/testsuite/gas/aarch64/armv8_2-a-illegal.d new file mode 100644 index 0000000..ce7f637 --- /dev/null +++ b/gas/testsuite/gas/aarch64/armv8_2-a-illegal.d @@ -0,0 +1,3 @@ +#as: -march=armv8.2-a +#source: armv8_2-a-illegal.s +#error-output: armv8_2-a-illegal.l diff --git a/gas/testsuite/gas/aarch64/armv8_2-a-illegal.l b/gas/testsuite/gas/aarch64/armv8_2-a-illegal.l new file mode 100644 index 0000000..f917bf7 --- /dev/null +++ b/gas/testsuite/gas/aarch64/armv8_2-a-illegal.l @@ -0,0 +1,9 @@ +[^:]+: Assembler messages: +[^:]+:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr uao,#2' +[^:]+:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr uao,#3' +[^:]+:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr uao,#4' +[^:]+:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr uao,#5' +[^:]+:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr uao,#8' +[^:]+:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr uao,#15' +[^:]+:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr uao,#19' +[^:]+:[0-9]+: Error: immediate value out of range 0 to 1 at operand 1 -- `msr uao,#31' diff --git a/gas/testsuite/gas/aarch64/armv8_2-a-illegal.s b/gas/testsuite/gas/aarch64/armv8_2-a-illegal.s new file mode 100644 index 0000000..da551ae --- /dev/null +++ b/gas/testsuite/gas/aarch64/armv8_2-a-illegal.s @@ -0,0 +1,5 @@ + + /* MSR UAO, #imm4. */ + .irp N,0, 1,2,3,4,5,8,15,19,31 + msr uao, #\N + .endr |