From patchwork Fri Feb 18 17:10:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatoly Sokolov X-Patchwork-Id: 83629 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 DD895B70F0 for ; Sat, 19 Feb 2011 04:10:47 +1100 (EST) Received: (qmail 13813 invoked by alias); 18 Feb 2011 17:10:44 -0000 Received: (qmail 13805 invoked by uid 22791); 18 Feb 2011 17:10:43 -0000 X-SWARE-Spam-Status: No, hits=2.2 required=5.0 tests=AWL, BAYES_50, KAM_THEBAT, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from contrabass.post.ru (HELO contrabass.post.ru) (85.21.78.5) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Feb 2011 17:10:32 +0000 Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id E0B73CB1D3; Fri, 18 Feb 2011 20:10:28 +0300 (MSK) Received: from [95.26.254.126] (account aesok@post.ru HELO Vista.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPA id 302034172; Fri, 18 Feb 2011 20:10:28 +0300 Date: Fri, 18 Feb 2011 20:10:45 +0300 From: Anatoly Sokolov Message-ID: <02751912.20110218201045@post.ru> To: gcc-patches CC: nickc@redhat.com Subject: [STORMY16] Hookize GO_IF_MODE_DEPENDENT_ADDRESS MIME-Version: 1.0 X-IsSubscribed: yes 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. This patch removes obsolete GO_IF_MODE_DEPENDENT_ADDRESS macros from STORMY16 back end in the GCC and introduces equivalent TARGET_MODE_DEPENDENT_ADDRESS_P target hook. Regression tested on xstormy16-unknown-elf. OK to install? * config/stormy16/stormy16.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove. * config/stormy16/stormy16-protos.h (xstormy16_mode_dependent_address_p): Remove. * config/stormy16/stormy16.c (xstormy16_mode_dependent_address_p): Make static. Change return type to bool. Change argument type to const_rtx. Remove dead code. (TARGET_MODE_DEPENDENT_ADDRESS_P): Define. Anatoly. Index: gcc/config/stormy16/stormy16.c =================================================================== --- gcc/config/stormy16/stormy16.c (revision 170195) +++ gcc/config/stormy16/stormy16.c (working copy) @@ -647,40 +647,27 @@ return false; } -/* Return nonzero if memory address X (an RTX) can have different - meanings depending on the machine mode of the memory reference it - is used for or if the address is valid for some modes but not - others. +/* Worker function for TARGET_MODE_DEPENDENT_ADDRESS_P. - Autoincrement and autodecrement addresses typically have mode-dependent - effects because the amount of the increment or decrement is the size of the - operand being addressed. Some machines have other mode-dependent addresses. - Many RISC machines have no mode-dependent addresses. - - You may assume that ADDR is a valid address for the machine. - On this chip, this is true if the address is valid with an offset of 0 but not of 6, because in that case it cannot be used as an address for DImode or DFmode, or if the address is a post-increment or pre-decrement address. */ -int -xstormy16_mode_dependent_address_p (rtx x) +static bool +xstormy16_mode_dependent_address_p (const_rtx x) { if (LEGITIMATE_ADDRESS_CONST_INT_P (x, 0) && ! LEGITIMATE_ADDRESS_CONST_INT_P (x, 6)) - return 1; + return true; if (GET_CODE (x) == PLUS && LEGITIMATE_ADDRESS_INTEGER_P (XEXP (x, 1), 0) && ! LEGITIMATE_ADDRESS_INTEGER_P (XEXP (x, 1), 6)) - return 1; + return true; - if (GET_CODE (x) == PLUS) - x = XEXP (x, 0); - /* Auto-increment addresses are now treated generically in recog.c. */ - return 0; + return false; } int @@ -2619,6 +2606,8 @@ #undef TARGET_LEGITIMATE_ADDRESS_P #define TARGET_LEGITIMATE_ADDRESS_P xstormy16_legitimate_address_p +#undef TARGET_MODE_DEPENDENT_ADDRESS_P +#define TARGET_MODE_DEPENDENT_ADDRESS_P xstormy16_mode_dependent_address_p #undef TARGET_CAN_ELIMINATE #define TARGET_CAN_ELIMINATE xstormy16_can_eliminate Index: gcc/config/stormy16/stormy16.h =================================================================== --- gcc/config/stormy16/stormy16.h (revision 170195) +++ gcc/config/stormy16/stormy16.h (working copy) @@ -371,14 +371,6 @@ #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X) -/* On this chip, this is true if the address is valid with an offset - of 0 but not of 6, because in that case it cannot be used as an - address for DImode or DFmode, or if the address is a post-increment - or pre-decrement address. */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ - if (xstormy16_mode_dependent_address_p (ADDR)) \ - goto LABEL - #define LEGITIMATE_CONSTANT_P(X) 1 Index: gcc/config/stormy16/stormy16-protos.h =================================================================== --- gcc/config/stormy16/stormy16-protos.h (revision 170195) +++ gcc/config/stormy16/stormy16-protos.h (working copy) @@ -44,7 +44,6 @@ extern void xstormy16_emit_cbranch (enum rtx_code, rtx, rtx, rtx); extern char *xstormy16_output_cbranch_hi (rtx, const char *, int, rtx); extern char *xstormy16_output_cbranch_si (rtx, const char *, int, rtx); -extern int xstormy16_mode_dependent_address_p (rtx); extern void xstormy16_print_operand (FILE *, rtx, int); extern void xstormy16_print_operand_address (FILE *, rtx);