From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105478 invoked by alias); 17 Aug 2015 09:29:29 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 105464 invoked by uid 89); 17 Aug 2015 09:29:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Aug 2015 09:29:26 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-25-wAIVclm7T9uj12VudaYnlQ-1; Mon, 17 Aug 2015 10:29:21 +0100 Received: from E105887 ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 17 Aug 2015 10:29:20 +0100 From: "David Sherwood" To: "'Richard Biener'" Cc: "GCC Patches" References: <000001d0d5b0$5da4dbb0$18ee9310$@arm.com> In-Reply-To: Subject: RE: [PING][Patch] Add support for IEEE-conformant versions of scalar fmin* and fmax* Date: Mon, 17 Aug 2015 09:41:00 -0000 Message-ID: <000001d0d8cf$2fb42770$8f1c7650$@arm.com> MIME-Version: 1.0 X-MC-Unique: wAIVclm7T9uj12VudaYnlQ-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2015-08/txt/msg00884.txt.bz2 Hi Richard, Thanks for the reply. I'd chosen to add new expressions as this seemed more consistent with the existing MAX_EXPR and MIN_EXPR tree codes. In addition = it would seem to provide more opportunities for optimisation than a target-spe= cific builtin implementation would. I accept that optimisation opportunities will be more limited for strict math compilation, but that it was still worth ha= ving them. Also, if we did map it to builtins then the scalar version would go through the optabs and the vector version would go through the target's bui= ltin expansion, which doesn't seem very consistent. Regards, David. > -----Original Message----- > From: Richard Biener [mailto:richard.guenther@gmail.com] > Sent: 13 August 2015 12:10 > To: David Sherwood > Cc: GCC Patches > Subject: Re: [PING][Patch] Add support for IEEE-conformant versions of sc= alar fmin* and fmax* >=20 > On Thu, Aug 13, 2015 at 12:11 PM, David Sherwood = wrote: > > Hi, > > > > Sorry to bother people again. Is this OK to go now? >=20 > Hmm, why don't you go the vectorized function call path for this, > implementing the builtin_vectorized_function target hook? >=20 > Richard. >=20 > > Thanks! > > David. > > > >> > > >> > > On Mon, 29 Jun 2015, David Sherwood wrote: > >> > > > >> > > > Hi, > >> > > > > >> > > > I have added new STRICT_MAX_EXPR and STRICT_MIN_EXPR expressions= to support the > >> > > > IEEE versions of fmin and fmax. This is done by recognising the = math library > >> > > > "fmax" and "fmin" builtin functions in a similar way to how this= is done for > >> > > > -ffast-math. This also allows us to vectorise the IEEE max/min f= unctions for > >> > > > targets that support it, for example aarch64/aarch32. > >> > > > >> > > This patch is missing documentation. You need to document the new= insn > >> > > patterns in md.texi and the new tree codes in generic.texi. > >> > > >> > Hi, I've uploaded a new patch with the documentation. Hope this is o= k. > >> > >> In various places where you refer to one operand being NaN, I think you > >> mean one operand being a *quiet* NaN (if one is a signaling NaN - only > >> supported by GCC if -fsignaling-nans - the IEEE minNum and maxNum > >> operations raise "invalid" and return a quiet NaN). > > > > Hi, I have a new patch that hopefully addresses the documentation issue= s. > > > > Thanks, > > David. > > > > ChangeLog: > > > > 2015-07-15 David Sherwood > > > > gcc/ > > * builtins.c (integer_valued_real_p): Add STRICT_MIN_EXPR and > > STRICT_MAX_EXPR. > > (fold_builtin_fmin_fmax): For strict math, convert builting fmin and > > fmax to STRICT_MIN_EXPR and STRICT_MIN_EXPR, respectively. > > * expr.c (expand_expr_real_2): Add STRICT_MIN_EXPR and STRICT_MAX_E= XPR. > > * fold-const.c (const_binop): Likewise. > > (fold_binary_loc, tree_binary_nonnegative_warnv_p): Likewise. > > (tree_binary_nonzero_warnv_p): Likewise. > > * optabs.h (strict_minmax_support): Declare. > > * optabs.def: Add new optabs strict_max_optab/strict_min_optab. > > * optabs.c (optab_for_tree_code): Return new optabs for STRICT_MIN_= EXPR > > and STRICT_MAX_EXPR. > > (strict_minmax_support): New function. > > * real.c (real_arithmetic): Add STRICT_MIN_EXPR and STRICT_MAX_EXPR. > > * tree.def: Likewise. > > * tree.c (associative_tree_code, commutative_tree_code): Likewise. > > * tree-cfg.c (verify_expr): Likewise. > > (verify_gimple_assign_binary): Likewise. > > * tree-inline.c (estimate_operator_cost): Likewise. > > * tree-pretty-print.c (dump_generic_node, op_code_prio): Likewise. > > (op_symbol_code): Likewise. > > gcc/config: > > * aarch64/aarch64.md: New pattern. > > * aarch64/aarch64-simd.md: Likewise. > > * aarch64/iterators.md: New unspecs, iterators. > > * arm/iterators.md: New iterators. > > * arm/unspecs.md: New unspecs. > > * arm/neon.md: New pattern. > > * arm/vfp.md: Likewise. > > gcc/doc: > > * generic.texi: Add STRICT_MAX_EXPR and STRICT_MIN_EXPR. > > * md.texi: Add strict_min and strict_max patterns. > > gcc/testsuite > > * gcc.target/aarch64/maxmin_strict.c: New test. > > * gcc.target/arm/maxmin_strict.c: New test.