aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2005-03-19 00:21:23 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2005-03-19 00:21:23 +0000
commit14755fb0c27ca236afd3ef6c2652bbc4192c4ac0 (patch)
treeeb91dc655c45d278b66cccbb737e9fb5b06919b7
parentd9d4150fa205d21a3eb75c4839e114b530cb1687 (diff)
downloadgcc-14755fb0c27ca236afd3ef6c2652bbc4192c4ac0.zip
gcc-14755fb0c27ca236afd3ef6c2652bbc4192c4ac0.tar.gz
gcc-14755fb0c27ca236afd3ef6c2652bbc4192c4ac0.tar.bz2
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
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/mn10300/mn10300-protos.h2
-rw-r--r--gcc/config/mn10300/mn10300.c29
-rw-r--r--gcc/config/mn10300/mn10300.h5
-rw-r--r--gcc/config/mn10300/mn10300.md4
-rw-r--r--gcc/config/mn10300/predicates.md50
6 files changed, 63 insertions, 37 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a35d258..d0882f3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2005-03-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * 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 <joseph@codesourcery.com>
* 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 77af9a9..2936dcf 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 1683205..c419101 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 121d087..4b1e44d 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 8b6933b..0d51857 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 0000000..752ccd8
--- /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);
+})