From patchwork Thu Dec 22 13:52:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tristan Gingold X-Patchwork-Id: 132849 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 A7D1EB7171 for ; Fri, 23 Dec 2011 00:52:53 +1100 (EST) Received: (qmail 31172 invoked by alias); 22 Dec 2011 13:52:49 -0000 Received: (qmail 31149 invoked by uid 22791); 22 Dec 2011 13:52:47 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Dec 2011 13:52:29 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 74A16CB1EE9; Thu, 22 Dec 2011 14:52:29 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QRT4GASWl4rg; Thu, 22 Dec 2011 14:52:29 +0100 (CET) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 46283CB1EDF; Thu, 22 Dec 2011 14:52:29 +0100 (CET) Subject: Re: [Patch]: ia64 - remove ia64_promote_function_mode Mime-Version: 1.0 (Apple Message framework v1251.1) From: Tristan Gingold In-Reply-To: <4EF20508.8010808@redhat.com> Date: Thu, 22 Dec 2011 14:52:27 +0100 Cc: GCC Patches , Steve Ellcey Message-Id: References: <25452971-2C54-42B7-96BF-F11BBBBF3898@adacore.com> <4EF20508.8010808@redhat.com> To: Richard Henderson 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 On Dec 21, 2011, at 5:10 PM, Richard Henderson wrote: > On 12/21/2011 02:29 AM, Tristan Gingold wrote: >> #undef TARGET_PROMOTE_FUNCTION_MODE >> -#define TARGET_PROMOTE_FUNCTION_MODE ia64_promote_function_mode >> +#define TARGET_PROMOTE_FUNCTION_MODE default_promote_function_mode > > Delete this entirely. Sure. I have also merged both patches. Ok for trunk ? Tested by building for ia64-hp-openvms. Tristan. 2011-12-22 Tristan Gingold * config/ia64/ia64.c (ia64_promote_function_mode): Remove. (TARGET_PROMOTE_FUNCTION_MODE): Remove. (ia64_function_value): Call promote_function_mode instead of ia64_promote_function_mode. * config/ia64/vms.h (PROMOTE_MODE): Define. (TARGET_PROMOTE_FUNCTION_MODE): Define. diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 1635a7e..d74eeb6 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -316,11 +316,6 @@ static const char *ia64_invalid_conversion (const_tree, const_tree); static const char *ia64_invalid_unary_op (int, const_tree); static const char *ia64_invalid_binary_op (int, const_tree, const_tree); static enum machine_mode ia64_c_mode_for_suffix (char); -static enum machine_mode ia64_promote_function_mode (const_tree, - enum machine_mode, - int *, - const_tree, - int); static void ia64_trampoline_init (rtx, tree, rtx); static void ia64_override_options_after_change (void); @@ -546,9 +541,6 @@ static const struct attribute_spec ia64_attribute_table[] = #define TARGET_ASM_OUTPUT_DWARF_DTPREL ia64_output_dwarf_dtprel #endif -#undef TARGET_PROMOTE_FUNCTION_MODE -#define TARGET_PROMOTE_FUNCTION_MODE ia64_promote_function_mode - /* ??? Investigate. */ #if 0 #undef TARGET_PROMOTE_PROTOTYPES @@ -5013,9 +5005,9 @@ ia64_function_value (const_tree valtype, return gen_rtx_PARALLEL (mode, gen_rtvec_v (i, loc)); } - mode = ia64_promote_function_mode (valtype, mode, &unsignedp, - func ? TREE_TYPE (func) : NULL_TREE, - true); + mode = promote_function_mode (valtype, mode, &unsignedp, + func ? TREE_TYPE (func) : NULL_TREE, + true); return gen_rtx_REG (mode, GR_RET_FIRST); } @@ -10984,43 +10976,6 @@ ia64_c_mode_for_suffix (char suffix) return VOIDmode; } -static enum machine_mode -ia64_promote_function_mode (const_tree type, - enum machine_mode mode, - int *punsignedp, - const_tree funtype, - int for_return) -{ - /* Special processing required for OpenVMS ... */ - - if (!TARGET_ABI_OPEN_VMS) - return default_promote_function_mode(type, mode, punsignedp, funtype, - for_return); - - /* HP OpenVMS Calling Standard dated June, 2004, that describes - HP OpenVMS I64 Version 8.2EFT, - chapter 4 "OpenVMS I64 Conventions" - section 4.7 "Procedure Linkage" - subsection 4.7.5.2, "Normal Register Parameters" - - "Unsigned integral (except unsigned 32-bit), set, and VAX floating-point - values passed in registers are zero-filled; signed integral values as - well as unsigned 32-bit integral values are sign-extended to 64 bits. - For all other types passed in the general registers, unused bits are - undefined." */ - - if (for_return != 2 - && GET_MODE_CLASS (mode) == MODE_INT - && GET_MODE_SIZE (mode) < UNITS_PER_WORD) - { - if (mode == SImode) - *punsignedp = 0; - return DImode; - } - else - return promote_mode (type, mode, punsignedp); -} - static GTY(()) rtx ia64_dconst_0_5_rtx; rtx diff --git a/gcc/config/ia64/vms.h b/gcc/config/ia64/vms.h index 75ea4ad..f34ee78 100644 --- a/gcc/config/ia64/vms.h +++ b/gcc/config/ia64/vms.h @@ -135,3 +135,25 @@ STATIC func_ptr __CTOR_LIST__[1] \ #undef TARGET_ASM_NAMED_SECTION #define TARGET_ASM_NAMED_SECTION ia64_vms_elf_asm_named_section + +/* Define this macro if it is advisable to hold scalars in registers + in a wider mode than that declared by the program. In such cases, + the value is constrained to be within the bounds of the declared + type, but kept valid in the wider mode. The signedness of the + extension may differ from that of the type. + + For ia64, we always store objects in a full register. 32-bit integers + are always sign-extended, but smaller objects retain their signedness. */ + +#undef PROMOTE_MODE +#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \ + if (GET_MODE_CLASS (MODE) == MODE_INT \ + && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \ + { \ + if ((MODE) == SImode) \ + (UNSIGNEDP) = 0; \ + (MODE) = DImode; \ + } + +#undef TARGET_PROMOTE_FUNCTION_MODE +#define TARGET_PROMOTE_FUNCTION_MODE default_promote_function_mode_always_promote