From patchwork Sun Nov 25 12:22:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 1002793 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-490834-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="V+nQlLhh"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rs4jPcp+"; dkim-atps=neutral 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 432q1Y2RbLz9s1c for ; Sun, 25 Nov 2018 23:22:23 +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:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=x/McRZz+IwClTSwIk/5YyxHVijlBR2LmuE5KM+8mP+UQKrfe2q bSQTtV7jDDbKHT4dr3BngiDBQlGis7i6+BSBZJUz4itoEox99Qww7XnCDOf1JuV3 I6rSZ/F+HpZjM6rm1/bd6YCC6OWZb5D1Kqoy+ksogh8fBdsSrxBh7g6S0= 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:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=umhCSuVmLrsjyKf2iSAV7JsID7k=; b=V+nQlLhhC1VgB0LEoRIg nCvli5wTqYPpLYt33cpgCSQaHKAI13l+QBOpG6KVcICmveI3LCwnQYM4btkEtLIt v3MIljwct6Xqi2RcCFImzZueKuhF03pMQM+vtC6PuPU8+ngd7Yd5k9V4htQVPwL5 TW+zxg8CWP5setLG4Fy3lRY= Received: (qmail 73743 invoked by alias); 25 Nov 2018 12:22:16 -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 73728 invoked by uid 89); 25 Nov 2018 12:22:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=64, 53, Hx-languages-length:1714, HX-HELO:sk:mail-pl X-HELO: mail-pl1-f177.google.com Received: from mail-pl1-f177.google.com (HELO mail-pl1-f177.google.com) (209.85.214.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 25 Nov 2018 12:22:14 +0000 Received: by mail-pl1-f177.google.com with SMTP id b5so12550359plr.4 for ; Sun, 25 Nov 2018 04:22:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=QuRUguw2RMs5Tb4n0ZlWdEl+XnJY/zuFUmx8I0ZY1/w=; b=rs4jPcp+V2PPHcbjYjY7Juw0wPua5/KiG0M9ZwO22YwyHPBxmbU5Clsar/N1gbiAri S8JFDV7i8BQ1WJ6WgZCa5bvWxrZ3rH/erslsRgh1/N4p49YU03RtIM09poRK5hnTGsJN skdIlLM4PN+G/nmAqKJrCWlUq8iu/hl0ZUx4lBYXJPPj0gKzeOFU0Ef5H90UT9gogUKA Q4lKDokpn879u9luhMvRfEt0eQ5aC/Az4+kyomc/unfgjel7qYS0u/b65uRYykJqknUC RlERXuAG5JI+H/twT25I8v5MQDeqHKMLyuWFwI0fYfgdfF5bi/JD8arNv5VtbKebgLtv vWXA== Received: from bubble.grove.modra.org ([58.175.241.133]) by smtp.gmail.com with ESMTPSA id t4-v6sm62174064pfh.21.2018.11.25.04.22.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 25 Nov 2018 04:22:11 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id A2B958077C; Sun, 25 Nov 2018 22:52:08 +1030 (ACDT) Date: Sun, 25 Nov 2018 22:52:08 +1030 From: Alan Modra To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool Subject: [RS6000] PR11848 rs6000_emit_move long double split Message-ID: <20181125122208.GQ21617@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-IsSubscribed: yes This split is disabled for power7 and up, so we don't often see its bad effects. However, on a powerpc-linux compiler (which defaults to PPC750 judging from rs6000/sysv4.h) we see long double ld1 (void) { return 1.0L; } compiled with -msoft-float -O2 -S resulting in ld1: li 3,0 li 4,0 mr 6,4 mr 5,3 li 4,0 lis 3,0x3ff0 blr Things go awry in init-regs, with the TFmode reg being initialized to zero on seeing the subreg from the split. (And that initialization itself is split by rs6000_emit_move!) Later passes apparently don't clean up the rubbish. Since the split was added for Darwin (as the comment says), let's get rid of it on other targets. Bootstrapped etc. powerpc64le-linux and powerpc64-linux. * config/rs6000/rs6000.c (rs6000_emit_move): Disable long double split for targets other than Darwin. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 212e9facb3a..c339368be29 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -10010,8 +10010,8 @@ rs6000_emit_move (rtx dest, rtx source, machine_mode mode) /* 128-bit constant floating-point values on Darwin should really be loaded as two parts. However, this premature splitting is a problem when DFmode values can go into Altivec registers. */ - if (FLOAT128_IBM_P (mode) && !reg_addr[DFmode].scalar_in_vmx_p - && GET_CODE (operands[1]) == CONST_DOUBLE) + if (TARGET_MACHO && CONST_DOUBLE_P (operands[1]) && FLOAT128_IBM_P (mode) + && !reg_addr[DFmode].scalar_in_vmx_p) { rs6000_emit_move (simplify_gen_subreg (DFmode, operands[0], mode, 0), simplify_gen_subreg (DFmode, operands[1], mode, 0),