Blame SOURCES/binutils-aa64-full-sysreg-range.patch

881b8e
From d7dbef3c3149dfd404f5dc68f9337e1f9b5d3e8c Mon Sep 17 00:00:00 2001
881b8e
From: Mark Salter <msalter@redhat.com>
881b8e
Date: Sat, 14 Jun 2014 00:34:58 -0400
881b8e
Subject: [PATCH] gas: Backport support for full range of aarch64 sysregs
881b8e
881b8e
gas/
881b8e
881b8e
	Backport from mainline:
881b8e
881b8e
	2013-02-27 Yufeng Zhang <yufeng.zhang@arm.com>
881b8e
	* config/tc-aarch64.c (parse_sys_reg): Allow the full range of CRn
881b8e
	for system registers.
881b8e
881b8e
gas/testsuite/
881b8e
881b8e
	Backport from mainline:
881b8e
881b8e
	2013-02-27 Yufeng Zhang <yufeng.zhang@arm.com>
881b8e
	* gas/aarch64/illegal.l: Delete the error message for
881b8e
	msr S3_1_C13_C15_1,x7.
881b8e
	* gas/aarch64/sysreg.s: Add new tests.
881b8e
	* gas/aarch64/sysreg.d: Update.
881b8e
---
881b8e
 gas/ChangeLog                       |  8 ++++++++
881b8e
 gas/config/tc-aarch64.c             | 10 +++++++---
881b8e
 gas/testsuite/ChangeLog             | 10 ++++++++++
881b8e
 gas/testsuite/gas/aarch64/illegal.l |  1 -
881b8e
 gas/testsuite/gas/aarch64/sysreg.d  |  3 +++
881b8e
 gas/testsuite/gas/aarch64/sysreg.s  |  4 ++++
881b8e
 6 files changed, 32 insertions(+), 4 deletions(-)
881b8e
881b8e
diff --git a/gas/ChangeLog b/gas/ChangeLog
881b8e
index 0014922..e03e191 100644
881b8e
--- a/gas/ChangeLog
881b8e
+++ b/gas/ChangeLog
881b8e
@@ -1,3 +1,11 @@
881b8e
+2013-05-13 Yufeng Zhang <yufeng.zhang@arm.com>
881b8e
+
881b8e
+	Backport from mainline:
881b8e
+
881b8e
+	2013-02-27 Yufeng Zhang <yufeng.zhang@arm.com>
881b8e
+	* config/tc-aarch64.c (parse_sys_reg): Allow the full range of CRn
881b8e
+	for system registers.
881b8e
+
881b8e
 2013-02-25  Kaushik Phatak  <Kaushik.Phatak@kpitcummins.com>
881b8e
 
881b8e
 	* config/rl78-parse.y: Fix encoding of DIVWU insn.
881b8e
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
881b8e
index 620ae8a..1e88891 100644
881b8e
--- a/gas/config/tc-aarch64.c
881b8e
+++ b/gas/config/tc-aarch64.c
881b8e
@@ -3288,10 +3288,14 @@ parse_sys_reg (char **str, struct hash_control *sys_regs, int imple_defined_p)
881b8e
 	  unsigned int op0, op1, cn, cm, op2;
881b8e
 	  if (sscanf (buf, "s%u_%u_c%u_c%u_%u", &op0, &op1, &cn, &cm, &op2) != 5)
881b8e
 	    return PARSE_FAIL;
881b8e
-	  /* Register access is encoded as follows:
881b8e
+	  /* The architecture specifies the encoding space for implementation
881b8e
+	     defined registers as:
881b8e
 	     op0  op1  CRn   CRm   op2
881b8e
-	     11   xxx  1x11  xxxx  xxx.  */
881b8e
-	  if (op0 != 3 || op1 > 7 || (cn | 0x4) != 0xf || cm > 15 || op2 > 7)
881b8e
+	     11   xxx  1x11  xxxx  xxx
881b8e
+	     For convenience GAS accepts a wider encoding space, as follows:
881b8e
+	     op0  op1  CRn   CRm   op2
881b8e
+	     11   xxx  xxxx  xxxx  xxx  */
881b8e
+	  if (op0 != 3 || op1 > 7 || cn > 15 || cm > 15 || op2 > 7)
881b8e
 	    return PARSE_FAIL;
881b8e
 	  value = (op0 << 14) | (op1 << 11) | (cn << 7) | (cm << 3) | op2;
881b8e
 	}
881b8e
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
881b8e
index 4508042..48574c4 100644
881b8e
--- a/gas/testsuite/ChangeLog
881b8e
+++ b/gas/testsuite/ChangeLog
881b8e
@@ -1,3 +1,13 @@
881b8e
+2013-05-13 Yufeng Zhang <yufeng.zhang@arm.com>
881b8e
+
881b8e
+	Backport from mainline:
881b8e
+
881b8e
+	2013-02-27 Yufeng Zhang <yufeng.zhang@arm.com>
881b8e
+	* gas/aarch64/illegal.l: Delete the error message for
881b8e
+	msr S3_1_C13_C15_1,x7.
881b8e
+	* gas/aarch64/sysreg.s: Add new tests.
881b8e
+	* gas/aarch64/sysreg.d: Update.
881b8e
+
881b8e
 2013-02-19  H.J. Lu  <hongjiu.lu@intel.com>
881b8e
 
881b8e
 	PR gas/15159
881b8e
diff --git a/gas/testsuite/gas/aarch64/illegal.l b/gas/testsuite/gas/aarch64/illegal.l
881b8e
index 6905866..5bc9c3c 100644
881b8e
--- a/gas/testsuite/gas/aarch64/illegal.l
881b8e
+++ b/gas/testsuite/gas/aarch64/illegal.l
881b8e
@@ -520,7 +520,6 @@
881b8e
 [^:]*:496: Error: .*`str x1,page_table_count'
881b8e
 [^:]*:498: Error: .*`prfm PLDL3KEEP,\[x9,x15,sxtx#2\]'
881b8e
 [^:]*:500: Error: .*`mrs x5,S1_0_C13_C8_0'
881b8e
-[^:]*:501: Error: .*`msr S3_1_C13_C15_1,x7'
881b8e
 [^:]*:502: Error: .*`msr S3_1_C11_C15_-1,x7'
881b8e
 [^:]*:503: Error: .*`msr S3_1_11_15_1,x7'
881b8e
 [^:]*:506: Error: .*`movi w1,#15'
881b8e
diff --git a/gas/testsuite/gas/aarch64/sysreg.d b/gas/testsuite/gas/aarch64/sysreg.d
881b8e
index b83b270..c7cf00e 100644
881b8e
--- a/gas/testsuite/gas/aarch64/sysreg.d
881b8e
+++ b/gas/testsuite/gas/aarch64/sysreg.d
881b8e
@@ -23,3 +23,6 @@ Disassembly of section \.text:
881b8e
   3c:	d5380260 	mrs	x0, id_isar3_el1
881b8e
   40:	d5380280 	mrs	x0, id_isar4_el1
881b8e
   44:	d53802a0 	mrs	x0, id_isar5_el1
881b8e
+  48:	d538cc00 	mrs	x0, s3_0_c12_c12_0
881b8e
+  4c:	d5384600 	mrs	x0, s3_0_c4_c6_0
881b8e
+  50:	d5184600 	msr	s3_0_c4_c6_0, x0
881b8e
diff --git a/gas/testsuite/gas/aarch64/sysreg.s b/gas/testsuite/gas/aarch64/sysreg.s
881b8e
index e6f770e..3287594 100644
881b8e
--- a/gas/testsuite/gas/aarch64/sysreg.s
881b8e
+++ b/gas/testsuite/gas/aarch64/sysreg.s
881b8e
@@ -22,3 +22,7 @@
881b8e
 	mrs x0, id_isar3_el1
881b8e
 	mrs x0, id_isar4_el1
881b8e
 	mrs x0, id_isar5_el1
881b8e
+
881b8e
+	mrs x0, s3_0_c12_c12_0
881b8e
+	mrs x0, s3_0_c4_c6_0
881b8e
+	msr s3_0_c4_c6_0, x0
881b8e
-- 
881b8e
1.9.0
881b8e