From patchwork Fri Sep 25 07:59:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Greenhalgh X-Patchwork-Id: 522685 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 8BC47140779 for ; Fri, 25 Sep 2015 18:00:09 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=MO7ovDYy; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=eaTPIlHY0VK+8VaB Ip+kVE4MWTJLwe5WmzL+FQB47ZZ8Yc1en0kX3JlT+HLJCGYfXFSPIJx0kopHSQAp Al+bXnpdIVrxQZ0gcH3Jp0hw00YukAbZR5+HJDwl5WG8yLnPux96BxJcaKHtWJyY OJPM8VFUSjW+PkBIytuTta5F+Lw= 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:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=+mioeueuU9dIbFaik2XMr7 hC6KU=; b=MO7ovDYyo6PS9AXkKiPnzHRDglSd7mf/Edh98d2kE/jTCjkMQoJWV6 HyiSz6Nxqhsyg3unzn53wJWuMi5LjQzDP9i9HluRXW6gAmm8ZS4katxEN0ZgRmLG XpjY5mWZdNzOdsNyKubfpzpTer7nBM9F03i36FFYvcHPMKGb7nKKE= Received: (qmail 9493 invoked by alias); 25 Sep 2015 07:59:56 -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 9292 invoked by uid 89); 25 Sep 2015 07:59:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 Sep 2015 07:59:51 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-29-rkxlKHfnQvKSTRI0kdg9JA-1; Fri, 25 Sep 2015 08:59:47 +0100 Received: from e107456-lin.cambridge.arm.com ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 25 Sep 2015 08:59:46 +0100 From: James Greenhalgh To: gcc-patches@gcc.gnu.org Cc: marcus.shawcroft@arm.com, richard.earnshaw@arm.com, kyrtka01@arm.com, ramana.radhakrishnan@arm.com Subject: [Patch 1/2 AArch64/ARM] Give AArch64 ROR (Immediate) a new type attribute Date: Fri, 25 Sep 2015 08:59:32 +0100 Message-Id: <1443167973-37806-2-git-send-email-james.greenhalgh@arm.com> In-Reply-To: <1443167973-37806-1-git-send-email-james.greenhalgh@arm.com> References: <1443167973-37806-1-git-send-email-james.greenhalgh@arm.com> MIME-Version: 1.0 X-MC-Unique: rkxlKHfnQvKSTRI0kdg9JA-1 X-IsSubscribed: yes Hi, This patch splits the "shift_imm" type attribute used by AArch64 in two - giving rotate_imm and shift_imm. We then apply this transform across the AArch64 pipeline descriptions which have modelling for shift_imm (cortex-a53, cortex-a57, thunderx). This should give no functional change to these models. Bootstrapped and tested on aarch64-none-linux-gnu, and arm-none-linux-gnueabihf with no issues. OK? Thanks, James --- 2015-09-25 James Greenhalgh * config/arm/types.md (type): Add rotate_imm. * config/aarch64/aarch64.md (*ror3_insn): Split out the ROR immediate case. (*rorsi3_insn_uxtw): Likewise. * config/aarch64/thunderx.md (thunderx_shift): Add rotate_imm. * config/arm/cortex-a53.md (cortex_a53_alu_shift): Add rotate_imm. * config/arm/cortex-a57.md (cortex_a53_alu): Add rotate_imm. diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 78b9ae2..4f7323c 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -3807,13 +3807,15 @@ ;; Rotate right (define_insn "*ror3_insn" - [(set (match_operand:GPI 0 "register_operand" "=r") - (rotatert:GPI - (match_operand:GPI 1 "register_operand" "r") - (match_operand:QI 2 "aarch64_reg_or_shift_imm_" "rUs")))] + [(set (match_operand:GPI 0 "register_operand" "=r,r") + (rotatert:GPI + (match_operand:GPI 1 "register_operand" "r,r") + (match_operand:QI 2 "aarch64_reg_or_shift_imm_" "r,Us")))] "" - "ror\\t%0, %1, %2" - [(set_attr "type" "shift_reg")] + "@ + ror\\t%0, %1, %2 + ror\\t%0, %1, %2" + [(set_attr "type" "shift_reg, rotate_imm")] ) ;; zero_extend version of above @@ -3902,7 +3904,7 @@ operands[3] = GEN_INT ( - UINTVAL (operands[2])); return "ror\\t%0, %1, %3"; } - [(set_attr "type" "shift_imm")] + [(set_attr "type" "rotate_imm")] ) ;; zero_extend version of the above @@ -3916,7 +3918,7 @@ operands[3] = GEN_INT (32 - UINTVAL (operands[2])); return "ror\\t%w0, %w1, %3"; } - [(set_attr "type" "shift_imm")] + [(set_attr "type" "rotate_imm")] ) (define_insn "*_ashl" diff --git a/gcc/config/aarch64/thunderx.md b/gcc/config/aarch64/thunderx.md index cf96368..3dae963 100644 --- a/gcc/config/aarch64/thunderx.md +++ b/gcc/config/aarch64/thunderx.md @@ -39,7 +39,7 @@ (define_insn_reservation "thunderx_shift" 1 (and (eq_attr "tune" "thunderx") - (eq_attr "type" "bfm,extend,shift_imm,shift_reg,rbit,rev")) + (eq_attr "type" "bfm,extend,rotate_imm,shift_imm,shift_reg,rbit,rev")) "thunderx_pipe0 | thunderx_pipe1") diff --git a/gcc/config/arm/cortex-a53.md b/gcc/config/arm/cortex-a53.md index db572f6..3fa0625 100644 --- a/gcc/config/arm/cortex-a53.md +++ b/gcc/config/arm/cortex-a53.md @@ -76,7 +76,7 @@ alu_sreg,alus_sreg,logic_reg,logics_reg,\ adc_imm,adcs_imm,adc_reg,adcs_reg,\ adr,bfm,csel,clz,rbit,rev,alu_dsp_reg,\ - shift_imm,shift_reg,\ + rotate_imm,shift_imm,shift_reg,\ mov_imm,mov_reg,mvn_imm,mvn_reg,\ mrs,multiple,no_insn")) "cortex_a53_slot_any") diff --git a/gcc/config/arm/cortex-a57.md b/gcc/config/arm/cortex-a57.md index a32c848..d6ce440 100644 --- a/gcc/config/arm/cortex-a57.md +++ b/gcc/config/arm/cortex-a57.md @@ -296,7 +296,7 @@ alu_sreg,alus_sreg,logic_reg,logics_reg,\ adc_imm,adcs_imm,adc_reg,adcs_reg,\ adr,bfm,clz,rbit,rev,alu_dsp_reg,\ - shift_imm,shift_reg,\ + rotate_imm,shift_imm,shift_reg,\ mov_imm,mov_reg,\ mvn_imm,mvn_reg,\ mrs,multiple,no_insn")) diff --git a/gcc/config/arm/types.md b/gcc/config/arm/types.md index ec609ae..534be74 100644 --- a/gcc/config/arm/types.md +++ b/gcc/config/arm/types.md @@ -120,6 +120,7 @@ ; final output, thus having no impact on scheduling. ; rbit reverse bits. ; rev reverse bytes. +; rotate_imm rotate by immediate. ; sdiv signed division. ; shift_imm simple shift operation (LSL, LSR, ASR, ROR) with an ; immediate. @@ -627,6 +628,7 @@ nop,\ rbit,\ rev,\ + rotate_imm,\ sdiv,\ shift_imm,\ shift_reg,\