From patchwork Tue Apr 30 15:21:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Greenhalgh X-Patchwork-Id: 240645 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 9B8362C00D1 for ; Wed, 1 May 2013 01:21:41 +1000 (EST) 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:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=Wo5hUplu+wAotP07putQfWyKGE+5A1L+OpJF96EzLvX0U5wvWm U3T5qad3GhqNQ0ypZuFrevUacaO+OIB76iAlvsn3D7xM0ArUR33e75J3Ruf/yyYs 5/zHodT+yNOvKL7jU0E7FznVyMQyAPqa4Gubh1T1CahvOQl6jSkvcsUPc= 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:cc:subject:date:message-id:mime-version:content-type; s= default; bh=92ibXEctnhh7BBpslN5XRNdmy1s=; b=HFCE8VG0HIH7iEw849lE wd0DTi8Rz1a6xnSCI3wYYz9Um7sPi9dFAZ/Q28Qm4FpdLhTFur8r6k5063zk9IU8 07kMS091o0Qe5NlqzGgulbbLrrwS4f752WQj9as/fzsG5eCvv165KE5rd/OLIk1y gzx8pfM0iag5zltMV4A8Kk0= Received: (qmail 10349 invoked by alias); 30 Apr 2013 15:21:34 -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 10340 invoked by uid 89); 30 Apr 2013 15:21:34 -0000 X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, SPF_PASS, TW_TM autolearn=ham version=3.3.1 Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 30 Apr 2013 15:21:26 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Tue, 30 Apr 2013 16:21:23 +0100 Received: from e106375-lin.cambridge.arm.com ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Tue, 30 Apr 2013 16:21:21 +0100 From: James Greenhalgh To: gcc-patches@gcc.gnu.org Cc: marcus.shawcroft@arm.com Subject: [AArch64] Fold max and min reduction builtins to tree. Date: Tue, 30 Apr 2013 16:21:17 +0100 Message-Id: <1367335277-23532-1-git-send-email-james.greenhalgh@arm.com> MIME-Version: 1.0 X-MC-Unique: 113043016212312201 X-Virus-Found: No Hi, This patch folds the signed versions of min and max reduction builtins to tree form. We can't safely fold the unsigned versions as they do not currently have the correct type. We must use TARGET_GIMPLE_FOLD_BUILTIN as REDUC_MIN_EXPR is not a valid GENERIC code. Regression tested on aarch64-none-elf with no regressions. Thanks, James --- gcc/ 2013-04-30 James Greenhalgh * config/aarch64/aarch64-builtins (aarch64_gimple_fold_builtin): Fold reduc__ builtins. diff --git a/gcc/config/aarch64/aarch64-builtins.c b/gcc/config/aarch64/aarch64-builtins.c index 3016f25..8eb32c6 100644 --- a/gcc/config/aarch64/aarch64-builtins.c +++ b/gcc/config/aarch64/aarch64-builtins.c @@ -1372,6 +1372,21 @@ aarch64_gimple_fold_builtin (gimple_stmt_iterator *gsi) args[0], NULL_TREE); break; + BUILTIN_VDQIF (UNOP, reduc_smax_, 10) + new_stmt = gimple_build_assign_with_ops ( + REDUC_MAX_EXPR, + gimple_call_lhs (stmt), + args[0], + NULL_TREE); + break; + BUILTIN_VDQIF (UNOP, reduc_smin_, 10) + new_stmt = gimple_build_assign_with_ops ( + REDUC_MIN_EXPR, + gimple_call_lhs (stmt), + args[0], + NULL_TREE); + break; + default: break; }