summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-28 14:08:34 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-28 14:08:34 +0000
commitb785ceb4da04ea8ed0d76bd34d7c0b8b2be0466b (patch)
tree0819044f469bad5b37e990758ae3d57b1628dd7c
parentd099b909ff0869490e786fb833fe817873d7002f (diff)
downloadppe42-gcc-b785ceb4da04ea8ed0d76bd34d7c0b8b2be0466b.tar.gz
ppe42-gcc-b785ceb4da04ea8ed0d76bd34d7c0b8b2be0466b.zip
* config/h8300/h8300.c (h8300_and_costs): New.
* config/h8300/h8300.h (RTX_COSTS): Use h8300_and_costs. * config/h8300/h8300-protos.h: Add a prototype for h8300_and_costs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59606 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/h8300/h8300-protos.h1
-rw-r--r--gcc/config/h8300/h8300.c20
-rw-r--r--gcc/config/h8300/h8300.h2
4 files changed, 30 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 86e69328bcf..ef37f748f6b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2002-11-28 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (h8300_and_costs): New.
+ * config/h8300/h8300.h (RTX_COSTS): Use h8300_and_costs.
+ * config/h8300/h8300-protos.h: Add a prototype for
+ h8300_and_costs.
+
2002-11-27 Zack Weinberg <zack@codesourcery.com>
* config/rs6000/rs6000.c (altivec_init_builtins): Make the
diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h
index c9f506ae410..aac56220393 100644
--- a/gcc/config/h8300/h8300-protos.h
+++ b/gcc/config/h8300/h8300-protos.h
@@ -32,6 +32,7 @@ extern const char *emit_a_rotate PARAMS ((enum rtx_code, rtx *));
extern const char *output_simode_bld PARAMS ((int, rtx[]));
extern void print_operand_address PARAMS ((FILE *, rtx));
extern int const_costs PARAMS ((rtx, enum rtx_code, enum rtx_code));
+extern int h8300_and_costs PARAMS ((rtx));
extern int h8300_shift_costs PARAMS ((rtx));
extern void print_operand PARAMS ((FILE *, rtx, int));
extern void final_prescan_insn PARAMS ((rtx, rtx *, int));
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 93807a09a06..66ee6fa4759 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -1136,6 +1136,26 @@ const_costs (r, c, outer_code)
}
int
+h8300_and_costs (x)
+ rtx x;
+{
+ rtx operands[4];
+
+ if (GET_MODE (x) == QImode)
+ return 1;
+
+ if (GET_MODE (x) != HImode
+ && GET_MODE (x) != SImode)
+ return 100;
+
+ operands[0] = NULL;
+ operands[1] = NULL;
+ operands[2] = XEXP (x, 1);
+ operands[3] = x;
+ return compute_logical_op_length (GET_MODE (x), operands);
+}
+
+int
h8300_shift_costs (x)
rtx x;
{
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index a8257113b4d..747f7b10c02 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -1022,6 +1022,8 @@ struct cum_arg
switch on CODE. */
#define RTX_COSTS(RTX, CODE, OUTER_CODE) \
+ case AND: \
+ return COSTS_N_INSNS (h8300_and_costs (RTX)); \
case MOD: \
case DIV: \
return 60; \
OpenPOWER on IntegriCloud