From patchwork Fri Aug 3 02:07:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Froyd X-Patchwork-Id: 174836 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]) by ozlabs.org (Postfix) with SMTP id 9E9A52C0093 for ; Fri, 3 Aug 2012 12:07:41 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1344564462; h=Comment: DomainKey-Signature:Received:Received:Received:Received:From:To: Cc:Subject:Date:Message-Id:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=Afwduvfk5uZY4HJY2+2DnqBh8+k=; b=PzSDHXygB/TSv0i yulN9c2xaPiCndsgFntIzDL1AfY4ONkJdS8LWDqRsjerVAVRdDBWujX1V5V9PFeB x2+iMU5HVTKsLgH44+ZF3d2DyLz7AHILGmL383l7+NTBhlD7VhkCuwr4X78wm1qX cYeKzMtK3Y0RuP6rDlA2JFlUQKJM= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:From:To:Cc:Subject:Date:Message-Id:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=TumJeMVd0UHYe73CgrK65oVON41sLuRjfD2S+o0SzQ142ZW1eVf2L5EBv3itsI c8txMSx5mb/bh9Gk3v/5eNZmi0/xC91Otd8C5SxU7FLxJ9/SBXE8d/pAuX1uYuJj jq5eGB8lCsomqwhwk7H11IWzqgjuZqeeczA6PYRTg1Bfo=; Received: (qmail 3578 invoked by alias); 3 Aug 2012 02:07:34 -0000 Received: (qmail 3554 invoked by uid 22791); 3 Aug 2012 02:07:27 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mx1.corp.phx1.mozilla.com (HELO smtp.mozilla.org) (63.245.216.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Aug 2012 02:07:12 +0000 Received: from localhost (cpe-107-10-247-225.indy.res.rr.com [107.10.247.225]) (Authenticated sender: nfroyd@mozilla.com) by mx1.mail.corp.phx1.mozilla.com (Postfix) with ESMTPSA id 0E2F7F2608; Thu, 2 Aug 2012 19:07:10 -0700 (PDT) From: Nathan Froyd To: gcc-patches@gcc.gnu.org Cc: dj@redhat.com Subject: [PATCH] [mep] delete unused constraint-related macros and functions Date: Thu, 2 Aug 2012 22:07:06 -0400 Message-Id: <1343959626-1339-1-git-send-email-froydnj@mozilla.com> 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 mep uses {constraints,predicates}.md and #if 0'd out the old macro versions. In the interest of not keeping dead code around, I'd like to delete these. I think this falls under the obvious rule, so I'll commit this in a couple of days after waiting to hear from DJ. Tested by building mep-elf. -Nathan * config/mep/mep.h (REG_CLASS_FROM_CONSTRAINT): Delete. (CONST_OK_FOR_LETTER_P, CONST_DOUBLE_OK_FOR_LETTER_P): Delete. (CONSTRAINT_LEN, EXTRA_CONSTRAINT): Delete. * config/mep/mep.c (mep_reg_class_from_constraint): Delete. (mep_const_ok_for_letter_p, mep_extra_constraint): Delete. * config/mep/mep-protos.h (mep_reg_class_from_constraint): Delete. (mep_const_ok_for_letter_p, mep_extra_constraint): Delete. --- gcc/ChangeLog | 10 ++++ gcc/config/mep/mep-protos.h | 3 - gcc/config/mep/mep.c | 126 ------------------------------------------- gcc/config/mep/mep.h | 15 ----- 4 files changed, 10 insertions(+), 144 deletions(-) diff --git a/gcc/config/mep/mep-protos.h b/gcc/config/mep/mep-protos.h index edfbaf7..f0f3496 100644 --- a/gcc/config/mep/mep-protos.h +++ b/gcc/config/mep/mep-protos.h @@ -20,9 +20,6 @@ along with GCC; see the file COPYING3. If not see . */ extern int mep_regno_reg_class (int); -extern int mep_reg_class_from_constraint (int, const char *); -extern bool mep_const_ok_for_letter_p (HOST_WIDE_INT, int); -extern bool mep_extra_constraint (rtx, int); extern rtx mep_mulr_source (rtx, rtx, rtx, rtx); extern bool mep_reuse_lo_p (rtx, rtx, rtx, bool); extern bool mep_use_post_modify_p (rtx, rtx, rtx); diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c index bba0327..5089e03 100644 --- a/gcc/config/mep/mep.c +++ b/gcc/config/mep/mep.c @@ -596,132 +596,6 @@ mep_regno_reg_class (int regno) return NO_REGS; } -#if 0 -int -mep_reg_class_from_constraint (int c, const char *str) -{ - switch (c) - { - case 'a': - return SP_REGS; - case 'b': - return TP_REGS; - case 'c': - return CONTROL_REGS; - case 'd': - return HILO_REGS; - case 'e': - { - switch (str[1]) - { - case 'm': - return LOADABLE_CR_REGS; - case 'x': - return mep_have_copro_copro_moves_p ? CR_REGS : NO_REGS; - case 'r': - return mep_have_core_copro_moves_p ? CR_REGS : NO_REGS; - default: - return NO_REGS; - } - } - case 'h': - return HI_REGS; - case 'j': - return RPC_REGS; - case 'l': - return LO_REGS; - case 't': - return TPREL_REGS; - case 'v': - return GP_REGS; - case 'x': - return CR_REGS; - case 'y': - return CCR_REGS; - case 'z': - return R0_REGS; - - case 'A': - case 'B': - case 'C': - case 'D': - { - enum reg_class which = c - 'A' + USER0_REGS; - return (reg_class_size[which] > 0 ? which : NO_REGS); - } - - default: - return NO_REGS; - } -} - -bool -mep_const_ok_for_letter_p (HOST_WIDE_INT value, int c) -{ - switch (c) - { - case 'I': return value >= -32768 && value < 32768; - case 'J': return value >= 0 && value < 65536; - case 'K': return value >= 0 && value < 0x01000000; - case 'L': return value >= -32 && value < 32; - case 'M': return value >= 0 && value < 32; - case 'N': return value >= 0 && value < 16; - case 'O': - if (value & 0xffff) - return false; - return value >= -2147483647-1 && value <= 2147483647; - default: - gcc_unreachable (); - } -} - -bool -mep_extra_constraint (rtx value, int c) -{ - encode_pattern (value); - - switch (c) - { - case 'R': - /* For near symbols, like what call uses. */ - if (GET_CODE (value) == REG) - return 0; - return mep_call_address_operand (value, GET_MODE (value)); - - case 'S': - /* For signed 8-bit immediates. */ - return (GET_CODE (value) == CONST_INT - && INTVAL (value) >= -128 - && INTVAL (value) <= 127); - - case 'T': - /* For tp/gp relative symbol values. */ - return (RTX_IS ("u3s") || RTX_IS ("u2s") - || RTX_IS ("+u3si") || RTX_IS ("+u2si")); - - case 'U': - /* Non-absolute memories. */ - return GET_CODE (value) == MEM && ! CONSTANT_P (XEXP (value, 0)); - - case 'W': - /* %hi(sym) */ - return RTX_IS ("Hs"); - - case 'Y': - /* Register indirect. */ - return RTX_IS ("mr"); - - case 'Z': - return mep_section_tag (value) == 'c' && RTX_IS ("ms"); - } - - return false; -} -#endif - -#undef PASS -#undef FAIL - static bool const_in_range (rtx x, int minv, int maxv) { diff --git a/gcc/config/mep/mep.h b/gcc/config/mep/mep.h index 920120c..9a382e6 100644 --- a/gcc/config/mep/mep.h +++ b/gcc/config/mep/mep.h @@ -408,11 +408,6 @@ enum reg_class #define BASE_REG_CLASS GENERAL_REGS #define INDEX_REG_CLASS GENERAL_REGS -#if 0 -#define REG_CLASS_FROM_CONSTRAINT(CHAR, STRING) \ - mep_reg_class_from_constraint (CHAR, STRING) -#endif - #define REGNO_OK_FOR_BASE_P(NUM) (GR_REGNO_P (NUM) \ || (NUM) == ARG_POINTER_REGNUM \ || (NUM) >= FIRST_PSEUDO_REGISTER) @@ -428,16 +423,6 @@ enum reg_class #define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \ mep_secondary_memory_needed (CLASS1, CLASS2, MODE) -#if 0 -#define CONST_OK_FOR_LETTER_P(VALUE, C) mep_const_ok_for_letter_p (VALUE, C) - -#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0 - -#define CONSTRAINT_LEN(C, STR) \ - ((C) == 'e' ? 2 : DEFAULT_CONSTRAINT_LEN (C, STR)) -#define EXTRA_CONSTRAINT(VALUE, C) mep_extra_constraint (VALUE, C) -#endif - #define WANT_GCC_DECLARATIONS #include "mep-intrin.h" #undef WANT_GCC_DECLARATIONS