From patchwork Sun Jun 18 09:05:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Sayle X-Patchwork-Id: 1796224 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nextmovesoftware.com header.i=@nextmovesoftware.com header.a=rsa-sha256 header.s=default header.b=ERIFtNuh; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QkRpM53J9z20Wg for ; Sun, 18 Jun 2023 19:06:17 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7927F385842E for ; Sun, 18 Jun 2023 09:06:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from server.nextmovesoftware.com (server.nextmovesoftware.com [162.254.253.69]) by sourceware.org (Postfix) with ESMTPS id 8A5A63858410 for ; Sun, 18 Jun 2023 09:05:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A5A63858410 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=nextmovesoftware.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nextmovesoftware.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nextmovesoftware.com; s=default; h=Content-Type:MIME-Version:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=5jBxxoSaA5nxktwtI8kNz9ZKIlvy9DjgCKKMRN/dA1k=; b=ERIFtNuh3DyYuKLzyyyExR7qPH t8CirmbCHr0hFXSNrbM5VASZpL7g83y9TsCD/Fz+cvCDd6liYAhRxqIHAvPii7bu2TkynQ1UMRXFZ RCsENL0+Bp/keTFREsW/051coJK2OzfAXshs8c146LIr/DM2NbMJp/ROnxAANJtSCsdorTd8DlvqA 3Ahl7u8DXW9sOg+2hzuWbAK65MArjw5xcq6eW+atP1iFYC69IP1XRLJWYUsA6AszpZqfFXCTgTQMA +oCCscmyVso6SRZb9GZr9w+Sqs7VTpDmVMN2ZLaAoS1SkteRPwhK/YvlcoCe2x7Q4lYrHTxU5AP7Z UudjL1iA==; Received: from host86-169-41-81.range86-169.btcentralplus.com ([86.169.41.81]:56613 helo=Dell) by server.nextmovesoftware.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qAoM2-00073B-2c; Sun, 18 Jun 2023 05:05:51 -0400 From: "Roger Sayle" To: Cc: "'Uros Bizjak'" Subject: [x86 PATCH] Standardize shift amount constants as QImode. Date: Sun, 18 Jun 2023 10:05:48 +0100 Message-ID: <005501d9a1c4$1443cd30$3ccb6790$@nextmovesoftware.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: Admhw56wdzvFfIEHQN276BpXHuiCwQ== Content-Language: en-gb X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.nextmovesoftware.com X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - nextmovesoftware.com X-Get-Message-Sender-Via: server.nextmovesoftware.com: authenticated_id: roger@nextmovesoftware.com X-Authenticated-Sender: server.nextmovesoftware.com: roger@nextmovesoftware.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This clean-up improves consistency within i386.md by using QImode for the constant shift count in patterns that specify a mode. This patch has been tested on x86_64-pc-linux-gnu with make bootstrap and make -k check, both with and without --target_board=unix{-m32} with no new failures. Ok for mainline? 2023-06-18 Roger Sayle gcc/ChangeLog * config/i386/i386.md (*concat3_1): Use QImode for the immediate constant shift count. (*concat3_2): Likewise. (*concat3_3): Likewise. (*concat3_4): Likewise. (*concat3_5): Likewise. (*concat3_6): Likewise. Thanks, Roger diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 93794c1..b8d2e3a 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -12211,7 +12211,7 @@ [(set (match_operand: 0 "nonimmediate_operand" "=ro,r") (any_or_plus: (ashift: (match_operand: 1 "register_operand" "r,r") - (match_operand: 2 "const_int_operand")) + (match_operand:QI 2 "const_int_operand")) (zero_extend: (match_operand:DWIH 3 "nonimmediate_operand" "r,m"))))] "INTVAL (operands[2]) == * BITS_PER_UNIT" @@ -12230,7 +12230,7 @@ (zero_extend: (match_operand:DWIH 1 "nonimmediate_operand" "r,m")) (ashift: (match_operand: 2 "register_operand" "r,r") - (match_operand: 3 "const_int_operand"))))] + (match_operand:QI 3 "const_int_operand"))))] "INTVAL (operands[3]) == * BITS_PER_UNIT" "#" "&& reload_completed" @@ -12247,7 +12247,7 @@ (ashift: (zero_extend: (match_operand:DWIH 1 "nonimmediate_operand" "r,m,r,m")) - (match_operand: 2 "const_int_operand")) + (match_operand:QI 2 "const_int_operand")) (zero_extend: (match_operand:DWIH 3 "nonimmediate_operand" "r,r,m,m"))))] "INTVAL (operands[2]) == * BITS_PER_UNIT" @@ -12267,7 +12267,7 @@ (ashift: (zero_extend: (match_operand:DWIH 2 "nonimmediate_operand" "r,r,m,m")) - (match_operand: 3 "const_int_operand"))))] + (match_operand:QI 3 "const_int_operand"))))] "INTVAL (operands[3]) == * BITS_PER_UNIT" "#" "&& reload_completed" @@ -12281,7 +12281,7 @@ [(set (match_operand:DWI 0 "nonimmediate_operand" "=r,o,o") (any_or_plus:DWI (ashift:DWI (match_operand:DWI 1 "register_operand" "r,r,r") - (match_operand:DWI 2 "const_int_operand")) + (match_operand:QI 2 "const_int_operand")) (match_operand:DWI 3 "const_scalar_int_operand" "n,n,Wd")))] "INTVAL (operands[2]) == * BITS_PER_UNIT / 2 && (mode == DImode @@ -12313,7 +12313,7 @@ (ashift: (zero_extend: (match_operand:DWIH 1 "nonimmediate_operand" "r,r,r,m")) - (match_operand: 2 "const_int_operand")) + (match_operand:QI 2 "const_int_operand")) (match_operand: 3 "const_scalar_int_operand" "n,n,Wd,n")))] "INTVAL (operands[2]) == * BITS_PER_UNIT && (mode == DImode