From patchwork Sun Jul 24 20:47:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatoly Sokolov X-Patchwork-Id: 106573 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 CDED2B6F80 for ; Mon, 25 Jul 2011 06:47:31 +1000 (EST) Received: (qmail 31084 invoked by alias); 24 Jul 2011 20:47:29 -0000 Received: (qmail 31075 invoked by uid 22791); 24 Jul 2011 20:47:29 -0000 X-SWARE-Spam-Status: No, hits=-0.2 required=5.0 tests=AWL, BAYES_40, KAM_THEBAT, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from contrabass.post.ru (HELO contrabass.corbina.net) (85.21.78.5) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 24 Jul 2011 20:47:15 +0000 Received: from corbina.ru (violin.corbina.net [195.14.50.30]) by contrabass.corbina.net (Postfix) with ESMTP id EF470CAEAC; Mon, 25 Jul 2011 00:47:13 +0400 (MSD) Received: from [95.28.37.227] (account aesok@post.ru HELO Vista.beeline) by fe1-mc.corbina.ru (CommuniGate Pro SMTP 5.4.0) with ESMTPA id 19653026; Mon, 25 Jul 2011 00:47:13 +0400 Date: Mon, 25 Jul 2011 00:47:36 +0400 From: Anatoly Sokolov Message-ID: <69593726.20110725004736@post.ru> To: gcc-patches CC: dj@redhat.com Subject: [M32C] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P 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 Hi. This patch removes obsolete PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P macros from M32C back end in the GCC and introduces equivalent TARGET_PRINT_OPERAND, TARGET_PRINT_OPERAND_ADDRESS and TARGET_PRINT_OPERAND_PUNCT_VALID_P target hooks. Regression tested on m32c-unknown-elf. OK to install? * config/m32c/m32c.h (PRINT_OPERAND, PRINT_OPERAND_ADDRESS, PRINT_OPERAND_PUNCT_VALID_P): Remove macro. * config/m32c/m32c-protos.h (m32c_print_operand_punct_valid_p, m32c_print_operand, m32c_print_operand_address): Remove. * config/m32c/m32c.c (m32c_print_operand_punct_valid_p): Make static. Change return type to bool. Change argument type to bool. (m32c_print_operand, m32c_print_operand_address): Make static. (TARGET_PRINT_OPERAND, TARGET_PRINT_OPERAND_ADDRESS, TARGET_PRINT_OPERAND_PUNCT_VALID_P): Define. Anatoly. Index: gcc/config/m32c/m32c.c =================================================================== --- gcc/config/m32c/m32c.c (revision 176672) +++ gcc/config/m32c/m32c.c (working copy) @@ -2644,8 +2644,12 @@ "fb", "sb", "a1", "a0", "r3", "r2", "r1", "r0" }; -/* Implements PRINT_OPERAND. */ -void +/* Implements TARGET_PRINT_OPERAND. */ + +#undef TARGET_PRINT_OPERAND +#define TARGET_PRINT_OPERAND m32c_print_operand + +static void m32c_print_operand (FILE * file, rtx x, int code) { int i, j, b; @@ -2998,18 +3002,28 @@ return; } -/* Implements PRINT_OPERAND_PUNCT_VALID_P. See m32c_print_operand - above for descriptions of what these do. */ -int -m32c_print_operand_punct_valid_p (int c) +/* Implements TARGET_PRINT_OPERAND_PUNCT_VALID_P. + + See m32c_print_operand above for descriptions of what these do. */ + +#undef TARGET_PRINT_OPERAND_PUNCT_VALID_P +#define TARGET_PRINT_OPERAND_PUNCT_VALID_P m32c_print_operand_punct_valid_p + +static bool +m32c_print_operand_punct_valid_p (unsigned char c) { if (c == '&' || c == '!') - return 1; - return 0; + return true; + + return false; } -/* Implements PRINT_OPERAND_ADDRESS. Nothing unusual here. */ -void +/* Implements TARGET_PRINT_OPERAND_ADDRESS. Nothing unusual here. */ + +#undef TARGET_PRINT_OPERAND_ADDRESS +#define TARGET_PRINT_OPERAND_ADDRESS m32c_print_operand_address + +static void m32c_print_operand_address (FILE * stream, rtx address) { if (GET_CODE (address) == MEM) Index: gcc/config/m32c/m32c.h =================================================================== --- gcc/config/m32c/m32c.h (revision 176672) +++ gcc/config/m32c/m32c.h (working copy) @@ -620,10 +620,6 @@ {"a0a1", 4}, \ {"r0r2r1r3", 0} } -#define PRINT_OPERAND(S,X,C) m32c_print_operand (S, X, C) -#define PRINT_OPERAND_PUNCT_VALID_P(C) m32c_print_operand_punct_valid_p (C) -#define PRINT_OPERAND_ADDRESS(S,X) m32c_print_operand_address (S, X) - #undef USER_LABEL_PREFIX #define USER_LABEL_PREFIX "_" Index: gcc/config/m32c/m32c-protos.h =================================================================== --- gcc/config/m32c/m32c-protos.h (revision 176672) +++ gcc/config/m32c/m32c-protos.h (working copy) @@ -33,7 +33,6 @@ int m32c_initial_elimination_offset (int, int); void m32c_output_reg_pop (FILE *, int); void m32c_output_reg_push (FILE *, int); -int m32c_print_operand_punct_valid_p (int); unsigned int m32c_push_rounding (int); int m32c_reg_class_from_constraint (char, const char *); void m32c_register_pragmas (void); @@ -71,8 +70,6 @@ int m32c_preferred_reload_class (rtx, int); int m32c_prepare_move (rtx *, enum machine_mode); int m32c_prepare_shift (rtx *, int, int); -void m32c_print_operand (FILE *, rtx, int); -void m32c_print_operand_address (FILE *, rtx); int m32c_reg_ok_for_base_p (rtx, int); enum reg_class m32c_regno_reg_class (int); rtx m32c_return_addr_rtx (int);