From patchwork Wed Jul 18 18:31:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 171806 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]) by ozlabs.org (Postfix) with SMTP id E6C1B2C00B3 for ; Thu, 19 Jul 2012 04:31:52 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1343241113; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=hgUQOeF iO37K/VAqMuBn3Zpm8Uc=; b=ZGjhvnoXkmuosIF+g8Cin3x74st+6C2niiC7JKv pB2LUHM9l10rYwjGYXBMW4hHC/sanH5WAsh0iCR3Wg9dbLRY061NHZzmfM7XsVxO uMLItB6q8zJY9K4lbtZpSJUqM21qG31wlzl0xfmLn+KpdSvyvzyKuStI5OKfwqlo LO0g= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=k12FKjdt8iV2JGDoP7uJvs20bp7wQqkaqbZMH4wFWnlUMG13VmQD/UghBBEMHd hScZAvyfVUTHevJnqATM+yOkqBhX7uY14ROIrC+tPmiTajnkswYP3/rQp+k2MR7w m77QruOEdXViOFHSHtj+MP+W9aDUGUvVCdLB04IZy2lQo=; Received: (qmail 17207 invoked by alias); 18 Jul 2012 18:31:48 -0000 Received: (qmail 17198 invoked by uid 22791); 18 Jul 2012 18:31:46 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-pb0-f47.google.com (HELO mail-pb0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Jul 2012 18:31:33 +0000 Received: by pbbrq2 with SMTP id rq2so3009921pbb.20 for ; Wed, 18 Jul 2012 11:31:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.238.68 with SMTP id vi4mr1154699pbc.123.1342636292495; Wed, 18 Jul 2012 11:31:32 -0700 (PDT) Received: by 10.66.11.130 with HTTP; Wed, 18 Jul 2012 11:31:32 -0700 (PDT) Date: Wed, 18 Jul 2012 20:31:32 +0200 Message-ID: Subject: [PATCH]: Add entity argument to MODE_AFTER macro From: Uros Bizjak To: gcc-patches@gcc.gnu.org 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 Hello! As with all other mode switching macros, we need to pass entity index also to MODE_AFTER macro. In a multi-entity mode switching case, we usually don't have same modes for all entities, and we should be able to return the mode that applies to a specific entity. It looks that epiphany port already tripped on this issue. 2012-07-18 Uros Bizjak * doc/tm.texi.in (MODE_AFTER): Add entity as the first macro argument. * doc/tm.texi: Regenerate. * mode-switching.c (optimize_mode_switching): Update MODE_AFTER call. * config/sh/sh.h (MODE_AFTER): Update. * config/epiphany/epiphany.h (MODE_AFTER): Update. Patch was bootstrapped on x86_64-pc-linux-gnu. Also, a functional C crosscompiler was built for sh-elf and epiphany-elf targets. Bordering on obvious, OK for mainline? Uros. Index: mode-switching.c =================================================================== --- mode-switching.c (revision 189491) +++ mode-switching.c (working copy) @@ -534,7 +534,7 @@ optimize_mode_switching (void) RESET_BIT (transp[bb->index], j); } #ifdef MODE_AFTER - last_mode = MODE_AFTER (last_mode, insn); + last_mode = MODE_AFTER (e, last_mode, insn); #endif /* Update LIVE_NOW. */ for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) Index: doc/tm.texi =================================================================== --- doc/tm.texi (revision 189491) +++ doc/tm.texi (working copy) @@ -9708,8 +9708,9 @@ return an integer value not larger than the corres be switched into prior to the execution of @var{insn}. @end defmac -@defmac MODE_AFTER (@var{mode}, @var{insn}) -If this macro is defined, it is evaluated for every @var{insn} during +@defmac MODE_AFTER (@var{entity}, @var{mode}, @var{insn}) +@var{entity} is an integer specifying a mode-switched entity. If +this macro is defined, it is evaluated for every @var{insn} during mode switching. It determines the mode that an insn results in (if different from the incoming mode). @end defmac Index: doc/tm.texi.in =================================================================== --- doc/tm.texi.in (revision 189491) +++ doc/tm.texi.in (working copy) @@ -9587,8 +9587,9 @@ return an integer value not larger than the corres be switched into prior to the execution of @var{insn}. @end defmac -@defmac MODE_AFTER (@var{mode}, @var{insn}) -If this macro is defined, it is evaluated for every @var{insn} during +@defmac MODE_AFTER (@var{entity}, @var{mode}, @var{insn}) +@var{entity} is an integer specifying a mode-switched entity. If +this macro is defined, it is evaluated for every @var{insn} during mode switching. It determines the mode that an insn results in (if different from the incoming mode). @end defmac Index: config/sh/sh.h =================================================================== --- config/sh/sh.h (revision 189491) +++ config/sh/sh.h (working copy) @@ -2351,7 +2351,7 @@ extern int current_function_interrupt; ? get_attr_fp_mode (INSN) \ : FP_MODE_NONE) -#define MODE_AFTER(MODE, INSN) \ +#define MODE_AFTER(ENTITY, MODE, INSN) \ (TARGET_HITACHI \ && recog_memoized (INSN) >= 0 \ && get_attr_fp_set (INSN) != FP_SET_NONE \ Index: config/epiphany/epiphany.h =================================================================== --- config/epiphany/epiphany.h (revision 189491) +++ config/epiphany/epiphany.h (working copy) @@ -888,8 +888,8 @@ enum epiphany_function_type #define MODE_ENTRY(ENTITY) (epiphany_mode_entry_exit ((ENTITY), false)) #define MODE_EXIT(ENTITY) (epiphany_mode_entry_exit ((ENTITY), true)) -#define MODE_AFTER(LAST_MODE, INSN) \ - (epiphany_mode_after (e, (LAST_MODE), (INSN))) +#define MODE_AFTER(ENTITY, LAST_MODE, INSN) \ + (epiphany_mode_after ((ENTITY), (LAST_MODE), (INSN))) #define TARGET_INSERT_MODE_SWITCH_USE epiphany_insert_mode_switch_use