From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-xc30.google.com (mail-oo1-xc30.google.com [IPv6:2607:f8b0:4864:20::c30]) by sourceware.org (Postfix) with ESMTPS id 9DC5C3858D32 for ; Fri, 17 Nov 2023 17:11:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9DC5C3858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dabbelt.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dabbelt.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9DC5C3858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::c30 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700241111; cv=none; b=cBIqpMtiFUa/2lCBdVMLWsZgZE4aAB31Z8MpsdxHTfcU/2a09dUZs8IGSwnF83WfoN4vwbwnvyRQPGIK1N3zfSMsNOP6893SHhNwAbAdqKXo1dbXnLqa1GKDiF/FVmZ3SCdh8Cq075CaNjQKEbvNF6WnTjsN9UN3vCSG2Y6oKQI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700241111; c=relaxed/simple; bh=iiYZpdh/pqRHIdcZ4eCuR6DiGjdSY+DtMQ7dlXXaDuw=; h=DKIM-Signature:Date:Subject:From:To:Message-ID:Mime-Version; b=M/yhxkrdjynWtyHJCpHFudt94GMCpbg9LcwrnkqBEPdXRRKPCbCMwVvut6UDB1eQJyFtdVelgxkSwg0ZCi/RPBrvWA9inBVqGl7eLK9hHKth0+Jf8US0TtDoCUjfP9R0Y1yN6XKxDqISuM5CAtSCiPJdR8kzAyNh4iwlbSSPKxA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oo1-xc30.google.com with SMTP id 006d021491bc7-58a737957d3so1235267eaf.0 for ; Fri, 17 Nov 2023 09:11:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20230601.gappssmtp.com; s=20230601; t=1700241107; x=1700845907; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=LBze/Vdwmz3KondBuwOOIrfXbgFnSr8+/D16TjZYjZw=; b=sUraxWEh/Q1a7VTj2fOXU4zGvS1yQ9XKhrKoMjM0koqN35VLkPQ1FoLXQOfCZ2tNbS ScgbufHDmpwIFpQZlM5eip4Ih5JnmN3ozqS21+M2t/AUlI+lIkx2Xdc4lRB3rAFieAfS cTS1vwAhl50cuhCcpAvpckLOG4vDRo+cFooiDdzqtUZ7ZXZcZ1cBhX8DkfZVyloOe56s Qq1vvhqjMtAWB+ClTnK49nXB957OLfqBOX2zY5pyhuQmPohcZelZnFI6vkZTv/WauIMY 9EAev03pu+0Fc5kK0pq2jUtdq5+IMIQfF/jLULhOQLEJ0vlY0BpXyJPPW6IDA15Afgvb 3o3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700241107; x=1700845907; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=LBze/Vdwmz3KondBuwOOIrfXbgFnSr8+/D16TjZYjZw=; b=cyQj/EZ7Z5l1xMKuhF0b95T7lcUWJJcvZN5EuVhwFPDBHubmSUZ+jVjk2/650oInwT c0ECbgdcJrxLu//SR6/E2VLL4TZDEOdvednxxK02kZO3EUmAxaRWpfR7KezTSKYu54Mh hOOKIIg6nFsq4o+8DpqNULF9YaTzVOZE4V5yHd8O1Bovy/yDAU9Drldd1C04+1FzE+Af Yn+wWJdrZoEZc+kIejW2cpCgcX6ULRKczUNM20uyI84RLZqMBw71yDNLhO82tJzi3Dx0 ABwc1Hzbe0EfdFRLHhTUUC9geEUDFxbhutR7S2LMjF51KuDKlid/N1Pas0WXqSdeRLNE luTw== X-Gm-Message-State: AOJu0YwBgl18uT8mYkrgzpsqh8Ki7ok/5errTVUF+Sup017oguEJtj+Z l3NirCUBLH0A+IGbj4sCU7hIdGM78QUlcWegv7s= X-Google-Smtp-Source: AGHT+IEQsl1a6MTp563mv/6GDBTcP+Ij/LXcT2FxVu4mxDshg9qF7zwSxjULZyOkRa7NjWBCfn1UWg== X-Received: by 2002:a05:6820:1502:b0:581:ec87:edc0 with SMTP id ay2-20020a056820150200b00581ec87edc0mr210764oob.9.1700241107462; Fri, 17 Nov 2023 09:11:47 -0800 (PST) Received: from localhost ([192.184.165.199]) by smtp.gmail.com with ESMTPSA id r15-20020a4aad0f000000b0057bb326cad4sm359300oon.33.2023.11.17.09.11.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 09:11:45 -0800 (PST) Date: Fri, 17 Nov 2023 09:11:45 -0800 (PST) X-Google-Original-Date: Fri, 17 Nov 2023 09:11:42 PST (-0800) Subject: Re: RISC-V: Support XTheadVector extensions In-Reply-To: <086123810F5FEA3C+202311171939484236058@rivai.ai> CC: gcc-patches@gcc.gnu.org, Kito Cheng , kito.cheng@sifive.com, cooper.joshua@linux.alibaba.com, rdapp.gcc@gmail.com, jeffreyalaw@gmail.com From: Palmer Dabbelt To: juzhe.zhong@rivai.ai Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,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 Fri, 17 Nov 2023 03:39:48 PST (-0800), juzhe.zhong@rivai.ai wrote: > 90% theadvector extension reusing current RVV 1.0 instructions patterns: > Just change ASM, For example: > > @@ -2923,7 +2923,7 @@ (define_insn "*pred_mulh_scalar" > (match_operand:VFULLI_D 3 "register_operand" "vr,vr, vr, vr")] VMULH) > (match_operand:VFULLI_D 2 "vector_merge_operand" "vu, 0, vu, 0")))] > "TARGET_VECTOR" > - "vmulh.vx\t%0,%3,%z4%p1" > + "%^vmulh.vx\t%0,%3,%z4%p1" > [(set_attr "type" "vimul") > (set_attr "mode" "")]) > + if (letter == '^') > + { > + if (TARGET_XTHEADVECTOR) > + fputs ("th.", file); > + return; > + } > > For almost all patterns, you just simply append "th." in the ASM prefix. > like change "vmulh.vv" -> "th.vmulh.vv" > > Almost all theadvector instructions are not new features, all same as RVV1.0. > Why do you invent the such ISA doesn't include any features that RVV1.0 doesn't satisfy ? > > I am not explicitly object this patch. But I should know the reason. There's some more in the later threads, but with the top posting it kind of got lost so I'm just replying here. This really isn't T-Head's fault: we announced V-0.7 as a stable draft that was being implemented, and then T-Head went and implemented it. Most of that history has been scrubbed by RVI, but you can still find some stuff like this old talk on YouTube . In general we've just figured out a way to make things work when HW vendors end up in a grey area in RISC-V land. That obviously results in a bunch of pain for the SW people, but this stuff is only useful if we can run on real HW and that always involves some amount of pain. Hopefully we can get to a point where we make fewer problems for ourselves, but we've got a long history to dig out from and there's going to be a lot more of this in the future. So I don't like this XTHeadV stuff, but I think we're best to take it: these guys tried to do the right thing and got thrown under the bus by RVI, we should help them. This is almost certainly going to be a lot more pain that we're used to, just given the size of the extensions in question, but I still think it's the right way to go. The other option is to essentially just tell them to fork the ISA, which isn't good for anyone. > Btw, stage 1 will close soon. So I will review this patch on GCC-15 as long as all other RISC-V maintainers agree. I agree this is gcc-15 material: there's a lot of subtle differences in behavior between 0.7 and 1.0, even when the mnemonics are the same. We're already pretty buried in testing for 14, so trying to pick up another target is going to be a huge headache (particularly one that's a bit special). > > > > > juzhe.zhong@rivai.ai