From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18812 invoked by alias); 6 Apr 2018 09:00:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 18635 invoked by uid 89); 6 Apr 2018 09:00:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Sleep X-HELO: smtprelay.synopsys.com Received: from smtprelay2.synopsys.com (HELO smtprelay.synopsys.com) (198.182.60.111) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Apr 2018 09:00:34 +0000 Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id A71C210C0909; Fri, 6 Apr 2018 02:00:25 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 8ACD5398F; Fri, 6 Apr 2018 02:00:25 -0700 (PDT) Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) by mailhost.synopsys.com (Postfix) with ESMTP id 630183986; Fri, 6 Apr 2018 02:00:25 -0700 (PDT) Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.104) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 6 Apr 2018 02:00:25 -0700 Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by IN01WEHTCA.internal.synopsys.com (10.144.199.103) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 6 Apr 2018 14:30:24 +0530 Received: from nl20droid1.internal.synopsys.com (10.100.24.228) by IN01WEHTCB.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 6 Apr 2018 14:30:23 +0530 From: Claudiu Zissulescu To: CC: , , Subject: [PATCH 1/5] [ARC] Update sleep builtin. Date: Fri, 06 Apr 2018 09:00:00 -0000 Message-ID: <1523005214-1611-2-git-send-email-claziss@synopsys.com> In-Reply-To: <1523005214-1611-1-git-send-email-claziss@synopsys.com> References: <1523005214-1611-1-git-send-email-claziss@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-04/txt/msg00294.txt.bz2 From: claziss gcc/ 2017-05-09 Claudiu Zissulescu * config/arc/arc-protos.h (check_if_valid_sleep_operand): Remove. * config/arc/arc.c (arc_expand_builtin): Sleep accepts registers and short u6 immediate. (check_if_valid_sleep_operand): Remove. * config/arc/arc.md (Sleep): Accepts registers and u6 immediates. --- gcc/config/arc/arc-protos.h | 1 - gcc/config/arc/arc.c | 26 -------------------------- gcc/config/arc/arc.md | 4 ++-- 3 files changed, 2 insertions(+), 29 deletions(-) diff --git a/gcc/config/arc/arc-protos.h b/gcc/config/arc/arc-protos.h index 75cfeda..0ba6871 100644 --- a/gcc/config/arc/arc-protos.h +++ b/gcc/config/arc/arc-protos.h @@ -59,7 +59,6 @@ void arc_asm_output_aligned_decl_local (FILE *, tree, const char *, unsigned HOST_WIDE_INT); extern rtx arc_return_addr_rtx (int , rtx); extern bool check_if_valid_regno_const (rtx *, int); -extern bool check_if_valid_sleep_operand (rtx *, int); extern bool arc_legitimate_constant_p (machine_mode, rtx); extern bool arc_legitimate_pic_addr_p (rtx); extern bool arc_raw_symbolic_reference_mentioned_p (rtx, bool); diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 3564696..47d3ba4 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -6573,11 +6573,6 @@ arc_expand_builtin (tree exp, fold (arg0); op0 = expand_expr (arg0, NULL_RTX, VOIDmode, EXPAND_NORMAL); - if (!CONST_INT_P (op0) || !satisfies_constraint_L (op0)) - { - error ("builtin operand should be an unsigned 6-bit value"); - return NULL_RTX; - } gcc_assert (icode != 0); emit_insn (GEN_FCN (icode) (op0)); return NULL_RTX; @@ -6925,27 +6920,6 @@ check_if_valid_regno_const (rtx *operands, int opno) return false; } -/* Check that after all the constant folding, whether the operand to - __builtin_arc_sleep is an unsigned int of 6 bits. If not, flag an error. */ - -bool -check_if_valid_sleep_operand (rtx *operands, int opno) -{ - switch (GET_CODE (operands[opno])) - { - case CONST : - case CONST_INT : - if( UNSIGNED_INT6 (INTVAL (operands[opno]))) - return true; - /* FALLTHRU */ - default: - fatal_error (input_location, - "operand for sleep instruction must be an unsigned 6 bit compile-time constant"); - break; - } - return false; -} - /* Return true if it is ok to make a tail-call to DECL. */ static bool diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md index fb34329..2ec2b48 100644 --- a/gcc/config/arc/arc.md +++ b/gcc/config/arc/arc.md @@ -4794,9 +4794,9 @@ archs4x, archs4xd, archs4xd_slow" (define_insn "sleep" - [(unspec_volatile [(match_operand:SI 0 "immediate_operand" "L")] + [(unspec_volatile [(match_operand:SI 0 "nonmemory_operand" "Lr")] VUNSPEC_ARC_SLEEP)] - "check_if_valid_sleep_operand(operands,0)" + "" "sleep %0" [(set_attr "length" "4") (set_attr "type" "misc")]) -- 1.9.1