From patchwork Fri Sep 29 20:59:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 820073 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-463245-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="CsspOjQO"; 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 3y3kTJ2nnPz9t4k for ; Sat, 30 Sep 2017 06:59:48 +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:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; q=dns; s=default; b=Gp8vhMbsq5EmIYb8Y3+RaKHXsUlCy UMSZDy0bMBvXfdUAIdwRIh4f3PeuszTQi4NELYwLb8MtUKzIL/UKOGpDKV3/o2Bh 5lDeXN02PEssRG05YjayCAeF1ZUPno3qI0R9pSVdstjhgc5kXvZFxUAcl1ggni5v nwFZCj2sCnXIko= 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:reply-to:mime-version :content-type; s=default; bh=2asOLkpj4kapU4mlEvXm/rHMFj4=; b=Css pOjQOXptBRKsJ3ktlFb1cFi8sVNSJU6oXcy83tpxTIi4k8FaDNv7RAIgYHfiAriY 41KpSvoPyOXOQp9ghOSpln9H+P5uTcgtDkHe9mHTSMptIAqxDlbFwNzCMBMwPnSM jj3W8lTs/45XkWcPdJd82vBbMRoZPHwPgkYbKXaY= Received: (qmail 111495 invoked by alias); 29 Sep 2017 20:59:38 -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 111486 invoked by uid 89); 29 Sep 2017 20:59:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 29 Sep 2017 20:59:37 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EDA1780B22; Fri, 29 Sep 2017 20:59:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EDA1780B22 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jakub@redhat.com Received: from tucnak.zalov.cz (ovpn-116-41.ams2.redhat.com [10.36.116.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9137617A76; Fri, 29 Sep 2017 20:59:35 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id v8TKxXQ3028319; Fri, 29 Sep 2017 22:59:33 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id v8TKxWua028318; Fri, 29 Sep 2017 22:59:32 +0200 Date: Fri, 29 Sep 2017 22:59:32 +0200 From: Jakub Jelinek To: Uros Bizjak Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix REG_EQUAL note in x86 -m8bit-idiv code Message-ID: <20170929205932.GO1701@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes Hi! While working on the following patch, I've discovered that the REG_EQUAL notes for DImode signed/unsigned division/modulo are wrong, there is e.g. (div:SI (reg:DI ...) (reg:DI ...)). Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2017-09-29 Jakub Jelinek * config/i386/i386.c (ix86_split_idivmod): Use mode instead of always SImode for DIV and MOD in REG_EQUAL notes. Jakub --- gcc/config/i386/i386.c.jj 2017-09-28 20:35:14.000000000 +0200 +++ gcc/config/i386/i386.c 2017-09-29 19:15:27.822267844 +0200 @@ -21980,13 +21980,13 @@ ix86_split_idivmod (machine_mode mode, r if (signed_p) { - div = gen_rtx_DIV (SImode, operands[2], operands[3]); - mod = gen_rtx_MOD (SImode, operands[2], operands[3]); + div = gen_rtx_DIV (mode, operands[2], operands[3]); + mod = gen_rtx_MOD (mode, operands[2], operands[3]); } else { - div = gen_rtx_UDIV (SImode, operands[2], operands[3]); - mod = gen_rtx_UMOD (SImode, operands[2], operands[3]); + div = gen_rtx_UDIV (mode, operands[2], operands[3]); + mod = gen_rtx_UMOD (mode, operands[2], operands[3]); } /* Extract remainder from AH. */