From patchwork Fri Jan 9 15:26:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 427138 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A372B1401B5 for ; Sat, 10 Jan 2015 02:27:16 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=nPf8OZ6qszZu g683PRx+b8M/PUvNfynbFuEwn5be4uen3tCYyxYnfqwW6d2F+prKlosxK8LCwBUd kOj1RxanKs4eZzQa46KZfFf7T4wHWFag3ZgNuXrIbkvP+2q+MijsHQskYxf7Cf8x cmnA2EIuvnfUZqSMRsVLaHgXr8HLGn0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; s=default; bh=gqWHA9IOsGiDlQ13X9 tHAuqW5nA=; b=V6Cu/s/smidHsJQvUemwTQh8WAom9AAewsiyMvBrNgZZw7F77X Oib1PiEZk7dH7Aj4CqNHiU4J0l6kf5aIR9G6LXZbBxQuy8CEB1Wsa84echFyZ3IZ eShCNefs9qNjkNdRrQFBbo9etR2wEkOY0xGD+y8sMPypvztW2Qei+whds= Received: (qmail 15122 invoked by alias); 9 Jan 2015 15:27:02 -0000 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 Received: (qmail 15025 invoked by uid 89); 9 Jan 2015 15:27:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: gcc1-power7.osuosl.org Received: from gcc1-power7.osuosl.org (HELO gcc1-power7.osuosl.org) (140.211.15.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 09 Jan 2015 15:26:59 +0000 Received: from gcc1-power7.osuosl.org (localhost [127.0.0.1]) by gcc1-power7.osuosl.org (8.14.6/8.14.6) with ESMTP id t09FQvNq053843; Fri, 9 Jan 2015 07:26:57 -0800 Received: (from segher@localhost) by gcc1-power7.osuosl.org (8.14.6/8.14.6/Submit) id t09FQpWG024867; Fri, 9 Jan 2015 07:26:51 -0800 From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com, Segher Boessenkool Subject: [PATCH] rs6000: Introducing rs6000_abi_word_mode Date: Fri, 9 Jan 2015 07:26:49 -0800 Message-Id: <0a1541b82e8d3ff150976862824db4eabba4e9c5.1420816654.git.segher@kernel.crashing.org> X-IsSubscribed: yes Some hooks return word_mode by default, which is incorrect for -m32 -mpowerpc64. This patch creates a new function rs6000_abi_word_mode to implement these hooks, and does so. This fixes 163 testuite FAILs. Tested as usual; okay for mainline? 2015-01-09 Segher Boessenkool gcc/ * config/rs6000/rs6000.c (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE, TARGET_UNWIND_WORD_MODE): Implement as ... (rs6000_abi_word_mode): New function. --- gcc/config/rs6000/rs6000.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index cc7b2a4..958a8b9 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1663,6 +1663,13 @@ static const struct attribute_spec rs6000_attribute_table[] = #undef TARGET_ATOMIC_ASSIGN_EXPAND_FENV #define TARGET_ATOMIC_ASSIGN_EXPAND_FENV rs6000_atomic_assign_expand_fenv + +#undef TARGET_LIBGCC_CMP_RETURN_MODE +#define TARGET_LIBGCC_CMP_RETURN_MODE rs6000_abi_word_mode +#undef TARGET_LIBGCC_SHIFT_COUNT_MODE +#define TARGET_LIBGCC_SHIFT_COUNT_MODE rs6000_abi_word_mode +#undef TARGET_UNWIND_WORD_MODE +#define TARGET_UNWIND_WORD_MODE rs6000_abi_word_mode /* Processor table. */ @@ -9293,8 +9300,18 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, } } +/* The mode the ABI uses for a word. This is not the same as word_mode + for -m32 -mpowerpc64. This is used to implement various target hooks. */ + +static enum machine_mode +rs6000_abi_word_mode (void) +{ + return TARGET_32BIT ? SImode : DImode; +} + /* On rs6000, function arguments are promoted, as are function return values. */ + static machine_mode rs6000_promote_function_mode (const_tree, machine_mode mode, int *, const_tree, int)