Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp79010lql; Fri, 12 Apr 2024 04:32:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW5oN06enAuEcN+Kh13osmV0ecE2LLn7OQa+P4FXWVdb8PduRJxdVE19n7ESQ51kaysPmgx68Z6atPnw4rfwptVUsl9U/AaSP9C3a4HqQ== X-Google-Smtp-Source: AGHT+IEvGnlW2nREvs/upJ61vjgW/hzCObygYngjhz08GhjHFrhOt751lM0QCKgl488CbcM4MDpt X-Received: by 2002:a05:6a20:1581:b0:1a7:4b40:96db with SMTP id h1-20020a056a20158100b001a74b4096dbmr2999117pzj.10.1712921531386; Fri, 12 Apr 2024 04:32:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712921531; cv=pass; d=google.com; s=arc-20160816; b=bkd2dkSKeUgpu1uwJX7v0G1g8RpjAP+8zospXk6Ps/qQs9kPGP+g9DkbBFDNSktYwu 5V0txAMCV8RIB75sfIWmObkPfFVHX+gZhUkQ8W+Ki1EBWlKx3RC7wzjby3NgsQT1Z8BJ ckvAmvVBi4NBd+oKW6DmUHb+MxsBPsaKq3rJU5eJd7nEZmnIjOitsml9mT8zE5brezL1 Zy+1e4G/o/cJajFi1A2hOk+8b3s3uujchUhBLzW3TyO9/dskhHEohY953YM20hrzaZ/p zkkux4JSZ7fx5BDIPZa/HM5s1HER2q456hnp6GVN8HZWd1WOKYQk48kl8TiBL35l6P1V CIGw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=C97PTGaCVmuz1mKW7B7NZInORmcODjh7UFoMysADGP8=; fh=4jyGPlIgBC+cOBl2betKVRRu896Cfe1VEzAQNc3FCOU=; b=GpIwWd92WkR9AOpO6qtZEUS4MeAQn2TdQs2PY5im8vA3JZxpTUdy/J7j2t+P9btgwH +XOCq9LzAzbewmE6znDHBEOOnfuCheb7vVVp96yT2F3W//J6UK2LZoCMAsExtJEQGhl8 hs2Eywqqta3L+EQhNahbHu1/iZAiBCdw1Kz3pj6FEaFZg5ynnGswNT3DXYH3/Ovs/d9e o4Oqixe4VUTHrpncVzq4ImbwyeZP7RUCILz8JCYG4EknL8+bfBEdv5h9nRlfzftLq+SR hwpdZWea+c8dng5ifZEbWvFA2vOB5GynmQXFmf24BLhLOBrnU2nTyvGM0bhLdjwtgT8/ e12Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=hToX5BP4; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-142586-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142586-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u16-20020a17090341d000b001e52959e81fsi3136237ple.235.2024.04.12.04.32.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 04:32:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142586-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=hToX5BP4; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-142586-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142586-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0FE46282F59 for ; Fri, 12 Apr 2024 11:32:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C0FD454FAD; Fri, 12 Apr 2024 11:32:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="hToX5BP4" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6C953FE4B; Fri, 12 Apr 2024 11:32:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712921523; cv=none; b=W4KOcLeeOIRrW+/Feo2nqygGyrBNNTjPaHtp2fCn9eE7bWXK6EYYnNh+GdoIaIHL54f7j6jrSKQhOjQPzciLzFAI6IP7W6hKlh2wy+r67tfYKUgGI7Upyv5kA+/8GXtyLSliNedR+JjQzxkvNI3U/oghxLnDZc5IthIq64rg2Yk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712921523; c=relaxed/simple; bh=BzJrqDFA6AyqBMFADduzWLtGiHXrJzqR3kUA+iQC510=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lktQJQZjktcn2/1tTMZyEfFo7wMHqLyNI7JtK76TnFDXueP2Z/A71BdTe2sTHRaoH28eoNwj9meGEG4X8tamMTkqs8VFmvOVsWlpel8NtV2guOE9cHk6HChut3VCjtwDuyfPHxmXOwFKJmvi70ATnHy4K+4w3z3YLuefwZaSvJM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=hToX5BP4; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1712921521; x=1744457521; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=BzJrqDFA6AyqBMFADduzWLtGiHXrJzqR3kUA+iQC510=; b=hToX5BP4SXoVMNvZRVi/Ay/pxg591xwePZJ7/MAzhm2s4jqZ920kP/f+ 3Iu28KTiGaFX94vqs1C1gMK/DvHdOAVDOKRLI/hR/8LBUOYHuT2MN4JpY 0+9nC81MiU8+FidMEi2F2VzZCey2++hjmbEebHTaMRemtUGY36D27g7Sn FZ/YlM6bzPm3PMNaDowVXJA/XGdwhztRhrrNKY8M/G2BMUxj1chh0zGEd 6cOS7LkolPn4uQ3KvdD0z3tH8plkHNSD+5auPAgs4FgwoT53xNUmqz5yf fLC5MVSh1AaHkme6IDXAxiB5EPHMBq5bOH44w/90qW7mwX9GJM/A8iGl5 w==; X-CSE-ConnectionGUID: VphaOc2hTpGpkTSDHvpbiw== X-CSE-MsgGUID: V1pgwBcRSfihNzKAqHlD4Q== X-IronPort-AV: E=Sophos;i="6.07,195,1708412400"; d="asc'?scan'208";a="20733274" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 12 Apr 2024 04:32:00 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 12 Apr 2024 04:31:27 -0700 Received: from wendy (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 12 Apr 2024 04:31:23 -0700 Date: Fri, 12 Apr 2024 12:30:32 +0100 From: Conor Dooley To: Charlie Jenkins CC: Conor Dooley , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Evan Green , =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= , Jonathan Corbet , Shuah Khan , , , , Palmer Dabbelt , , , , Subject: Re: [PATCH 12/19] riscv: Create xtheadvector file Message-ID: <20240412-thirty-sacrament-db052c7fe6fe@wendy> References: <20240411-dev-charlie-support_thead_vector_6_9-v1-0-4af9815ec746@rivosinc.com> <20240411-dev-charlie-support_thead_vector_6_9-v1-12-4af9815ec746@rivosinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zwcSHVZLwjxefjz8" Content-Disposition: inline In-Reply-To: <20240411-dev-charlie-support_thead_vector_6_9-v1-12-4af9815ec746@rivosinc.com> --zwcSHVZLwjxefjz8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 11, 2024 at 09:11:18PM -0700, Charlie Jenkins wrote: > These definitions didn't fit anywhere nicely, so create a new file to > house various xtheadvector instruction encodings. >=20 > Signed-off-by: Charlie Jenkins > --- > arch/riscv/include/asm/xtheadvector.h | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) >=20 > diff --git a/arch/riscv/include/asm/xtheadvector.h b/arch/riscv/include/a= sm/xtheadvector.h > new file mode 100644 > index 000000000000..348263ea164c > --- /dev/null > +++ b/arch/riscv/include/asm/xtheadvector.h > @@ -0,0 +1,25 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > + > +/* > + * Vector 0.7.1 as used for example on T-Head Xuantie cores, uses an old= er > + * encoding for vsetvli (ta, ma vs. d1), so provide an instruction for > + * vsetvli t4, x0, e8, m8, d1 > + */ > +#define THEAD_VSETVLI_T4X0E8M8D1 ".long 0x00307ed7\n\t" > +#define THEAD_VSETVLI_X0X0E8M8D1 ".long 0x00307057\n\t" > + > +/* > + * While in theory, the vector-0.7.1 vsb.v and vlb.v result in the same > + * encoding as the standard vse8.v and vle8.v, compilers seem to optimize > + * the call resulting in a different encoding and then using a value for > + * the "mop" field that is not part of vector-0.7.1 > + * So encode specific variants for vstate_save and _restore. This wording seems oddly familiar to me, did Heiko not write this? > + */ > +#define THEAD_VSB_V_V0T0 ".long 0x02028027\n\t" > +#define THEAD_VSB_V_V8T0 ".long 0x02028427\n\t" > +#define THEAD_VSB_V_V16T0 ".long 0x02028827\n\t" > +#define THEAD_VSB_V_V24T0 ".long 0x02028c27\n\t" > +#define THEAD_VLB_V_V0T0 ".long 0x012028007\n\t" > +#define THEAD_VLB_V_V8T0 ".long 0x012028407\n\t" > +#define THEAD_VLB_V_V16T0 ".long 0x012028807\n\t" > +#define THEAD_VLB_V_V24T0 ".long 0x012028c07\n\t" >=20 > --=20 > 2.44.0 >=20 --zwcSHVZLwjxefjz8 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZhkbWAAKCRB4tDGHoIJi 0nL6AQCJkh59MUri2maEyaJ1kO+VFKtPc14IkIZHwM9bajqXywD+Jf+vDHMGA2cu 5IE2w9WyYjd8dq+NtRxdy9fp8qwtqQE= =mofk -----END PGP SIGNATURE----- --zwcSHVZLwjxefjz8--