From patchwork Thu Sep 28 18:16:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 819711 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-463128-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="e9ywV7SY"; 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 3y32vN2vCnz9tX5 for ; Fri, 29 Sep 2017 04:16:32 +1000 (AEST) 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:from:date:message-id:subject:to:content-type; q= dns; s=default; b=o/3ogEgtQVnL5azXJLz7Qm0f6vGnRGcJIL3pw/DVyYDyBj v/uM3kn5HY4+9aji8QGNtNR3FJ2w0ibSGCAWK2NCSHeLjt4rCdVB2K/qBIDWtDfI asybCm/Sf3zxB59aa5YB5yOUzrAwfSIH9P1oD6EAnC7XHJNYUcJJb863gPVlA= 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:from:date:message-id:subject:to:content-type; s= default; bh=JVVQkVLKJuxcqkigmqVvFiqVwHo=; b=e9ywV7SYnsBD6qlFq33K iR6rBZb/O0BURrbZMUIA0ZCBMNqkhe0a4L/pBAJhP+suGogx7nFulWzi/NbT6/uH B4iJPRUPAX80hGNZmgIN/lqhuv6zBYMmZzBrwntEjEGZwn2NpBXU0zYoHpzGIPK4 xO1ek7ntP0cOAZs68b+cers= Received: (qmail 25792 invoked by alias); 28 Sep 2017 18:16:23 -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 25779 invoked by uid 89); 28 Sep 2017 18:16:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-15.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-io0-f176.google.com Received: from mail-io0-f176.google.com (HELO mail-io0-f176.google.com) (209.85.223.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 28 Sep 2017 18:16:20 +0000 Received: by mail-io0-f176.google.com with SMTP id 21so2322920iof.6 for ; Thu, 28 Sep 2017 11:16:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=8stP/OLTA2INjG+wOSH924WFewJdte949sjEeHIvUcs=; b=dvQhZC0h7JvoJJFNvDav6AZvmajxKIbiCLtcxNBtcB4CVvxhmtIRh1JOwO6yurNWtQ 2BSMNpSMcO8yYmP9ahGtQu0txUBnNz2gJYut2NpaAOt2P9gYRyXHopJ8ytJ+fQs3asOk SlARBg356l3k6sNtopLVgl5Vz9Pqa9RV77IgynMOTuQ0u1roElTsRlvaFA6Cm1ujRqQ1 Z3LwkNLRjfAaus4dbk4YsjjAtBql2lPwuLXiWNyq+m56aDnOCeAyRH/b1iT7GbkKGVAF 7QTztnKf70MTSFKZtNjeAZxIVjPXPDkBPrC3a0nM6QiQ4a74dXqUcpJ/P48UfITdNkOL lPXg== X-Gm-Message-State: AMCzsaUkQTC8KMAC++dJmBhZblE8FVFnCHqcB66ynowuuoojYUMCDtiA B1Wy3M8tealEshszcQZ/hhn2qKSsDgowwFarwC+q1A== X-Google-Smtp-Source: AOwi7QDQL9WkLKFWNREx8EMT3e9xXc5TwZ8gDV3hd2zEGYw+2gsZEpGZUPFmY1GiN+9cNjj+BdO/xchxeykw0WLzVDY= X-Received: by 10.107.7.74 with SMTP id 71mr8473331ioh.131.1506622578979; Thu, 28 Sep 2017 11:16:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.137.252 with HTTP; Thu, 28 Sep 2017 11:16:18 -0700 (PDT) From: Uros Bizjak Date: Thu, 28 Sep 2017 20:16:18 +0200 Message-ID: Subject: [PATCH, i386]: Do not check index when encoding %esp as %rsp to avoid 0x67 prefix To: "gcc-patches@gcc.gnu.org" As mentioned in the PR, SP_REG can not be encoded as index. 2017-09-28 Uros Bizjak * config/i386/i386.c (ix86_print_operand_address_as): Do not check index when encoding %esp as %rsp to avoid 0x67 prefix. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Committed to mainline SVN. Uros. Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 253254) +++ config/i386/i386.c (working copy) @@ -19953,12 +19953,11 @@ ix86_print_operand_address_as (FILE *file, rtx add code = 'k'; } - /* Since the upper 32 bits of RSP are always zero for x32, we can - encode %esp as %rsp to avoid 0x67 prefix if there is no index or - base register. */ + /* Since the upper 32 bits of RSP are always zero for x32, + we can encode %esp as %rsp to avoid 0x67 prefix if + there is no index register. */ if (TARGET_X32 && Pmode == SImode - && ((!index && base && REG_P (base) && REGNO (base) == SP_REG) - || (!base && index && REGNO (index) == SP_REG))) + && !index && base && REG_P (base) && REGNO (base) == SP_REG) code = 'q'; if (ASSEMBLER_DIALECT == ASM_ATT)