From patchwork Tue Apr 7 10:42:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Andre Vieira (lists)" X-Patchwork-Id: 1267342 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=arm.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 48xPBR1KnGz9sSj for ; Tue, 7 Apr 2020 20:42:54 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 256AF385DC34; Tue, 7 Apr 2020 10:42:52 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 5007B385DC0F for ; Tue, 7 Apr 2020 10:42:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5007B385DC0F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andre.simoesdiasvieira@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 02A1D31B; Tue, 7 Apr 2020 03:42:49 -0700 (PDT) Received: from [10.57.25.163] (unknown [10.57.25.163]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 908833F73D; Tue, 7 Apr 2020 03:42:48 -0700 (PDT) To: "gcc-patches@gcc.gnu.org" From: "Andre Vieira (lists)" Subject: [PATCH][GCC][Arm]: MVE Don't use lsll for 32-bit shifts scalar Message-ID: Date: Tue, 7 Apr 2020 11:42:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-27.8 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, 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" Hi, After fixing the v[id]wdups using the "moving the wrap parameter" into the top-end of a DImode operand using a shift, I noticed we were using lsll for 32-bit shifts in scalars, where we don't need to, as we can simply do a move, which is much better if we don't need to use the bottom part. We can solve this in a better way, but for now this will do. Regression tested on arm-none-eabi. Is this OK for trunk? 2020-04-07  Andre Vieira          * config/arm/arm.d (ashldi3): Don't use lsll for constant 32-bit         shifts. diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 1a7ea0d701e5677965574d877d0fe4b2f5bc149f..6d5560398dae3d0ace0342b4907542d2a6865f70 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -4422,7 +4422,8 @@ (define_expand "ashldi3" operands[2] = force_reg (SImode, operands[2]); /* Armv8.1-M Mainline double shifts are not expanded. */ - if (arm_reg_or_long_shift_imm (operands[2], GET_MODE (operands[2]))) + if (arm_reg_or_long_shift_imm (operands[2], GET_MODE (operands[2])) + && (REG_P (operands[2]) || INTVAL(operands[2]) != 32)) { if (!reg_overlap_mentioned_p(operands[0], operands[1])) emit_insn (gen_movdi (operands[0], operands[1]));