From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id E2A8E3858D37 for ; Thu, 29 Jun 2023 12:29:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E2A8E3858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [192.168.100.1]) by gateway (Coremail) with SMTP id _____8Dx+cUbeZ1ks94DAA--.6447S3; Thu, 29 Jun 2023 20:29:15 +0800 (CST) Received: from localhost (unknown [192.168.100.1]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxHs8beZ1k3eYQAA--.6524S2; Thu, 29 Jun 2023 20:29:15 +0800 (CST) References: <20230629090831.2579210-1-mengqinggang@loongson.cn> User-agent: mu4e 1.4.15; emacs 28.2 From: Chenghua Xu To: WANG Xuerui Cc: mengqinggang , 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 In-reply-to: Date: Thu, 29 Jun 2023 20:29:14 +0800 Message-ID: <864jmq1mg5.fsf@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain X-CM-TRANSID:AQAAf8AxHs8beZ1k3eYQAA--.6524S2 X-CM-SenderInfo: x0xfxv5qjk3to6or00hjvr0hdfq/ X-Coremail-Antispam: 1Uk129KBj93XoWxXw4UKw17XF43Ww17Gr1Utwc_yoW5uw4fpF y5ZFZ8KFs5JFnrCF9xG345ur15t3yxKF17XF9xtr1Skr4agF1UXF15tr9xJF1kJ34UK342 qFn5GFWUuF1UK3gCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkjb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv 67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I 0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07j8sqAUUUUU= X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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.