public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Nelson Chu <nelson@rivosinc.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] RISC-V: make C-extension JAL available again for (32-bit) assembly
Date: Tue, 31 Jan 2023 09:52:21 +0100	[thread overview]
Message-ID: <612c50e2-9dcd-6ad3-bfc3-a1b51f59dc20@suse.com> (raw)
In-Reply-To: <CAPpQWtDiTspFK6L-=UMgEJt7aDRKjiVu_ODdOQRb=R7Ke9SwsQ@mail.gmail.com>

On 31.01.2023 02:11, Nelson Chu wrote:
> Thanks for helping to follow these.

Well, it was my fault.

>  Looks reasonable, so please commit.

Done, also ..

> On Mon, Jan 30, 2023 at 10:07 PM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> Along with the normal JAL alias, the C-extension one should have been
>> moved as well by 839189bc932e ("RISC-V: re-arrange opcode table for
>> consistent alias handling"), for the assembler to actually be able to
>> use it where/when possible.
>>
>> Since neither this nor any other compressed branch insn was being tested
>> so far, take the opportunity and introduce a new testcase covering those.
>> ---
>> Pretty clearly this should also go on the 2.40 branch.

... on to the branch.

>> --- a/gas/config/tc-riscv.c
>> +++ b/gas/config/tc-riscv.c
>> @@ -2764,6 +2764,8 @@ riscv_ip (char *str, struct riscv_cl_ins
>>                 case 'p':
>>                   goto branch;
>>                 case 'a':
>> +                 if (oparg == insn->args + 1)
>> +                   goto jump_check_gpr;
>>                   goto jump;
>>                 case 'S': /* Floating-point RS1 x8-x15.  */
>>                   if (!reg_lookup (&asarg, RCLASS_FPR, &regno)
>> @@ -3273,6 +3275,7 @@ riscv_ip (char *str, struct riscv_cl_ins
>>                  but the 2nd (with 2 operands) might.  */
>>               if (oparg == insn->args)
>>                 {
>> +           jump_check_gpr:
>>                   asargStart = asarg;
>>                   if (reg_lookup (&asarg, RCLASS_GPR, NULL)
>>                       && (*asarg == ',' || (ISSPACE (*asarg) && asarg[1] == ',')))

Just to mention it: I already have a patch to remove all this hackery
again, I just want to chew on it for a little more before posting, in
case I notice something that's wrong with the approach taken.

Jan

      reply	other threads:[~2023-01-31  8:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30 14:07 Jan Beulich
2023-01-31  1:11 ` Nelson Chu
2023-01-31  8:52   ` Jan Beulich [this message]

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=612c50e2-9dcd-6ad3-bfc3-a1b51f59dc20@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew@sifive.com \
    --cc=binutils@sourceware.org \
    --cc=jim.wilson.gcc@gmail.com \
    --cc=nelson@rivosinc.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).