From patchwork Thu Mar 21 09:35:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 229608 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 7EDA62C00B9 for ; Thu, 21 Mar 2013 20:36:43 +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 :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=wmLhTReWCe+CvdtudpROKE4nh8HXt+rKzELY4OBF+FSrS9 +n3j7ME72i2KdPZKY8SwUBtMmaU2bm8Yg3QeYbUeTgJ5GubVbblVVQ0lRf97ecrK ZpV784d4quKY62zURqM1Om17d4v01Zu6Z/3o0QyzN4TOA8G4SL3lQ+itkkUlc= 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 :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=b9qVusxjFk08n1GbKXcckUSthnk=; b=SG+x9J2SScMPi1ANCUEV YZTzeMOjwdRyz/AzBpI5tJZflD7wjVJujAS+VnM6SZHZayFMXxd2d+l9AfUi3bny UZosm1/3EQLZ+yzbFAR8Tb+CnoxBxU2eIW6UZ5zFP1B44INFyNgVGa49yvN2Rrcy j+GDGKqKhFIhNSx+TzEazEw= Received: (qmail 11159 invoked by alias); 21 Mar 2013 09:36:37 -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 11125 invoked by uid 89); 21 Mar 2013 09:36:27 -0000 X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_OV, TW_PX, TW_ZJ autolearn=ham version=3.3.1 Received: from mail-ob0-f180.google.com (HELO mail-ob0-f180.google.com) (209.85.214.180) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 21 Mar 2013 09:35:56 +0000 Received: by mail-ob0-f180.google.com with SMTP id wo10so344552obc.11 for ; Thu, 21 Mar 2013 02:35:55 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.108.104 with SMTP id hj8mr6384450obb.44.1363858555072; Thu, 21 Mar 2013 02:35:55 -0700 (PDT) Received: by 10.182.49.68 with HTTP; Thu, 21 Mar 2013 02:35:54 -0700 (PDT) Date: Thu, 21 Mar 2013 10:35:54 +0100 Message-ID: Subject: [PATCH, i386]: Fix PR56656, Suffix or operands invalid for 'movq' From: Uros Bizjak To: gcc-patches@gcc.gnu.org Hello! Attached patch detects assemblers that expects movd instead of movq for interunit moves and adds fixup code only in case of broken assembler. 2013-03-21 Uros Bizjak PR bootstrap/56656 * configure.ac (HAVE_AS_IX86_INTERUNIT_MOVQ): New test. * configure: Regenerate. * config.in: Regenerate. * config/i386/i386.md (*movdf_internal): Use HAVE_AS_IX86_INTERUNIT_MOVQ to handle broken assemblers that require movd instead of movq mnemonic for interunit moves. (*movdi_internal): Ditto. Tested on x86_64-pc-linux-gnu, committed to mainline SVN. Uros. Index: config/i386/i386.md =================================================================== --- config/i386/i386.md (revision 196841) +++ config/i386/i386.md (working copy) @@ -1878,9 +1878,11 @@ return "pxor\t%0, %0"; case TYPE_MMXMOV: +#ifndef HAVE_AS_IX86_INTERUNIT_MOVQ /* Handle broken assemblers that require movd instead of movq. */ if (GENERAL_REG_P (operands[0]) || GENERAL_REG_P (operands[1])) return "movd\t{%1, %0|%0, %1}"; +#endif return "movq\t{%1, %0|%0, %1}"; case TYPE_SSELOG1: @@ -1890,9 +1892,11 @@ switch (get_attr_mode (insn)) { case MODE_DI: +#ifndef HAVE_AS_IX86_INTERUNIT_MOVQ /* Handle broken assemblers that require movd instead of movq. */ if (GENERAL_REG_P (operands[0]) || GENERAL_REG_P (operands[1])) return "%vmovd\t{%1, %0|%0, %1}"; +#endif return "%vmovq\t{%1, %0|%0, %1}"; case MODE_TI: return "%vmovdqa\t{%1, %0|%0, %1}"; @@ -2797,9 +2801,11 @@ return "movlpd\t{%1, %0|%0, %1}"; case MODE_DI: +#ifndef HAVE_AS_IX86_INTERUNIT_MOVQ /* Handle broken assemblers that require movd instead of movq. */ if (GENERAL_REG_P (operands[0]) || GENERAL_REG_P (operands[1])) return "%vmovd\t{%1, %0|%0, %1}"; +#endif return "%vmovq\t{%1, %0|%0, %1}"; default: Index: configure.ac =================================================================== --- configure.ac (revision 196841) +++ configure.ac (working copy) @@ -3723,6 +3723,14 @@ [AC_DEFINE(HAVE_AS_IX86_SAHF, 1, [Define if your assembler supports the sahf mnemonic in 64bit mode.])]) + gcc_GAS_CHECK_FEATURE([interunit movq mnemonic], + gcc_cv_as_ix86_interunit_movq,,, + [.code64 + movq %mm0, %rax + movq %rax, %xmm0],, + [AC_DEFINE(HAVE_AS_IX86_INTERUNIT_MOVQ, 1, + [Define if your assembler supports interunit movq mnemonic.])]) + gcc_GAS_CHECK_FEATURE([hle prefixes], gcc_cv_as_ix86_hle,,, [lock xacquire cmpxchg %esi, (%ecx)],,