From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe2b.google.com (mail-vs1-xe2b.google.com [IPv6:2607:f8b0:4864:20::e2b]) by sourceware.org (Postfix) with ESMTPS id 079E438555AD for ; Mon, 15 May 2023 14:23:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 079E438555AD Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vs1-xe2b.google.com with SMTP id ada2fe7eead31-4301281573aso4063791137.3 for ; Mon, 15 May 2023 07:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684160579; x=1686752579; 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=ugKGoJ81f5tjlSeKwQunFBD6/6l/tft31Xgh7oSMPhU=; b=ccUdYVaR4Mepv+kcVq4UzUo6UhyPoG1/4cgV1g4SBw/DWTCsxbxQmLM74iT+luGnHO y1oCSD+jLX7IHFHR7UCjbACG8/0RRqcGK71yTi+qpIKkkSEMOQtchb7FUlr0fXI4fO6I CUU4JSFMecmXE8e/pJuURwhxhCPn8zHkXYRFYCu2L6DZLKqZI9fxwKoGsXpbWcgDfSb2 4NbNyw+e0Jr6DmQGW3AuaytulGfYrB149OMrW2OuDZ6kRPvM/qUAaHC/akBZzoSb7C+K fRXdfns6FpQFQTipNaNwuOmR62OJdWzxadMtfXerWIYvCr5hNoWxlmbHbaF8Z/JhRwRV dJlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684160579; x=1686752579; 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=ugKGoJ81f5tjlSeKwQunFBD6/6l/tft31Xgh7oSMPhU=; b=NinnB1fD9eNNVLUsYLRAM4uGHgMOU063qZCorZclJeWTuSQ0geO5uQk9M3ycuaHd/8 x+k1PqRs5GLc6vMYgeiCUcXs8YVwXT+PEOWpWlzx5Tr/Ls96WJBNHjDJ9KPKsPbVy9c+ uPCHvSUvK/pHx9h718YR4EAY6SZm9fgAkdfrnDHEYTqwRxHd2anRLWOCKQ0ZfqQ/PcHn bRVgVm1VjBL5ORTS4wPVIkVKiKiZxtOu/+aWtk7hb7O0DzsAqmCDYo45ZDzhL6eOps+p 3uMDxLEq4ymf3Ny5K0gUuUDxD7S+oPLjqznBfsgeHLn/ebd9IBArDbK7S+yBhW+Vb5tl if7w== X-Gm-Message-State: AC+VfDzHE/hvOZj3c0uVdSL4kcZzfJOfXDoohoXFNgazoH4wu0azB9Tn KRLVULLnfodwzo5RbnnWLXPe7ObEkTOcegmN0j4= X-Google-Smtp-Source: ACHHUZ6EizAgvcxgK0QdUkkXTR/ZzRdk1CRxM2wjlg2Wni4FkML7JrKCiEVrU+fyistcMY4CFO0q1SklQefHRnxF5nA= X-Received: by 2002:a67:e948:0:b0:436:57fc:ffa3 with SMTP id p8-20020a67e948000000b0043657fcffa3mr1803695vso.23.1684160579139; Mon, 15 May 2023 07:22:59 -0700 (PDT) MIME-Version: 1.0 References: <20230515114932.244397-1-juzhe.zhong@rivai.ai> In-Reply-To: From: Kito Cheng Date: Mon, 15 May 2023 22:22:47 +0800 Message-ID: Subject: Re: Re: [PATCH] RISC-V: Add rounding mode operand for floating point instructions To: =?UTF-8?B?6ZKf5bGF5ZOy?= Cc: Jeff Law , gcc-patches , "kito.cheng" , palmer , palmer , "rdapp.gcc" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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: > Oh, do you mean vfsqrt7/vfrec7 doesn't have frm, but vfsqrt/vfneg should = have frm. > Is that rigth? If yes, I am gonna send a patch to fix it immediately. Yes, and I also double checked spike implementation :P and it seems like you're not committed yet, so let's send V2 :) On Mon, May 15, 2023 at 10:12=E2=80=AFPM =E9=92=9F=E5=B1=85=E5=93=B2 wrote: > > Oh, do you mean vfsqrt7/vfrec7 doesn't have frm, but vfsqrt/vfneg should = have frm. > Is that rigth? If yes, I am gonna send a patch to fix it immediately. > > > > juzhe.zhong@rivai.ai > > From: Kito Cheng > Date: 2023-05-15 22:07 > To: =E9=92=9F=E5=B1=85=E5=93=B2 > CC: Jeff Law; gcc-patches; kito.cheng; palmer; palmer; rdapp.gcc > Subject: Re: Re: [PATCH] RISC-V: Add rounding mode operand for floating p= oint instructions > Oh, Craig says vfrsqrt7.v not have frm but vsqrt.v have frm, and > checked spike that match that. > > On Mon, May 15, 2023 at 9:55=E2=80=AFPM =E9=92=9F=E5=B1=85=E5=93=B2 wrote: > > > > I don't know why we should not add frm vfsqrt.v since I saw topper (LLV= M maintainer) said we should > > not add frm into vsqrt.v. Maybe kito knows the reason ? > > > > https://github.com/riscv-non-isa/rvv-intrinsic-doc/pull/226 > > > > > > > > > > juzhe.zhong@rivai.ai > > > > From: Jeff Law > > Date: 2023-05-15 21:52 > > To: juzhe.zhong; gcc-patches > > CC: kito.cheng; kito.cheng; palmer; palmer; rdapp.gcc > > Subject: Re: [PATCH] RISC-V: Add rounding mode operand for floating poi= nt instructions > > > > > > On 5/15/23 05:49, juzhe.zhong@rivai.ai wrote: > > > From: Juzhe-Zhong > > > > > > This patch is adding rounding mode operand and FRM_REGNUM dependency > > > into floating-point instructions. > > > > > > The floating-point instructions we added FRM and rounding mode operan= d: > > > 1. vfadd/vfsub > > > 2. vfwadd/vfwsub > > > 3. vfmul > > > 4. vfdiv > > > 5. vfwmul > > > 6. vfwmacc/vfwnmacc/vfwmsac/vfwnmsac > > > 7. vfsqrt7/vfrec7 > > > 8. floating-point conversions. > > > 9. floating-point reductions. > > > > > > The floating-point instructions we did NOT add FRM and rounding mode = operand: > > > 1. vfsqrt/vfneg > > Assuming vfsqrt is actually an estimator the best place to handle > > rounding modes is at the last step(s) after N-R or Goldschmidt > > refinement steps. I haven't paid too much attention to FP yet, but thi= s > > is an area I've got fairly extensive experience. > > > > Sadly RISC-V's estimator is fairly poor and the single instance FMACs > > are going to result in an implementation that may not actually be any > > better than what glibc can do. > > > > Jeff > > >