From patchwork Sat Nov 5 12:29:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsukasa OI X-Patchwork-Id: 15963 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp966052wru; Sat, 5 Nov 2022 05:32:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4MJU6u/pvYqMZrzYkNN1FrSdiGHC/j8l+SqNSEXCVLUET73oaUO1V8y8O2zNnkvTUl29Pn X-Received: by 2002:a05:6402:1cca:b0:460:7d72:8f2 with SMTP id ds10-20020a0564021cca00b004607d7208f2mr40753903edb.205.1667651573788; Sat, 05 Nov 2022 05:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667651573; cv=none; d=google.com; s=arc-20160816; b=uDgXxFpV66xjk8z88F8CGcAp2YNN8VPLngFEQ/9IK2OlKQHhU5k25MK3sC9tJDi5pi a5B9O7/1mo21pIEhKeqNCS0TzyN48TAEttOVXCt2EwtYJpxBZrVALqzPAOAjGths/+io ifiL3ixw5CdCmjc6r/a+Ld5xBcpNV2k3bGZmsWC9osXnclF++khr1nypb2Wn0Q30iFzi vYxcYNmTwpBT5uYbrnfAKI4Kr6Sev7XmSo0KNxeA5PMznH44+OsRtVLJr6fkLZRq3FXx tPJmgHyT4t2rLbc+C8DnZ5BIKry6U7qoHtF8p7crEh7coNVsCVAfAbr8ScFc6oFRmFlc 80Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from: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:to:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=oJL7ULs7TL8ur9AjhHkViS9RUZ4ml2cVyTUlUCTysQg=; b=K23UxmQpg5TKe/a2/9AsEkk7aRBeOFKC6Je4txCbuqJr7qNP+9cQyVY9dgV+kquBbI gG4WAMKvIE7nCI4QYVjpg9anqXMoY/nL096eEiNEcQgNwlR++5lUfnr7pIxqttptpuRc Xc+SYiLM83yQEM8Sum/wt/SI1mOk0yZ5Rv0MI/djplqUFdTf49ZBjFRDS/XSnS+udcED U8ucd7vn7FtbYxOUkw7kivINRdcXSu+r6ST6jPAZHoLG60hlAIvWz9tBM1fihzU6HnjR aPyc7q0Yp9bhkhEMpXq7aeuDSQGALXviHjDdD4DayWc2Nk3ZiUfWHome28bc+9/YOg1K A+bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=aIjsmk2L; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id sg10-20020a170907a40a00b0079e925b0200si2681037ejc.59.2022.11.05.05.32.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Nov 2022 05:32:53 -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; dkim=pass header.i=@sourceware.org header.s=default header.b=aIjsmk2L; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5803E38576A1 for ; Sat, 5 Nov 2022 12:32:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5803E38576A1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667651545; bh=oJL7ULs7TL8ur9AjhHkViS9RUZ4ml2cVyTUlUCTysQg=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=aIjsmk2L7OZB6mBvIsEJXSMXVSHG4UblKPj15LfxL3ukcIunUpxq23uimK0PBs9Kz E73fwyJW1ao02zDj5yMO6Gc5Nvb/V09vEBw82rZ5RPmKQxDD9Bc32ttq/O+e4fyjq1 M7EcWovhlH2u3ttiFmXV1dYb24FSnCOQMxQLl0FE= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id 2818E3858427 for ; Sat, 5 Nov 2022 12:30:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2818E3858427 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 63994300091; Sat, 5 Nov 2022 12:30:26 +0000 (UTC) To: Tsukasa OI , Nelson Chu , Kito Cheng , Palmer Dabbelt Subject: [PATCH 06/12] RISC-V: Reorganize/enhance {sign, zero}-extension instructions Date: Sat, 5 Nov 2022 12:29:12 +0000 Message-Id: <7311ed3d2429000e18877d7af594890da170a7a3.1667651354.git.research_trasio@irq.a4lg.com> In-Reply-To: References: Mime-Version: 1.0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, 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: , X-Patchwork-Original-From: Tsukasa OI via Binutils From: Tsukasa OI Reply-To: Tsukasa OI Cc: binutils@sourceware.org Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748659416879182568?= X-GMAIL-MSGID: =?utf-8?q?1748659416879182568?= This commit: - Clarifies the roles of {sign,zero}-extension instruction tests, - Shortens ".s" file using macro, - Enhances the tests with 'Zba' and 'Zbb' extensions and - Makes some tidying (e.g. making matching patterns stricter). gas/ChangeLog: * testsuite/gas/riscv/ext-insn.s: Reorganize based on ext.s. * testsuite/gas/riscv/ext-insn-32-noalias.d: Based on ext-32.d. Make matching pattern stricter. * testsuite/gas/riscv/ext-insn-64-noalias.d: Based on ext-64.d. Make matching pattern stricter. * testsuite/gas/riscv/ext-insn-32-noarch.d: New failure test. * testsuite/gas/riscv/ext-insn-32-noarch.l: Likewise. * testsuite/gas/riscv/ext-insn-64-noarch.d: New test to make sure that NOARCH=1 does not make errors since all opcodes are valid. * testsuite/gas/riscv/ext-insn-zba-32-noalias.d: Test with 'Zba'. * testsuite/gas/riscv/ext-insn-zba-64-noalias.d: Likewise. * testsuite/gas/riscv/ext-insn-zbb-32-noalias.d: Test with 'Zbb'. * testsuite/gas/riscv/ext-insn-zbb-64-noalias.d: Likewise. * testsuite/gas/riscv/ext.s: Removed. * testsuite/gas/riscv/ext-32.d: Removed. * testsuite/gas/riscv/ext-64.d: Removed. --- gas/testsuite/gas/riscv/ext-32.d | 39 -------------- gas/testsuite/gas/riscv/ext-64.d | 51 ------------------- gas/testsuite/gas/riscv/ext-insn-32-noalias.d | 39 ++++++++++++++ gas/testsuite/gas/riscv/ext-insn-32-noarch.d | 3 ++ gas/testsuite/gas/riscv/ext-insn-32-noarch.l | 9 ++++ gas/testsuite/gas/riscv/ext-insn-64-noalias.d | 51 +++++++++++++++++++ gas/testsuite/gas/riscv/ext-insn-64-noarch.d | 5 ++ .../gas/riscv/ext-insn-zba-32-noalias.d | 39 ++++++++++++++ .../gas/riscv/ext-insn-zba-64-noalias.d | 47 +++++++++++++++++ .../gas/riscv/ext-insn-zbb-32-noalias.d | 27 ++++++++++ .../gas/riscv/ext-insn-zbb-64-noalias.d | 39 ++++++++++++++ gas/testsuite/gas/riscv/ext-insn.s | 23 +++++++++ gas/testsuite/gas/riscv/ext.s | 38 -------------- 13 files changed, 282 insertions(+), 128 deletions(-) delete mode 100644 gas/testsuite/gas/riscv/ext-32.d delete mode 100644 gas/testsuite/gas/riscv/ext-64.d create mode 100644 gas/testsuite/gas/riscv/ext-insn-32-noalias.d create mode 100644 gas/testsuite/gas/riscv/ext-insn-32-noarch.d create mode 100644 gas/testsuite/gas/riscv/ext-insn-32-noarch.l create mode 100644 gas/testsuite/gas/riscv/ext-insn-64-noalias.d create mode 100644 gas/testsuite/gas/riscv/ext-insn-64-noarch.d create mode 100644 gas/testsuite/gas/riscv/ext-insn-zba-32-noalias.d create mode 100644 gas/testsuite/gas/riscv/ext-insn-zba-64-noalias.d create mode 100644 gas/testsuite/gas/riscv/ext-insn-zbb-32-noalias.d create mode 100644 gas/testsuite/gas/riscv/ext-insn-zbb-64-noalias.d create mode 100644 gas/testsuite/gas/riscv/ext-insn.s delete mode 100644 gas/testsuite/gas/riscv/ext.s diff --git a/gas/testsuite/gas/riscv/ext-32.d b/gas/testsuite/gas/riscv/ext-32.d deleted file mode 100644 index 97daa31d0e9..00000000000 --- a/gas/testsuite/gas/riscv/ext-32.d +++ /dev/null @@ -1,39 +0,0 @@ -#as: -march=rv32i -#source: ext.s -#objdump: -d - -.*:[ ]+file format .* - - -Disassembly of section .text: - -0+000 : -[ ]+0:[ ]+0ff57513[ ]+zext.b[ ]+a0,a0 -[ ]+4:[ ]+01051513[ ]+sll[ ]+a0,a0,0x10 -[ ]+8:[ ]+01055513[ ]+srl[ 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 100644 index 1fe339c4af4..00000000000 --- a/gas/testsuite/gas/riscv/ext-64.d +++ /dev/null @@ -1,51 +0,0 @@ -#as: -march=rv64i -defsym __64_bit__=1 -#source: ext.s -#objdump: -d - -.*:[ ]+file format .* - - -Disassembly of section .text: - -0+000 : -[ ]+0:[ ]+0ff57513[ ]+zext.b[ ]+a0,a0 -[ ]+4:[ ]+03051513[ ]+sll[ ]+a0,a0,0x30 -[ ]+8:[ ]+03055513[ ]+srl[ ]+a0,a0,0x30 -[ ]+c:[ ]+03851513[ ]+sll[ ]+a0,a0,0x38 -[ ]+10:[ ]+43855513[ ]+sra[ ]+a0,a0,0x38 -[ ]+14:[ ]+03051513[ ]+sll[ ]+a0,a0,0x30 -[ ]+18:[ ]+43055513[ ]+sra[ ]+a0,a0,0x30 -[ ]+1c:[ ]+0ff67593[ ]+zext.b[ ]+a1,a2 -[ ]+20:[ ]+03061593[ ]+sll[ ]+a1,a2,0x30 -[ ]+24:[ ]+0305d593[ ]+srl[ ]+a1,a1,0x30 -[ ]+28:[ ]+03861593[ ]+sll[ ]+a1,a2,0x38 -[ ]+2c:[ ]+4385d593[ ]+sra[ ]+a1,a1,0x38 -[ ]+30:[ ]+03061593[ ]+sll[ ]+a1,a2,0x30 -[ ]+34:[ ]+4305d593[ ]+sra[ ]+a1,a1,0x30 -[ ]+38:[ ]+02051513[ ]+sll[ ]+a0,a0,0x20 -[ ]+3c:[ ]+02055513[ ]+srl[ ]+a0,a0,0x20 -[ ]+40:[ ]+0005051b[ ]+sext.w[ ]+a0,a0 -[ ]+44:[ ]+02061593[ ]+sll[ ]+a1,a2,0x20 -[ ]+48:[ ]+0205d593[ ]+srl[ ]+a1,a1,0x20 -[ ]+4c:[ ]+0006059b[ ]+sext.w[ ]+a1,a2 -[ ]+50:[ ]+0ff57513[ ]+zext.b[ ]+a0,a0 -[ ]+54:[ ]+1542[ ]+sll[ ]+a0,a0,0x30 -[ ]+56:[ ]+9141[ ]+srl[ ]+a0,a0,0x30 -[ ]+58:[ ]+1562[ ]+sll[ ]+a0,a0,0x38 -[ ]+5a:[ ]+9561[ ]+sra[ ]+a0,a0,0x38 -[ ]+5c:[ ]+1542[ ]+sll[ ]+a0,a0,0x30 -[ ]+5e:[ ]+9541[ ]+sra[ ]+a0,a0,0x30 -[ ]+60:[ ]+0ff67593[ ]+zext.b[ ]+a1,a2 -[ ]+64:[ ]+03061593[ ]+sll[ ]+a1,a2,0x30 -[ ]+68:[ ]+91c1[ ]+srl[ ]+a1,a1,0x30 -[ ]+6a:[ ]+03861593[ ]+sll[ ]+a1,a2,0x38 -[ ]+6e:[ ]+95e1[ ]+sra[ ]+a1,a1,0x38 -[ ]+70:[ ]+03061593[ ]+sll[ ]+a1,a2,0x30 -[ ]+74:[ ]+95c1[ ]+sra[ ]+a1,a1,0x30 -[ ]+76:[ ]+1502[ ]+sll[ ]+a0,a0,0x20 -[ ]+78:[ ]+9101[ ]+srl[ ]+a0,a0,0x20 -[ ]+7a:[ ]+2501[ ]+sext.w[ ]+a0,a0 -[ ]+7c:[ ]+02061593[ ]+sll[ ]+a1,a2,0x20 -[ ]+80:[ ]+9181[ ]+srl[ ]+a1,a1,0x20 -[ ]+82:[ ]+0006059b[ ]+sext.w[ ]+a1,a2 -#... diff --git a/gas/testsuite/gas/riscv/ext-insn-32-noalias.d b/gas/testsuite/gas/riscv/ext-insn-32-noalias.d new file mode 100644 index 00000000000..237fcf033d0 --- /dev/null +++ b/gas/testsuite/gas/riscv/ext-insn-32-noalias.d @@ -0,0 +1,39 @@ +#as: -march=rv32i -I$srcdir/$subdir -defsym XLEN=32 +#source: ext-insn.s +#objdump: -d -M no-aliases + +.*:[ ]+file format .* + + +Disassembly of section .text: + +0+000 : +[ ]+[0-9a-f]+:[ ]+0ff57513[ ]+andi[ ]+a0,a0,255 +[ ]+[0-9a-f]+:[ ]+01051513[ ]+slli[ ]+a0,a0,0x10 +[ ]+[0-9a-f]+:[ ]+01055513[ ]+srli[ ]+a0,a0,0x10 +[ ]+[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e1[ ]+c\.srai[ ]+a1,0x18 +[ ]+[0-9a-f]+:[ ]+01061593[ ]+slli[ ]+a1,a2,0x10 +[ ]+[0-9a-f]+:[ ]+85c1[ ]+c\.srai[ ]+a1,0x10 +#... diff --git a/gas/testsuite/gas/riscv/ext-insn-32-noarch.d b/gas/testsuite/gas/riscv/ext-insn-32-noarch.d new file mode 100644 index 00000000000..7a2f4ddfec2 --- /dev/null +++ b/gas/testsuite/gas/riscv/ext-insn-32-noarch.d @@ -0,0 +1,3 @@ +#as: -march=rv32i -I$srcdir/$subdir -defsym XLEN=32 -defsym NOARCH=1 +#source: ext-insn.s +#error_output: ext-insn-32-noarch.l diff --git a/gas/testsuite/gas/riscv/ext-insn-32-noarch.l b/gas/testsuite/gas/riscv/ext-insn-32-noarch.l new file mode 100644 index 00000000000..f5954f207f0 --- /dev/null +++ b/gas/testsuite/gas/riscv/ext-insn-32-noarch.l @@ -0,0 +1,9 @@ +.*: Assembler messages: +.*: Error: unrecognized opcode `zext.w a0,a0' +.*: Error: unrecognized opcode `sext.w a0,a0' +.*: Error: unrecognized opcode `zext.w a1,a2' +.*: Error: unrecognized opcode `sext.w a1,a2' +.*: Error: unrecognized opcode `zext.w a0,a0' +.*: Error: unrecognized opcode `sext.w a0,a0' +.*: Error: unrecognized opcode `zext.w a1,a2' +.*: Error: unrecognized opcode `sext.w a1,a2' diff --git a/gas/testsuite/gas/riscv/ext-insn-64-noalias.d b/gas/testsuite/gas/riscv/ext-insn-64-noalias.d new file mode 100644 index 00000000000..9a273eea0d7 --- /dev/null +++ b/gas/testsuite/gas/riscv/ext-insn-64-noalias.d @@ -0,0 +1,51 @@ +#as: -march=rv64i -I$srcdir/$subdir -defsym XLEN=64 +#source: ext-insn.s +#objdump: -d -M no-aliases + +.*:[ ]+file format .* + + +Disassembly of section .text: + +0+000 : +[ ]+[0-9a-f]+:[ ]+0ff57513[ ]+andi[ ]+a0,a0,255 +[ ]+[0-9a-f]+:[ ]+03051513[ ]+slli[ ]+a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 ]+[0-9a-f]+:[ ]+9561[ ]+c\.srai[ ]+a0,0x38 +[ ]+[0-9a-f]+:[ ]+1542[ ]+c\.slli[ ]+a0,0x30 +[ ]+[0-9a-f]+:[ ]+9541[ ]+c\.srai[ ]+a0,0x30 +[ ]+[0-9a-f]+:[ ]+0ff67593[ ]+andi[ ]+a1,a2,255 +[ ]+[0-9a-f]+:[ ]+03061593[ ]+slli[ ]+a1,a2,0x30 +[ ]+[0-9a-f]+:[ ]+91c1[ ]+c\.srli[ ]+a1,0x30 +[ ]+[0-9a-f]+:[ ]+03861593[ ]+slli[ ]+a1,a2,0x38 +[ ]+[0-9a-f]+:[ ]+95e1[ ]+c\.srai[ ]+a1,0x38 +[ ]+[0-9a-f]+:[ ]+03061593[ ]+slli[ ]+a1,a2,0x30 +[ ]+[0-9a-f]+:[ ]+95c1[ ]+c\.srai[ ]+a1,0x30 +[ ]+[0-9a-f]+:[ ]+1502[ ]+c\.slli[ ]+a0,0x20 +[ ]+[0-9a-f]+:[ ]+9101[ ]+c\.srli[ ]+a0,0x20 +[ ]+[0-9a-f]+:[ ]+2501[ ]+c\.addiw[ ]+a0,0 +[ ]+[0-9a-f]+:[ ]+02061593[ ]+slli[ ]+a1,a2,0x20 +[ ]+[0-9a-f]+:[ ]+9181[ ]+c\.srli[ ]+a1,0x20 +[ ]+[0-9a-f]+:[ ]+0006059b[ ]+addiw[ ]+a1,a2,0 +#... diff --git a/gas/testsuite/gas/riscv/ext-insn-64-noarch.d b/gas/testsuite/gas/riscv/ext-insn-64-noarch.d new file mode 100644 index 00000000000..6061373bb71 --- /dev/null +++ b/gas/testsuite/gas/riscv/ext-insn-64-noarch.d @@ -0,0 +1,5 @@ +#as: -march=rv64i -I$srcdir/$subdir -defsym XLEN=64 -defsym NOARCH=1 +#source: ext-insn.s +#objdump: -d -M no-aliases + +#... diff --git a/gas/testsuite/gas/riscv/ext-insn-zba-32-noalias.d b/gas/testsuite/gas/riscv/ext-insn-zba-32-noalias.d new file mode 100644 index 00000000000..ccea949debc --- /dev/null +++ b/gas/testsuite/gas/riscv/ext-insn-zba-32-noalias.d @@ -0,0 +1,39 @@ +#as: -march=rv32i_zba -I$srcdir/$subdir -defsym XLEN=32 +#source: ext-insn.s +#objdump: -d -M no-aliases + +.*:[ ]+file format .* + + +Disassembly of section .text: + +0+000 : +[ ]+[0-9a-f]+:[ ]+0ff57513[ ]+andi[ ]+a0,a0,255 +[ ]+[0-9a-f]+:[ ]+01051513[ ]+slli[ ]+a0,a0,0x10 +[ ]+[0-9a-f]+:[ ]+01055513[ ]+srli[ ]+a0,a0,0x10 +[ ]+[0-9a-f]+:[ ]+01851513[ ]+slli[ ]+a0,a0,0x18 +[ ]+[0-9a-f]+:[ ]+41855513[ ]+srai[ ]+a0,a0,0x18 +[ ]+[0-9a-f]+:[ ]+01051513[ ]+slli[ ]+a0,a0,0x10 +[ ]+[0-9a-f]+:[ ]+41055513[ ]+srai[ ]+a0,a0,0x10 +[ ]+[0-9a-f]+:[ ]+0ff67593[ ]+andi[ ]+a1,a2,255 +[ ]+[0-9a-f]+:[ ]+01061593[ ]+slli[ ]+a1,a2,0x10 +[ ]+[0-9a-f]+:[ ]+0105d593[ ]+srli[ ]+a1,a1,0x10 +[ ]+[0-9a-f]+:[ ]+01861593[ ]+slli[ ]+a1,a2,0x18 +[ ]+[0-9a-f]+:[ ]+4185d593[ ]+srai[ ]+a1,a1,0x18 +[ ]+[0-9a-f]+:[ ]+01061593[ ]+slli[ ]+a1,a2,0x10 +[ ]+[0-9a-f]+:[ ]+4105d593[ ]+srai[ ]+a1,a1,0x10 +[ ]+[0-9a-f]+:[ ]+0ff57513[ ]+andi[ ]+a0,a0,255 +[ ]+[0-9a-f]+:[ ]+0542[ ]+c\.slli[ ]+a0,0x10 +[ ]+[0-9a-f]+:[ ]+8141[ ]+c\.srli[ ]+a0,0x10 +[ ]+[0-9a-f]+:[ ]+0562[ ]+c\.slli[ ]+a0,0x18 +[ ]+[0-9a-f]+:[ ]+8561[ ]+c\.srai[ ]+a0,0x18 +[ ]+[0-9a-f]+:[ ]+0542[ ]+c\.slli[ ]+a0,0x10 +[ ]+[0-9a-f]+:[ ]+8541[ ]+c\.srai[ ]+a0,0x10 +[ ]+[0-9a-f]+:[ ]+0ff67593[ ]+andi[ ]+a1,a2,255 +[ ]+[0-9a-f]+:[ ]+01061593[ ]+slli[ ]+a1,a2,0x10 +[ ]+[0-9a-f]+:[ ]+81c1[ ]+c\.srli[ ]+a1,0x10 +[ ]+[0-9a-f]+:[ ]+01861593[ ]+slli[ ]+a1,a2,0x18 +[ ]+[0-9a-f]+:[ ]+85e1[ ]+c\.srai[ ]+a1,0x18 +[ ]+[0-9a-f]+:[ ]+01061593[ ]+slli[ ]+a1,a2,0x10 +[ ]+[0-9a-f]+:[ ]+85c1[ ]+c\.srai[ ]+a1,0x10 +#... diff --git a/gas/testsuite/gas/riscv/ext-insn-zba-64-noalias.d b/gas/testsuite/gas/riscv/ext-insn-zba-64-noalias.d new file mode 100644 index 00000000000..a9e191a7449 --- /dev/null +++ b/gas/testsuite/gas/riscv/ext-insn-zba-64-noalias.d @@ -0,0 +1,47 @@ +#as: -march=rv64i_zba -I$srcdir/$subdir -defsym XLEN=64 +#source: ext-insn.s +#objdump: -d -M no-aliases + +.*:[ ]+file format .* + + +Disassembly of section .text: + +0+000 : +[ ]+[0-9a-f]+:[ ]+0ff57513[ ]+andi[ ]+a0,a0,255 +[ ]+[0-9a-f]+:[ ]+03051513[ ]+slli[ ]+a0,a0,0x30 +[ ]+[0-9a-f]+:[ ]+03055513[ ]+srli[ ]+a0,a0,0x30 +[ ]+[0-9a-f]+:[ ]+03851513[ ]+slli[ ]+a0,a0,0x38 +[ ]+[0-9a-f]+:[ ]+43855513[ ]+srai[ ]+a0,a0,0x38 +[ ]+[0-9a-f]+:[ ]+03051513[ ]+slli[ ]+a0,a0,0x30 +[ ]+[0-9a-f]+:[ ]+43055513[ ]+srai[ ]+a0,a0,0x30 +[ ]+[0-9a-f]+:[ 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\.srai[ ]+a1,0x38 +[ ]+[0-9a-f]+:[ ]+03061593[ ]+slli[ ]+a1,a2,0x30 +[ ]+[0-9a-f]+:[ ]+95c1[ ]+c\.srai[ ]+a1,0x30 +[ ]+[0-9a-f]+:[ ]+0805053b[ ]+add\.uw[ ]+a0,a0,zero +[ ]+[0-9a-f]+:[ ]+2501[ ]+c\.addiw[ ]+a0,0 +[ ]+[0-9a-f]+:[ ]+080605bb[ ]+add\.uw[ ]+a1,a2,zero +[ ]+[0-9a-f]+:[ ]+0006059b[ ]+addiw[ ]+a1,a2,0 +#... diff --git a/gas/testsuite/gas/riscv/ext-insn-zbb-32-noalias.d b/gas/testsuite/gas/riscv/ext-insn-zbb-32-noalias.d new file mode 100644 index 00000000000..edb2dcde2cf --- /dev/null +++ b/gas/testsuite/gas/riscv/ext-insn-zbb-32-noalias.d @@ -0,0 +1,27 @@ +#as: -march=rv32i_zbb -I$srcdir/$subdir -defsym XLEN=32 +#source: ext-insn.s +#objdump: -d -M no-aliases + +.*:[ ]+file format .* + + +Disassembly of section .text: + +0+000 : +[ ]+[0-9a-f]+:[ ]+0ff57513[ ]+andi[ ]+a0,a0,255 +[ ]+[0-9a-f]+:[ ]+08054533[ ]+zext\.h[ ]+a0,a0 +[ ]+[0-9a-f]+:[ ]+60451513[ ]+sext\.b[ ]+a0,a0 +[ ]+[0-9a-f]+:[ ]+60551513[ ]+sext\.h[ ]+a0,a0 +[ ]+[0-9a-f]+:[ ]+0ff67593[ ]+andi[ ]+a1,a2,255 +[ ]+[0-9a-f]+:[ ]+080645b3[ ]+zext\.h[ ]+a1,a2 +[ ]+[0-9a-f]+:[ ]+60461593[ ]+sext\.b[ ]+a1,a2 +[ ]+[0-9a-f]+:[ ]+60561593[ ]+sext\.h[ ]+a1,a2 +[ ]+[0-9a-f]+:[ ]+0ff57513[ ]+andi[ ]+a0,a0,255 +[ ]+[0-9a-f]+:[ ]+08054533[ ]+zext\.h[ ]+a0,a0 +[ ]+[0-9a-f]+:[ ]+60451513[ ]+sext\.b[ ]+a0,a0 +[ ]+[0-9a-f]+:[ ]+60551513[ ]+sext\.h[ ]+a0,a0 +[ ]+[0-9a-f]+:[ ]+0ff67593[ ]+andi[ ]+a1,a2,255 +[ ]+[0-9a-f]+:[ ]+080645b3[ ]+zext\.h[ ]+a1,a2 +[ ]+[0-9a-f]+:[ ]+60461593[ ]+sext\.b[ ]+a1,a2 +[ ]+[0-9a-f]+:[ ]+60561593[ ]+sext\.h[ ]+a1,a2 +#... diff --git a/gas/testsuite/gas/riscv/ext-insn-zbb-64-noalias.d b/gas/testsuite/gas/riscv/ext-insn-zbb-64-noalias.d new file mode 100644 index 00000000000..bc7b6145e59 --- /dev/null +++ b/gas/testsuite/gas/riscv/ext-insn-zbb-64-noalias.d @@ -0,0 +1,39 @@ +#as: -march=rv64i_zbb -I$srcdir/$subdir -defsym XLEN=64 +#source: ext-insn.s +#objdump: -d -M no-aliases + +.*:[ ]+file format .* + + +Disassembly of section .text: + +0+000 : +[ ]+[0-9a-f]+:[ ]+0ff57513[ ]+andi[ ]+a0,a0,255 +[ ]+[0-9a-f]+:[ ]+0805453b[ ]+zext\.h[ ]+a0,a0 +[ ]+[0-9a-f]+:[ ]+60451513[ ]+sext\.b[ ]+a0,a0 +[ ]+[0-9a-f]+:[ ]+60551513[ ]+sext\.h[ ]+a0,a0 +[ ]+[0-9a-f]+:[ ]+0ff67593[ ]+andi[ ]+a1,a2,255 +[ ]+[0-9a-f]+:[ ]+080645bb[ ]+zext\.h[ ]+a1,a2 +[ ]+[0-9a-f]+:[ ]+60461593[ ]+sext\.b[ ]+a1,a2 +[ ]+[0-9a-f]+:[ ]+60561593[ ]+sext\.h[ ]+a1,a2 +[ ]+[0-9a-f]+:[ ]+02051513[ ]+slli[ ]+a0,a0,0x20 +[ ]+[0-9a-f]+:[ ]+02055513[ ]+srli[ ]+a0,a0,0x20 +[ ]+[0-9a-f]+:[ ]+0005051b[ ]+addiw[ ]+a0,a0,0 +[ ]+[0-9a-f]+:[ ]+02061593[ ]+slli[ ]+a1,a2,0x20 +[ ]+[0-9a-f]+:[ ]+0205d593[ ]+srli[ ]+a1,a1,0x20 +[ ]+[0-9a-f]+:[ ]+0006059b[ ]+addiw[ ]+a1,a2,0 +[ ]+[0-9a-f]+:[ ]+0ff57513[ ]+andi[ ]+a0,a0,255 +[ ]+[0-9a-f]+:[ ]+0805453b[ ]+zext\.h[ ]+a0,a0 +[ ]+[0-9a-f]+:[ ]+60451513[ ]+sext\.b[ ]+a0,a0 +[ ]+[0-9a-f]+:[ ]+60551513[ ]+sext\.h[ ]+a0,a0 +[ ]+[0-9a-f]+:[ ]+0ff67593[ ]+andi[ ]+a1,a2,255 +[ ]+[0-9a-f]+:[ ]+080645bb[ ]+zext\.h[ ]+a1,a2 +[ ]+[0-9a-f]+:[ ]+60461593[ ]+sext\.b[ ]+a1,a2 +[ ]+[0-9a-f]+:[ ]+60561593[ ]+sext\.h[ ]+a1,a2 +[ ]+[0-9a-f]+:[ ]+1502[ ]+c\.slli[ ]+a0,0x20 +[ ]+[0-9a-f]+:[ ]+9101[ ]+c\.srli[ ]+a0,0x20 +[ ]+[0-9a-f]+:[ ]+2501[ ]+c\.addiw[ ]+a0,0 +[ ]+[0-9a-f]+:[ ]+02061593[ ]+slli[ ]+a1,a2,0x20 +[ ]+[0-9a-f]+:[ ]+9181[ ]+c\.srli[ ]+a1,0x20 +[ ]+[0-9a-f]+:[ ]+0006059b[ ]+addiw[ ]+a1,a2,0 +#... diff --git a/gas/testsuite/gas/riscv/ext-insn.s b/gas/testsuite/gas/riscv/ext-insn.s new file mode 100644 index 00000000000..2e4dc1ed850 --- /dev/null +++ b/gas/testsuite/gas/riscv/ext-insn.s @@ -0,0 +1,23 @@ +.include "testutils.inc" + +.macro INSN_SEQ + zext.b a0, a0 # andi (I) + zext.h a0, a0 # Zbb (RV32!=RV64) / shifts (I/C) + sext.b a0, a0 # Zbb / shifts (I/C) + sext.h a0, a0 # Zbb / shifts (I/C) + zext.b a1, a2 # andi (I) + zext.h a1, a2 # Zbb (RV32!=RV64) / shifts (I/C) + sext.b a1, a2 # Zbb / shifts (I/C) + sext.h a1, a2 # Zbb / shifts (I/C) +.if XLEN_GE_64 + zext.w a0, a0 # add.uw (RV64_Zba) / shifts (I/C) + sext.w a0, a0 # addiw (I) / c.addiw (C) + zext.w a1, a2 # add.uw (RV64_Zba) / shifts (I/C) + sext.w a1, a2 # addiw (I/C) +.endif +.endm + +target: + INSN_SEQ + .option arch, +c + INSN_SEQ diff --git a/gas/testsuite/gas/riscv/ext.s b/gas/testsuite/gas/riscv/ext.s deleted file mode 100644 index 0268dcafc1d..00000000000 --- a/gas/testsuite/gas/riscv/ext.s +++ /dev/null @@ -1,38 +0,0 @@ -target: - .option arch, -c - zext.b a0, a0 - zext.h a0, a0 - sext.b a0, a0 - sext.h a0, a0 - - zext.b a1, a2 - zext.h a1, a2 - sext.b a1, a2 - sext.h a1, a2 - -.ifdef __64_bit__ - zext.w a0, a0 - sext.w a0, a0 - - zext.w a1, a2 - sext.w a1, a2 -.endif - - .option arch, +c - zext.b a0, a0 - zext.h a0, a0 - sext.b a0, a0 - sext.h a0, a0 - - zext.b a1, a2 - zext.h a1, a2 - sext.b a1, a2 - sext.h a1, a2 - -.ifdef __64_bit__ - zext.w a0, a0 - sext.w a0, a0 - - zext.w a1, a2 - sext.w a1, a2 -.endif