From patchwork Sat Nov 7 12:50:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 541290 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 59D20140324 for ; Sat, 7 Nov 2015 23:51:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=urKBV6dN; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=WvKwZpVFflgBOK1G u8wovcBivBt2NIzesGponPWyQ+zMUBCvE/SC4avJKYWctIZMG4+K4njMF04CSnPF iiA2R6jCLFOWbdYZguT03OMnaBCZ/BVGhxzjrjqSM9C2mR+bmG/NV6hgDrRjaW9E SpNYt9KYLUzPP4JxqcBMd72wR6g= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=pMuWaDBCqbQBa/DgMXvNKS DpPbY=; b=urKBV6dNRuVggt3nVDnk3LbXAl1yk0aa82dHoHc6cBTwWrdxbB7tfd Tmbhh7T2bExcYbJYGnfpMeB/8nzw29/8D3EwKiJN8LTHIJqiS473cwZVSnnkCKqT vCdDSblvwDsdVZXpEpNqmmYPee6kDiXQJ1kUq0cEL5i3Dz3zIJ3Q4= Received: (qmail 32900 invoked by alias); 7 Nov 2015 12:51:07 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 32888 invoked by uid 89); 7 Nov 2015 12:51:07 -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) (207.82.80.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 07 Nov 2015 12:51:02 +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-2-WbpObh-iQz-H0wpM6zW9SQ-1; Sat, 07 Nov 2015 12:50:57 +0000 Received: from localhost ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Sat, 7 Nov 2015 12:50:57 +0000 From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: Use combined_fn in tree-vect-patterns.c Date: Sat, 07 Nov 2015 12:50:57 +0000 Message-ID: <87611eq8ge.fsf@e105548-lin.cambridge.arm.com> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-MC-Unique: WbpObh-iQz-H0wpM6zW9SQ-1 Another patch to extend uses of built_in_function to combined_fn, this time in tree-vect-patterns.c. The old code didn't handle the long double pow variants, but I think that's because noone had a target that would benefit rather than because the code would mishandle them. Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi. OK to install? Thanks, Richard gcc/ * tree-vect-patterns.c: Include case-cfn-macros.h. (vect_recog_pow_pattern): Use combined_fn instead of built-in codes. diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index d003d33..bab9a4f 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-vectorizer.h" #include "dumpfile.h" #include "builtins.h" +#include "case-cfn-macros.h" /* Pattern recognition functions */ static gimple *vect_recog_widen_sum_pattern (vec *, tree *, @@ -1007,23 +1008,17 @@ vect_recog_pow_pattern (vec *stmts, tree *type_in, tree *type_out) { gimple *last_stmt = (*stmts)[0]; - tree fn, base, exp = NULL; + tree base, exp = NULL; gimple *stmt; tree var; if (!is_gimple_call (last_stmt) || gimple_call_lhs (last_stmt) == NULL) return NULL; - fn = gimple_call_fndecl (last_stmt); - if (fn == NULL_TREE || DECL_BUILT_IN_CLASS (fn) != BUILT_IN_NORMAL) - return NULL; - - switch (DECL_FUNCTION_CODE (fn)) + switch (gimple_call_combined_fn (last_stmt)) { - case BUILT_IN_POWIF: - case BUILT_IN_POWI: - case BUILT_IN_POWF: - case BUILT_IN_POW: + CASE_CFN_POW: + CASE_CFN_POWI: base = gimple_call_arg (last_stmt, 0); exp = gimple_call_arg (last_stmt, 1); if (TREE_CODE (exp) != REAL_CST