From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0598C433DF for ; Mon, 3 Aug 2020 10:36:19 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9D52C20738 for ; Mon, 3 Aug 2020 10:36:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="K2ZPpmA+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D52C20738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k2XpL-0004gr-EM for qemu-devel@archiver.kernel.org; Mon, 03 Aug 2020 06:36:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k2Xof-0004Bn-IE for qemu-devel@nongnu.org; Mon, 03 Aug 2020 06:35:37 -0400 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]:42997) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k2Xod-000845-DQ for qemu-devel@nongnu.org; Mon, 03 Aug 2020 06:35:36 -0400 Received: by mail-oi1-x234.google.com with SMTP id j7so16438520oij.9 for ; Mon, 03 Aug 2020 03:35:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=e9sfjVipAzOY/W6aqcIDPMN6DiHPEBcPBUUg65g/v08=; b=K2ZPpmA+s5nBZqoTRK+gDhXWTHX/mLxTOWBl9bnXzAetfEJjnGlv3mV1TGFzLm3VG+ jj880SIbJ98Zj+7M8KYY5N5e3Wr6MLvgkhAZQymCW0ZvR3covoE4SjQ6BQeXaAWuVp0/ O13b6atxxUNkRwhNiFeoCBuDThYgRuPlP0SMM/ftzCdiAPuKjhPmdF+pThK8GNE5zWQ0 ZDS9B2oL6WxcqeShJBO5z24TtBKlUqiVLkb5c+xKXdXpg4RRHdpoPGzQyAyCm6MG4pcv hywRrvTQHjjkfoDEOmloh3pW3w4ZCzN4QDE3tz7ScKcf8BPmtFTK5gi2ndIRKhwVg/yW jmrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=e9sfjVipAzOY/W6aqcIDPMN6DiHPEBcPBUUg65g/v08=; b=NAJMAg1WO07BhT4UpM0ciS1LJnOWwIoYtXDoL5CzqcftWR3ngaj6g/RBkhFV0V3nxy 7hJmAf9Lclthmu0HepuQv2GurM9iiL9K5X49m/rzjJPctFRCX1BBJ25b11MMhM8BsdEE Z25cFgOFIkua3Fj5mkGV3OEt4LhIQR7sIHXmpR3qVpxSoQHfO1TYUptd4F5Op25q0cZU ZpAfqXqWEDsb2QhjAfuDgpGPX3Mne/nA+BCXGzZWKawH4JH85e100Kw3jqFDzjkVwUNR Gu1f+EKpBVBJc8ZLqgSjt0chHn8/pZlKHr0jySEj9RwJr4xrltn1Z95WgAlCnWDh9cu4 oZ4g== X-Gm-Message-State: AOAM530JSj83Rxc+WsxfA/mFI46T+stA+HUe/B8RQOvDhuDb3JWvjsnR NdjzqZGZz08kUMJpT15ZvaD802qsWOpbf7OEh4hzRQ== X-Google-Smtp-Source: ABdhPJzLZAZAG95EH1E46Cvf+ucozJLWdD4lLezdGBC9k+zEMlGcpMymswnFN+cF/MggTp907HcO1rA9B5GdPr5NSXk= X-Received: by 2002:aca:c451:: with SMTP id u78mr4013945oif.118.1596450933525; Mon, 03 Aug 2020 03:35:33 -0700 (PDT) MIME-Version: 1.0 References: <20200722091641.8834-1-frank.chang@sifive.com> <20200722091641.8834-60-frank.chang@sifive.com> <8ae82210-965a-25cc-46d6-f3d2e05e88a5@linaro.org> In-Reply-To: <8ae82210-965a-25cc-46d6-f3d2e05e88a5@linaro.org> From: Frank Chang Date: Mon, 3 Aug 2020 18:35:22 +0800 Message-ID: Subject: Re: [RFC v2 59/76] target/riscv: rvv-0.9: floating-point slide instructions To: Richard Henderson Content-Type: multipart/alternative; boundary="000000000000cb615105abf6b23a" Received-SPF: pass client-ip=2607:f8b0:4864:20::234; envelope-from=frank.chang@sifive.com; helo=mail-oi1-x234.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:RISC-V" , Sagar Karandikar , Bastian Koppelmann , "qemu-devel@nongnu.org Developers" , Palmer Dabbelt , Alistair Francis , LIU Zhiwei Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --000000000000cb615105abf6b23a Content-Type: text/plain; charset="UTF-8" On Sat, Aug 1, 2020 at 12:05 AM Richard Henderson < richard.henderson@linaro.org> wrote: > On 7/22/20 2:16 AM, frank.chang@sifive.com wrote: > > +DEF_HELPER_6(vfslide1up_vf_h, void, ptr, ptr, i64, ptr, env, i32) > > +DEF_HELPER_6(vfslide1up_vf_w, void, ptr, ptr, i64, ptr, env, i32) > > +DEF_HELPER_6(vfslide1up_vf_d, void, ptr, ptr, i64, ptr, env, i32) > > +DEF_HELPER_6(vfslide1down_vf_h, void, ptr, ptr, i64, ptr, env, i32) > > +DEF_HELPER_6(vfslide1down_vf_w, void, ptr, ptr, i64, ptr, env, i32) > > +DEF_HELPER_6(vfslide1down_vf_d, void, ptr, ptr, i64, ptr, env, i32) > > You should not need new helpers. > > The only difference between vfslide1up and vslide1up is the source and the > nanboxing. Which you can do in the translator before using the existing > helpers. > > > r~ > I agree that the implementation of *vslide1up*'s helper function can be reused by *vfslide1up*. However, I've encountered an issue where the helper function called in *opfvf_trans()* used by *vfslide1up* takes *TCGv_i64* type as *s1* parameter. This conflicts with *vslide1up*'s helper function called in *opivx_trans(),* where *s1* parameter is the type of *TCGv* rather than *TCGv_i64*. i.e. *DEF_HELPER_6(vslide1up_vx_w, void, ptr, ptr, tl, ptr, env, i32)* vs. *DEF_HELPER_6(vfslide1up_vf_h, void, ptr, ptr, i64, ptr, env, i32)* As *opfvf_trans()* and *opivx_trans()* are shared among other instructions, I wouldn't like to make prototype changes to these functions. So far what I can come up with is to extract the logic in *vslide1up*'s helper function to an individual static function and make *vslide1up* and *vfslide1up*'s helper functions to call this static function. So that the're no redundant logic to be redefined. However, this still require to declare *vfslide1up'*s helper function explicitly as its function prototype is different with *vslide1up*. Any suggestions to this issue? Thanks Frank Chang --000000000000cb615105abf6b23a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Aug 1, 2020 at 12:05 AM Richard H= enderson <richard.henderson@linaro.org> wrote:
On 7/22/20 2:16 = AM, frank.chang= @sifive.com wrote:
> +DEF_HELPER_6(vfslide1up_vf_h, void, ptr, ptr, i64, ptr, env, i32)
> +DEF_HELPER_6(vfslide1up_vf_w, void, ptr, ptr, i64, ptr, env, i32)
> +DEF_HELPER_6(vfslide1up_vf_d, void, ptr, ptr, i64, ptr, env, i32)
> +DEF_HELPER_6(vfslide1down_vf_h, void, ptr, ptr, i64, ptr, env, i32) > +DEF_HELPER_6(vfslide1down_vf_w, void, ptr, ptr, i64, ptr, env, i32) > +DEF_HELPER_6(vfslide1down_vf_d, void, ptr, ptr, i64, ptr, env, i32)
You should not need new helpers.

The only difference between vfslide1up and vslide1up is the source and the<= br> nanboxing.=C2=A0 Which you can do in the translator before using the existi= ng helpers.


r~

I agree that the implementation of= =C2=A0vslide1up's helper function can be
reused by=C2= =A0vfslide1up.

However, I've encountere= d an issue
where the helper function called in=C2=A0opfvf_tran= s() used by vfslide1up
takes TCGv_i64 type as= =C2=A0s1 parameter.
This conflicts with vslide1up<= /i>'s=C2=A0helper function called in opivx_trans(),
wh= ere=C2=A0s1 parameter is the type of=C2=A0TCGv=C2=A0rather th= an=C2=A0TCGv_i64.

i.e.
DEF_HELPER_6(vslide1up_vx_w, void, ptr, ptr, tl, ptr, env, i32)<= /i> vs.
DEF_HELPER_6(vfslide1up_vf_h, void, ptr, ptr, i64, ptr, env, i32)

As=C2=A0opfvf_tran= s() and=C2=A0opivx_trans() are shared among other instructions,<= /div>
I wouldn't like to make prototype changes to these functions.=

So far what I can come up with is to extract the = logic in=C2=A0vslide1up's
helper function to an indivi= dual static function and make=C2=A0vslide1up
and=C2=A0v= fslide1up's helper functions to call this static function.

So that the're no redundant logic to be redefined.
However, this still require to declare=C2=A0vfslide1up's<= i>=C2=A0helper function explicitly
as its function prototype = is different with=C2=A0vslide1up.

Any sugge= stions to this issue?

Thanks
Frank C= hang
--000000000000cb615105abf6b23a--