From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by sourceware.org (Postfix) with ESMTPS id DE1B23858287 for ; Wed, 22 Nov 2023 23:37:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DE1B23858287 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DE1B23858287 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1029 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700696279; cv=none; b=gMbs6lRsJrfUX6B1Ml3TIYqw9YKAb/UMXO1cJmi3DRByfhu5tMrBY5ZP9n31q6mhTmon+ht+mYyCKcp3gYdiKc5EIvusQxfHLUEVVh2T9OHSli2P4gpcxTvxFzgMWZDMBuv+3EbEvGwO6UGv1A9S5aK74phwXNz8//Cfhrg/hQ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700696279; c=relaxed/simple; bh=60dz6c0cm8b7nA9truoWcRYMmuMYN2S+65U9vBDwWtA=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=qFU1EmpQgGuZNCPqE3yJzegJtLPs70pi2BuHyy+CHNg4i89pRtgVB06MQgiMHoRR2qF5vtjOfjNwb2s3UeeLZQd3kn4UzXnmYA+0OLwC5uXGUeGYNSgrSzYZIk77FrGhMt2eJd0Xc7MCRrPrHlfbTSsowHCtUnGnq8bt23Fk/0k= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2839c113cbcso279555a91.3 for ; Wed, 22 Nov 2023 15:37:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1700696277; x=1701301077; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8YUbLXDsPx772eGSf5klhXnaW4W5y9hTiRqOkT1QvXU=; b=LJHh1yGTnq+uMJwJw1hm07MzC9zUJkcteTTMhYjISJHN0J6aTfavazCOkovORF5JAF PNT4+SDVSrOfY1dQaCr3GYLNr3anmK4wL9WOFgq86hcRwur8ZD/lP0x+1WWcmGQ6eZze CXM2Jm5nv6WyxrbVBwkIQd9ocSbBZcgFxHFFZ41jgdDqWlfQNOEsTBjg5cLa9agY9BPL HpAmm0P3sqYqTUxsQJHrEzOhT7DL+br+VTSJ/1GuNrNuzekgAAlT1oFv1yBRHG/5mInI c9xj/579iwX1bSHGqnNJWgnN+rpx5g67GxxouO1ZprvR3byb0NKQDJ+dLiU0LsbWG8zP tP6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700696277; x=1701301077; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8YUbLXDsPx772eGSf5klhXnaW4W5y9hTiRqOkT1QvXU=; b=XeEBGxex6QsI+d3CEP3W3rbGDHOw3q+QFkJ1c5ENNXW/zu6AmrlISasqfgRea7pPIB Y+/TLxrpNZHqxE+W/EX5K0lpqy/bKlLLOjOX1phKdu3aINyW2Je5U+oJeb5m+TuUqajL 1CPHnjPr/wj8bgsqKvGot19mdK+7KWPpSzM1Hv17aRqtnMi9pfWXg1L7YEB1mwE2LvVR fxryQ026/ECU2RLZB5VA7Sajg+DkH5qPBac418liSTHYDK9+T2yUPafzGq1Vcp9MxM3w 6MMBVO1N4T+TJJMOC2Sb6A7gEd7W1AuwzK7iaLwh/dncSrRWAMnUraTDED+17gf/khPK Sj7Q== X-Gm-Message-State: AOJu0Yy7rf2D++XfSOT+n4MYBMy9BjBzYpQrANE/+XVA1RS8oEI07418 hJOvypBEbQKeSUSQp8AYi/53BNszw2tkuI/MYolIVP9LbLqrxYtdyiN/Cw== X-Google-Smtp-Source: AGHT+IHsQPITt13fyV2uDXcdjUt8JcT64FAjkkbxtSo3wN4JkKrixIt4elP3o0nTBeFlUJ0Sjw+LpuxwbWiZdxODO3I= X-Received: by 2002:a17:90b:4f44:b0:27f:fce3:2266 with SMTP id pj4-20020a17090b4f4400b0027ffce32266mr3834168pjb.24.1700696276877; Wed, 22 Nov 2023 15:37:56 -0800 (PST) MIME-Version: 1.0 References: <202311171939484236058@rivai.ai> <799FFC52C75DBD19+2023111721411742145625@rivai.ai> <1C19D9D85FEE32C4+2023112221521872810857@rivai.ai> <81fc1cc3-2fa2-4cac-a0b1-5272a2a09535@gmail.com> In-Reply-To: From: =?UTF-8?Q?Christoph_M=C3=BCllner?= Date: Thu, 23 Nov 2023 00:37:44 +0100 Message-ID: Subject: Re: RISC-V: Support XTheadVector extensions To: Kito Cheng Cc: Jeff Law , =?UTF-8?B?6ZKf5bGF5ZOy?= , gcc-patches , "kito.cheng" , "cooper.joshua" , "rdapp.gcc" , "philipp.tomsich" , Cooper Qu , jinma , Nelson Chu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,JMQ_SPF_NEUTRAL,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, Nov 22, 2023 at 11:48=E2=80=AFPM Kito Cheng = wrote: > > I am less worry about the thead vector combined with other zv extension, = instead we should reject those combinations at all. > > My reason is thead vector is transitional products, they won't have any f= urther new products with that longer, also it's not compatible with all oth= er zv extension in theory, zv extension requires at least zve32x which is s= ubset of v1p0, and I don't think it's valid to use thead vector as replacem= ent required extension - it should just introduce another thead vector exte= nsion instead. The "transitional products" argument is probably enough to add this restric= tion, so we will add this to the first patch of the series. Further, we'll implement approach 1 (emitting no "th." prefix for instructions in vector.md) with an additional patch on top, which implements the ASM_OUTPUT_OPCODE hoo= k (with a comment that clarifies why "ptr[0] =3D=3D 'v'" is sufficient there)= . So the decision about this can be postponed and we can focus on the rest of the patchset as Jeff suggested. Thanks for the inputs! > > > > Jeff Law =E6=96=BC 2023=E5=B9=B411=E6=9C=8823=E6= =97=A5 =E9=80=B1=E5=9B=9B 06:27 =E5=AF=AB=E9=81=93=EF=BC=9A >> >> >> >> On 11/22/23 07:24, Christoph M=C3=BCllner wrote: >> > On Wed, Nov 22, 2023 at 2:52=E2=80=AFPM =E9=92=9F=E5=B1=85=E5=93=B2 wrote: >> >> >> >> I am totally ok to approve theadvector on GCC-14 before stage 3 close >> >> as long as it doesn't touch the current RVV codes too much and binuti= ls supports theadvector. >> >> >> >> I have provided the draft approach: >> >> https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637349.html >> >> which turns out doesn't need to change any codes of vector.md. >> >> I strongly suggest follow this draft. I can be actively review theadv= ector during stage 3. >> >> And hopefully can help you land theadvector on GCC-14. >> > >> > I see now two approaches: >> > 1) Let GCC emit RVV instructions for XTheadVector for instructions >> > that are in both >> > 2) Use the ASM_OUTPUT_OPCODE hook to output "th." for these instructio= ns >> > >> > No doubt, the ASM_OUTPUT_OPCODE hook approach is better than our >> > format-string approach, but would 1) not be the even better >> > solution? It would also mean, that not a single test case is required >> > for these overlapping instructions (only a few tests that ensure that >> > we don't emit RVV instructions that are not available in >> > XTheadVector). Besides that, letting GCC emit RVV instructions for >> > XTheadVector is a very clever idea, because it fully utilizes the >> > fact that both extensions overlap to a huge degree. >> > >> > The ASM_OUTPUT_OPCODE approach could lead to an issue if we enable >> XTheadVector >> > with any other vector extension, say Zvfoo. In this case the Zvfoo >> > instructions will all be prefixed as well with "th.". I know that it >> > is not likely to run into this problem (such a machine does not exist >> > in real hardware), but it is possible to trigger this issue easily >> > and approach 1) would not have this potential issue. >> I'm not a big fan of the ASM_OUTPUT_OPCODE approach. While it is >> simple, I worry a bit about it from a long term maintenance standpoint. >> As you note we could well end up at some point with an extension that >> has an mnenomic starting with "v" that would blow up. But I certainly >> see the appeal of such a simple test to support thead vector. >> >> Given there are at least 3 approaches that can fix that problem (%^, >> assembler dialect or ASM_OUTPUT_OPCODE), maybe we could set that >> discussion aside in the immediate term and see if there are other issues >> that are potentially more substantial. >> >> >> >> >> -- >> >> >> >> More generally, I think I need to soften my prior statement about >> deferring this to gcc-15. This code was submitted in time for the >> gcc-14 deadline, so it should be evaluated just like we do anything else >> that makes the deadline. There are various criteria we use to evaluate >> if something should get integrated and we should just work through this >> series like we always do and not treat it specially in any way. >> >> >> jeff