From patchwork Wed Jan 23 19:08:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 215025 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 5ABA52C008C for ; Thu, 24 Jan 2013 06:08:19 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1359572901; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Date:Message-ID:Subject:From:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=WVuiW/B dvAoWQIJe4DSVqbSxgJs=; b=TpFJhM5J8xKx5t6FaSU6DT9KPdBhWUXrLh8VXgD acM9iwDp8M7Z4NEnkR6/sMbLHdGjzgZ5fXCkMm0bcXZ4qO8EF8cTkAD4hA71nXx4 /k0yubqsV+mcH1SAXTELWH85ass1fBZtk1UTQOWXgKycZ4WNTNUWpthpb7l3NeCq E6lo= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:X-Received:Received:Date:Message-ID:Subject:From:To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=JMuw6HrEVUnaKT0QAUH2QGf8QOswnAdX2kcc0VpjfFZ8P7T8zvlCKazNbHrDa0 x+JiK8iwbF0iaAouKxdcDfudc69uJ4qnikh+0qTXM6pHSHSjhDwEftVbwmReKZDM 6flmCEm6vFr0EeTk9WvNSRn+TR290FoVjjQleuaZQEum8=; Received: (qmail 17917 invoked by alias); 23 Jan 2013 19:08:12 -0000 Received: (qmail 17903 invoked by uid 22791); 23 Jan 2013 19:08:11 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_VS, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-oa0-f47.google.com (HELO mail-oa0-f47.google.com) (209.85.219.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Jan 2013 19:08:06 +0000 Received: by mail-oa0-f47.google.com with SMTP id h1so8753415oag.20 for ; Wed, 23 Jan 2013 11:08:05 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.60.29.226 with SMTP id n2mr1806393oeh.132.1358968085634; Wed, 23 Jan 2013 11:08:05 -0800 (PST) Received: by 10.182.49.68 with HTTP; Wed, 23 Jan 2013 11:08:05 -0800 (PST) Date: Wed, 23 Jan 2013 20:08:05 +0100 Message-ID: Subject: [PATCH, i386]: Slightly disparage DFmode moves involving stack registers on x86_64 From: Uros Bizjak To: gcc-patches@gcc.gnu.org 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! All things equal, we would like to avoid x87 registers to move DFmode immediates to a memory. Following testcase: --cut here-- volatile double y; void test () { int z; for (z = 0; z < 1000; z++) { y = 1.33; } } -- cut here-- compiled with -O3 to: movl $1000, %eax .L3: fldl .LC0(%rip) subl $1, %eax fstpl y(%rip) jne .L3 rep; ret With attached patch, it compiles to: movsd .LC0(%rip), %xmm0 movl $1000, %eax .L3: subl $1, %eax movsd %xmm0, y(%rip) jne .L3 rep; ret 2013-01-23 Uros Bizjak * config/i386/i386.md (*movdf_internal_rex64): Disparage alternatives involving stack registers slightly. Tested on x86_64-pc-linux-gnu, committed to mainline, will ba commited also to 4.7 branch. Uros. Index: i386.md =================================================================== --- i386.md (revision 195407) +++ i386.md (working copy) @@ -2934,9 +2934,9 @@ (define_insn "*movdf_internal_rex64" [(set (match_operand:DF 0 "nonimmediate_operand" - "=f,m,f,?r,?m,?r,x,x,x,m,Yi,r ") + "=?f,?m,?f,?r,?m,?r,x,x,x,m,Yi,r ") (match_operand:DF 1 "general_operand" - "fm,f,G,rm,r ,F ,C,x,m,x,r ,Yi"))] + "fm ,f ,G ,rm,r ,F ,C,x,m,x,r ,Yi"))] "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1])) && (!can_create_pseudo_p () || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)