From patchwork Fri Jun 28 12:26:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Shawcroft X-Patchwork-Id: 255353 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 5CD442C01D4 for ; Fri, 28 Jun 2013 22:26:40 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=gH2MoAS76/H0B0g1IV7zMdHxJGdwfbAuMKbfWAYcMjwHwH Uo6im5+M1l3gtXzHnADB7Uviz04F6i49Ub51BSIB+EJgiUj1wxUFD1enPV1duIqj 2mkafY10f6I9oyxdEcO55y9M+CmxqEyrUzDJ8k1E/Zpp7hFGOR/Nsd2q63kFk= 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 :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=eL8114OUI1WCmDGYlyYYDMODegQ=; b=thGBTSba9qmL/GHFNWff Ydpz1bVsmQj7j6CDIfz1kXPSJwLuBh5FJs8+0jRbuy8Kbdro7BQGCA50H9E/6nZJ /CSzvBqOV6HlnDMKVswDlI+uSlA9Gl75UIw9BhMIzkWxeaLqTgFJwRIUEgzKuAlB kt6HTSWmQDje8MMHSL1dcNw= Received: (qmail 6265 invoked by alias); 28 Jun 2013 12:26:33 -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 6236 invoked by uid 89); 28 Jun 2013 12:26:29 -0000 X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.1 Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 28 Jun 2013 12:26:28 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Fri, 28 Jun 2013 13:26:25 +0100 Received: from [10.1.207.140] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Fri, 28 Jun 2013 13:26:25 +0100 Message-ID: <51CD80F1.1000309@arm.com> Date: Fri, 28 Jun 2013 13:26:25 +0100 From: Marcus Shawcroft User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [PATCH, COMMITTED] AArch64 remove aarch64_symbolic_constant_p. X-MC-Unique: 113062813262503001 X-Virus-Found: No This patch replaces the use of aarch64_symbolic_constant_p with the (very similar) aarch64_classify_symbolic_expression. Tested on aarch64-none-elf. Committed. /Marcus 2013-06-28 Marcus Shawcroft * config/aarch64/aarch64-protos.h (aarch64_classify_symbol_expression): Define. (aarch64_symbolic_constant_p): Remove. * config/aarch64/aarch64.c (aarch64_classify_symbol_expression): Remove static. Fix line length and white space. (aarch64_symbolic_constant_p): Remove. * config/aarch64/predicates.md (aarch64_valid_symref): Use aarch64_classify_symbol_expression. diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index bdb6b04..7969920 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -137,6 +137,8 @@ struct tune_params HOST_WIDE_INT aarch64_initial_elimination_offset (unsigned, unsigned); bool aarch64_bitmask_imm (HOST_WIDE_INT val, enum machine_mode); +enum aarch64_symbol_type +aarch64_classify_symbolic_expression (rtx, enum aarch64_symbol_context); bool aarch64_constant_address_p (rtx); bool aarch64_float_const_zero_rtx_p (rtx); bool aarch64_function_arg_regno_p (unsigned); @@ -158,8 +160,6 @@ bool aarch64_simd_imm_zero_p (rtx, enum machine_mode); bool aarch64_simd_scalar_immediate_valid_for_move (rtx, enum machine_mode); bool aarch64_simd_shift_imm_p (rtx, enum machine_mode, bool); bool aarch64_symbolic_address_p (rtx); -bool aarch64_symbolic_constant_p (rtx, enum aarch64_symbol_context, - enum aarch64_symbol_type *); bool aarch64_uimm12_shift (HOST_WIDE_INT); const char *aarch64_output_casesi (rtx *); enum aarch64_symbol_type aarch64_classify_symbol (rtx, diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 9c77888..f9fea71 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -3082,10 +3082,13 @@ aarch64_symbolic_address_p (rtx x) /* Classify the base of symbolic expression X, given that X appears in context CONTEXT. */ -static enum aarch64_symbol_type -aarch64_classify_symbolic_expression (rtx x, enum aarch64_symbol_context context) + +enum aarch64_symbol_type +aarch64_classify_symbolic_expression (rtx x, + enum aarch64_symbol_context context) { rtx offset; + split_const (x, &x, &offset); return aarch64_classify_symbol (x, context); } @@ -5082,24 +5085,6 @@ aarch64_classify_symbol (rtx x, return SYMBOL_FORCE_TO_MEM; } -/* Return true if X is a symbolic constant that can be used in context - CONTEXT. If it is, store the type of the symbol in *SYMBOL_TYPE. */ - -bool -aarch64_symbolic_constant_p (rtx x, enum aarch64_symbol_context context, - enum aarch64_symbol_type *symbol_type) -{ - rtx offset; - split_const (x, &x, &offset); - if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF) - *symbol_type = aarch64_classify_symbol (x, context); - else - return false; - - /* No checking of offset at this point. */ - return true; -} - bool aarch64_constant_address_p (rtx x) { diff --git a/gcc/config/aarch64/predicates.md b/gcc/config/aarch64/predicates.md index 3248f61..3e2b6b3 100644 --- a/gcc/config/aarch64/predicates.md +++ b/gcc/config/aarch64/predicates.md @@ -118,9 +118,8 @@ (define_predicate "aarch64_valid_symref" (match_code "const, symbol_ref, label_ref") { - enum aarch64_symbol_type symbol_type; - return (aarch64_symbolic_constant_p (op, SYMBOL_CONTEXT_ADR, &symbol_type) - && symbol_type != SYMBOL_FORCE_TO_MEM); + return (aarch64_classify_symbolic_expression (op, SYMBOL_CONTEXT_ADR) + != SYMBOL_FORCE_TO_MEM); }) (define_predicate "aarch64_tls_ie_symref"