From patchwork Wed Oct 26 20:26:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 687339 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 3t41km5Wscz9t2b for ; Thu, 27 Oct 2016 07:26:24 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=oQKXTmE3; 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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=j1SMhJkFPgZmOlybiXuAVES9vjPhC7nRHTtj4nKh04ybohujA9 2gf8rottrfezuGDWLqHSbAKxF++aeSFJTud2iUXl8jnFOOD/9KdGGydpd3K4Jabg 2eGQztPWiA8gn9NKSY8QOUGdrElay3a3bwY3q39gGsuc4UOjq3Z0lk1lU= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=ArFkWjibvg3N8mqXJn0iy+dJK04=; b=oQKXTmE3P0aekq/l5VJw QyFLZ6n1ynJGRIKl+5hWevqtNAVCgA0pKU2F/TlbJSYq1TcuhqOOJV5qKb6blX92 U98yzfy1RG8nSArptCjF68bkOZz+3MCBPgX14JfL8FDOTZ7Tdr1MBrynNEBTR+Z0 4xZbPqaKcs5XBIrOe7shLwY= Received: (qmail 74523 invoked by alias); 26 Oct 2016 20:26:16 -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 74501 invoked by uid 89); 26 Oct 2016 20:26:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2795 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Oct 2016 20:26:05 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3E47CC05A283 for ; Wed, 26 Oct 2016 20:26:04 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-128.phx2.redhat.com [10.3.116.128]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9QKQ3oY005951 for ; Wed, 26 Oct 2016 16:26:04 -0400 To: gcc-patches From: Jeff Law Subject: Fix sh port WRT fallthru Message-ID: Date: Wed, 26 Oct 2016 14:26:03 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 X-IsSubscribed: yes This adjusts existing fallthru comments and adds some new ones. I couldn't convince myself the original code in movsicc was correct, It looks like we properly reverse the condition, but not the operands in the case of LT/LE/LEU/LTU. But then we do almost the same th ing in sh_emit_scc_to_t as well. So I just kept the existing semantics and added fallthru comments. In gen_shl_and, I'm pretty sure we ended to fallthru. Installing on the trunk. Jeff diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3e7704c..0eb5f88 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2016-10-26 Jeff Law + * config/sh/sh.c (output_branch): Add missing fallthru comments. + (gen_shl_and): Likewise. + * config/sh/sh.md (movsicc): Add missing fallthru comments. + * config/mips/mips.c (mips16_constant_cost): Add missing fallthru comments. (mips16_build_call_stub): Increase buffer size. Adjust diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index cf5231e..4ca4b74 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -2665,6 +2665,7 @@ output_branch (int logic, rtx_insn *insn, rtx *operands) return ""; } + /* FALLTHRU */ /* When relaxing, handle this like a short branch. The linker will fix it up if it still doesn't fit after relaxation. */ case 2: @@ -2690,7 +2691,7 @@ output_branch (int logic, rtx_insn *insn, rtx *operands) return ""; } - /* When relaxing, fall through. */ + /* FALLTHRU */ case 4: { char buffer[10]; @@ -3461,7 +3462,7 @@ sh_rtx_costs (rtx x, machine_mode mode ATTRIBUTE_UNUSED, int outer_code, *total = COSTS_N_INSNS (1); return true; } - /* Fall through to shiftcosts. */ + /* FALLTHRU */ case ASHIFT: case ASHIFTRT: { @@ -4069,12 +4070,14 @@ gen_shl_and (rtx dest, rtx left_rtx, rtx mask_rtx, rtx source) } case 4: shift_gen_fun = gen_shifty_op; + /* FALLTHRU */ case 3: /* If the topmost bit that matters is set, set the topmost bits that don't matter. This way, we might be able to get a shorter signed constant. */ if (mask & ((HOST_WIDE_INT) 1 << (31 - total_shift))) mask |= (HOST_WIDE_INT) ((HOST_WIDE_INT_M1U) << (31 - total_shift)); + /* FALLTHRU */ case 2: /* Don't expand fine-grained when combining, because that will make the pattern fail. */ @@ -4647,6 +4650,7 @@ dump_table (rtx_insn *start, rtx_insn *barrier) align_insn = scan; need_align = false; } + /* FALLTHRU */ case DImode: for (lab = p->label; lab; lab = LABEL_REFS (lab)) scan = emit_label_after (lab, scan); diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index dcb31eb..e80ef58 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -1509,6 +1509,7 @@ case LT: case LE: case LEU: case LTU: if (GET_MODE_CLASS (GET_MODE (op0)) != MODE_INT) break; + /* FALLTHRU */ case NE: new_code = reverse_condition (code); break;