From patchwork Mon Oct 18 19:42:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anatoly Sokolov X-Patchwork-Id: 68233 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 033E1B70D5 for ; Tue, 19 Oct 2010 06:41:53 +1100 (EST) Received: (qmail 18236 invoked by alias); 18 Oct 2010 19:41:51 -0000 Received: (qmail 18228 invoked by uid 22791); 18 Oct 2010 19:41:51 -0000 X-SWARE-Spam-Status: No, hits=2.2 required=5.0 tests=AWL, BAYES_20, 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; Mon, 18 Oct 2010 19:41:45 +0000 Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 42112696E; Mon, 18 Oct 2010 23:41:42 +0400 (MSD) Received: from [89.178.234.66] (account aesok@post.ru HELO Vista.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPA id 267718871; Mon, 18 Oct 2010 23:41:42 +0400 Date: Mon, 18 Oct 2010 23:42:11 +0400 From: Anatoly Sokolov Message-ID: <308596926.20101018234211@post.ru> To: gcc-patches CC: Steve Ellcey Subject: [IA64] Hookize PREFERRED_RELOAD_CLASS 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 PREFERRED_RELOAD_CLASS macro from IA64 back end in the GCC and introduces equivalent TARGET_PREFERRED_RELOAD_CLASS target hooks.  Bootstrapped and regression tested on ia64-unknown-linux-gnu. OK to install? * config/ia64/ia64.h (PREFERRED_RELOAD_CLASS): Remove macros. * config/ia64/ia64-protos.h (ia64_preferred_reload_class): Remove. * config/ia64/ia64.c (TARGET_PREFERRED_RELOAD_CLASS): Define. (ia64_preferred_reload_class): Make static. Change rclass argument and result types from enum reg_class to reg_class_t. Anatoly. Index: gcc/config/ia64/ia64.c =================================================================== --- gcc/config/ia64/ia64.c (revision 165655) +++ gcc/config/ia64/ia64.c (working copy) @@ -324,6 +324,8 @@ static void ia64_dwarf_handle_frame_unspec (const char *, rtx, int); static tree ia64_builtin_decl (unsigned, bool); + +static reg_class_t ia64_preferred_reload_class (rtx, reg_class_t); /* Table of valid machine attributes. */ static const struct attribute_spec ia64_attribute_table[] = @@ -595,6 +597,9 @@ #undef TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE #define TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE ia64_override_options_after_change +#undef TARGET_PREFERRED_RELOAD_CLASS +#define TARGET_PREFERRED_RELOAD_CLASS ia64_preferred_reload_class + struct gcc_target targetm = TARGET_INITIALIZER; typedef enum @@ -5346,11 +5351,11 @@ return 10; } -/* Implement PREFERRED_RELOAD_CLASS. Place additional restrictions on RCLASS - to use when copying X into that class. */ +/* Implement TARGET_PREFERRED_RELOAD_CLASS. Place additional restrictions + on RCLASS to use when copying X into that class. */ -enum reg_class -ia64_preferred_reload_class (rtx x, enum reg_class rclass) +static reg_class_t +ia64_preferred_reload_class (rtx x, reg_class_t rclass) { switch (rclass) { Index: gcc/config/ia64/ia64.h =================================================================== --- gcc/config/ia64/ia64.h (revision 165655) +++ gcc/config/ia64/ia64.h (working copy) @@ -849,14 +849,6 @@ This is needed for POST_MODIFY. */ #define REGNO_OK_FOR_INDEX_P(NUM) REGNO_OK_FOR_BASE_P (NUM) -/* A C expression that places additional restrictions on the register class to - use when it is necessary to copy value X into a register in class CLASS. - The value is a register class; perhaps CLASS, or perhaps another, smaller - class. */ - -#define PREFERRED_RELOAD_CLASS(X, CLASS) \ - ia64_preferred_reload_class (X, CLASS) - /* You should define this macro to indicate to the reload phase that it may need to allocate at least one register for a reload in addition to the register to contain the data. Specifically, if copying X to a register Index: gcc/config/ia64/ia64-protos.h =================================================================== --- gcc/config/ia64/ia64-protos.h (revision 165655) +++ gcc/config/ia64/ia64-protos.h (working copy) @@ -56,7 +56,6 @@ extern void ia64_print_operand_address (FILE *, rtx); extern void ia64_print_operand (FILE *, rtx, int); -extern enum reg_class ia64_preferred_reload_class (rtx, enum reg_class); extern enum reg_class ia64_secondary_reload_class (enum reg_class, enum machine_mode, rtx); extern const char *get_bundle_name (int);