Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp95258lqp; Fri, 12 Apr 2024 11:25:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUWqscpPUgvvjL7oJkv1HuvHPH+uOGwuDgJQwzepHXcR+AVUudVVbLrJAXwgoXwXAK/SBUkW7/6pFOO56yPPpx0VugeHmita0wYlhBMRw== X-Google-Smtp-Source: AGHT+IHMl1Kh5uxUbJdVR28xx4ojMVp/bVW8DgewhHr0wkhjfyzQQWh2BxZe4YMjlAemD1l/Cx/E X-Received: by 2002:a17:903:2286:b0:1e2:718d:f290 with SMTP id b6-20020a170903228600b001e2718df290mr3820185plh.67.1712946303713; Fri, 12 Apr 2024 11:25:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712946303; cv=pass; d=google.com; s=arc-20160816; b=K7+qOhnWVkWKTy4hqJyx/FebAnz2jHM6uwfgEbjmx48V6fsfKslQpBHo5CnQqDL72E 69n7GIoqjFMckoZBbl/z+2C5gUZ2pwKepRtbpSuh0pN2nWeuW8aQFw5ZuK93Sow2JLoc 29pvAvzvUPJGAXbTZiwDSXcNUSUbor+1RFzyAm/eKVdrG81inowpLhU5JzTmrlA2VWXS +aYLb5CQ+yG0lSeo4bIJH120yUY0PT7uEJPUwwxF1VRe3P88JYaOCzHG4stZLaD2+Vjw Sy1wyvvfCylQSPI9P3qWUIZ2uQ9xzSbT0chJ4LEDYinszDdv40yEBkuNXUhPD1L5HYTq ughg== 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=VnBuVioN4do9yO5Fp+To5ya+VzBTYCmZkVY34L3QmB0=; fh=tN8nUsznngU2qBb2vXJf87i3QuU1O4h63Ox80z0eMmM=; b=LhJa0WEcqgfqlrMG5ZxPQRkld+iyO2dTM7uHUDCZ3TLlngRB6Vq6WSWc937ambIm2A p4bHGtR8XUtiVVwJjaw2r5lnPIQYM0iXrzXXSsR32rYsC8lO/0bvpCOgfE12eYW8es6F nybBNRn4Cv1DtwqHogmqZPLxBPHQpnlVAlTF3PlMwfwK5KzaSHeKDfyN7Ry3gKPDorlY MwrnNFuouyeOSsNhzNEFusGzJMUDtfmvW38Jw4fgJPVYzFK1TS0WWnPZ6PqYkwUY6d95 K+dRq1YaGCwycTCWnFgso3LJDZ2zYXw+LthlZY9UIBOuXZcip1sgU5JKRZUACzk/3XoV fleQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=WXFbh+rj; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-143196-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143196-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id k4-20020a170902ce0400b001e5c07ce240si1175917plg.397.2024.04.12.11.25.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 11:25:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143196-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=WXFbh+rj; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-143196-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143196-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 4E9B1B21A88 for ; Fri, 12 Apr 2024 18:24:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3519214F115; Fri, 12 Apr 2024 18:24:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="WXFbh+rj" Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 173DB14EC79 for ; Fri, 12 Apr 2024 18:24:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712946283; cv=none; b=bQMWf/tHjeIiqrRIeVM+SLXOJByT6RTP0FZtuNDnMj/T9c4/4m6Pb+DJ6BFEUps9uLlOWg1SSrCTYq7Laztn2+swDl/l2pmXbCjqSi5OkcdN9or93mNbk+WoPp1SKWFg5er7sNpwRjdxstgjXhezXJe/UCRe9dPQVkT2XPmRBXw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712946283; c=relaxed/simple; bh=nY7gbkgkBr+eHZR919YowyRoq31FRxlbVFMFZulxFuQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pa4X57dogVHVhcAUXk/Cb4yHRRcCBb7W76y+AOVWDVL9vJGStw8c8c8qtuMAIuCgRrCf5WfpHz+XKfhx2Cc1buH4qvU15gijr1SOoXR3GGV5oadv96U0ei+ZxkLOoZTikZ+c2OPl0rSgYXrwGMPOTNjHE5HpAbw4v8QP8OQjs6U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=WXFbh+rj; arc=none smtp.client-ip=209.85.210.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-6ed691fb83eso1050230b3a.1 for ; Fri, 12 Apr 2024 11:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1712946280; x=1713551080; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=VnBuVioN4do9yO5Fp+To5ya+VzBTYCmZkVY34L3QmB0=; b=WXFbh+rjZbX/JtdaihjFORYvRF0dx+G+Pqx+XqL7cIhCKY7vsfto1e20iGv8dUdM6P xdPJKDUGkY9C2z5/vxT6x7z6z0xWPA6+k8xclCvd5k+xsgTNz2PbGEmHFb8htMzACxaN BPwtNHSt4yj/Hg89E+hvoLXqh9b4UhKqOLvqIgEpb/4xHJaz1dOYmpUQZ0bn5TBv4dZP EHMCsceq+rt/Kf4v9jGoWstqMXLCpSaHLwZqdjiQjjcAlHq9GnRnv74coySAH8rMeIjr Amg2eb3YMSrlbj5Jo8xouUcd3oMt/TRkvUCCNupcT6VQDiDti0gQMYVd1co83qwD8AvY vmZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712946280; x=1713551080; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=VnBuVioN4do9yO5Fp+To5ya+VzBTYCmZkVY34L3QmB0=; b=Qcbacnt942KxqXvuaJSG8zJe25QMZz/ZEjIvLuzn1y0bwijogBx6eXhzGMHlpdCnEK w84TBdIyZHSP13sGw5FzY5ckcoUO83GcQ4ETe5CwCwzqsYZk78Y1p4xaUNQs0A9KSPAr tJT+ON1vSCJb6nzJIK5svgVmvJM0oqusrXVg558rZVVOazdRWvn3cWFPXUY6M0szQzvA fQ1vzKh8wFkqo6oMyEPwTKkOu7zYvI2OX9x/zbq2b5tDgfkNs87v95EU6rRRhwX0Oy79 Jarmhr2VlitkGzlK+IpxdMRSrMsxKi6KAcbwrEBtkLmFB4QB+uNkS3R4UtukVYbfV/vh g+gQ== X-Forwarded-Encrypted: i=1; AJvYcCVKj2aQPXG83bvYR7Ir1zegCeWJOFLgaxE6oxUbryKyE/wqBZNuCYTdaoq7NPHstFKJ9nlhyHNea57AnJ3s086moj/SgvbEfo4gmGMU X-Gm-Message-State: AOJu0Yxi9c2+3BERpxq8xpVa/1OU9rba0Hpp6trCB1Ab5TjCPq/oZ4rP QZCdDhuOg7jGxAJHVDWYt6lNGxhY34QYfmD776QgPVwbDArBILCebbmoxSEXqLI= X-Received: by 2002:a05:6a00:3913:b0:6ea:8e89:7faf with SMTP id fh19-20020a056a00391300b006ea8e897fafmr4224014pfb.28.1712946280297; Fri, 12 Apr 2024 11:24:40 -0700 (PDT) Received: from ghost (mobile-166-137-160-039.mycingular.net. [166.137.160.39]) by smtp.gmail.com with ESMTPSA id q4-20020a656244000000b005dc4fc80b21sm2633420pgv.70.2024.04.12.11.24.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 11:24:39 -0700 (PDT) Date: Fri, 12 Apr 2024 11:24:35 -0700 From: Charlie Jenkins To: Conor Dooley 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 , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH 12/19] riscv: Create xtheadvector file Message-ID: 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> <20240412-thirty-sacrament-db052c7fe6fe@wendy> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240412-thirty-sacrament-db052c7fe6fe@wendy> On Fri, Apr 12, 2024 at 12:30:32PM +0100, Conor Dooley wrote: > 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. > > > > Signed-off-by: Charlie Jenkins > > --- > > arch/riscv/include/asm/xtheadvector.h | 25 +++++++++++++++++++++++++ > > 1 file changed, 25 insertions(+) > > > > diff --git a/arch/riscv/include/asm/xtheadvector.h b/arch/riscv/include/asm/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 older > > + * 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? Yeah, I wasn't sure how to attribute him. He wrote almost all of the lines in this file, but I put it together into this file. What is the standard way of doing that? - Charlie > > > + */ > > +#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" > > > > -- > > 2.44.0 > >