From patchwork Fri May 15 10:37:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 1291016 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49NlHY5FYSz9sTc for ; Fri, 15 May 2020 20:38:17 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4C32F397A4B9; Fri, 15 May 2020 10:38:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 87F86397A4AE for ; Fri, 15 May 2020 10:38:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 87F86397A4AE Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Andrew_Stubbs@mentor.com IronPort-SDR: 4AlxVJXsOECcKnMHXTrt0S1AHRqo52Gk92N5m7xK7o0lv8PaeJhObM4GeNVFfdVJNbPK1YBjkR jUwSncEMoItG4QTkdEW4WOEkZIENjkbsMlwWuntakatyZMHm++viKkzzlJ7k3HJNmN639VABNY OsAIJUPuDZ616/9q81+zpJ30hKtkx1VIUjgBmexOXWW2vIgzW4KexMDv84bt4+FohCCVCZENXp E5lo5E1CXw1Fxos+B89IIrqK8NuwjSiDjeTR52feUSDKadsv8665PlT30tx8VTGZoFHtRGWq9/ 1lo= X-IronPort-AV: E=Sophos;i="5.73,394,1583222400"; d="scan'208";a="48879936" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 15 May 2020 02:37:49 -0800 IronPort-SDR: mZiTU8ZDRHFWZjoV8ak3rxIEMkIawRBpezCOGS4tIOf8Qcc+viRzEmiapsLVmNbqjuW5PvmsQV nnTS49rlK2om3UBFZ4YdKqTGgsOUrcv52cXsKbFsy6D8c5SxkLooJG53LMAU8i5vy2rKhEuBHs u+F8lmJS0EZCVFrxI7UQpeFvAehMYr9jmpzseG9JBKyg949xjLJ42cHAynz4INQkjQHPF9Wwf+ T8ZVdu7n+QVy4BIExWIfTG207goQvxqDh9kcObCyj4optOkyWL+EIsITbGr2omb4ewCrH4JRmC I04= From: Andrew Stubbs Subject: [committed] amdgcn: use unsigned extend for lshiftrt To: "gcc-patches@gcc.gnu.org" Message-ID: <341b1c9b-4932-7396-876e-be42f84d2d5b@codesourcery.com> Date: Fri, 15 May 2020 11:37:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 Content-Language: en-GB X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-16.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" This patch fixes a bug in which 8 and 16-bit vector shifts used the wrong kind of extend, thus causing wrong results. It was simply a thinko in the insn code, so easily fixed. Andrew P.S. Apologies for the "work-in-progress" tag on the commit subject. Obviously that was meant to be removed, but I didn't notice it until after the push. :-( WIP amdgcn: use unsigned extend for lshiftrt This fixes a wrong-code logic error in a previous patch. Detected by gcc.c-torture/execute/pr53645-2.c. 2020-05-15 Andrew Stubbs gcc/ * config/gcn/gcn-valu.md (v3): Fix unsignedp. diff --git a/gcc/config/gcn/gcn-valu.md b/gcc/config/gcn/gcn-valu.md index a43d6b6c6f3..d31fe5063b9 100644 --- a/gcc/config/gcn/gcn-valu.md +++ b/gcc/config/gcn/gcn-valu.md @@ -2113,7 +2113,7 @@ "" { enum {ashift, lshiftrt, ashiftrt}; - bool unsignedp = ( == ashift || == ashiftrt); + bool unsignedp = ( == lshiftrt); rtx insi1 = gen_reg_rtx (mode); rtx insi2 = gen_reg_rtx (mode); rtx outsi = gen_reg_rtx (mode);