From patchwork Thu Sep 28 08:01:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lulu Cai X-Patchwork-Id: 145842 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3145252vqu; Thu, 28 Sep 2023 01:02:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGl/znbDZQOpQhFbnWTGFbGA+xG73y4ozV7R3Uhc0V/EcgLsPRXZKy9/1DGv91vm6PxbnbI X-Received: by 2002:a17:906:31d7:b0:9b2:b119:4918 with SMTP id f23-20020a17090631d700b009b2b1194918mr585701ejf.13.1695888136686; Thu, 28 Sep 2023 01:02:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695888136; cv=none; d=google.com; s=arc-20160816; b=vRrirX/f4HNoOnAtMTXFU5efXd+HD0K7LDCh2lAhhCn/kxr6JtHTBsURO4/t0HKqE9 r84Pb8xy3c1TyqrPpai+266BIxlsYtIt0B6+XusIV1tphL7aqSb2AGI8/aGp9y+Ytqkb VyYJtc0KXs0sdfBgMPjJslElrcN0MuVSwVJdH7kYJFH//+bo5ULeQNsvVai+TfLOT+TE pFlTCZW3pBNSKZf70rdnhj/ymzL9ht9JZ9gSTB2XYhZt3QbDBNH6z3NKmrRwis0vtmoo rhenSwfMQTfnoxxUQF9BFj5kilY6v2smBZxXwnVbC7KTxloGjNeVqDBOyBtfOFJgeDaa X6Qg== 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=CgJ5mg4e5fxeEgGZlEBiZ6oyRXeBkcCWmaZz4nxPVjI=; fh=QpykPZvl8YOjxJLNdAbPbZH5o/33CLekOvWxiufftr0=; b=MTGFjvz4qAa8pRev2uvXJft3r/G82ubdrN57/rDgPVGl59u0WXiFQCRzF2M0iyBdDx LpgIYk19bQ8vCL2qP3Cpr2vhWdHMazLnMdPmZDZExBNVgRSnYNvCxkolzO/iksVB9X5d 9pLHaeHQ0qLmRw9sYmt7YLGljUsC5G/oTzAvGS8x/RcG9goHeoz/qn9vxyf8OnpMO5My efvqSYas43Vx4Uo9to+FROsfmk3DkSu64xdQkjk2TYS4u8izhSinnlGt4Rzw+Wz8XBeX 7WP2gsQ0l1/kXgEhPmtLdUSGXglExZj3AKY40iA3iXjyAMsygtBDM8eiHxF8tvJlPn+V rbdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id rh27-20020a17090720fb00b009a633ef0e21si13359120ejb.1037.2023.09.28.01.02.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 01:02:16 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 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 E51BC386190C for ; Thu, 28 Sep 2023 08:02:12 +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 573163858CD1 for ; Thu, 28 Sep 2023 08:02:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 573163858CD1 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.6.5]) by gateway (Coremail) with SMTP id _____8DxVuj2MhVlM7otAA--.52200S3; Thu, 28 Sep 2023 16:01:58 +0800 (CST) Received: from 5.5.5 (unknown [10.2.6.5]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Bxni_zMhVl3CUVAA--.43623S5; Thu, 28 Sep 2023 16:01:56 +0800 (CST) From: Lulu Cai To: binutils@sourceware.org Cc: xuchenghua@loongson.cn, chenglulu@loongson.cn, liuzhensong@loongson.cn, mengqinggang@loongson.cn, xry111@xry111.site, i.swmail@xen0n.name, maskray@google.com, cailulu Subject: [PATCH 2/2] Add testsuits for new assembler option of mthin-add-sub. Date: Thu, 28 Sep 2023 16:01:53 +0800 Message-Id: <20230928080153.3626326-2-cailulu@loongson.cn> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230928080153.3626326-1-cailulu@loongson.cn> References: <20230928080153.3626326-1-cailulu@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Bxni_zMhVl3CUVAA--.43623S5 X-CM-SenderInfo: xfdlz3tox6z05rqj20fqof0/1tbiAQAIB2UU4qQHKwAAsV X-Coremail-Antispam: 1Uk129KBj93XoW3Ar1UJryDCry8JryxXF15ZFc_yoWfXw1rpr 9rZrnakFW0kan7WF4UCry5Cw17Xw40v3Wjva4fGFyIkr1xGryxJw4xJw4aqayDtryUKw1a vr1kXrW2qFyvkwcCm3ZEXasCq-sJn29KB7ZKAUJUUUU5529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUv2b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVWxJr0_GcWle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jw0_WrylYx0Ex4A2jsIE 14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x 0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwCFI7km07C267AKxVWUXVWUAwC20s026c02 F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GF ylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7Cj xVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r 1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU8sX o7UUUUU== X-Spam-Status: No, score=-13.5 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.30 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: 1778267598628885727 X-GMAIL-MSGID: 1778267598628885727 From: cailulu --- gas/testsuite/gas/loongarch/no_thin_add_sub.d | 66 +++++++++++++++++++ gas/testsuite/gas/loongarch/no_thin_add_sub.s | 44 +++++++++++++ ...pcrel_norelax.d => thin_add_sub_norelax.d} | 25 ++++--- ...pcrel_norelax.s => thin_add_sub_norelax.s} | 8 +-- .../{pcrel_relax.d => thin_add_sub_relax.d} | 12 ++-- .../{pcrel_relax.s => thin_add_sub_relax.s} | 0 6 files changed, 131 insertions(+), 24 deletions(-) create mode 100644 gas/testsuite/gas/loongarch/no_thin_add_sub.d create mode 100644 gas/testsuite/gas/loongarch/no_thin_add_sub.s rename gas/testsuite/gas/loongarch/{pcrel_norelax.d => thin_add_sub_norelax.d} (75%) rename gas/testsuite/gas/loongarch/{pcrel_norelax.s => thin_add_sub_norelax.s} (87%) rename gas/testsuite/gas/loongarch/{pcrel_relax.d => thin_add_sub_relax.d} (91%) rename gas/testsuite/gas/loongarch/{pcrel_relax.s => thin_add_sub_relax.s} (100%) diff --git a/gas/testsuite/gas/loongarch/no_thin_add_sub.d b/gas/testsuite/gas/loongarch/no_thin_add_sub.d new file mode 100644 index 00000000000..614aca71d66 --- /dev/null +++ b/gas/testsuite/gas/loongarch/no_thin_add_sub.d @@ -0,0 +1,66 @@ +#as: +#objdump: -Dr + +.*:[ ]+file format .* + + +Disassembly of section .text: + +00000000.* <.L1>: +[ ]+... +[ ]+0:[ ]+R_LARCH_ADD32[ ]+.L3 +[ ]+0:[ ]+R_LARCH_SUB32[ ]+.L1 +[ ]+4:[ ]+R_LARCH_ADD32[ ]+.L3 +[ ]+4:[ ]+R_LARCH_SUB32[ ]+.L1 + +0*00000008[ ]+<.L2>: +[ ]+... +[ ]+8:[ ]+R_LARCH_ADD64[ ]+.L3 +[ ]+8:[ ]+R_LARCH_SUB64[ ]+.L2 +[ ]+10:[ ]+R_LARCH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+0xfffffff4 +[ ]+18:[ ]+ffffffff[ ]+.word[ ]+0xffffffff +[ ]+... +[ ]+1c:[ ]+R_LARCH_ADD64[ ]+.L3 +[ ]+1c:[ ]+R_LARCH_SUB64[ ]+.L5 diff --git a/gas/testsuite/gas/loongarch/no_thin_add_sub.s b/gas/testsuite/gas/loongarch/no_thin_add_sub.s new file mode 100644 index 00000000000..c680168956f --- /dev/null +++ b/gas/testsuite/gas/loongarch/no_thin_add_sub.s @@ -0,0 +1,44 @@ + .section .text +.L1: + # add32+sub32 + .4byte .L3-.L1 + .4byte .L3-.L1 +.L2: + # add64+sub64 + .8byte .L3-.L2 + .8byte .L3-.L2 + + .section sx +.L3: + # no relocation + .4byte .L3-.L4 + .8byte .L3-.L4 +.L4: + # add32+sub32 + .4byte .L4-.L5 + # add64+sub64 + .8byte .L4-.L5 + + .section sy +.L5: + # add32+sub32 + .4byte .L1-.L5 + .4byte .L3-.L5 + # add64+sub64 + .8byte .L1-.L5 + .8byte .L3-.L5 + + .section sz + # add32+sub32 + .4byte .L1-.L2 + # no relocation + .4byte .L3-.L4 + # add32+sub32 + .4byte .L3-.L5 + + # add64+sub64 + .8byte .L1-.L2 + # no relocation + .8byte .L3-.L4 + # add64+sub64 + .8byte .L3-.L5 diff --git a/gas/testsuite/gas/loongarch/pcrel_norelax.d b/gas/testsuite/gas/loongarch/thin_add_sub_norelax.d similarity index 75% rename from gas/testsuite/gas/loongarch/pcrel_norelax.d rename to gas/testsuite/gas/loongarch/thin_add_sub_norelax.d index 842c8d48e0e..702093b6997 100644 --- a/gas/testsuite/gas/loongarch/pcrel_norelax.d +++ b/gas/testsuite/gas/loongarch/thin_add_sub_norelax.d @@ -1,4 +1,4 @@ -#as: -mno-relax +#as: -mthin-add-sub -mno-relax #objdump: -Dr .*:[ ]+file format .* @@ -10,20 +10,17 @@ Disassembly of section .text: [ ]+... [ ]+0:[ ]+R_LARCH_32_PCREL[ ]+.L3 [ ]+4:[ ]+R_LARCH_32_PCREL[ ]+.L3\+0x4 - -0*00000008[ ]+<.L2>: -[ ]+... [ ]+8:[ ]+R_LARCH_64_PCREL[ ]+.L3 [ ]+10:[ ]+R_LARCH_64_PCREL[ ]+.L3\+0x8 Disassembly[ ]+of[ ]+section[ ]+sx: -0*00000000[ ]+<.L3>: +0*00000000[ ]+<.L3>: [ ]+0:[ ]+fffffff4[ ]+.word[ ]+0xfffffff4 [ ]+4:[ ]+fffffff4[ ]+.word[ ]+0xfffffff4 [ ]+8:[ ]+ffffffff[ ]+.word[ ]+0xffffffff -0*0000000c[ ]+<.L4>: +0*0000000c[ ]+<.L4>: [ ]+... [ ]+c:[ ]+R_LARCH_ADD32[ ]+.L4 [ ]+c:[ ]+R_LARCH_SUB32[ ]+.L5 @@ -32,25 +29,25 @@ Disassembly[ ]+of[ ]+section[ ]+sx: Disassembly[ ]+of[ ]+section[ ]+sy: -0*00000000[ ]+<.L5>: +0*00000000[ ]+<.L5>: [ ]+... [ ]+0:[ ]+R_LARCH_32_PCREL[ ]+.L1 -[ ]+4:[ ]+R_LARCH_32_PCREL[ ]+.L2\+0x4 +[ ]+4:[ ]+R_LARCH_32_PCREL[ ]+.L3\+0x4 [ ]+8:[ ]+R_LARCH_64_PCREL[ ]+.L1\+0x8 -[ ]+10:[ ]+R_LARCH_64_PCREL[ ]+.L2\+0x10 +[ ]+10:[ ]+R_LARCH_64_PCREL[ ]+.L3\+0x10 Disassembly[ ]+of[ ]+section[ ]+sz: -0*00000000[ ]+: +0*00000000[ ]+: [ ]+0:[ ]+fffffff8[ ]+.word[ ]+0xfffffff8 [ ]+4:[ ]+fffffff4[ ]+.word[ ]+0xfffffff4 [ ]+8:[ ]+00000000[ ]+.word[ ]+0x00000000 -[ ]+8:[ ]+R_LARCH_ADD32[ ]+.L2 -[ ]+8:[ ]+R_LARCH_SUB32[ ]+.L3 +[ ]+8:[ ]+R_LARCH_ADD32[ ]+.L3 +[ ]+8:[ ]+R_LARCH_SUB32[ ]+.L5 [ ]+c:[ ]+fffffff8[ ]+.word[ ]+0xfffffff8 [ ]+10:[ ]+ffffffff[ ]+.word[ ]+0xffffffff [ ]+14:[ ]+fffffff4[ ]+.word[ ]+0xfffffff4 [ ]+18:[ ]+ffffffff[ ]+.word[ ]+0xffffffff [ ]+... -[ ]+1c:[ ]+R_LARCH_ADD64[ ]+.L2 -[ ]+1c:[ ]+R_LARCH_SUB64[ ]+.L3 +[ ]+1c:[ ]+R_LARCH_ADD64[ ]+.L3 +[ ]+1c:[ ]+R_LARCH_SUB64[ ]+.L5 diff --git a/gas/testsuite/gas/loongarch/pcrel_norelax.s b/gas/testsuite/gas/loongarch/thin_add_sub_norelax.s similarity index 87% rename from gas/testsuite/gas/loongarch/pcrel_norelax.s rename to gas/testsuite/gas/loongarch/thin_add_sub_norelax.s index 09527f146a9..94cfd90870c 100644 --- a/gas/testsuite/gas/loongarch/pcrel_norelax.s +++ b/gas/testsuite/gas/loongarch/thin_add_sub_norelax.s @@ -23,20 +23,20 @@ .L5: # 32_pcrel .4byte .L1-.L5 - .4byte .L2-.L5 + .4byte .L3-.L5 # 64_pcrel .8byte .L1-.L5 - .8byte .L2-.L5 + .8byte .L3-.L5 .section sz # no relocation .4byte .L1-.L2 .4byte .L3-.L4 # add32+sub32 - .4byte .L2-.L3 + .4byte .L3-.L5 # no relocation .8byte .L1-.L2 .8byte .L3-.L4 # add64+sub64 - .8byte .L2-.L3 + .8byte .L3-.L5 diff --git a/gas/testsuite/gas/loongarch/pcrel_relax.d b/gas/testsuite/gas/loongarch/thin_add_sub_relax.d similarity index 91% rename from gas/testsuite/gas/loongarch/pcrel_relax.d rename to gas/testsuite/gas/loongarch/thin_add_sub_relax.d index d6f875259be..9455c3e66bf 100644 --- a/gas/testsuite/gas/loongarch/pcrel_relax.d +++ b/gas/testsuite/gas/loongarch/thin_add_sub_relax.d @@ -1,4 +1,4 @@ -#as: +#as: -mthin-add-sub #objdump: -Dr .*:[ ]+file format .* @@ -12,7 +12,7 @@ Disassembly of section .text: [ ]+4:[ ]+R_LARCH_ADD32[ ]+.L3 [ ]+4:[ ]+R_LARCH_SUB32[ ]+.L1 -0*00000008[ ]+<.L2>: +0*00000008[ ]+<.L2>: [ ]+... [ ]+8:[ ]+R_LARCH_64_PCREL[ ]+.L3 [ ]+10:[ ]+R_LARCH_ADD64[ ]+.L3 @@ -20,12 +20,12 @@ Disassembly of section .text: Disassembly[ ]+of[ ]+section[ ]+sx: -0*00000000[ ]+<.L3>: +0*00000000[ ]+<.L3>: [ ]+0:[ ]+fffffff4[ ]+.word[ ]+0xfffffff4 [ ]+4:[ ]+fffffff4[ ]+.word[ ]+0xfffffff4 [ ]+8:[ ]+ffffffff[ ]+.word[ ]+0xffffffff -0*0000000c[ ]+<.L4>: +0*0000000c[ ]+<.L4>: [ ]+... [ ]+c:[ ]+R_LARCH_ADD32[ ]+.L4 [ ]+c:[ ]+R_LARCH_SUB32[ ]+.L5 @@ -34,7 +34,7 @@ Disassembly[ ]+of[ ]+section[ ]+sx: Disassembly[ ]+of[ ]+section[ ]+sy: -0*00000000[ ]+<.L5>: +0*00000000[ ]+<.L5>: [ ]+... [ ]+0:[ ]+R_LARCH_32_PCREL[ ]+.L1 [ ]+4:[ ]+R_LARCH_32_PCREL[ ]+.L3\+0x4 @@ -43,7 +43,7 @@ Disassembly[ ]+of[ ]+section[ ]+sy: Disassembly[ ]+of[ ]+section[ ]+sz: -0*00000000[ ]+: +0*00000000[ ]+: [ ]+0:[ ]+00000000[ ]+.word[ ]+0x00000000 [ ]+0:[ ]+R_LARCH_ADD32[ ]+.L1 [ ]+0:[ ]+R_LARCH_SUB32[ ]+.L2 diff --git a/gas/testsuite/gas/loongarch/pcrel_relax.s b/gas/testsuite/gas/loongarch/thin_add_sub_relax.s similarity index 100% rename from gas/testsuite/gas/loongarch/pcrel_relax.s rename to gas/testsuite/gas/loongarch/thin_add_sub_relax.s