From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2e.google.com (mail-oa1-x2e.google.com [IPv6:2001:4860:4864:20::2e]) by sourceware.org (Postfix) with ESMTPS id 66EFA3858426 for ; Wed, 22 Nov 2023 22:27:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 66EFA3858426 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 66EFA3858426 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4860:4864:20::2e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700692083; cv=none; b=b4n1R+SVyENqZzA4AjGWHoDGM1teUAZoXaHHP9N/7EomjCQ8QOahT+B96PghAxuXeFsp52TzpLDOB9ZrbuAwTfZE+v/vkKzfBKc+8UOwVVenYclTwUYSMcSvegMOeI9CFZOSHhfsG3csM/nZR0MaRHP6FgcvV7/8IkiXY8Tr95I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700692083; c=relaxed/simple; bh=s8F4B5Wk119CwhvXtJdGc/ynUS99wuQT8vnkNU4/76c=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=Bq8pLfLyuJny5Mm/loSu7ngx679kAdWFf9LR9Wj9mK0zcD5Gkndq8m/siHwXXcScSCs0+SX+Gnnp33/NKojCJf2W68/u9Uf94bllXi9f1YYEABbgpNQkN16tSWZMm9Ken2VqfBXzVOwWIw3Msve/Gxh6ndJPt7BZ7CzCRMa7xhI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-1eb6c559ab4so218464fac.0 for ; Wed, 22 Nov 2023 14:27:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700692073; x=1701296873; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=uTPymjPmz5Bemfs+IB4+EfFZtjHE6TTtAClnY7WUZpY=; b=aCBl5iD4GkQapNJrcKgsSl2gD9ObWWRvrNk+mWRhvcXbtoNnguhg+ncxwJA7HVsWlN IImCKgOMCGxXxp3B/bCIDR8QQcbrDFuqCPF/2cszAeDut9WzaLWQkMw/Vg/Wp9DCDvVB +haD2rMyMxRbZPVg2b8qldIoVNwqeqtTvSuMl8LAD0tcZJ+SKOtwZKpFT5lxjougbXkO umaq4x2QTfaxoCaX6kqlIYZ7nU60AqzwM8YviUb5y/82KXn4/Tn3C94WEt2RN/ALjtv8 PkJLWVsavJagoi9Cl9NWJBxcgw22d9Bhs5SLXQQlAepn2sHzKpHFHT9+A+2oL8esJW7T HD8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700692073; x=1701296873; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uTPymjPmz5Bemfs+IB4+EfFZtjHE6TTtAClnY7WUZpY=; b=cAhaaQIfvZFpEkh0z6ojD/Nd6P5/K7hK0xQRjJgh2dsSNOxAhN/TdVAMkU9y9m6EKY BayJcB/QiHbLtm5A4xfG9AbU26qpsl8aAyhW61yVXuyCAokgD0UD7mce9sRRPgrMRbU8 AXdu4fGuzrKUECPNIa0Kmk1ZtNCROZbmu1wyD5/5rrKghomAzAd9KUgGW8nZRUW+lJrE WETX1/biKJRRe+WsY1Au0fRgHsVC6klG4dnPBMCEVF4SZ+PLNi9T6Vblqo+dzy5pmSH4 +GZ2UjhKzJkhbDiX5cIMFqK2Lqog4LPvh8QgKONN2gnixj03cp7gSz1zstPX1FLnczHh IJ1g== X-Gm-Message-State: AOJu0Yz7rWSmZKQgYn3n1nzyZ0luPxXSoNzXgNp2ZAmTONsHlW07miay gJfn+UPd28ajoCA39B003+I= X-Google-Smtp-Source: AGHT+IHVNv1smTW8xhUOb2ak6raO6m4WqppTmg1PH0bQ/mK4CjK21puk/1vbos0wXW6ArVrEq9bDvQ== X-Received: by 2002:a05:6871:e405:b0:1ef:f14e:6f0a with SMTP id py5-20020a056871e40500b001eff14e6f0amr5315273oac.0.1700692072652; Wed, 22 Nov 2023 14:27:52 -0800 (PST) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id yl13-20020a05687c218d00b001f40abd9fdbsm10779oab.2.2023.11.22.14.27.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Nov 2023 14:27:52 -0800 (PST) Message-ID: <81fc1cc3-2fa2-4cac-a0b1-5272a2a09535@gmail.com> Date: Wed, 22 Nov 2023 15:27:50 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: RISC-V: Support XTheadVector extensions Content-Language: en-US To: =?UTF-8?Q?Christoph_M=C3=BCllner?= , =?UTF-8?B?6ZKf5bGF5ZOy?= Cc: gcc-patches , "kito.cheng" , "kito.cheng" , "cooper.joshua" , "rdapp.gcc" , "philipp.tomsich" , Cooper Qu , jinma , Nelson Chu References: <202311171939484236058@rivai.ai> <799FFC52C75DBD19+2023111721411742145625@rivai.ai> <1C19D9D85FEE32C4+2023112221521872810857@rivai.ai> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham 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 11/22/23 07:24, Christoph Müllner wrote: > On Wed, Nov 22, 2023 at 2:52 PM 钟居哲 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 binutils 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 theadvector 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 instructions > > 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