From patchwork Tue Aug 8 11:45:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mengqinggang X-Patchwork-Id: 132519 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2054292vqr; Tue, 8 Aug 2023 04:45:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGs4zvtUkWgcs8y6mDfymSPyEEAG15u6okoL8dFRtKY6xreMbDpci/WWGZ3pCZB94PWCagM X-Received: by 2002:a05:6402:1243:b0:522:586d:6f3a with SMTP id l3-20020a056402124300b00522586d6f3amr10004112edw.6.1691495133483; Tue, 08 Aug 2023 04:45:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691495133; cv=none; d=google.com; s=arc-20160816; b=FurVh3G8CUZvVya+IBE3AuKFxdYxInvkKo21FQ1U81TVN0n5D69mxsp0yEJOVOPFXM sZT40+1kDsoRvR9gq79dZ9THFO8i83HhpSjID9niGf5aXjcTrfz4mcIOKRt2f/Hbwqvm ZUozBqhrTNLiuoFvhHlhqYX+chkNVCsaSkOj+g/QAMZsFjAxQxj9EzsribMC/xxA5I4f NeAAghsJTO0BhTO+Zpz7kpJseIy1Wp+HzQA2RqqRqQvzMzIctgtBX/lnBJl86PMoMdEC WKcYVe7KkRkdigMJDVEH4h1vJIJ9w9YZ2ais8xEmx5kSGMdrBmsKuMzWIMmngCFcUNtY eWXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dmarc-filter :delivered-to; bh=I4PFlUq1wH6WQk8SPeSVIKlNI3QMHuA2noylCL53Uto=; fh=QBSRBSUnFSUbjYPlYXRvmmbzYsSiOdYMaNH5lUTXA7g=; b=axL1nmRfdrjfQY10LHxM7cdaCMSsFasD8LN486G08fy7nbKPUonkHa0AynSsXh/sfs A3dXuuevpV2xrlD2dv7P5VcPKmEN08gH2BVeFLtsAIyqKZ7rE+d2sAZx8t5kIglwAINu 3+fdZxHb3CUYXqD2CMFSMCgWcHjZOA6eItvsticgOIBMzfZRW8NPt4glJ75309J3aApY 6pSu5zF6rOGL23I7ULJtW6OLmVOfMheIL3/IlKTP1HKOMJRuCjtHJ9k/1FTjxX0pQkml qQTbxkKs70AJ0q8rQ2CG77s6yu2MlJVJZKgx/pUfnKm+4P9XZyqLAVJYFXqvpmbm6pGt 0FiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id n2-20020aa7c442000000b0051dff4f3c97si7307617edr.132.2023.08.08.04.45.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 04:45:33 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BDC2D3858288 for ; Tue, 8 Aug 2023 11:45:30 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 106E93858D20 for ; Tue, 8 Aug 2023 11:45:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 106E93858D20 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 [10.2.5.5]) by gateway (Coremail) with SMTP id _____8AxTevQKtJkf9ASAA--.36388S3; Tue, 08 Aug 2023 19:45:21 +0800 (CST) Received: from 5.5.5 (unknown [10.2.5.5]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxF83QKtJkVetOAA--.144S2; Tue, 08 Aug 2023 19:45:20 +0800 (CST) From: mengqinggang To: binutils@sourceware.org Cc: xuchenghua@loongson.cn, chenglulu@loongson.cn, liuzhensong@loongson.cn, xry111@xry111.site, i.swmail@xen0n.name, maskray@google.com, mengqinggang Subject: [PATCH 1/2] LoongArch: Fix pcaddi format string Date: Tue, 8 Aug 2023 19:45:17 +0800 Message-Id: <20230808114518.2058726-1-mengqinggang@loongson.cn> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8CxF83QKtJkVetOAA--.144S2 X-CM-SenderInfo: 5phqw15lqjwttqj6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBj9xXoWruF13XryUGr45Jw1rCw4ftFc_yoWfKrb_Wr yfKrykKa12ya4jy3W0qrW8JryUKr4xZF15Casrtr9FkFy5Aw15Gry8tr4kArWYqr10qrnI y3W3Wrs3Aw1rKosvyTuYvTs0mTUanT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUb7AYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVWUCVW8JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV WUJVW8JwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jrv_JF1lYx0Ex4A2jsIE 14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x 0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E 7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcV C0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF 04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7 CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU8oGQDUUUUU== X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773661201190654939 X-GMAIL-MSGID: 1773661201190654939 Add "<<2" for pcaddi format string --- opcodes/loongarch-opc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opcodes/loongarch-opc.c b/opcodes/loongarch-opc.c index 2f02e33dbec..7d110683e93 100644 --- a/opcodes/loongarch-opc.c +++ b/opcodes/loongarch-opc.c @@ -564,7 +564,7 @@ static struct loongarch_opcode loongarch_imm_opcodes[] = { 0x10000000, 0xfc000000, "addu16i.d", "r0:5,r5:5,s10:16", 0, 0, 0, 0 }, { 0x14000000, 0xfe000000, "lu12i.w", "r0:5,s5:20", 0, 0, 0, 0 }, { 0x16000000, 0xfe000000, "lu32i.d", "r0:5,s5:20", 0, 0, 0, 0 }, - { 0x18000000, 0xfe000000, "pcaddi", "r0:5,s5:20", 0, 0, 0, 0 }, + { 0x18000000, 0xfe000000, "pcaddi", "r0:5,s5:20<<2", 0, 0, 0, 0 }, { 0x1a000000, 0xfe000000, "pcalau12i", "r0:5,s5:20", 0, 0, 0, 0 }, { 0x1c000000, 0xfe000000, "pcaddu12i", "r0:5,s5:20", 0, 0, 0, 0 }, { 0x1e000000, 0xfe000000, "pcaddu18i", "r0:5,s5:20", 0, 0, 0, 0 }, From patchwork Tue Aug 8 11:45:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mengqinggang X-Patchwork-Id: 132520 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2054367vqr; Tue, 8 Aug 2023 04:45:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHb07D26aHkvB5JZxxixEq0v0whIM0fL+K1ik+9jdD7jOppuSTX0T4j3M6sXRVVKZvT7Nmr X-Received: by 2002:a17:907:2c64:b0:997:c377:b41f with SMTP id ib4-20020a1709072c6400b00997c377b41fmr9438080ejc.64.1691495143727; Tue, 08 Aug 2023 04:45:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691495143; cv=none; d=google.com; s=arc-20160816; b=mb7IeEIn7SjcmhEYCYfezLHbewgJlsNW/nk8bcV4+H73TH5buRak1P7HCeQqfcttWc pHEOVKRc5XAL9wXAAa/3G1c48SAbff//nkewb57S0ZSRK7cg9SeS/r8KxYYqCp9chwEL A9ZbOaRur2M4B//EWtHR6/f49io3wfnkeLgTf+sofUaOnx4tbR4vLyLCE5SHYlhWmDrD TJemdi6D+Vv1JAQW4jF5/DtPpox+AED74vGYam3loaKNRDDlcDG9U6RgMceSU1UmX0JR 1BxIR9hjbTTUg9PNpDnUuoJJL6txIaP4A140sIfq+589O0Pzmm42Bf+0Y3pABOqPTEBz MnwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dmarc-filter:delivered-to; bh=TRYp7wYBIykcRbbb00PKd2F3D72biTQR+B5fx1kT6E8=; fh=QBSRBSUnFSUbjYPlYXRvmmbzYsSiOdYMaNH5lUTXA7g=; b=aW6d6Mxp3Ztwm1G5mFzsRRdbcAm527Ok4NfLNloN2cIHXhgkBTHdu3O+gNCGTfRCYC +IXaQz8Wfrys1Ad3KuzNeGbmF893d7tZo9gVep6KP26OrqS5N6fm6FS46s+ZMGsJPBjk aviR/1I1SE1VS7Sr1Wq13vaGNFLz/4QiwAnfhzU1jSdIgzGjX5JcMzHByNAnH2CwDzCD tkMFu49pyqaxW7FNbCWFvg8LhkVCsi2AKD3DEucTDQ57plXp9QNWjdrc+mKUNtVdz9nN SgzO+ssV6TDj77C00C7lMh8pt9JDRVgOG17hy8/ueqd5zF+KjA9yI6g+EshuXonNb3o6 nKmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id k4-20020a1709063fc400b00992a9bc7432si7069385ejj.936.2023.08.08.04.45.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 04:45:43 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4C8333858033 for ; Tue, 8 Aug 2023 11:45:35 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id E4AEE3858D33 for ; Tue, 8 Aug 2023 11:45:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E4AEE3858D33 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 [10.2.5.5]) by gateway (Coremail) with SMTP id _____8CxNvHUKtJkiNASAA--.41761S3; Tue, 08 Aug 2023 19:45:24 +0800 (CST) Received: from 5.5.5 (unknown [10.2.5.5]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxF83QKtJkVetOAA--.144S3; Tue, 08 Aug 2023 19:45:23 +0800 (CST) From: mengqinggang To: binutils@sourceware.org Cc: xuchenghua@loongson.cn, chenglulu@loongson.cn, liuzhensong@loongson.cn, xry111@xry111.site, i.swmail@xen0n.name, maskray@google.com, mengqinggang Subject: [PATCH 2/2] LoongArch: Add support for "pcaddi rd, label" Date: Tue, 8 Aug 2023 19:45:18 +0800 Message-Id: <20230808114518.2058726-2-mengqinggang@loongson.cn> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230808114518.2058726-1-mengqinggang@loongson.cn> References: <20230808114518.2058726-1-mengqinggang@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8CxF83QKtJkVetOAA--.144S3 X-CM-SenderInfo: 5phqw15lqjwttqj6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBj9fXoW3CFykJry8KF47Kw17WryDurX_yoW8Wr13Wo W7uayavrsagwsrt34kKr43tF1jy3s7GFnayr9rCw4jy3W5Cw15CFnrGr4F9FyqgrWrJFn8 AryDtr1UGry3Cr4Dl-sFpf9Il3svdjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8wcxFpf 9Il3svdxBIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3 UjIYCTnIWjp_UUUY17kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI 8IcIk0rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xG Y2AK021l84ACjcxK6xIIjxv20xvE14v26r1I6r4UM28EF7xvwVC0I7IYx2IY6xkF7I0E14 v26r1j6r4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAF wI0_Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI 0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUAVWUtwAv7VC2z280 aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28Icx kI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2Iq xVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42 IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY 6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aV CY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjxU7tx6UUUUU X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773661211567005559 X-GMAIL-MSGID: 1773661211567005559 Add a macro pcaddi instruction to support "pcaddi rd, label". pcaddi has a 20-bit signed immediate, it can address a +/- 2MB pc relative address, and the address should be 4-byte aligned. --- bfd/elfxx-loongarch.c | 2 +- gas/testsuite/gas/loongarch/imm_ins.d | 137 +++++++++++++------------- gas/testsuite/gas/loongarch/imm_op.d | 82 +++++++-------- gas/testsuite/gas/loongarch/imm_op.s | 4 +- gas/testsuite/gas/loongarch/pcaddi.d | 13 +++ gas/testsuite/gas/loongarch/pcaddi.s | 4 + opcodes/loongarch-opc.c | 1 + 7 files changed, 131 insertions(+), 112 deletions(-) create mode 100644 gas/testsuite/gas/loongarch/pcaddi.d create mode 100644 gas/testsuite/gas/loongarch/pcaddi.s diff --git a/bfd/elfxx-loongarch.c b/bfd/elfxx-loongarch.c index f27c9fdba6a..683e771af90 100644 --- a/bfd/elfxx-loongarch.c +++ b/bfd/elfxx-loongarch.c @@ -1431,7 +1431,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] = false, /* pcrel_offset. */ BFD_RELOC_LARCH_PCREL20_S2, /* bfd_reloc_code_real_type. */ reloc_sign_bits, /* adjust_reloc_bits. */ - NULL), /* larch_reloc_type_name. */ + "pc20"), /* larch_reloc_type_name. */ /* Canonical Frame Address. */ LOONGARCH_HOWTO (R_LARCH_CFA, /* type (104). */ diff --git a/gas/testsuite/gas/loongarch/imm_ins.d b/gas/testsuite/gas/loongarch/imm_ins.d index f00110cd8a3..b54df8735a8 100644 --- a/gas/testsuite/gas/loongarch/imm_ins.d +++ b/gas/testsuite/gas/loongarch/imm_ins.d @@ -7,74 +7,75 @@ Disassembly of section .text: -00000000.* <.text>: -[ ]+0:[ ]+03848c0c[ ]+li.w[ ]+\$t0,[ ]+0x123 -[ ]+4:[ ]+15ffe00d[ ]+lu12i.w[ ]+\$t1,[ ]+-256 -[ ]+8:[ ]+16001fed[ ]+lu32i.d[ ]+\$t1,[ ]+255 -[ ]+c:[ ]+02bffc0e[ ]+li.w[ ]+\$t2,[ ]+-1 -[ ]+10:[ ]+1601ffee[ ]+lu32i.d[ ]+\$t2,[ ]+4095 -[ ]+14:[ ]+0004b58b[ ]+alsl.w[ ]+\$a7,[ ]+\$t0,[ ]+\$t1,[ ]+0x2 -[ ]+18:[ ]+0006b58b[ ]+alsl.wu[ ]+\$a7,[ ]+\$t0,[ ]+\$t1,[ ]+0x2 -[ ]+1c:[ ]+0009358b[ ]+bytepick.w[ ]+\$a7,[ ]+\$t0,[ ]+\$t1,[ ]+0x2 -[ ]+20:[ ]+000d358b[ ]+bytepick.d[ ]+\$a7,[ ]+\$t0,[ ]+\$t1,[ ]+0x2 +[ ]*0000000000000000 <.text>: +[ ]+0:[ ]+03848c0c[ ]+li.w[ ]+\$t0, 0x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t2 +[ ]+108:[ ]+2b048d8a[ ]+fld.s[ ]+\$ft2, \$t0, 291 +[ ]+10c:[ ]+2b448d8a[ ]+fst.s[ ]+\$ft2, \$t0, 291 +[ ]+110:[ ]+2b848d8a[ ]+fld.d[ ]+\$ft2, \$t0, 291 +[ ]+114:[ ]+2bc48d8a[ ]+fst.d[ ]+\$ft2, \$t0, 291 diff --git a/gas/testsuite/gas/loongarch/imm_op.d b/gas/testsuite/gas/loongarch/imm_op.d index 3d4cba45586..4c5cffc7101 100644 --- a/gas/testsuite/gas/loongarch/imm_op.d +++ b/gas/testsuite/gas/loongarch/imm_op.d @@ -1,48 +1,48 @@ #as: #objdump: -dr -.*:[ ]+file format .* +.*:[ ]+file format .* Disassembly of section .text: -00000000.* <.text>: -[ ]+0:[ ]+020000a4 [ ]+slti[ ]+[ ]+\$a0, \$a1, 0 -[ ]+4:[ ]+021ffca4 [ ]+slti[ ]+[ ]+\$a0, \$a1, 2047 -[ ]+8:[ ]+022004a4 [ ]+slti[ ]+[ ]+\$a0, \$a1, -2047 -[ ]+c:[ ]+024000a4 [ ]+sltui[ ]+[ ]+\$a0, \$a1, 0 -[ ]+10:[ ]+025ffca4 [ ]+sltui[ ]+[ ]+\$a0, \$a1, 2047 -[ ]+14:[ ]+026004a4 [ ]+sltui[ ]+[ ]+\$a0, \$a1, -2047 -[ ]+18:[ ]+028000a4 [ ]+addi.w[ ]+[ ]+\$a0, \$a1, 0 -[ ]+1c:[ ]+029ffca4 [ ]+addi.w[ ]+[ ]+\$a0, \$a1, 2047 -[ ]+20:[ ]+02a004a4 [ ]+addi.w[ ]+[ ]+\$a0, \$a1, -2047 -[ ]+24:[ ]+02c000a4 [ ]+addi.d[ ]+[ ]+\$a0, \$a1, 0 -[ ]+28:[ ]+02dffca4 [ ]+addi.d[ ]+[ ]+\$a0, \$a1, 2047 -[ ]+2c:[ ]+02e004a4 [ ]+addi.d[ ]+[ ]+\$a0, \$a1, -2047 -[ ]+30:[ ]+030000a4 [ ]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]+\$a0, -524287 -[ ]+84:[ ]+1c000004 [ ]+pcaddu12i[ ]+[ ]+\$a0, 0 -[ ]+88:[ ]+1cffffe4 [ ]+pcaddu12i[ ]+[ ]+\$a0, 524287 -[ ]+8c:[ ]+1d000024 [ ]+pcaddu12i[ ]+[ ]+\$a0, -524287 -[ ]+90:[ ]+1e000004 [ ]+pcaddu18i[ ]+[ ]+\$a0, 0 -[ ]+94:[ ]+1effffe4 [ ]+pcaddu18i[ ]+[ ]+\$a0, 524287 -[ ]+98:[ ]+1f000024 [ ]+pcaddu18i[ ]+[ ]+\$a0, -524287 +[ ]*0000000000000000 <.text>: +[ ]+0:[ ]+020000a4[ ]+slti[ ]+\$a0, \$a1, 0 +[ ]+4:[ ]+021ffca4[ ]+slti[ ]+\$a0, \$a1, 2047 +[ ]+8:[ ]+022004a4[ ]+slti[ ]+\$a0, \$a1, -2047 +[ ]+c:[ ]+024000a4[ ]+sltui[ ]+\$a0, \$a1, 0 +[ ]+10:[ ]+025ffca4[ ]+sltui[ ]+\$a0, \$a1, 2047 +[ ]+14:[ ]+026004a4[ ]+sltui[ ]+\$a0, \$a1, -2047 +[ ]+18:[ ]+028000a4[ ]+addi.w[ ]+\$a0, \$a1, 0 +[ ]+1c:[ ]+029ffca4[ ]+addi.w[ ]+\$a0, \$a1, 2047 +[ ]+20:[ ]+02a004a4[ ]+addi.w[ ]+\$a0, \$a1, -2047 +[ ]+24:[ ]+02c000a4[ ]+addi.d[ ]+\$a0, \$a1, 0 +[ ]+28:[ ]+02dffca4[ ]+addi.d[ ]+\$a0, \$a1, 2047 +[ ]+2c:[ ]+02e004a4[ ]+addi.d[ ]+\$a0, \$a1, -2047 +[ ]+30:[ ]+030000a4[ ]+lu52i.d[ ]+\$a0, \$a1, 0 +[ ]+34:[ ]+031ffca4[ ]+lu52i.d[ ]+\$a0, \$a1, 2047 +[ ]+38:[ ]+032004a4[ ]+lu52i.d[ ]+\$a0, \$a1, -2047 +[ ]+3c:[ ]+034000a4[ ]+andi[ ]+\$a0, \$a1, 0x0 +[ ]+40:[ ]+035ffca4[ ]+andi[ ]+\$a0, \$a1, 0x7ff +[ ]+44:[ ]+038000a4[ ]+ori[ ]+\$a0, \$a1, 0x0 +[ ]+48:[ ]+039ffca4[ ]+ori[ ]+\$a0, \$a1, 0x7ff +[ ]+4c:[ ]+03c000a4[ ]+xori[ ]+\$a0, \$a1, 0x0 +[ ]+50:[ ]+03dffca4[ ]+xori[ ]+\$a0, \$a1, 0x7ff +[ ]+54:[ ]+100000a4[ ]+addu16i.d[ ]+\$a0, \$a1, 0 +[ ]+58:[ ]+11fffca4[ ]+addu16i.d[ ]+\$a0, \$a1, 32767 +[ ]+5c:[ ]+120004a4[ ]+addu16i.d[ ]+\$a0, \$a1, -32767 +[ ]+60:[ ]+14000004[ ]+lu12i.w[ ]+\$a0, 0 +[ ]+64:[ ]+14ffffe4[ ]+lu12i.w[ ]+\$a0, 524287 +[ ]+68:[ ]+17000024[ ]+lu32i.d[ ]+\$a0, -524287 +[ ]+6c:[ ]+18000004[ ]+pcaddi[ ]+\$a0, 0 +[ ]+70:[ ]+18ffffe4[ ]+pcaddi[ ]+\$a0, 2097148 +[ ]+74:[ ]+19000004[ ]+pcaddi[ ]+\$a0, -2097152 +[ ]+78:[ ]+1a000004[ ]+pcalau12i[ ]+\$a0, 0 +[ ]+7c:[ ]+1affffe4[ ]+pcalau12i[ ]+\$a0, 524287 +[ ]+80:[ ]+1b000024[ ]+pcalau12i[ ]+\$a0, -524287 +[ ]+84:[ ]+1c000004[ ]+pcaddu12i[ ]+\$a0, 0 +[ ]+88:[ ]+1cffffe4[ ]+pcaddu12i[ ]+\$a0, 524287 +[ ]+8c:[ ]+1d000024[ ]+pcaddu12i[ ]+\$a0, -524287 +[ ]+90:[ ]+1e000004[ ]+pcaddu18i[ ]+\$a0, 0 +[ ]+94:[ ]+1effffe4[ ]+pcaddu18i[ ]+\$a0, 524287 +[ ]+98:[ ]+1f000024[ ]+pcaddu18i[ ]+\$a0, -524287 diff --git a/gas/testsuite/gas/loongarch/imm_op.s b/gas/testsuite/gas/loongarch/imm_op.s index 7e1c5518cba..329486cad55 100644 --- a/gas/testsuite/gas/loongarch/imm_op.s +++ b/gas/testsuite/gas/loongarch/imm_op.s @@ -26,8 +26,8 @@ lu12i.w $r4,0 lu12i.w $r4,0x7ffff lu32i.d $r4,-0x7ffff pcaddi $r4,0 -pcaddi $r4,0x7ffff -pcaddi $r4,-0x7ffff +pcaddi $r4,0x1ffffc +pcaddi $r4,-0x200000 pcalau12i $r4,0 pcalau12i $r4,0x7ffff pcalau12i $r4,-0x7ffff diff --git a/gas/testsuite/gas/loongarch/pcaddi.d b/gas/testsuite/gas/loongarch/pcaddi.d new file mode 100644 index 00000000000..06dcee1a60c --- /dev/null +++ b/gas/testsuite/gas/loongarch/pcaddi.d @@ -0,0 +1,13 @@ +#as: +#objdump: -dr + +.*:[ ]+file format .* + + +Disassembly of section .text: + +[ ]*0000000000000000 <.L1>: +[ ]+0:[ ]+1800000c[ ]+pcaddi[ ]+\$t0, 0 +[ ]+0: R_LARCH_PCREL20_S2[ ]+.L1 +[ ]+4:[ ]+1800000c[ ]+pcaddi[ ]+\$t0, 0 +[ ]+4: R_LARCH_PCREL20_S2[ ]+.L2 diff --git a/gas/testsuite/gas/loongarch/pcaddi.s b/gas/testsuite/gas/loongarch/pcaddi.s new file mode 100644 index 00000000000..46b56306ce4 --- /dev/null +++ b/gas/testsuite/gas/loongarch/pcaddi.s @@ -0,0 +1,4 @@ +.L1: + pcaddi $t0, .L1 + pcaddi $t0, .L2 +.L2: diff --git a/opcodes/loongarch-opc.c b/opcodes/loongarch-opc.c index 7d110683e93..072c138472f 100644 --- a/opcodes/loongarch-opc.c +++ b/opcodes/loongarch-opc.c @@ -564,6 +564,7 @@ static struct loongarch_opcode loongarch_imm_opcodes[] = { 0x10000000, 0xfc000000, "addu16i.d", "r0:5,r5:5,s10:16", 0, 0, 0, 0 }, { 0x14000000, 0xfe000000, "lu12i.w", "r0:5,s5:20", 0, 0, 0, 0 }, { 0x16000000, 0xfe000000, "lu32i.d", "r0:5,s5:20", 0, 0, 0, 0 }, + { 0x0, 0x0, "pcaddi", "r,la", "pcaddi %1, %%pc20(%2)", 0, 0, 0 }, { 0x18000000, 0xfe000000, "pcaddi", "r0:5,s5:20<<2", 0, 0, 0, 0 }, { 0x1a000000, 0xfe000000, "pcalau12i", "r0:5,s5:20", 0, 0, 0, 0 }, { 0x1c000000, 0xfe000000, "pcaddu12i", "r0:5,s5:20", 0, 0, 0, 0 },