From patchwork Thu Aug 22 14:43:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Richard Earnshaw (lists)" X-Patchwork-Id: 1151652 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-507531-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="pWjaRmgl"; dkim-atps=neutral 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 46DnMW0MhCz9sPf for ; Fri, 23 Aug 2019 00:43:18 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=v/ZkBMjutDPM9HMhhFJfMer6gqhWg+OHVf14B4kWWSSrQMmBl1 FVdWTEtp79vO/0illg0Wmxmbzj6p/RRJAIZnWz4xK/b95aCCAzS1lFjZTs7Gg+Us jiBY46hcycbKUcfR5xF3gk9sN+CiFiNQJ8zLSc4NKCJi0l7eQhF+ovbwI= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=9n+iGsr/2Fy70Hj3XwLyaWUnjb4=; b=pWjaRmglDLcbh6PkeWfZ Rvx3SYMcomGmkitf1aapOAcvoqcfzBYTagxguFN68eo6d7FPdhypWt6Y2Nsl5C6s MYcjp3VH55scOCeCDDa1JFhKCHE07An4KpMpKWkgImfrGoGnFnY1K1hE9ZbVoSVi HHM+Wqsafu91b3AN7l9Y2u8= Received: (qmail 59998 invoked by alias); 22 Aug 2019 14:43:11 -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 59983 invoked by uid 89); 22 Aug 2019 14:43:11 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=ir, Ir X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Aug 2019 14:43:10 +0000 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 B4B39337; Thu, 22 Aug 2019 07:43:08 -0700 (PDT) Received: from e120077-lin.cambridge.arm.com (e120077-lin.cambridge.arm.com [10.2.206.91]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5FF413F706; Thu, 22 Aug 2019 07:43:08 -0700 (PDT) To: gcc-patches@gcc.gnu.org From: "Richard Earnshaw (lists)" Subject: [Arm] Add 16-bit thumb alternatives to iorsi3_compare0[_scratch] Message-ID: <72ba3f0e-8bbd-0605-a4b7-0aaaffe74124@arm.com> Date: Thu, 22 Aug 2019 15:43:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 The iorsi3_compare0 and iorsi3_compare0_scratch patterns can make use of the 16-bit thumb orrs instruction if suitable registers are allocated. This patch adds the alternative to allow this to happen. * config/arm/arm.md (iorsi3_compare0): Add alternative for 16-bit thumb insn. (iorsi3_compare0_scratch): Likewise. Committed to trunk. R. diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 50e1b908f59..4ba246ceeee 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -3339,27 +3339,33 @@ (define_peephole2 (define_insn "*iorsi3_compare0" [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (ior:SI (match_operand:SI 1 "s_register_operand" "%r,r") - (match_operand:SI 2 "arm_rhs_operand" "I,r")) - (const_int 0))) - (set (match_operand:SI 0 "s_register_operand" "=r,r") + (compare:CC_NOOV + (ior:SI (match_operand:SI 1 "s_register_operand" "%r,0,r") + (match_operand:SI 2 "arm_rhs_operand" "I,l,r")) + (const_int 0))) + (set (match_operand:SI 0 "s_register_operand" "=r,l,r") (ior:SI (match_dup 1) (match_dup 2)))] "TARGET_32BIT" "orrs%?\\t%0, %1, %2" [(set_attr "conds" "set") - (set_attr "type" "logics_imm,logics_reg")] + (set_attr "arch" "*,t2,*") + (set_attr "length" "4,2,4") + (set_attr "type" "logics_imm,logics_reg,logics_reg")] ) (define_insn "*iorsi3_compare0_scratch" [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (ior:SI (match_operand:SI 1 "s_register_operand" "%r,r") - (match_operand:SI 2 "arm_rhs_operand" "I,r")) - (const_int 0))) - (clobber (match_scratch:SI 0 "=r,r"))] + (compare:CC_NOOV + (ior:SI (match_operand:SI 1 "s_register_operand" "%r,0,r") + (match_operand:SI 2 "arm_rhs_operand" "I,l,r")) + (const_int 0))) + (clobber (match_scratch:SI 0 "=r,l,r"))] "TARGET_32BIT" "orrs%?\\t%0, %1, %2" [(set_attr "conds" "set") - (set_attr "type" "logics_imm,logics_reg")] + (set_attr "arch" "*,t2,*") + (set_attr "length" "4,2,4") + (set_attr "type" "logics_imm,logics_reg,logics_reg")] ) (define_expand "xordi3"