From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117085 invoked by alias); 25 Feb 2015 22:59:21 -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 117075 invoked by uid 89); 25 Feb 2015 22:59:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: homiemail-a56.g.dreamhost.com Received: from sub5.mail.dreamhost.com (HELO homiemail-a56.g.dreamhost.com) (208.113.200.129) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 25 Feb 2015 22:59:19 +0000 Received: from homiemail-a56.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a56.g.dreamhost.com (Postfix) with ESMTP id 680AAFE064; Wed, 25 Feb 2015 14:59:10 -0800 (PST) Received: from redwood.eagercon.com (c-24-7-16-38.hsd1.ca.comcast.net [24.7.16.38]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: eager@eagerm.com) by homiemail-a56.g.dreamhost.com (Postfix) with ESMTPSA id 312A9FE05B; Wed, 25 Feb 2015 14:59:10 -0800 (PST) Message-ID: <54EE53BD.9060702@eagerm.com> Date: Wed, 25 Feb 2015 23:31:00 -0000 From: Michael Eager User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Ajit Kumar Agarwal , GCC Patches CC: Vinod Kathail , Shail Aditya Gupta , Vidhumouli Hunsigida , Nagaraju Mekala Subject: Re: [Patch,microblaze]: Optimized usage of pcmp conditional instruction. References: <4efa2fbc04a649b483100a8235c6e263@BN1BFFO11FD004.protection.gbl> In-Reply-To: <4efa2fbc04a649b483100a8235c6e263@BN1BFFO11FD004.protection.gbl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg01554.txt.bz2 On 02/25/15 02:19, Ajit Kumar Agarwal wrote: > Hello All: > > Please find the patch for the optimized usage of pcmp instructions in microblaze. No regressions is seen > In deja GNU tests. There are many testcases that are already there in deja GNU to check the generation of > pcmpne/pcmpeq instructions and are used to check the validity. > > commit b74acf44ce4286649e5be7cff7518d814cb2491f > Author: Ajit Kumar Agarwal > Date: Wed Feb 25 15:33:02 2015 +0530 > > [Patch,microblaze]: Optimized usage of pcmp conditional instruction. > > The changes are made in the patch for optimized usage of pcmpne/pcmpeq > instructions. The xor with register to register is replaced with pcmpeq > /pcmpne instructions and for immediate check still the xori will be used. > The purpose of the change is to acheive the aggressive usage of pcmpne > /pcmpeq instructions instead of xor being used for comparison. > > ChangeLog: > 2015-02-25 Ajit Agarwal > > * config/microblaze/microblaze.md (cbranchsi4): Added immediate > constraints. > (cbranchsi4_reg): New. > * config/microblaze/microblaze.c > (microblaze_expand_conditional_branch_reg): New. > * config/microblaze/microblaze-protos.h > (microblaze_expand_conditional_branch_reg): New prototype. + if (cmp_op1 == const0_rtx) + { + comp_reg = cmp_op0; + condition = gen_rtx_fmt_ee (signed_condition (code), + SImode, comp_reg, const0_rtx); + emit_jump_insn (gen_condjump (condition, label1)); + } + + else if (code == EQ || code == NE) + { + if (code == NE) + { + emit_insn (gen_sne_internal_pat (comp_reg, cmp_op0, + cmp_op1)); + condition = gen_rtx_NE (SImode, comp_reg, const0_rtx); + } + else + { + emit_insn (gen_seq_internal_pat (comp_reg, + cmp_op0, cmp_op1)); + condition = gen_rtx_EQ (SImode, comp_reg, const0_rtx); + } + emit_jump_insn (gen_condjump (condition, label1)); + } + else + { ... No blank line between end brace of if and else. Replace with + else if (code == EQ) + { + emit_insn (gen_seq_internal_pat (comp_reg, cmp_op0, cmp_op1)); + condition = gen_rtx_EQ (SImode, comp_reg, const0_rtx); + emit_jump_insn (gen_condjump (condition, label1)); + } + else if (code == NE) + { + emit_insn (gen_sne_internal_pat (comp_reg, cmp_op0, cmp_op1)); + condition = gen_rtx_NE (SImode, comp_reg, const0_rtx); + emit_jump_insn (gen_condjump (condition, label1)); + } + else + { ... -- Michael Eager eager@eagercon.com 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077