From: Chenghua Xu <xuchenghua@loongson.cn>
To: WANG Xuerui <i.swmail@xen0n.name>
Cc: mengqinggang <mengqinggang@loongson.cn>,
binutils@sourceware.org, chenglulu@loongson.cn,
liuzhensong@loongson.cn, xry111@xry111.site, maskray@google.com
Subject: Re: [PATCH] LoongArch: gas: Add LVZ and LBT instructions support
Date: Thu, 29 Jun 2023 20:29:14 +0800 [thread overview]
Message-ID: <864jmq1mg5.fsf@loongson.cn> (raw)
In-Reply-To: <f66bd6bc-878a-aeb7-b1b8-711458d79dcf@xen0n.name>
WANG Xuerui writes:
> On 2023/6/29 17:08, mengqinggang wrote:
>> gas/ChangeLog:
>> * testsuite/gas/loongarch/uleb128.d: Regenerated.
>> * testsuite/gas/loongarch/lvz-lbt.d: New test.
>> * testsuite/gas/loongarch/lvz-lbt.s: New test.
>> opcodes/ChangeLog:
>> * loongarch-opc.c (struct loongarch_ase): Add LVZ and LBT
>> instructions.
>> ---
>> gas/testsuite/gas/loongarch/lvz-lbt.d | 196 ++++++++++++++++++++++++
>> gas/testsuite/gas/loongarch/lvz-lbt.s | 186 +++++++++++++++++++++++
>> gas/testsuite/gas/loongarch/uleb128.d | 52 +++----
>> opcodes/loongarch-opc.c | 205 +++++++++++++++++++++++++-
>> 4 files changed, 611 insertions(+), 28 deletions(-)
>> create mode 100644 gas/testsuite/gas/loongarch/lvz-lbt.d
>> create mode 100644 gas/testsuite/gas/loongarch/lvz-lbt.s
>> [snip]
>>
>> diff --git a/opcodes/loongarch-opc.c b/opcodes/loongarch-opc.c
>> index bd104465ca7..202614390db 100644
>> --- a/opcodes/loongarch-opc.c
>> +++ b/opcodes/loongarch-opc.c
>> @@ -1646,6 +1646,7 @@ static struct loongarch_opcode loongarch_lsx_opcodes[] =
>> { 0x73e40000, 0xfffc0000, "vpermi.w", "v0:5,v5:5,u10:8", 0, 0, 0, 0},
>> { 0, 0, 0, 0, 0, 0, 0, 0 } /* Terminate the list. */
>> };
>> +
>> static struct loongarch_opcode loongarch_lasx_opcodes[] =
>> {
>> /* match, mask, name, format, macro, include, exclude, pinfo. */
>> @@ -2321,6 +2322,204 @@ static struct loongarch_opcode loongarch_lasx_opcodes[] =
>> { 0, 0, 0, 0, 0, 0, 0, 0 } /* Terminate the list. */
>> };
>> +static struct loongarch_opcode loongarch_lvz_opcodes[] =
>> +{
>> + /* match, mask, name, format, macro, include, exclude, pinfo. */
>> + {0x05000000, 0xff0003e0, "gcsrrd", "r0:5,u10:14", 0, 0, 0, 0},
>> + {0x05000020, 0xff0003e0, "gcsrwr", "r0:5,u10:14", 0, 0, 0, 0},
>> + {0x05000000, 0xff000000, "gcsrxchg", "r0:5,r5:5,u10:14", 0, 0, 0, 0},
>> + {0x06482801, 0xffffffff, "gtlbsrch", "", 0, 0, 0, 0},
>> + {0x06482c01, 0xffffffff, "gtlbrd", "", 0, 0, 0, 0},
>> + {0x06483001, 0xffffffff, "gtlbwr", "", 0, 0, 0, 0},
>> + {0x06483401, 0xffffffff, "gtlbfill", "", 0, 0, 0, 0},
>> + {0x06482001, 0xffffffff, "gtlbclr", "", 0, 0, 0, 0},
>> + {0x06482401, 0xffffffff, "gtlbflush", "", 0, 0, 0, 0},
>> + {0x002b8000, 0xffff8000, "hvcl", "u0:15", 0, 0, 0, 0},
>> + { 0, 0, 0, 0, 0, 0, 0, 0 } /* Terminate the list. */
>> +};
>> +
>> +static struct loongarch_opcode loongarch_lbt_opcodes[] =
>> +{
>> + /* match, mask, name, format, macro, include, exclude, pinfo. */
>> + {0x00000800, 0xfffffc1c, "gr2scr", "cr0:2,r5:5", 0, 0, 0, 0},
>> + {0x00000c00, 0xffffff80, "scr2gr", "r0:5,cr5:2", 0, 0, 0, 0},
>
> Hmm why aren't this couple of instructions named "movgr2scr" and
> "movscr2gr", like other similar ones? I remember suggesting this a
> while ago (in the now-deleted loongson/linux GitHub repo) but seems
> the suggestion wasn't taken.
Thanks for catch this, movgr2src/movscr2gr are fine.
> If compatibility with older in-house code is what you intend, maybe we
> can add the more consistent names alongside, so the overall symmetry
> of transfer-between-banks instruction mnemonics is preserved.
>
>> [snip]
>
> The rest looks good (though I obviously have no means to verify the
> encodings). Thanks very much for posting this so we're finally going
> to have the entirety of LA64 v1.00 supported in 2.41.
next prev parent reply other threads:[~2023-06-29 12:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-29 9:08 mengqinggang
2023-06-29 11:33 ` WANG Xuerui
2023-06-29 12:29 ` Chenghua Xu [this message]
2023-06-29 12:42 ` WANG Xuerui
2023-06-29 12:38 ` WANG Xuerui
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=864jmq1mg5.fsf@loongson.cn \
--to=xuchenghua@loongson.cn \
--cc=binutils@sourceware.org \
--cc=chenglulu@loongson.cn \
--cc=i.swmail@xen0n.name \
--cc=liuzhensong@loongson.cn \
--cc=maskray@google.com \
--cc=mengqinggang@loongson.cn \
--cc=xry111@xry111.site \
/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).