aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gas/ChangeLog10
-rw-r--r--gas/config/tc-aarch64.c11
-rw-r--r--gas/doc/c-aarch64.texi3
-rw-r--r--gas/testsuite/gas/aarch64/diagnostic.l4
-rw-r--r--gas/testsuite/gas/aarch64/diagnostic.s5
-rw-r--r--gas/testsuite/gas/aarch64/register_aliases.d10
-rw-r--r--gas/testsuite/gas/aarch64/register_aliases.s9
7 files changed, 47 insertions, 5 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index dd61142..cdfa036 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,13 @@
+2017-08-15 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ * config/tc-aarch64.c (REGDEF_ALIAS): Define
+ (reg_names): Update for ip0, ip1, fp, lr to use REGDEF_ALIAS
+ * doc/c-aarch64.texi: Update documentation on .req.
+ * testsuite/gas/diagnostic.s: Update
+ * testsuite/gas/diagnostic.l: Likewise
+ * testsuite/gas/register_aliases.s: New file.
+ * testsuite/gas/register_aliases.d: New file.
+
2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
PR gas/21667
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index 6a23f21..0cefa16 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -6772,6 +6772,7 @@ aarch64_canonicalize_symbol_name (char *name)
also have mixed-case names. */
#define REGDEF(s,n,t) { #s, n, REG_TYPE_##t, TRUE }
+#define REGDEF_ALIAS(s, n, t) { #s, n, REG_TYPE_##t, FALSE}
#define REGNUM(p,n,t) REGDEF(p##n, n, t)
#define REGSET16(p,t) \
REGNUM(p, 0,t), REGNUM(p, 1,t), REGNUM(p, 2,t), REGNUM(p, 3,t), \
@@ -6793,17 +6794,16 @@ static const reg_entry reg_names[] = {
REGSET31 (x, R_64), REGSET31 (X, R_64),
REGSET31 (w, R_32), REGSET31 (W, R_32),
+ REGDEF_ALIAS (ip0, 16, R_64), REGDEF_ALIAS (IP0, 16, R_64),
+ REGDEF_ALIAS (ip1, 17, R_64), REGDEF_ALIAS (IP1, 16, R_64),
+ REGDEF_ALIAS (fp, 29, R_64), REGDEF_ALIAS (FP, 29, R_64),
+ REGDEF_ALIAS (lr, 30, R_64), REGDEF_ALIAS (LR, 30, R_64),
REGDEF (wsp, 31, SP_32), REGDEF (WSP, 31, SP_32),
REGDEF (sp, 31, SP_64), REGDEF (SP, 31, SP_64),
REGDEF (wzr, 31, Z_32), REGDEF (WZR, 31, Z_32),
REGDEF (xzr, 31, Z_64), REGDEF (XZR, 31, Z_64),
- REGDEF (ip0, 16, R_64), REGDEF (IP0, 16, R_64),
- REGDEF (ip1, 17, R_64), REGDEF (IP1, 17, R_64),
- REGDEF (fp, 29, R_64), REGDEF (FP, 29, R_64),
- REGDEF (lr, 30, R_64), REGDEF (LR, 30, R_64),
-
/* Floating-point single precision registers. */
REGSET (s, FP_S), REGSET (S, FP_S),
@@ -6830,6 +6830,7 @@ static const reg_entry reg_names[] = {
};
#undef REGDEF
+#undef REGDEF_ALIAS
#undef REGNUM
#undef REGSET16
#undef REGSET31
diff --git a/gas/doc/c-aarch64.texi b/gas/doc/c-aarch64.texi
index 6774205..e73d48c 100644
--- a/gas/doc/c-aarch64.texi
+++ b/gas/doc/c-aarch64.texi
@@ -363,6 +363,9 @@ example:
foo .req w0
@end smallexample
+ip0, ip1, lr and fp are automatically defined to
+alias to X16, X17, X30 and X29 respectively.
+
@c SSSSSSSSSSSSSSSSSSSSSSSSSS
@c TTTTTTTTTTTTTTTTTTTTTTTTTT
diff --git a/gas/testsuite/gas/aarch64/diagnostic.l b/gas/testsuite/gas/aarch64/diagnostic.l
index b749d2e..cd3ce99 100644
--- a/gas/testsuite/gas/aarch64/diagnostic.l
+++ b/gas/testsuite/gas/aarch64/diagnostic.l
@@ -172,3 +172,7 @@
[^:]*:295: Error: invalid use of 'MUL' at operand 4 -- `orr x0,x0,#0xff,mul#1'
[^:]*:296: Error: invalid use of 'MUL' at operand 4 -- `orr x0,x0,#0xfe,mul#255'
[^:]*:297: Error: invalid use of 'MUL' at operand 4 -- `orr x0,x0,#0xfc,mul#256'
+[^:]*:299: Warning: ignoring redefinition of register alias 'ip0'
+[^:]*:300: Warning: ignoring redefinition of register alias 'ip1'
+[^:]*:301: Warning: ignoring redefinition of register alias 'lr'
+[^:]*:302: Warning: ignoring redefinition of register alias 'fp'
diff --git a/gas/testsuite/gas/aarch64/diagnostic.s b/gas/testsuite/gas/aarch64/diagnostic.s
index 09126e6..12e8504 100644
--- a/gas/testsuite/gas/aarch64/diagnostic.s
+++ b/gas/testsuite/gas/aarch64/diagnostic.s
@@ -295,3 +295,8 @@
orr x0, x0, #0xff, mul #1
orr x0, x0, #0xfe, mul #255
orr x0, x0, #0xfc, mul #256
+
+ ip0 .req x0
+ ip1 .req x1
+ lr .req x2
+ fp .req x3
diff --git a/gas/testsuite/gas/aarch64/register_aliases.d b/gas/testsuite/gas/aarch64/register_aliases.d
new file mode 100644
index 0000000..677d5f0
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/register_aliases.d
@@ -0,0 +1,10 @@
+#objdump: -dr
+
+.*: file format .*
+
+Disassembly of section \.text:
+
+0+ <.*>:
+ 0: 8b1e0210 add x16, x16, x30
+ 4: f90003b0 str x16, \[x29\]
+ 8: f94003b1 ldr x17, \[x29\] \ No newline at end of file
diff --git a/gas/testsuite/gas/aarch64/register_aliases.s b/gas/testsuite/gas/aarch64/register_aliases.s
new file mode 100644
index 0000000..5864283
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/register_aliases.s
@@ -0,0 +1,9 @@
+ # test register aliases.
+ lr .req x30
+ fp .req x29
+ ip0 .req x16
+ ip1 .req x17
+ add ip0, ip0, lr
+ str ip0, [fp]
+ ldr ip1, [fp]
+