From patchwork Wed Feb 12 06:55:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 1236651 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=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-519389-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=axis.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=Z6Vohc8g; 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 48HVlp0dnwz9s1x for ; Wed, 12 Feb 2020 17:55:48 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :message-id:from:to:subject:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=JlVX7DOWKa2IVjlP 2uDS1H1vN5KVHTaw0e+dEMVSS+V24xrdCgRJ0NLTg98Fh9IMFxwcmZ3KoHyPdIQ8 kd/QNJrQ3bXqp1M4a6hearUtPDm1sq4rFWCR8BaJnprA0w40mFy9j3NiH2YX+4Lm vsPYNilzjGxSWIxO1HyXYzuGHUw= 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:date :message-id:from:to:subject:mime-version:content-type :content-transfer-encoding; s=default; bh=6cdP4J7cwkwz8y/97zqItt bnxVg=; b=Z6Vohc8gjP8zGVJxfpMa2BmYxwXzmVQIttsYl1SmYQIza6I9dkCgcT z2i1vXTYN/Eq730CieCHlC3Ayum9pBJ3uRqplvn1PGmbmRmwZfEtPKDhcQ5hggxD +yFKF6Yg/qLMf0h/p4ln7lRcAa4GrnedlFrICTvBSOfRCh202G5Gg= Received: (qmail 54460 invoked by alias); 12 Feb 2020 06:55:42 -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 54450 invoked by uid 89); 12 Feb 2020 06:55:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, MEDICAL_SUBJECT, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: smtp2.axis.com Received: from smtp2.axis.com (HELO smtp2.axis.com) (195.60.68.18) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 12 Feb 2020 06:55:40 +0000 IronPort-SDR: GQLxB8pOVVw6jDWgdBM3+AIZuWjL1aAmbaLFyXDnwVi1pm4Tn1oDhksWFH77MWT6paP+0bIGaZ APnDrj0+ONKAM9nvCiCS2OdqV5Nvh+s+z6ba/JnZLiYh0h1UwjBa7IemUU8oyd/m74uD7k6pdv PcShU3sGyqrBkEIzMkT4O6sSU3vBhLSGHW+7e1QPpVZn2g6N1+IaCGevOqrgCFy80OckiE1mrz R4rIDFUVy+gJZPUw7eVOL8lSjtVzCenEpw5D7dlqwL0V12uItkQEdh7GqVy7dlQxkj5GsDoTZQ EpQ= Date: Wed, 12 Feb 2020 07:55:37 +0100 Message-ID: <202002120655.01C6tbUr026573@ignucius.se.axis.com> From: Hans-Peter Nilsson To: Subject: [cris-decc0 5/14] cris.md: Post-reload, split/generate clobberless zero source moves MIME-Version: 1.0 X-IsSubscribed: yes * config/cris/cris.md ("movsi"): For a zero-source post-reload, generate a clobberless variant. ("*mov_fromzero_split"): New split. ("*mov_fromzero"): New insn. A separated follow-up to the previous change: Also emit moves from zero as not clobbering condition-codes. --- gcc/config/cris/cris.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md index 3de2f5a13..bf2cf9663 100644 --- a/gcc/config/cris/cris.md +++ b/gcc/config/cris/cris.md @@ -449,8 +449,9 @@ (define_expand "movsi" /* At post-reload time, we'll get here for e.g. split multi-mode insns with a memory destination. Go directly to the clobber-less variant. - FIXME: Also applies to zero source. */ - if (MEM_P (operands[0]) && reload_completed) + FIXME: Also applies to special-register source or destination. */ + if (reload_completed + && (MEM_P (operands[0]) || operands[1] == const0_rtx)) { emit_insn (gen_rtx_SET (operands[0], operands[1])); DONE; @@ -697,6 +698,20 @@ (define_insn "*mov_tomem" move %1,%0" [(set_attr "slottable" "yes,yes,yes,no,no,no") (set_attr "enabled" "")]) + +(define_split ;; "*mov_fromzero_split" + [(set (match_operand:BWD 0 "register_operand") (const_int 0)) + (clobber (reg:CC CRIS_CC0_REGNUM))] + "reload_completed + && REGNO(operands[0]) <= CRIS_LAST_GENERAL_REGISTER" + [(set (match_dup 0) (const_int 0))] + "") + +(define_insn "*mov_fromzero" + [(set (match_operand:BWD 0 "register_operand" "=r") (const_int 0))] + "reload_completed" + "clear %0" + [(set_attr "slottable" "yes")]) ;; Movem patterns. Primarily for use in function prologue and epilogue. ;; Unfortunately, movem stores R0 in the highest memory location, thus