From patchwork Tue Nov 19 09:02:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Zissulescu Ianculescu X-Patchwork-Id: 1197306 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-513997-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="hnneXk7E"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hgc4hbhe"; 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 47HKc874Jxz9s4Y for ; Tue, 19 Nov 2019 20:03:18 +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:from :to:cc:subject:date:message-id:mime-version :content-transfer-encoding; q=dns; s=default; b=KbmGuLSy+E13JwEB 4X//e5W7iyaV5R+mAoUFxnuv1AOioBTF34jYNVRXcQ8Tx0Ige7iBvwSlQgAlvuWj vZY2n7f4JVHMXpHLW0OCEEVwbFzF8Xcy81ERejoF8dnxEy1IUQiBkvN6x02xbZyQ 5TUA5FVzVaKVSFfJTMmDeTcIuME= 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:mime-version :content-transfer-encoding; s=default; bh=OkQB6i9Of8gVZkEjAhd/p7 dNIj4=; b=hnneXk7EsjE9RLf/acQ/Zvu9nawpzq7RRA5iTmQ2SSPqa5vVpD7vMK ahUoZKZPZSGwr4T+a2mpvXIKoKKB9EkNvBvgfhozdJ2RrYIuzTtqE7NFDQ6U2+Vg OVcTSkj2hsQEgmpW3LSilaRxHCLSX8Ux4UcC3RPhCEdsUjt2ZhFsw= Received: (qmail 100225 invoked by alias); 19 Nov 2019 09:03:10 -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 100217 invoked by uid 89); 19 Nov 2019 09:03:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:3082, HContent-Transfer-Encoding:8bit X-HELO: mail-wm1-f68.google.com Received: from mail-wm1-f68.google.com (HELO mail-wm1-f68.google.com) (209.85.128.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 19 Nov 2019 09:02:59 +0000 Received: by mail-wm1-f68.google.com with SMTP id b11so2244213wmb.5 for ; Tue, 19 Nov 2019 01:02:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0Kfb3gWwyi/KG7I8x1+diQ1wEM86y9hBk23MtXxv5kM=; b=hgc4hbhesZVPWjsE0jnYjQztcLL27Jz5UF0TShNbK92fa8h0WgJfeo2ap6taT0JGfY VHy4fsQ0fe3GU9c3ZI/dlhvm+MBqr6apKW2EDyzNM3yKo3HXg0H0yCDsKQUJ6JQekqxZ pzg0YYonuqacna2kMftk8PW2Tb4TdGkgLpSOF4ZgfzYB5rTpzzSeErOpLdrKB1ODdjNm D1mi0erWYXXCzp8t99Xb5WnHujbJVfqFSrRKw8KtAAOCOul7ajUdA8Lno6LFdV8T8lBb B2/adX7TNhn3Rxr8m4iDtaDGvfG6UmR0pykh/COU4aJPtTrI++cNVpfyCf6lEDAT8Pbp QMyw== Received: from localhost.localdomain ([79.115.252.33]) by smtp.gmail.com with ESMTPSA id z9sm26695136wrv.35.2019.11.19.01.02.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2019 01:02:56 -0800 (PST) From: Claudiu Zissulescu To: gcc-patches@gcc.gnu.org Cc: fbedard@synopsys.com, claziss@synopsys.com, andrew.burgess@embecosm.com Subject: [PATCH 1/3] [ARC] Fix failing pr77309 for ARC700 Date: Tue, 19 Nov 2019 11:02:48 +0200 Message-Id: <20191119090250.5619-1-claziss@gmail.com> MIME-Version: 1.0 X-IsSubscribed: yes The patterns neg_scc_insn and not_scc_insn are not correct, leading to failing pr77309 test for ARC700. Add two new bic compare with zero patterns to improve output code. gcc/ xxxx-xx-xx Claudiu Zissulescu * config/arc/arc.md (bic_f): Use cc_set_register predicate. (bic_cmp0_noout): New pattern. (bic_cmp0): Likewise. (neg_scc_insn): Remove pattern. (not_scc_insn): Likewise. --- gcc/config/arc/arc.md | 52 ++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md index 7da52199415..d2b7a45b6e6 100644 --- a/gcc/config/arc/arc.md +++ b/gcc/config/arc/arc.md @@ -1272,7 +1272,7 @@ archs4x, archs4xd" "") (define_insn "*bic_f" - [(set (match_operand 3 "cc_register" "=Rcc,Rcc,Rcc") + [(set (match_operand 3 "cc_set_register" "") (match_operator 4 "zn_compare_operator" [(and:SI (match_operand:SI 1 "register_operand" "c,0,c") (not:SI @@ -1286,6 +1286,34 @@ archs4x, archs4xd" (set_attr "cond" "set_zn,set_zn,set_zn") (set_attr "length" "4,4,8")]) +(define_insn "*bic_cmp0_noout" + [(set (match_operand 0 "cc_set_register" "") + (compare:CC_ZN + (and:SI (not:SI (match_operand:SI 1 "nonmemory_operand" "Lr,Cal,r")) + (match_operand:SI 2 "nonmemory_operand" "r,r,Cal")) + (const_int 0)))] + "register_operand (operands[1], SImode) + || register_operand (operands[2], SImode)" + "bic.f\\t0,%2,%1" + [(set_attr "type" "unary") + (set_attr "cond" "set_zn") + (set_attr "length" "4,8,8")]) + +(define_insn "*bic_cmp0" + [(set (match_operand 0 "cc_set_register" "") + (compare:CC_ZN + (and:SI (not:SI (match_operand:SI 1 "nonmemory_operand" "Lr,Cal,r")) + (match_operand:SI 2 "nonmemory_operand" "r,r,Cal")) + (const_int 0))) + (set (match_operand:SI 3 "register_operand" "=r,r,r") + (and:SI (not:SI (match_dup 1)) (match_dup 2)))] + "register_operand (operands[1], SImode) + || register_operand (operands[2], SImode)" + "bic.f\\t%3,%2,%1" + [(set_attr "type" "unary") + (set_attr "cond" "set_zn") + (set_attr "length" "4,8,8")]) + (define_expand "movdi" [(set (match_operand:DI 0 "move_dest_operand" "") (match_operand:DI 1 "general_operand" ""))] @@ -3763,28 +3791,6 @@ archs4x, archs4xd" } [(set_attr "type" "unary")]) -;; ??? At least for ARC600, we should use sbc b,b,s12 if we want a value -;; that is one lower if the carry flag is set. - -;; ??? Look up negscc insn. See pa.md for example. -(define_insn "*neg_scc_insn" - [(set (match_operand:SI 0 "dest_reg_operand" "=w") - (neg:SI (match_operator:SI 1 "proper_comparison_operator" - [(reg CC_REG) (const_int 0)])))] - "" - "mov %0,-1\;sub.%D1 %0,%0,%0" - [(set_attr "type" "unary") - (set_attr "length" "8")]) - -(define_insn "*not_scc_insn" - [(set (match_operand:SI 0 "dest_reg_operand" "=w") - (not:SI (match_operator:SI 1 "proper_comparison_operator" - [(reg CC_REG) (const_int 0)])))] - "" - "mov %0,1\;sub.%d1 %0,%0,%0" - [(set_attr "type" "unary") - (set_attr "length" "8")]) - ; cond_exec patterns (define_insn "*movsi_ne" [(cond_exec