From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10952 invoked by alias); 4 Feb 2019 23:34:13 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 10379 invoked by uid 89); 4 Feb 2019 23:34:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:0A4AE13, H*i:sk:0A4AE13 X-HELO: mail-wr1-f41.google.com Received: from mail-wr1-f41.google.com (HELO mail-wr1-f41.google.com) (209.85.221.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 04 Feb 2019 23:34:08 +0000 Received: by mail-wr1-f41.google.com with SMTP id z5so1721108wrt.11 for ; Mon, 04 Feb 2019 15:34:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=v5fFtF6f13Gm5l3eTh8RvOnuLKL8+u+xbqakIbi5k2U=; b=d439Bnwgkb9jsGvDb18xWs6HFp4qZ2earqXVO8yYtJmOMC7y0whu0+YolaFcCvuSJD CRTCk0B8PbCtQPR1zufbOsAfocTEV8OI+Prwpb3dew1DZ55Rp9Qa5lEpyzDyRFcMGqdc TO/TDzF35WuH261jeGGkVjpsL1YEUYoAXiMQ4JpXEauFXUwqObIk6AKIGAHQsTpKn67W AxHV2Kevht4XsXU+MupyJ6Oq5MZo7wDdvRBFSQXIpp1ng8rpaS81JONhA9y2urx+d8Mo qfApKT6a33PfS3fNifg1QC0sHotyhES8PebMxmq5pO8k3aoWLa1V9T9YK79gZjvYTJk/ 9o5w== MIME-Version: 1.0 References: <78ef-5c583400-5-25671200@29579276> <0A4AE13B-24BF-4818-BFE9-1C4999C77A36@thvnx.com> In-Reply-To: <0A4AE13B-24BF-4818-BFE9-1C4999C77A36@thvnx.com> From: Andrew Pinski Date: Mon, 04 Feb 2019 23:34:00 -0000 Message-ID: Subject: Re: How to gimplify_build a FMA_EXPR since it was removed? To: =?UTF-8?Q?Laurent_Th=C3=A9venoux?= Cc: GCC Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-02/txt/msg00015.txt.bz2 On Mon, Feb 4, 2019 at 3:13 PM Laurent Th=C3=A9venoux wrot= e: > > Hi, > > Thanks for pointing this me out. Nevertheless, I=E2=80=99m not sure this = can apply in my case since gimple_build_call_internal() returns a gimple da= ta type while gimplify_build3() returns a tree data type. I=E2=80=99ll try = to figure how faisable is to use it in my case. For more context, see the c= ode snippet below. You need to create a new temp ssa name to hold the FMA results. There are few examples in the tree-ssa-phi-opt.c code for on how to use this way instead of using gimplify_build3. Thanks, Andrew Pinski > > ``` > static void > some_fn (gimple_stmt_iterator *gsi, tree inner_type, tree ar, tree ai, tr= ee br, tree bi) > { > tree rr, ri, pr1; > > p1r =3D gimplify_build2 (gsi, MULT_EXPR, inner_type, ar, ar); > rr =3D gimplify_build3 (gsi, FMA_EXPR, inner_type, ai, ai, p1r); > ri =3D build_real (inner_type, dconst0); > update_complex_assignment (gsi, rr, ri); > } > > ``` > > > Le 4 f=C3=A9vr. 2019 =C3=A0 23:38, Andrew Pinski a = =C3=A9crit : > > > > On Mon, Feb 4, 2019 at 4:47 AM Laurent Th=C3=A9venoux = wrote: > >> > >> Sorry for duplicate, gcc-help was not the right mailing list for this = one. > >> > >> > >> -------- Original Message -------- > >> Subject: How to gimplify_build a FMA_EXPR since it was removed? > >> Date: Monday, February 04, 2019 13:28 CET > >> From: Laurent Th=C3=A9venoux > >> To: gcc-help@gcc.gnu.org > >> CC: richard.sandiford@linaro.org > >> > >> > >> > >> Hi, > >> > >> I've developed some code in gcc/tree-complex.c. I was using the > >> FMA_EXPR to generate fma operations such as in: > >> > >> ``` > >> rr =3D gimplify_build3 (gsi, FMA_EXPR, inner_type, ai, ai, p1r);``` > >> > >> FMA_EXPR was removed in https://gcc.gnu.org/ml/gcc-patches/2018-05/msg= 00570.html. > >> > >> Is there an easy way to gimplify FMAs with the new functions > >> introduced in the patch below? > > > > From that patch (e.g. rs6000_gimple_fold_builtin): > > > > - gimple *g =3D gimple_build_assign (lhs, FMA_EXPR, arg0, arg1, arg2); > > + gcall *g =3D gimple_build_call_internal (IFN_FMA, 3, arg0, arg1, arg2= ); > > + gimple_call_set_lhs (g, lhs); > > + gimple_call_set_nothrow (g, true); > > > > > > Thanks, > > Andrew Pinski > > > > > >> > >> Thanks, > >> Laurent >