From patchwork Fri Oct 24 12:01:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Lawrence X-Patchwork-Id: 402832 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 7AF89140080 for ; Fri, 24 Oct 2014 23:01:39 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:in-reply-to :content-type; q=dns; s=default; b=sRttgjchzVgaS/HRM6idFwS7aHmFK WZyTwuqmsoLr5dJZ7GArkWuPFRmzJWRx/WS5W3bcPYkTnWea3Q7T1ChRJ/+AVY/d 1rDrEc5vVGXXZzmPY4pWvGJStq+SypC1eQefPcRl+axxXfBhQIyP5wCxAU2yHrnJ DWLtyy2uQ5IG/w= 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 :message-id:date:from:mime-version:to:subject:in-reply-to :content-type; s=default; bh=Sm27atDqXJ1SOdbXTjyp2bBWG5I=; b=A25 kyby35UfrP83G30pGlHASovqKY4QFmdw5OmO7gacuWMAMiTTKdhzeQ5q/hZ2D6EM H3VQ2Rc4Uc5raPsrMunyi4KThLS1TJXqxg/zjBF/ABAdHqOCabATU4xwoYCommCS 6jf9e2A0spQbbYI+Rks9gBrT9BgEEyDUHl0EMaaE= Received: (qmail 3116 invoked by alias); 24 Oct 2014 12:01:31 -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 3105 invoked by uid 89); 24 Oct 2014 12:01:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 24 Oct 2014 12:01:30 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Fri, 24 Oct 2014 13:01:27 +0100 Received: from [10.1.209.51] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 24 Oct 2014 13:01:26 +0100 Message-ID: <544A3F95.3050305@arm.com> Date: Fri, 24 Oct 2014 13:01:25 +0100 From: Alan Lawrence User-Agent: Thunderbird 2.0.0.24 (X11/20101213) MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [PATCH 8/11][ARM] Migrate to new reduc_[us](min|max)_scal_optab In-Reply-To: <544A3E0B.2000803@arm.com> X-MC-Unique: 114102413012700501 X-IsSubscribed: yes Similarly to last patch. Tested, in combination with previous patch: bootstrap on arm-none-linux-gnueabihf cross-tested check-gcc on arm-none-eabi. gcc/ChangeLog: config/arm/neon.md (reduc_smin_ *2): Rename to... (reduc_smin_scal_ *2): ...this; extract scalar result. (reduc_smax_ *2): Rename to... (reduc_smax_scal_ *2): ...this; extract scalar result. (reduc_umin_ *2): Rename to... (reduc_umin_scal_ *2): ...this; extract scalar result. (reduc_umax_ *2): Rename to... (reduc_umax_scal_ *2): ...this; extract scalar result. commit 537c31561933f8054a2289198f35b19cf5c4196e Author: Alan Lawrence Date: Thu Aug 28 16:49:24 2014 +0100 ARM reduc_[us](min|max)_scal, V_elem not V_ext, rm old non-_scal version. diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md index d13fe5d..19e1ba0 100644 --- a/gcc/config/arm/neon.md +++ b/gcc/config/arm/neon.md @@ -1398,104 +1398,109 @@ [(set_attr "type" "neon_add_q")] ) -(define_expand "reduc_smin_" - [(match_operand:VD 0 "s_register_operand" "") +(define_expand "reduc_smin_scal_" + [(match_operand: 0 "nonimmediate_operand" "") (match_operand:VD 1 "s_register_operand" "")] "TARGET_NEON && (! || flag_unsafe_math_optimizations)" { - neon_pairwise_reduce (operands[0], operands[1], mode, + rtx vec = gen_reg_rtx (mode); + + neon_pairwise_reduce (vec, operands[1], mode, &gen_neon_vpsmin); + /* The result is computed into every element of the vector. */ + emit_insn (gen_vec_extract (operands[0], vec, const0_rtx)); DONE; }) -(define_expand "reduc_smin_" - [(match_operand:VQ 0 "s_register_operand" "") +(define_expand "reduc_smin_scal_" + [(match_operand: 0 "nonimmediate_operand" "") (match_operand:VQ 1 "s_register_operand" "")] "TARGET_NEON && (! || flag_unsafe_math_optimizations) && !BYTES_BIG_ENDIAN" { rtx step1 = gen_reg_rtx (mode); - rtx res_d = gen_reg_rtx (mode); emit_insn (gen_quad_halves_smin (step1, operands[1])); - emit_insn (gen_reduc_smin_ (res_d, step1)); - emit_insn (gen_move_lo_quad_ (operands[0], res_d)); + emit_insn (gen_reduc_smin_scal_ (operands[0], step1)); DONE; }) -(define_expand "reduc_smax_" - [(match_operand:VD 0 "s_register_operand" "") +(define_expand "reduc_smax_scal_" + [(match_operand: 0 "nonimmediate_operand" "") (match_operand:VD 1 "s_register_operand" "")] "TARGET_NEON && (! || flag_unsafe_math_optimizations)" { - neon_pairwise_reduce (operands[0], operands[1], mode, + rtx vec = gen_reg_rtx (mode); + neon_pairwise_reduce (vec, operands[1], mode, &gen_neon_vpsmax); + /* The result is computed into every element of the vector. */ + emit_insn (gen_vec_extract (operands[0], vec, const0_rtx)); DONE; }) -(define_expand "reduc_smax_" - [(match_operand:VQ 0 "s_register_operand" "") +(define_expand "reduc_smax_scal_" + [(match_operand: 0 "nonimmediate_operand" "") (match_operand:VQ 1 "s_register_operand" "")] "TARGET_NEON && (! || flag_unsafe_math_optimizations) && !BYTES_BIG_ENDIAN" { rtx step1 = gen_reg_rtx (mode); - rtx res_d = gen_reg_rtx (mode); emit_insn (gen_quad_halves_smax (step1, operands[1])); - emit_insn (gen_reduc_smax_ (res_d, step1)); - emit_insn (gen_move_lo_quad_ (operands[0], res_d)); + emit_insn (gen_reduc_smax_scal_ (operands[0], step1)); DONE; }) -(define_expand "reduc_umin_" - [(match_operand:VDI 0 "s_register_operand" "") +(define_expand "reduc_umin_scal_" + [(match_operand: 0 "nonimmediate_operand" "") (match_operand:VDI 1 "s_register_operand" "")] "TARGET_NEON" { - neon_pairwise_reduce (operands[0], operands[1], mode, + rtx vec = gen_reg_rtx (mode); + neon_pairwise_reduce (vec, operands[1], mode, &gen_neon_vpumin); + /* The result is computed into every element of the vector. */ + emit_insn (gen_vec_extract (operands[0], vec, const0_rtx)); DONE; }) -(define_expand "reduc_umin_" - [(match_operand:VQI 0 "s_register_operand" "") +(define_expand "reduc_umin_scal_" + [(match_operand: 0 "nonimmediate_operand" "") (match_operand:VQI 1 "s_register_operand" "")] "TARGET_NEON && !BYTES_BIG_ENDIAN" { rtx step1 = gen_reg_rtx (mode); - rtx res_d = gen_reg_rtx (mode); emit_insn (gen_quad_halves_umin (step1, operands[1])); - emit_insn (gen_reduc_umin_ (res_d, step1)); - emit_insn (gen_move_lo_quad_ (operands[0], res_d)); + emit_insn (gen_reduc_umin_scal_ (operands[0], step1)); DONE; }) -(define_expand "reduc_umax_" - [(match_operand:VDI 0 "s_register_operand" "") +(define_expand "reduc_umax_scal_" + [(match_operand: 0 "nonimmediate_operand" "") (match_operand:VDI 1 "s_register_operand" "")] "TARGET_NEON" { - neon_pairwise_reduce (operands[0], operands[1], mode, + rtx vec = gen_reg_rtx (mode); + neon_pairwise_reduce (vec, operands[1], mode, &gen_neon_vpumax); + /* The result is computed into every element of the vector. */ + emit_insn (gen_vec_extract (operands[0], vec, const0_rtx)); DONE; }) -(define_expand "reduc_umax_" - [(match_operand:VQI 0 "s_register_operand" "") +(define_expand "reduc_umax_scal_" + [(match_operand: 0 "nonimmediate_operand" "") (match_operand:VQI 1 "s_register_operand" "")] "TARGET_NEON && !BYTES_BIG_ENDIAN" { rtx step1 = gen_reg_rtx (mode); - rtx res_d = gen_reg_rtx (mode); emit_insn (gen_quad_halves_umax (step1, operands[1])); - emit_insn (gen_reduc_umax_ (res_d, step1)); - emit_insn (gen_move_lo_quad_ (operands[0], res_d)); + emit_insn (gen_reduc_umax_scal_ (operands[0], step1)); DONE; })