From: Matthew Wahab Date: Thu, 14 Jan 2016 10:55:11 +0000 (+0000) Subject: [AArch64] Fix missing architecture checks for ARMv8.2 system registers. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=651657fa61aa0a2946d56063295a7ce8d73f803b;p=binutils-gdb.git [AArch64] Fix missing architecture checks for ARMv8.2 system registers. Some of the RAS system registers added to binutils as part of the ARMv8.2 support are missing the feature checks to warn when they aren't supported by the target. This patch adds the missing feature checks with a test to check that the correct warnings are given for all the ARMv8.2 system registers. gas/ 2016-01-14 Matthew Wahab * testsuite/gas/aarch64/illegal-sysreg-2.l: New. * testsuite/gas/aarch64/illegal-sysreg-2.d: New. opcodes/ 2016-01-14 Matthew Wahab * aarch64-opc.c (aarch64_sys_reg_supported_p): Merge conditionals testing for RAS support. Add checks for erxfr_el1, erxctlr_el1, erxtatus_el1 and erxaddr_el1. Change-Id: I66b590ea49c1eb6b0e5c93e0dc2bc9c4e79a52fe --- diff --git a/gas/ChangeLog b/gas/ChangeLog index a86a0717677..97f3a03c85f 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2016-01-14 Matthew Wahab + + * testsuite/gas/aarch64/illegal-sysreg-2.l: New. + * testsuite/gas/aarch64/illegal-sysreg-2.d: New. + 2016-01-13 Maciej W. Rozycki * config/tc-nios2.c (output_movia): Preset `code' to 0. diff --git a/gas/testsuite/gas/aarch64/illegal-sysreg-2.d b/gas/testsuite/gas/aarch64/illegal-sysreg-2.d new file mode 100644 index 00000000000..5306efbb93d --- /dev/null +++ b/gas/testsuite/gas/aarch64/illegal-sysreg-2.d @@ -0,0 +1,3 @@ +#as: -march=armv8-a +#source: sysreg-2.s +#error-output: illegal-sysreg-2.l diff --git a/gas/testsuite/gas/aarch64/illegal-sysreg-2.l b/gas/testsuite/gas/aarch64/illegal-sysreg-2.l new file mode 100644 index 00000000000..f05961120bd --- /dev/null +++ b/gas/testsuite/gas/aarch64/illegal-sysreg-2.l @@ -0,0 +1,49 @@ +[^:]*: Assembler messages: +[^:]*:[0-9]+: Error: selected processor does not support system register name 'id_aa64mmfr2_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'erridr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'errselr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'errselr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxfr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxctlr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxctlr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxstatus_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxstatus_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxaddr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxaddr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxmisc0_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxmisc0_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxmisc1_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxmisc1_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'vsesr_el2' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'disr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'disr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'vdisr_el2' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'cvap' +[^:]*:[0-9]+: Error: selected processor does not support system register name 's1e1rp' +[^:]*:[0-9]+: Error: selected processor does not support system register name 's1e1wp' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmblimitr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmblimitr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmbptr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmbptr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmbsr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmbsr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmbidr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmbidr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmscr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmscr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmsicr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmsicr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmsirr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmsirr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmsfcr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmsfcr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmsevfr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmsevfr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmslatfr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmslatfr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmscr_el2' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmscr_el2' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmscr_el12' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmscr_el12' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmbidr_el1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmsidr_el1' diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 333bac5a64c..37e9a6e0035 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2016-01-14 Matthew Wahab + + * aarch64-opc.c (aarch64_sys_reg_supported_p): Merge conditionals + testing for RAS support. Add checks for erxfr_el1, erxctlr_el1, + erxtatus_el1 and erxaddr_el1. + 2016-01-12 Matthew Wahab * arm-dis.c (arm_opcodes): Add "esb". diff --git a/opcodes/aarch64-opc.c b/opcodes/aarch64-opc.c index 83c4dbbdc70..1cd5c1b55df 100644 --- a/opcodes/aarch64-opc.c +++ b/opcodes/aarch64-opc.c @@ -3222,18 +3222,16 @@ aarch64_sys_reg_supported_p (const aarch64_feature_set features, /* RAS extension. */ - /* ERRIDR_EL1 and ERRSELR_EL1. */ + /* ERRIDR_EL1, ERRSELR_EL1, ERXFR_EL1, ERXCTLR_EL1, ERXSTATUS_EL, ERXADDR_EL1, + ERXMISC0_EL1 AND ERXMISC1_EL1. */ if ((reg->value == CPENC (3, 0, C5, C3, 0) - || reg->value == CPENC (3, 0, C5, C3, 1)) - && !AARCH64_CPU_HAS_FEATURE (features, AARCH64_FEATURE_RAS)) - return FALSE; - - /* ERXFR_EL1, ERXCTLR_EL1, ERXSTATUS_EL, ERXADDR_EL1, ERXMISC0_EL1 AND - ERXMISC1_EL1. */ - if ((reg->value == CPENC (3, 0, C5, C3, 0) - || reg->value == CPENC (3, 0, C5, C3 ,1) + || reg->value == CPENC (3, 0, C5, C3, 1) || reg->value == CPENC (3, 0, C5, C3, 2) || reg->value == CPENC (3, 0, C5, C3, 3) + || reg->value == CPENC (3, 0, C5, C4, 0) + || reg->value == CPENC (3, 0, C5, C4, 1) + || reg->value == CPENC (3, 0, C5, C4, 2) + || reg->value == CPENC (3, 0, C5, C4, 3) || reg->value == CPENC (3, 0, C5, C5, 0) || reg->value == CPENC (3, 0, C5, C5, 1)) && !AARCH64_CPU_HAS_FEATURE (features, AARCH64_FEATURE_RAS))