Message ID | 20211223222133.451967-1-hjl.tools@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DC6D13858429 for <patchwork@sourceware.org>; Thu, 23 Dec 2021 22:22:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC6D13858429 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1640298124; bh=ske0iHLO4AhM4CZO2cWGZhkT50rgm8llofYfsB3NF10=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=hUmSORjzPjNouNfYuNypTrslnwc1d90236YasFOM+2mFpOuJ5NCYaviB8Nl+6ddij 9PawZXxTAb3SnxRIgzD+xLgiOxiYcElzKVcb+ze0m/ACvt2dkkmb3TD6Isw5j51L0I mbJ7zadhbGCEYTPo1ykWSEMK2aqJauajXKpeMHQM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id ADCE43858402 for <gcc-patches@gcc.gnu.org>; Thu, 23 Dec 2021 22:21:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ADCE43858402 Received: by mail-pj1-x102d.google.com with SMTP id jw3so6071632pjb.4 for <gcc-patches@gcc.gnu.org>; Thu, 23 Dec 2021 14:21:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=ske0iHLO4AhM4CZO2cWGZhkT50rgm8llofYfsB3NF10=; b=zOgceDUgSpvldrsSTKpcFcSn8JxNvuCkxYmjlaRBHVC5kwJTmkKV61TWNEV+mpt2a9 68PfpXJdZF9BdV4hprWDySZJS0opMXhO+O7D3HrYieNhX4NSM2jlpD7t/OigeP/8pMJ1 KX7WScWOx9ts+IjCjDALtzqZ0Jx5z9eDgnb54ViGjkblCdt9RSTGGWiHMWeA8ft3ELzX r9jF5yttLu6VBaT+NEYR+vbXdYUxz5T/0eKyKK1dTroAorVpXjVkgReY/J0MeagCPxBi wq4vbE4AGz9A3XwO2F/TRZevA8+TCcy/YGueBjN0w6bUIElNWwnex5lEaMgU2I5khagT AKjw== X-Gm-Message-State: AOAM531y00xXthgotmw94AKNORwClFTFVvHn3zidXt7Q1Qw0n0rhK9id VSu1qhve6HcI0dPSHN9n097/NgDQ1ss= X-Google-Smtp-Source: ABdhPJwHLSOygZxclhUmqSwA+fhMB+776Snrqf3l38oESwfYxBL7gA7JY6QKkrizPnGcJ5wDVmLmyQ== X-Received: by 2002:a17:903:408d:b0:149:28e9:9cb with SMTP id z13-20020a170903408d00b0014928e909cbmr4233655plc.5.1640298095316; Thu, 23 Dec 2021 14:21:35 -0800 (PST) Received: from gnu-tgl-3.localdomain ([172.58.35.133]) by smtp.gmail.com with ESMTPSA id m3sm9224792pjz.10.2021.12.23.14.21.34 for <gcc-patches@gcc.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Dec 2021 14:21:34 -0800 (PST) Received: from gnu-tgl-3.. (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id 2A12BC00C1 for <gcc-patches@gcc.gnu.org>; Thu, 23 Dec 2021 14:21:33 -0800 (PST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] i386: Require TARGET_64BIT for any_mul_highpart peephole Date: Thu, 23 Dec 2021 14:21:33 -0800 Message-Id: <20211223222133.451967-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3029.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: "H.J. Lu via Gcc-patches" <gcc-patches@gcc.gnu.org> Reply-To: "H.J. Lu" <hjl.tools@gmail.com> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
i386: Require TARGET_64BIT for any_mul_highpart peephole
|
|
Commit Message
H.J. Lu
Dec. 23, 2021, 10:21 p.m. UTC
Restore i686 bootstrap by requiring TARGET_64BIT for any_mul_highpart peephole. PR bootstrap/103785 * config/i386/i386.md: Require TARGET_64BIT for any_mul_highpart peephole. --- gcc/config/i386/i386.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On Thu, Dec 23, 2021 at 11:21 PM H.J. Lu via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > Restore i686 bootstrap by requiring TARGET_64BIT for any_mul_highpart > peephole. > > PR bootstrap/103785 > * config/i386/i386.md: Require TARGET_64BIT for any_mul_highpart > peephole. I don't think this is correct. The patch uses SWI48, where DImode is enabled only for TARGET_64BIT. The patch disables SImode peephole only for 32bit targets, so if there is something wrong with the peephole, it still remains buggy for 64bit targets. Either we remove problematic peepholes to restore bootstrap or get a testcase and analyze the problem to figure out the correct fix. Uros. > --- > gcc/config/i386/i386.md | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md > index 284b9507466..9d6786c5c2e 100644 > --- a/gcc/config/i386/i386.md > +++ b/gcc/config/i386/i386.md > @@ -8588,7 +8588,8 @@ > (any_mul_highpart:SWI48 (match_dup 2) (match_dup 0))) > (clobber (match_dup 2)) > (clobber (reg:CC FLAGS_REG))])] > - "REGNO (operands[0]) != REGNO (operands[2]) > + "TARGET_64BIT > + && REGNO (operands[0]) != REGNO (operands[2]) > && REGNO (operands[0]) != REGNO (operands[3]) > && (REGNO (operands[0]) == REGNO (operands[4]) > || peep2_reg_dead_p (3, operands[0]))" > -- > 2.33.1 >
On Fri, Dec 24, 2021 at 12:17 AM Uros Bizjak <ubizjak@gmail.com> wrote: > > On Thu, Dec 23, 2021 at 11:21 PM H.J. Lu via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: > > > > Restore i686 bootstrap by requiring TARGET_64BIT for any_mul_highpart > > peephole. > > > > PR bootstrap/103785 > > * config/i386/i386.md: Require TARGET_64BIT for any_mul_highpart > > peephole. > > I don't think this is correct. The patch uses SWI48, where DImode is > enabled only for TARGET_64BIT. The patch disables SImode peephole only > for 32bit targets, so if there is something wrong with the peephole, > it still remains buggy for 64bit targets. Either we remove problematic > peepholes to restore bootstrap or get a testcase and analyze the > problem to figure out the correct fix. > I couldn't create a small testcase in C. The problem is in (set (reg:SI 1 dx [92]) (const_int 714200473 [0x2a91d599])) (set (reg:SI 0 ax [105]) (reg:SI 0 ax [orig:89 k ] [89])) (parallel [ (set (reg:SI 1 dx [91]) (smul_highpart:SI (reg:SI 0 ax [105]) (reg:SI 1 dx [92]))) (clobber (reg:SI 0 ax [105])) (clobber (reg:CC 17 flags)) ]) The v2 patch is posted at https://gcc.gnu.org/pipermail/gcc-patches/2021-December/587356.html
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 284b9507466..9d6786c5c2e 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -8588,7 +8588,8 @@ (any_mul_highpart:SWI48 (match_dup 2) (match_dup 0))) (clobber (match_dup 2)) (clobber (reg:CC FLAGS_REG))])] - "REGNO (operands[0]) != REGNO (operands[2]) + "TARGET_64BIT + && REGNO (operands[0]) != REGNO (operands[2]) && REGNO (operands[0]) != REGNO (operands[3]) && (REGNO (operands[0]) == REGNO (operands[4]) || peep2_reg_dead_p (3, operands[0]))"