From patchwork Wed Aug 30 01:38:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsukasa OI X-Patchwork-Id: 137130 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp4267446vqm; Tue, 29 Aug 2023 18:39:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHw19WoozGBUz0+U81rurmxgdeoKnOwLi8NV1VYsKx3gm34pltykZ2ThZ7Aqm9CPjSkz69E X-Received: by 2002:aa7:df8e:0:b0:522:582c:f427 with SMTP id b14-20020aa7df8e000000b00522582cf427mr929363edy.14.1693359543981; Tue, 29 Aug 2023 18:39:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693359543; cv=none; d=google.com; s=arc-20160816; b=hRpsIk1UTSjPiXGpF1X2xFcvv9dbzolO7xedxbD2SETJVqDPDaFmDCq8dWQ6upNz6i EBypquaEvHPRjGqkTBUWKXtAAn+7GhGrZM1hOR9K6Y+BWZcuyCrZ8NOkKbFO3w6Rs6Oz sgEaTIx4dCqe2vgrxkE6toFPdKUFi8+TouuehKy+NWhVVRTy8JxRNpBK6eTeZDQVpbh7 XTIeSSLHClnv1obdQKNg0lgll4sxEseP3wZSijUGvG9HK0f+agefZE2PLlN48gcjhVKL pjPJwmDFAjsUQAGJ02HONNuUExAnY67vie8LPZ8S0x6Nd0DjRsTYUPxIX4CQXfFabTM+ H2qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=wunbAHerI411bLnhOAcb71fKGT18IUF0/KdOmiwxG+4=; fh=SAEta3wwr247qD6SXGW9m28tVKGogS9R0m64eZCWbAU=; b=Ryv2FQpuUNHah2gTqJHjEeGjEWP40tJ68NLG1ntx4O8xtnQQb2jHHYCXkmuJpLMRK9 u5VcI3HY8WjVYN8QGNIlYBaEOHViaeZzrqStG+vFy3DxGqvzHahiNTpd7IPj630ZTkHg OiR3Tz/N5OjjdKsgmL89BNhwP3OwT43gEXPfk+mvTu/1rrfJPdJ4l1aN4b/kXIz6/fKd wIHtZAQsVFtvVJ2aXB0sryaHz82+zewjLK+fGlJtb66Ygyf8M4kGa/DKikGQWdjno4Uj pSRnMvkz5oJbuwTJwgRZhkxV6EbZkQRVR9bhD+6rREmcIsWqfStYkoDVnaSMlEmbXjoU EHlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=JpH3sdAb; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 z20-20020aa7d414000000b0052a49668f0dsi6688743edq.650.2023.08.29.18.39.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 18:39:03 -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; dkim=pass header.i=@sourceware.org header.s=default header.b=JpH3sdAb; 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"; 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 0DFC238582A4 for ; Wed, 30 Aug 2023 01:39:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0DFC238582A4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1693359542; bh=wunbAHerI411bLnhOAcb71fKGT18IUF0/KdOmiwxG+4=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=JpH3sdAbizlTvZG0CrrLQdssSCwkmxL1FBrjjLDtLP9auDWviXOMVze4skSolmBmi IK8eVBhmAQUF+6knK08gwqSUpulTMzeuyehDIjedc5llv+ch/aUTkswrMELtLqX4xW pOlpZa8FsK2KGPmiXui3ne7KruQJQvsUyvvnK6j0= 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 DA9C7385841B for ; Wed, 30 Aug 2023 01:38:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DA9C7385841B Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 87A32300089; Wed, 30 Aug 2023 01:38:49 +0000 (UTC) To: Tsukasa OI , Palmer Dabbelt , Andrew Waterman , Jim Wilson , Nelson Chu , Kito Cheng , Jeff Law , Greg Favor Cc: binutils@sourceware.org Subject: [PATCH 1/1] RISC-V: Make XVentanaCondOps RV64 only Date: Wed, 30 Aug 2023 01:38:34 +0000 Message-ID: <0af2c2372b816ba128cef7165227d905e419357a.1693359513.git.research_trasio@irq.a4lg.com> In-Reply-To: References: Mime-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, KAM_MANYTO, 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: , X-Patchwork-Original-From: Tsukasa OI via Binutils From: Tsukasa OI Reply-To: Tsukasa OI Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775616168598779499 X-GMAIL-MSGID: 1775616177312751214 From: Tsukasa OI Although XVentanaCondOps instructions are XLEN-agonistic, Ventana's manual only defines them only for RV64 (because all Ventana's processors implement RV64). This commit limits XVentanaCondOps instructions RV64-only to match the behavior of the manual and LLVM. Note that this commit alone will not make XVentanaCondOps extension with RV32 invalid (it just makes XVentanaCondOps on RV32 empty). opcodes/ChangeLog: * riscv-opc.c (riscv_opcodes): Restrict "vt.maskc" and "vt.maskcn" to XLEN=64. gas/ChangeLog: * testsuite/gas/riscv/x-ventana-condops-32.d: New failure test. * testsuite/gas/riscv/x-ventana-condops-32.l: Likewise. --- gas/testsuite/gas/riscv/x-ventana-condops-32.d | 3 +++ gas/testsuite/gas/riscv/x-ventana-condops-32.l | 3 +++ opcodes/riscv-opc.c | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 gas/testsuite/gas/riscv/x-ventana-condops-32.d create mode 100644 gas/testsuite/gas/riscv/x-ventana-condops-32.l diff --git a/gas/testsuite/gas/riscv/x-ventana-condops-32.d b/gas/testsuite/gas/riscv/x-ventana-condops-32.d new file mode 100644 index 000000000000..ea67515da0e3 --- /dev/null +++ b/gas/testsuite/gas/riscv/x-ventana-condops-32.d @@ -0,0 +1,3 @@ +#as: -march=rv32i_xventanacondops +#source: x-ventana-condops.s +#error_output: x-ventana-condops-32.l diff --git a/gas/testsuite/gas/riscv/x-ventana-condops-32.l b/gas/testsuite/gas/riscv/x-ventana-condops-32.l new file mode 100644 index 000000000000..e434caf15f60 --- /dev/null +++ b/gas/testsuite/gas/riscv/x-ventana-condops-32.l @@ -0,0 +1,3 @@ +.*Assembler messages: +.*Error: unrecognized opcode `vt.maskc a0,a1,a2' +.*Error: unrecognized opcode `vt.maskcn a0,a3,a4' diff --git a/opcodes/riscv-opc.c b/opcodes/riscv-opc.c index 067e9fdb611f..f5416605dcc3 100644 --- a/opcodes/riscv-opc.c +++ b/opcodes/riscv-opc.c @@ -2174,8 +2174,8 @@ const struct riscv_opcode riscv_opcodes[] = {"th.sync.s", 0, INSN_CLASS_XTHEADSYNC, "", MATCH_TH_SYNC_S, MASK_TH_SYNC_S, match_opcode, 0}, /* Vendor-specific (Ventana Microsystems) XVentanaCondOps instructions */ -{"vt.maskc", 0, INSN_CLASS_XVENTANACONDOPS, "d,s,t", MATCH_VT_MASKC, MASK_VT_MASKC, match_opcode, 0 }, -{"vt.maskcn", 0, INSN_CLASS_XVENTANACONDOPS, "d,s,t", MATCH_VT_MASKCN, MASK_VT_MASKCN, match_opcode, 0 }, +{"vt.maskc", 64, INSN_CLASS_XVENTANACONDOPS, "d,s,t", MATCH_VT_MASKC, MASK_VT_MASKC, match_opcode, 0 }, +{"vt.maskcn", 64, INSN_CLASS_XVENTANACONDOPS, "d,s,t", MATCH_VT_MASKCN, MASK_VT_MASKCN, match_opcode, 0 }, /* Terminate the list. */ {0, 0, INSN_CLASS_NONE, 0, 0, 0, 0, 0}