From 14755fb0c27ca236afd3ef6c2652bbc4192c4ac0 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 19 Mar 2005 00:21:23 +0000 Subject: [PATCH] mn10300-protos.h: Remove the prototypes for call_address_operand, const_8bit_operand. * config/mn10300/mn10300-protos.h: Remove the prototypes for call_address_operand, const_8bit_operand. * config/mn10300/mn10300.c (call_address_operand, const_8bit_operand, const_1f_operand): Move to predicates.md. * config/mn10300/mn10300.h (PREDICATE_CODES): Remove. * config/mn10300/mn10300.md: Include predicates.md. * config/mn10300/predicates.md: New. From-SVN: r96712 --- gcc/ChangeLog | 10 ++++++ gcc/config/mn10300/mn10300-protos.h | 2 -- gcc/config/mn10300/mn10300.c | 29 ----------------- gcc/config/mn10300/mn10300.h | 5 --- gcc/config/mn10300/mn10300.md | 4 ++- gcc/config/mn10300/predicates.md | 50 +++++++++++++++++++++++++++++ 6 files changed, 63 insertions(+), 37 deletions(-) create mode 100644 gcc/config/mn10300/predicates.md diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a35d25843560..d0882f39e29b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2005-03-18 Kazu Hirata + + * config/mn10300/mn10300-protos.h: Remove the prototypes for + call_address_operand, const_8bit_operand. + * config/mn10300/mn10300.c (call_address_operand, + const_8bit_operand, const_1f_operand): Move to predicates.md. + * config/mn10300/mn10300.h (PREDICATE_CODES): Remove. + * config/mn10300/mn10300.md: Include predicates.md. + * config/mn10300/predicates.md: New. + 2005-03-18 Joseph S. Myers * c-common.c, c-decl.c, c-format.c, c-typeck.c: Use %D for diff --git a/gcc/config/mn10300/mn10300-protos.h b/gcc/config/mn10300/mn10300-protos.h index 77af9a9b131f..2936dcf0de18 100644 --- a/gcc/config/mn10300/mn10300-protos.h +++ b/gcc/config/mn10300/mn10300-protos.h @@ -40,9 +40,7 @@ extern enum reg_class secondary_reload_class (enum reg_class, extern const char *output_tst (rtx, rtx); extern int store_multiple_operation (rtx, enum machine_mode); extern int symbolic_operand (rtx, enum machine_mode); -extern int call_address_operand (rtx, enum machine_mode); extern int impossible_plus_operand (rtx, enum machine_mode); -extern int const_8bit_operand (rtx, enum machine_mode); extern bool mn10300_wide_const_load_uses_clr (rtx operands[2]); #endif /* RTX_CODE */ diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c index 16832054c0d5..c419101c388d 100644 --- a/gcc/config/mn10300/mn10300.c +++ b/gcc/config/mn10300/mn10300.c @@ -1295,17 +1295,6 @@ store_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) return mask; } -/* Return true if OP is a valid call operand. */ - -int -call_address_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (flag_pic) - return (EXTRA_CONSTRAINT (op, 'S') || GET_CODE (op) == REG); - - return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == REG); -} - /* What (if any) secondary registers are needed to move IN with mode MODE into a register in register class CLASS. @@ -1675,24 +1664,6 @@ impossible_plus_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) return 0; } -/* Return 1 if X is a CONST_INT that is only 8 bits wide. This is used - for the btst insn which may examine memory or a register (the memory - variant only allows an unsigned 8 bit integer). */ -int -const_8bit_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT - && INTVAL (op) >= 0 - && INTVAL (op) < 256); -} - -/* Return true if the operand is the 1.0f constant. */ -int -const_1f_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (op == CONST1_RTX (SFmode)); -} - /* Similarly, but when using a zero_extract pattern for a btst where the source operand might end up in memory. */ int diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h index 121d087a1e54..4b1e44debf1a 100644 --- a/gcc/config/mn10300/mn10300.h +++ b/gcc/config/mn10300/mn10300.h @@ -1073,11 +1073,6 @@ while (0) #define FILE_ASM_OP "\t.file\n" -#define PREDICATE_CODES \ - {"const_1f_operand", {CONST_INT, CONST_DOUBLE}}, \ - {"const_8bit_operand", {CONST_INT}}, \ - {"call_address_operand", {SYMBOL_REF, REG, UNSPEC}}, - typedef struct mn10300_cc_status_mdep { int fpCC; diff --git a/gcc/config/mn10300/mn10300.md b/gcc/config/mn10300/mn10300.md index 8b6933b4aa62..0d51857a199b 100644 --- a/gcc/config/mn10300/mn10300.md +++ b/gcc/config/mn10300/mn10300.md @@ -1,5 +1,5 @@ ;; GCC machine description for Matsushita MN10300 -;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 ;; Free Software Foundation, Inc. ;; Contributed by Jeff Law (law@cygnus.com). @@ -47,6 +47,8 @@ (UNSPEC_GOTOFF 3) (UNSPEC_PLT 4) ]) + +(include "predicates.md") ;; ---------------------------------------------------------------------- ;; MOVE INSTRUCTIONS diff --git a/gcc/config/mn10300/predicates.md b/gcc/config/mn10300/predicates.md new file mode 100644 index 000000000000..752ccd89d4f2 --- /dev/null +++ b/gcc/config/mn10300/predicates.md @@ -0,0 +1,50 @@ +;; Predicate definitions for Matsushita MN10300. +;; Copyright (C) 2005 Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GCC; see the file COPYING. If not, write to +;; the Free Software Foundation, 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;; Return true if the operand is the 1.0f constant. + +(define_predicate "const_1f_operand" + (match_code "const_int,const_double") +{ + return (op == CONST1_RTX (SFmode)); +}) + +;; Return 1 if X is a CONST_INT that is only 8 bits wide. This is +;; used for the btst insn which may examine memory or a register (the +;; memory variant only allows an unsigned 8 bit integer). + +(define_predicate "const_8bit_operand" + (match_code "const_int") +{ + return (GET_CODE (op) == CONST_INT + && INTVAL (op) >= 0 + && INTVAL (op) < 256); +}) + +;; Return true if OP is a valid call operand. + +(define_predicate "call_address_operand" + (match_code "symbol_ref,reg,unspec") +{ + if (flag_pic) + return (EXTRA_CONSTRAINT (op, 'S') || GET_CODE (op) == REG); + + return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == REG); +}) -- 2.47.3