From patchwork Wed Feb 12 06:59:31 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: 1236654 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-519392-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=UCgvSx9A; 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 48HVrJ67wqz9s1x for ; Wed, 12 Feb 2020 17:59:44 +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=ZXfa1QK46Xp+P7u1 yb7lqpbKwqbEyZFOPdRLdR/sQ50v2oXsuwwmNR/wcgiUIAofFhPX/k7DoWBt5vIm Q5zBoXnRK04Q5A6wuI+32zyALNS0A351FjDW3FwIBGATM5qLIYRvC3BhzljMTsYn A0ZiQL6gOk6a1o8XJvR1mcBArdI= 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=a+8YWxfRfZgZXUvZWF9JFf 7zv4Y=; b=UCgvSx9ARGdkBtZRNTuRgaOo5MTvwExJT6z1mtHJ5C6BljImW51xj3 1XDO+sopyONH7L8rd6OVE8IvrLyjucDi3WZ+KndDZsjolmAAhrcZe8TGemm03+D9 mjCQL67NZR6xdynx3vlIcJYGCUGtoA1zWvVY18j4CP6WIjO+SJPyE= Received: (qmail 11207 invoked by alias); 12 Feb 2020 06:59:37 -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 9382 invoked by uid 89); 12 Feb 2020 06:59:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.5 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= X-HELO: smtp1.axis.com Received: from smtp1.axis.com (HELO smtp1.axis.com) (195.60.68.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 12 Feb 2020 06:59:34 +0000 IronPort-SDR: 6Jfk9ZzX7e07SRk4egaSF0sy0Xrfyx5Q9QudoqxUfL1wmm5EhWhs9CqBdfwkDFuAqz2A+84kwN Y6XVFN8YHrhZLON2jBd/nYk+PTvtR2rdsiWitv3NRaDTxmTYjZMhjvACCbFYzrfRTKxpWHsiSc Iw6IGbJbLg/CXpHMaHG1FPMFzGdqKktLySa9I2dndMRVvltZo6eQDwloqwGp2Zb2TRPqNxnVG8 AyBJFPeEPAVpyVwL5b4H5XXi/VUeklYOTq3qUQqlSIr9Imdti7ODqvBP4S/77gsRm1QU7ZeY3N HYk= Date: Wed, 12 Feb 2020 07:59:31 +0100 Message-ID: <202002120659.01C6xVTV026775@ignucius.se.axis.com> From: Hans-Peter Nilsson To: Subject: [cris-decc0 8/14] cris: Enable movhi and movqi to set condition codes. Anonymize. MIME-Version: 1.0 X-IsSubscribed: yes * config/cris/cris.md ("anz", "anzvc", "acc"): New define_subst_attrs. ("movhi"): Rename from "movhi". Rename "cc" attribute to "cc". ("movqi"): Similar from "movqi". Correct contents of, and rename "cc" attribute to "cc". ("*b"): Rename from "b". ("*b"): Rename from "b". ("*b"): Rename from "*b". Like with movsi_internal. Looks like the "cc" attribute didn't need tweaking for "movhi", but did for "movqi". N.B.: disabled alternatives make cause a later alternative to match. Also, non-anonymous insns get declarations and gen_* functions. We don't want that; even if it doesn't affect generated code it's sloppy. (This may or may not be preferable to the name decorations obfuscating standard pattern names.) Also anonymize left-over non-anonymous branches; they haven't been needing names since the cbranch pattern was made the generic method. --- gcc/config/cris/cris.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md index bee9e9735..5f77bc9e0 100644 --- a/gcc/config/cris/cris.md +++ b/gcc/config/cris/cris.md @@ -239,6 +239,7 @@ (define_code_attr xCC [(eq "CC") (ne "CC") (gtu "CC") (ltu "CC_NZVC") (define_subst_attr "setnz" "setnz_subst" "" "_setnz") (define_subst_attr "ccnz" "setnz_subst" "" "_enabled") +(define_subst_attr "anz" "setnz_subst" "" "*") (define_subst "setnz_subst" [(set (match_operand 0) @@ -251,6 +252,7 @@ (define_subst "setnz_subst" (define_subst_attr "setnzvc" "setnzvc_subst" "" "_setnzvc") (define_subst_attr "ccnzvc" "setnzvc_subst" "" "_enabled") +(define_subst_attr "anzvc" "setnzvc_subst" "" "*") (define_subst "setnzvc_subst" [(set (match_operand 0) @@ -263,6 +265,7 @@ (define_subst "setnzvc_subst" (define_subst_attr "setcc" "setcc_subst" "" "_setcc") (define_subst_attr "cccc" "setcc_subst" "" "_enabled") +(define_subst_attr "acc" "setcc_subst" "" "*") (define_subst "setcc_subst" [(set (match_operand 0) @@ -609,7 +612,7 @@ (define_insn "*movsi_internal" ;; FIXME: See movsi. -(define_insn "movhi" +(define_insn "movhi" [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r, r,Q>,r,Q>,r,r,r,g,g,r,r,x") (match_operand:HI 1 "general_operand" "r,Q>,M,M, I,r, L,O,n,M,r,g,x,r")) @@ -649,7 +652,7 @@ (define_insn "movhi" } } [(set_attr "slottable" "yes,yes,yes,yes,yes,yes,no,yes,no,no,no,no,yes,yes") - (set_attr "cc" "*,*,none,none,*,none,*,clobber,*,none,none,*,none,none")]) + (set_attr "cc" "*,*,none,none,*,none,*,clobber,*,none,none,*,none,none")]) (define_insn "movstricthi" [(set @@ -685,7 +688,7 @@ (define_expand "reload_out" "" "") -(define_insn "movqi" +(define_insn "movqi" [(set (match_operand:QI 0 "nonimmediate_operand" "=r,Q>,r, r,Q>,r,g,g,r,r,r,x") (match_operand:QI 1 "general_operand" "r,r, Q>,M,M, I,M,r,O,g,x,r")) (clobber (reg:CC CRIS_CC0_REGNUM))] @@ -704,7 +707,8 @@ (define_insn "movqi" move %1,%0 move %1,%0" [(set_attr "slottable" "yes,yes,yes,yes,yes,yes,no,no,yes,no,yes,yes") - (set_attr "cc" "*,*,*,*,*,*,*,*,clobber,*,none,none")]) + (set_attr "cc" + "*,none,*,none,none,*,none,none,clobber,*,none,none")]) (define_insn "movstrictqi" [(set (strict_low_part @@ -2117,7 +2121,7 @@ (define_insn_and_split "*cbranch4_btstq" ;; e.g. m68k, so we have to check if overflow bit is set on all "signed" ;; conditions. -(define_insn "b" +(define_insn "*b" [(set (pc) (if_then_else (zcond (reg:NZUSE CRIS_CC0_REGNUM) (const_int 0)) @@ -2127,7 +2131,7 @@ (define_insn "b" "b %l0%#" [(set_attr "slottable" "has_slot")]) -(define_insn "b" +(define_insn "*b" [(set (pc) (if_then_else (nzvccond (reg:NZVCUSE CRIS_CC0_REGNUM) (const_int 0)) @@ -2137,7 +2141,7 @@ (define_insn "b" "b %l0%#" [(set_attr "slottable" "has_slot")]) -(define_insn "b" +(define_insn "*b" [(set (pc) (if_then_else (rnzcond (reg:NZUSE CRIS_CC0_REGNUM) (const_int 0))