From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83931 invoked by alias); 4 Feb 2019 23:13:51 -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 83920 invoked by uid 89); 4 Feb 2019 23:13:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.6 required=5.0 tests=BAYES_00,GIT_PATCH_2,KAM_SHORT,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=sk:pinskia, U*pinskia, crit, H*f:1ahbq2vSj X-HELO: relay11.mail.gandi.net Received: from relay11.mail.gandi.net (HELO relay11.mail.gandi.net) (217.70.178.231) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 04 Feb 2019 23:13:49 +0000 Received: from [192.168.0.5] (wis38-2-88-180-229-108.fbx.proxad.net [88.180.229.108]) (Authenticated sender: lrnt@thvnx.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id B3D5B100006; Mon, 4 Feb 2019 23:13:45 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: How to gimplify_build a FMA_EXPR since it was removed? From: =?utf-8?Q?Laurent_Th=C3=A9venoux?= In-Reply-To: Date: Mon, 04 Feb 2019 23:13:00 -0000 Cc: GCC Mailing List Content-Transfer-Encoding: quoted-printable Message-Id: <0A4AE13B-24BF-4818-BFE9-1C4999C77A36@thvnx.com> References: <78ef-5c583400-5-25671200@29579276> To: Andrew Pinski X-SW-Source: 2019-02/txt/msg00014.txt.bz2 Hi, Thanks for pointing this me out. Nevertheless, I=E2=80=99m not sure this ca= n apply in my case since gimple_build_call_internal() returns a gimple data= 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 cod= e snippet below. ``` static void some_fn (gimple_stmt_iterator *gsi, tree inner_type, tree ar, tree ai, tree= 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 : >=20 > On Mon, Feb 4, 2019 at 4:47 AM Laurent Th=C3=A9venoux wr= ote: >>=20 >> Sorry for duplicate, gcc-help was not the right mailing list for this on= e. >>=20 >>=20 >> -------- 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 >>=20 >>=20 >>=20 >> Hi, >>=20 >> I've developed some code in gcc/tree-complex.c. I was using the >> FMA_EXPR to generate fma operations such as in: >>=20 >> ``` >> rr =3D gimplify_build3 (gsi, FMA_EXPR, inner_type, ai, ai, p1r);``` >>=20 >> FMA_EXPR was removed in https://gcc.gnu.org/ml/gcc-patches/2018-05/msg00= 570.html. >>=20 >> Is there an easy way to gimplify FMAs with the new functions >> introduced in the patch below? >=20 > From that patch (e.g. rs6000_gimple_fold_builtin): >=20 > - 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); >=20 >=20 > Thanks, > Andrew Pinski >=20 >=20 >>=20 >> Thanks, >> Laurent