From: Richard Sandiford Date: Thu, 30 Mar 2023 10:09:05 +0000 (+0100) Subject: aarch64: Tweak error for missing immediate offset X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f42fba98796e55b6a5cdc0db99a3e90803fc6868;p=binutils-gdb.git aarch64: Tweak error for missing immediate offset This patch tweaks the error message that is printed when a ZA-style index is missing the immediate offset. --- diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index d938aa9eb83..32375307b8e 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -4399,15 +4399,15 @@ parse_sme_za_index (char **str, struct aarch64_indexed_za *opnd) } opnd->index.regno = reg->number; - if (!skip_past_char (str, ',')) /* Optional index offset immediate. */ + if (!skip_past_char (str, ',')) { - set_syntax_error (_("expected ','")); + set_syntax_error (_("missing immediate offset")); return false; } if (!parse_sme_immediate (str, &opnd->index.imm)) { - set_syntax_error (_("index offset immediate expected")); + set_syntax_error (_("expected a constant immediate offset")); return false; } diff --git a/gas/testsuite/gas/aarch64/sme-2-illegal.l b/gas/testsuite/gas/aarch64/sme-2-illegal.l index 9d3495aebc0..b4ce9dc69fd 100644 --- a/gas/testsuite/gas/aarch64/sme-2-illegal.l +++ b/gas/testsuite/gas/aarch64/sme-2-illegal.l @@ -9,18 +9,18 @@ [^:]*:[0-9]+: Error: immediate offset out of range 0 to 3 at operand 3 -- `mova z31\.s,p7/m,za3v\.s\[w15,#4\]' [^:]*:[0-9]+: Error: immediate offset out of range 0 to 1 at operand 3 -- `mova z31\.d,p7/m,za7v\.d\[w15,#2\]' [^:]*:[0-9]+: Error: immediate offset must be 0 at operand 3 -- `mova z31\.q,p7/m,za15v\.q\[w15,#1\]' -[^:]*:[0-9]+: Error: expected ',' at operand 3 -- `mova z31\.q,p7/m,za15v\.q\[w15\]' +[^:]*:[0-9]+: Error: missing immediate offset at operand 3 -- `mova z31\.q,p7/m,za15v\.q\[w15\]' [^:]*:[0-9]+: Error: expected '\[' at operand 3 -- `mova z0\.b,p0/m,za0v.b' [^:]*:[0-9]+: Error: expected a 32-bit selection register at operand 3 -- `mova z31\.b,p7/m,za0v\.b\[15,w15\]' -[^:]*:[0-9]+: Error: expected ',' at operand 3 -- `mova z0\.h,p0/m,za0v\.h\[w12\. 0\]' +[^:]*:[0-9]+: Error: missing immediate offset at operand 3 -- `mova z0\.h,p0/m,za0v\.h\[w12\. 0\]' [^:]*:[0-9]+: Error: expected a 32-bit selection register at operand 3 -- `mova z0\.s,p0/m,za0v\.s\[x12,0]' [^:]*:[0-9]+: Error: expected a selection register in the range w12-w15 at operand 3 -- `mova z0\.d,p0/m,za0v\.d\[w21,0\]' [^:]*:[0-9]+: Error: expected a 32-bit selection register at operand 3 -- `mova z0\.q,p0/m,za0v\.q\[s12\]' [^:]*:[0-9]+: Error: expected a 32-bit selection register at operand 3 -- `mova z0\.q,p0/m,za0v\.q\[d12\]' -[^:]*:[0-9]+: Error: index offset immediate expected at operand 3 -- `mova z0.q,p0/m,za0v\.q\[w12,\]' -[^:]*:[0-9]+: Error: expected ',' at operand 3 -- `mova z0\.q,p0/m,za0v\.q\[w12\.\]' -[^:]*:[0-9]+: Error: index offset immediate expected at operand 3 -- `mova z0\.q,p0/m,za0v\.q\[w12,abc\]' -[^:]*:[0-9]+: Error: index offset immediate expected at operand 3 -- `mova z0\.q,p0/m,za0v\.q\[w12,#abc\]' +[^:]*:[0-9]+: Error: expected a constant immediate offset at operand 3 -- `mova z0.q,p0/m,za0v\.q\[w12,\]' +[^:]*:[0-9]+: Error: missing immediate offset at operand 3 -- `mova z0\.q,p0/m,za0v\.q\[w12\.\]' +[^:]*:[0-9]+: Error: expected a constant immediate offset at operand 3 -- `mova z0\.q,p0/m,za0v\.q\[w12,abc\]' +[^:]*:[0-9]+: Error: expected a constant immediate offset at operand 3 -- `mova z0\.q,p0/m,za0v\.q\[w12,#abc\]' [^:]*:[0-9]+: Error: expected '\]' at operand 3 -- `mova z0\.q,p0/m,za0v\.q\[w12,1a\]' [^:]*:[0-9]+: Error: expected '\]' at operand 3 -- `mova z0\.q,p0/m,za0v\.q\[w12,#1a\]' [^:]*:[0-9]+: Error: expected '\]' at operand 3 -- `mova z0\.q,p0/m,za0v\.q\[w12,1a2\]' diff --git a/gas/testsuite/gas/aarch64/sme-5-illegal.l b/gas/testsuite/gas/aarch64/sme-5-illegal.l index 14d3cf456f3..852f1547634 100644 --- a/gas/testsuite/gas/aarch64/sme-5-illegal.l +++ b/gas/testsuite/gas/aarch64/sme-5-illegal.l @@ -4,7 +4,7 @@ [^:]*:[0-9]+: Error: invalid addressing mode at operand 3 -- `ld1h {za0v.h\[w12,0\]},p0/z,\[x0,x0,lsl#3\]' [^:]*:[0-9]+: Error: '\]' expected at operand 3 -- `ld1w {za3v.s\[w15,3\]},p7/z,\[sp,lsl#2\]' [^:]*:[0-9]+: Error: invalid addressing mode at operand 3 -- `ld1d {za0h.d\[w12,0\]},p0/z,\[sp,x0,lsl#12\]' -[^:]*:[0-9]+: Error: expected ',' at operand 1 -- `ld1q {za0v.q\[w12\]},p0/z,\[x0,x0,lsl#2\]' +[^:]*:[0-9]+: Error: missing immediate offset at operand 1 -- `ld1q {za0v.q\[w12\]},p0/z,\[x0,x0,lsl#2\]' [^:]*:[0-9]+: Error: ZA tile number out of range at operand 1 -- `ld1b {za1h.b\[w12,0\]},p0/z,\[x0\]' [^:]*:[0-9]+: Error: ZA tile number out of range at operand 1 -- `ld1b {za1v.b\[w12,0\]},p0/z,\[sp\]' [^:]*:[0-9]+: Error: ZA tile number out of range at operand 1 -- `ld1b {za1h.b\[w12,0\]},p0/z,\[sp,x0\]' @@ -48,4 +48,4 @@ [^:]*:[0-9]+: Error: invalid addressing mode at operand 3 -- `ld1w {za3v.s\[w12,3\]},p7/z,\[x0,x1,lsl#3\]' [^:]*:[0-9]+: Error: invalid addressing mode at operand 3 -- `ld1d {za0h.d\[w12,0\]},p0/z,\[x0,x1,lsl#4\]' [^:]*:[0-9]+: Error: invalid addressing mode at operand 3 -- `ld1q {za0v.q\[w12,0\]},p0/z,\[x0,x1,lsl#1\]' -[^:]*:[0-9]+: Error: expected ',' at operand 1 -- `ld1q {za0v.q\[w12\]},p0/z,\[x0,x1,lsl#1\]' +[^:]*:[0-9]+: Error: missing immediate offset at operand 1 -- `ld1q {za0v.q\[w12\]},p0/z,\[x0,x1,lsl#1\]' diff --git a/gas/testsuite/gas/aarch64/sme-6-illegal.l b/gas/testsuite/gas/aarch64/sme-6-illegal.l index b2527ead250..30aea0b75ea 100644 --- a/gas/testsuite/gas/aarch64/sme-6-illegal.l +++ b/gas/testsuite/gas/aarch64/sme-6-illegal.l @@ -4,7 +4,7 @@ [^:]*:[0-9]+: Error: invalid addressing mode at operand 3 -- `st1h {za0v.h\[w12,0\]},p0,\[x0,x0,lsl#3\]' [^:]*:[0-9]+: Error: '\]' expected at operand 3 -- `st1w {za3v.s\[w15,3\]},p7,\[sp,lsl#2\]' [^:]*:[0-9]+: Error: invalid addressing mode at operand 3 -- `st1d {za0h.d\[w12,0\]},p0,\[sp,x0,lsl#12\]' -[^:]*:[0-9]+: Error: expected ',' at operand 1 -- `st1q {za0v.q\[w12\]},p0,\[x0,x0,lsl#2\]' +[^:]*:[0-9]+: Error: missing immediate offset at operand 1 -- `st1q {za0v.q\[w12\]},p0,\[x0,x0,lsl#2\]' [^:]*:[0-9]+: Error: ZA tile number out of range at operand 1 -- `st1b {za1h.b\[w12,0\]},p0,\[x0\]' [^:]*:[0-9]+: Error: ZA tile number out of range at operand 1 -- `st1b {za1v.b\[w12,0\]},p0,\[sp\]' [^:]*:[0-9]+: Error: ZA tile number out of range at operand 1 -- `st1b {za1h.b\[w12,0\]},p0,\[sp,x0\]' diff --git a/gas/testsuite/gas/aarch64/sme-9-illegal.l b/gas/testsuite/gas/aarch64/sme-9-illegal.l index 1a33420dc35..0243c9efcdf 100644 --- a/gas/testsuite/gas/aarch64/sme-9-illegal.l +++ b/gas/testsuite/gas/aarch64/sme-9-illegal.l @@ -1,6 +1,6 @@ [^:]*: Assembler messages: -[^:]*:[0-9]+: Error: expected ',' at operand 3 -- `psel p1,p15,p3.b\[w12\]' -[^:]*:[0-9]+: Error: expected ',' at operand 3 -- `psel p1,p15,p3.q\[w15\]' +[^:]*:[0-9]+: Error: missing immediate offset at operand 3 -- `psel p1,p15,p3.b\[w12\]' +[^:]*:[0-9]+: Error: missing immediate offset at operand 3 -- `psel p1,p15,p3.q\[w15\]' [^:]*:[0-9]+: Error: operand mismatch -- `psel p1,p15,p3.q\[w15,#0\]' [^:]*:[0-9]+: Info: did you mean this\? [^:]*:[0-9]+: Info: psel p1, p15, p3.b\[w15, 0\] @@ -15,10 +15,10 @@ [^:]*:[0-9]+: Info: psel p1, p15, p3.h\[w15, 0\] [^:]*:[0-9]+: Info: psel p1, p15, p3.s\[w15, 0\] [^:]*:[0-9]+: Info: psel p1, p15, p3.d\[w15, 0\] -[^:]*:[0-9]+: Error: expected ',' at operand 3 -- `psel p1,p15,p3.b\[w11\]' -[^:]*:[0-9]+: Error: expected ',' at operand 3 -- `psel p8,p11,p15.h\[w16\]' -[^:]*:[0-9]+: Error: expected ',' at operand 3 -- `psel p2,p7,p15.s\[w3\]' -[^:]*:[0-9]+: Error: expected ',' at operand 3 -- `psel p13,p3,p1.d\[w17\]' +[^:]*:[0-9]+: Error: missing immediate offset at operand 3 -- `psel p1,p15,p3.b\[w11\]' +[^:]*:[0-9]+: Error: missing immediate offset at operand 3 -- `psel p8,p11,p15.h\[w16\]' +[^:]*:[0-9]+: Error: missing immediate offset at operand 3 -- `psel p2,p7,p15.s\[w3\]' +[^:]*:[0-9]+: Error: missing immediate offset at operand 3 -- `psel p13,p3,p1.d\[w17\]' [^:]*:[0-9]+: Error: expected a selection register in the range w12-w15 at operand 3 -- `psel p1,p15,p3.b\[w11,#0\]' [^:]*:[0-9]+: Error: expected a selection register in the range w12-w15 at operand 3 -- `psel p8,p11,p15.h\[w16,#0\]' [^:]*:[0-9]+: Error: expected a selection register in the range w12-w15 at operand 3 -- `psel p2,p7,p15.s\[w3,#0\]'