From patchwork Sun Nov 17 21:12:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Weigand X-Patchwork-Id: 291881 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1FD7F2C0086 for ; Mon, 18 Nov 2013 08:14:40 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:to:date:from:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=er8DYBmgbT8Aeg+l J7EYRih97kEbLnokIuzGbSa9kRd/8k6Lc4TsxGBbzTpWPAAJzd2HeMiTyRYN7P9x ejXJme8horWngZ6iXjzGC67zi6x4ptgbgD8S7gIqlBzHNEubLTNiK+9AHfSmLvbI EEjzDsMEVtGKDKK1qTsGpV3zKvc= 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 :message-id:subject:to:date:from:mime-version:content-type :content-transfer-encoding; s=default; bh=uRfkcEaX7aJdDClv22Xpjj DYu3Q=; b=n3bHAsIxRhzwcGmU/nlC+Fr6Jw1my+hkibiwAV2mOkTn6lQIDybeSH +niPkZq95P7LF2HEhIRZeza/omnXwyNd2ozj/VE2tf8x5QsoXRDmCbBayZmVynQF Ore1TM0FExx+dL/+BhDmJ3fddJnC2PD92wRLLc6TxsNYTmJbSfwHY= Received: (qmail 26511 invoked by alias); 17 Nov 2013 21:14:29 -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 26501 invoked by uid 89); 17 Nov 2013 21:14:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.0 required=5.0 tests=AWL, BAYES_50, MSGID_FROM_MTA_HEADER, RDNS_NONE, SPF_PASS autolearn=no version=3.3.2 X-HELO: e06smtp11.uk.ibm.com Received: from Unknown (HELO e06smtp11.uk.ibm.com) (195.75.94.107) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sun, 17 Nov 2013 21:14:28 +0000 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 17 Nov 2013 21:14:18 -0000 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 17 Nov 2013 21:14:16 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id C51C817D8057 for ; Sun, 17 Nov 2013 21:13:58 +0000 (GMT) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rAHLCmM060555506 for ; Sun, 17 Nov 2013 21:12:48 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rAHLD0JU003777 for ; Sun, 17 Nov 2013 14:13:00 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id rAHLCxOp003742; Sun, 17 Nov 2013 14:12:59 -0700 Message-Id: <201311172112.rAHLCxOp003742@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Sun, 17 Nov 2013 22:12:58 +0100 Subject: [PATCH, rs6000] Fix little-endian access to sdmode_stack_slot To: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com Date: Sun, 17 Nov 2013 22:12:58 +0100 (CET) From: "Ulrich Weigand" MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13111721-5024-0000-0000-000007D94D6E Hello, when accessing the sdmode_stack_slot, code in rs6000_emit_move would unconditionally use rtx mem = adjust_address_nv (operands[0], mode, 4); This is wrong in little-endian mode; we always need to access the low word there too. Fixed by the patch below, which fixes a large number of DFP test suite failures in little-endian. Tested on powerpc64-linux and powerpc64le-linux. OK for mainline? Bye, Ulrich ChangeLog: * config/rs6000/rs6000.c (rs6000_emit_move): Use low word of sdmode_stack_slot also in little-endian mode. Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 204919) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -8188,7 +8188,9 @@ } else if (INT_REGNO_P (REGNO (operands[1]))) { - rtx mem = adjust_address_nv (operands[0], mode, 4); + rtx mem = operands[0]; + if (BYTES_BIG_ENDIAN) + mem = adjust_address_nv (mem, mode, 4); mem = eliminate_regs (mem, VOIDmode, NULL_RTX); emit_insn (gen_movsd_hardfloat (mem, operands[1])); } @@ -8211,7 +8213,9 @@ } else if (INT_REGNO_P (REGNO (operands[0]))) { - rtx mem = adjust_address_nv (operands[1], mode, 4); + rtx mem = operands[1]; + if (BYTES_BIG_ENDIAN) + mem = adjust_address_nv (mem, mode, 4); mem = eliminate_regs (mem, VOIDmode, NULL_RTX); emit_insn (gen_movsd_hardfloat (operands[0], mem)); }