From: Nelson Chu <nelson@rivosinc.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Binutils <binutils@sourceware.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Andrew Waterman <andrew@sifive.com>,
Jim Wilson <jim.wilson.gcc@gmail.com>
Subject: Re: [PATCH v2 5/7] RISC-V: relax post-relocation-operator separator expectation
Date: Tue, 25 Apr 2023 16:13:42 +0800 [thread overview]
Message-ID: <CAPpQWtAJ-Y3qZ=uFV-g4WL9a2VVmUG_rvaGKfoOve0Ne6S6URg@mail.gmail.com> (raw)
In-Reply-To: <89f892c8-e378-b81c-7b13-322a7876a252@suse.com>
[-- Attachment #1: Type: text/plain, Size: 2249 bytes --]
On Fri, Mar 10, 2023 at 5:27 PM Jan Beulich <jbeulich@suse.com> wrote:
> With a blank being okay as a separator, constructs like
>
> lui t0, %hi sym
> lui t0, %hi 0x1000
>
I never noticed this kind of usage. I always thought we should have a ()
after the %hi/%pcrel_hi/..., so perhaps this is just a mistake that should
be fixed. Maybe other experts can help to clarify this behavior.
Thanks
Nelson
> are accepted. But then it makes little sense to not also accept e.g.
>
> lui t0, %hi +sym
> lui t0, %hi -0x1000
>
> Therefore instead of looking for a blank or opening parenthesis, merely
> check whether what follows wouldn't continue an identifier.
>
> Note that we don't need to also check is_name_ender(), as LEX_END_NAME
> isn't used for any character.
> ---
> v2: New.
>
> --- a/gas/config/tc-riscv.c
> +++ b/gas/config/tc-riscv.c
> @@ -2184,7 +2184,7 @@ parse_relocation (char **str, bfd_reloc_
> {
> size_t len = 1 + strlen (percent_op->str);
>
> - if (!ISSPACE ((*str)[len]) && (*str)[len] != '(')
> + if (is_part_of_name ((*str)[len]))
> continue;
>
> *str += len;
> --- a/gas/testsuite/gas/riscv/auipc-parsing.d
> +++ b/gas/testsuite/gas/riscv/auipc-parsing.d
> @@ -1,3 +1,3 @@
> -#as:
> +#as: -al
> #source: auipc-parsing.s
> #error_output: auipc-parsing.l
> --- a/gas/testsuite/gas/riscv/auipc-parsing.l
> +++ b/gas/testsuite/gas/riscv/auipc-parsing.l
> @@ -3,3 +3,7 @@
> .*: Error: illegal operands `lui x10,x11'
> .*: Error: illegal operands `auipc x12,symbol'
> .*: Error: illegal operands `lui x13,symbol'
> +#...
> + *[0-9]+[ ]+# Accept unary .*
> + *[0-9]+[ ]+\?\?\?\? 17070000[ ]+auipc x14,%hi \+symbol
> + *[0-9]+[ ]+\?\?\?\? B7B7CBED[ ]+lui x15,%hi -0x12345678
> --- a/gas/testsuite/gas/riscv/auipc-parsing.s
> +++ b/gas/testsuite/gas/riscv/auipc-parsing.s
> @@ -4,3 +4,6 @@
> # Don't accept a symbol without %hi() for 'u' operands.
> auipc x12,symbol
> lui x13,symbol
> +# Accept unary operators starting the subject expression.
> + auipc x14,%hi +symbol
> + lui x15,%hi -0x12345678
>
>
next prev parent reply other threads:[~2023-04-25 8:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-10 9:23 [PATCH v2 0/7] RISC-V/gas: insn operand parsing Jan Beulich
2023-03-10 9:25 ` [PATCH v2 1/7] RISC-V: minor effort reduction in relocation specifier parsing Jan Beulich
2023-03-10 11:24 ` Jan Beulich
2023-03-10 9:26 ` [PATCH v2 2/7] RISC-V: drop "percent_op" parameter from my_getOpcodeExpression() Jan Beulich
2023-03-10 9:26 ` [PATCH v2 3/7] RISC-V: avoid redundant and misleading/wrong error messages Jan Beulich
2023-03-10 9:27 ` [PATCH v2 4/7] RISC-V: don't recognize bogus relocations Jan Beulich
2023-03-10 9:27 ` [PATCH v2 5/7] RISC-V: relax post-relocation-operator separator expectation Jan Beulich
2023-04-25 8:13 ` Nelson Chu [this message]
2023-04-25 8:37 ` Andreas Schwab
2023-04-25 8:44 ` Nelson Chu
2023-04-25 8:52 ` Jan Beulich
2023-04-28 1:29 ` Nelson Chu
2023-04-28 6:05 ` Jan Beulich
2023-04-28 8:03 ` Fangrui Song
2023-05-11 11:27 ` Jan Beulich
2023-03-10 9:27 ` [PATCH v2 6/7] RISC-V: test for expected / no unexpected symbols Jan Beulich
2023-03-10 9:28 ` [PATCH v2 7/7] RISC-V: adjust logic to avoid register name symbols Jan Beulich
2023-04-25 8:40 ` [PATCH v2 0/7] RISC-V/gas: insn operand parsing Nelson Chu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPpQWtAJ-Y3qZ=uFV-g4WL9a2VVmUG_rvaGKfoOve0Ne6S6URg@mail.gmail.com' \
--to=nelson@rivosinc.com \
--cc=andrew@sifive.com \
--cc=binutils@sourceware.org \
--cc=jbeulich@suse.com \
--cc=jim.wilson.gcc@gmail.com \
--cc=palmer@dabbelt.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).