From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5256 invoked by alias); 27 Jun 2011 06:40:27 -0000 Received: (qmail 5248 invoked by uid 22791); 27 Jun 2011 06:40:26 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 27 Jun 2011 06:40:13 +0000 From: "kkojima at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/49468] SH Target: inefficient integer abs code X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: kkojima at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Mon, 27 Jun 2011 06:40:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg02276.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D49468 --- Comment #5 from Kazumoto Kojima 2011-06-27= 06:39:40 UTC --- Argh, I also missed clobbers. Looks fine to me now, except that insn_and_split "*negdi2" forgot to set constraints and some minor coding style issues below. The first comment should be started with a capital letter and ended with a period. Also please follow GCC C coding style even for C program segments in .md file. C lines in the patch are started with a tab instead of 2 spaces. A long conditional should be broken like as (cond ? value0 : value1) instead of (cond ? value0 : value1) Please use braces " { int low_word =3D ... ... emit_insn (... DONE; }") instead of " int low_word =3D ... ... emit_insn (... DONE; ") especially when new variables are used, though those braces aren't required with the current gen* tools. > + emit_insn (gen_negsi_cond (operands[0], operands[1], operands[1],=20 > + GEN_INT (1))); The first line has an extra space after the last comma and the indentation of the 2nd line doesn't match with GCC coding standard. BTW, you could use const[01]_rtx for GEN_INT ([01]): emit_insn (gen_negsi_cond (operands[0], operands[1], operands[1], const1_rtx)); There are similar extra white space + broken indentation issues: > +(define_insn_and_split "negsi_cond" > + [(set (match_operand:SI 0 "arith_reg_dest" "=3Dr,r") > + (if_then_else:SI (eq:SI (reg:SI T_REG)=20 > + (match_operand:SI 3 "const_int_operand" "M,N")) ... > + emit_label_after (skip_neg_label,=20 > + emit_insn (gen_negsi2 (operands[0], operands[1]))); ... Perhaps mail or editor problem?