aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ"orn Rennecke <joern.rennecke@st.com>2009-05-20 17:56:08 +0000
committerJ"orn Rennecke <joern.rennecke@st.com>2009-05-20 17:56:08 +0000
commite303ef5f0ce4436912a5e7eefd1b07d0fb141e60 (patch)
treec76fd72c52d53c4f74efce2a80cbc66da8fffdfa
parentb4b4d0949a3f5c5ab2c1d3e4ff55e497aace2c78 (diff)
* config/spu/spu.md (doloop_end): Accept extra operand.
* config.gcc (spu-*-elf*): Use spu-cxx.o for cxx_target_objs. * config/spu/spu-protos.h (struct cpp_reader): Forward declaration. (spu_expand_epilogue) Use bool. * config/spu/spu-c.c [CC1PLUS]: Include cp/cp-tree.h instead of c-tree.h. [!CC1PLUS]: Define same_type_p. (spu_resolve_overloaded_builtin): Insert enum casts. Use same_type_p. * config/spu/t-spu-elf (spu-c.o): Depend on $(C_TREE_H). Use $(CXXX) to build. (spu-cxx.o): New rule. * config/spu/spu.c (spu_scalar_mode_supported_p): Declare with bool. (spu_vector_mode_supported_p, spu_handle_fndecl_attribute): Likewise. (spu_handle_vector_attribute, spu_pass_by_reference): Likewise. (spu_rtx_costs, spu_function_ok_for_sibcall): Likewise. (spu_attribute_table): Declare extern. (spu_emit_branch_or_set): Fix type and scope of ior_code. (spu_expand_prologue): Use alloc_reg_note. (expand_builtin_args): Use EXPAND_NORMAL instead of 0. * config/spu/spu.c: Include multi-target.h. Add START_TARGET_SPECIFIC / END_TARGET_SPECIFIC markers. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/arc-milepost-branch@147742 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.ARC4
-rw-r--r--gcc/ChangeLog.cxx21
-rw-r--r--gcc/ChangeLog.multi-target5
-rw-r--r--gcc/config.gcc2
-rw-r--r--gcc/config/spu/spu-c.c17
-rw-r--r--gcc/config/spu/spu-protos.h3
-rw-r--r--gcc/config/spu/spu.c35
-rw-r--r--gcc/config/spu/spu.md3
-rw-r--r--gcc/config/spu/t-spu-elf15
9 files changed, 79 insertions, 26 deletions
diff --git a/gcc/ChangeLog.ARC b/gcc/ChangeLog.ARC
index dac24b46a4c..ca1c85aa4f9 100644
--- a/gcc/ChangeLog.ARC
+++ b/gcc/ChangeLog.ARC
@@ -1,3 +1,7 @@
+2009-05-20 J"orn Rennecke <joern.rennecke@arc.com>
+
+ * config/spu/spu.md (doloop_end): Accept extra operand.
+
2009-05-13 J"orn Rennecke <joern.rennecke@arc.com>
* config/mxp/mxp-genregset.c (emit_regsets): Emit REG_ALLOC_ORDER
diff --git a/gcc/ChangeLog.cxx b/gcc/ChangeLog.cxx
index bd8f7133f40..8c399a6b5fb 100644
--- a/gcc/ChangeLog.cxx
+++ b/gcc/ChangeLog.cxx
@@ -1,3 +1,24 @@
+2009-05-20 J"orn Rennecke <joern.rennecke@arc.com>
+
+ * config.gcc (spu-*-elf*): Use spu-cxx.o for cxx_target_objs.
+ * config/spu/spu-protos.h (struct cpp_reader): Forward declaration.
+ (spu_expand_epilogue) Use bool.
+ * config/spu/spu-c.c [CC1PLUS]: Include cp/cp-tree.h instead of
+ c-tree.h.
+ [!CC1PLUS]: Define same_type_p.
+ (spu_resolve_overloaded_builtin): Insert enum casts. Use same_type_p.
+ * config/spu/t-spu-elf (spu-c.o): Depend on $(C_TREE_H).
+ Use $(CXXX) to build.
+ (spu-cxx.o): New rule.
+ * config/spu/spu.c (spu_scalar_mode_supported_p): Declare with bool.
+ (spu_vector_mode_supported_p, spu_handle_fndecl_attribute): Likewise.
+ (spu_handle_vector_attribute, spu_pass_by_reference): Likewise.
+ (spu_rtx_costs, spu_function_ok_for_sibcall): Likewise.
+ (spu_attribute_table): Declare extern.
+ (spu_emit_branch_or_set): Fix type and scope of ior_code.
+ (spu_expand_prologue): Use alloc_reg_note.
+ (expand_builtin_args): Use EXPAND_NORMAL instead of 0.
+
2009-05-01 J"orn Rennecke <joern.rennecke@arc.com>
* var-tracking.c: Include tm_p.h .
diff --git a/gcc/ChangeLog.multi-target b/gcc/ChangeLog.multi-target
index 049f4441f52..226c6d038cc 100644
--- a/gcc/ChangeLog.multi-target
+++ b/gcc/ChangeLog.multi-target
@@ -1,3 +1,8 @@
+2009-05-20 J"orn Rennecke <joern.rennecke@arc.com>
+
+ * config/spu/spu.c: Include multi-target.h.
+ Add START_TARGET_SPECIFIC / END_TARGET_SPECIFIC markers.
+
2009-05-19 J"orn Rennecke <joern.rennecke@arc.com>
* optabs.c (optab_for_tree_code_array): New array.
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 5a3ca8bae2d..a62c7a03c0c 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2343,7 +2343,7 @@ spu-*-elf*)
extra_headers="spu_intrinsics.h spu_internals.h vmx2spu.h spu_mfcio.h vec_types.h"
extra_modes=spu/spu-modes.def
c_target_objs="${c_target_objs} spu-c.o"
- cxx_target_objs="${cxx_target_objs} spu-c.o"
+ cxx_target_objs="${cxx_target_objs} spu-cxx.o"
;;
v850e1-*-*)
target_cpu_default="TARGET_CPU_v850e1"
diff --git a/gcc/config/spu/spu-c.c b/gcc/config/spu/spu-c.c
index 7db0bfb83ad..88715d0a8d4 100644
--- a/gcc/config/spu/spu-c.c
+++ b/gcc/config/spu/spu-c.c
@@ -20,7 +20,13 @@
#include "tm.h"
#include "cpplib.h"
#include "tree.h"
+#ifdef CC1PLUS
+#include "cp/cp-tree.h"
+#else /* !CC1PLUS */
#include "c-tree.h"
+#define same_type_p(TYPE1, TYPE2) \
+ comptypes ((TYPE1), (TYPE2))
+#endif /* !CC1PLUS */
#include "c-pragma.h"
#include "function.h"
#include "rtl.h"
@@ -102,7 +108,7 @@ spu_resolve_overloaded_builtin (tree fndecl, tree fnargs)
|| SCALAR_FLOAT_TYPE_P (t) \
|| POINTER_TYPE_P (t))
spu_function_code new_fcode, fcode =
- DECL_FUNCTION_CODE (fndecl) - END_BUILTINS;
+ (spu_function_code) (DECL_FUNCTION_CODE (fndecl) - END_BUILTINS);
struct spu_builtin_description *desc;
tree match = NULL_TREE;
@@ -116,8 +122,9 @@ spu_resolve_overloaded_builtin (tree fndecl, tree fnargs)
/* Compare the signature of each internal builtin function with the
function arguments until a match is found. */
- for (new_fcode = fcode + 1; spu_builtins[new_fcode].type == B_INTERNAL;
- new_fcode++)
+ for (new_fcode = (spu_function_code) (fcode + 1);
+ spu_builtins[new_fcode].type == B_INTERNAL;
+ new_fcode = (spu_function_code) (new_fcode + 1))
{
tree decl = spu_builtins[new_fcode].fndecl;
tree params = TYPE_ARG_TYPES (TREE_TYPE (decl));
@@ -159,8 +166,8 @@ spu_resolve_overloaded_builtin (tree fndecl, tree fnargs)
|| fcode == SPU_HCMPEQ || fcode == SPU_HCMPGT
|| fcode == SPU_MASKB || fcode == SPU_MASKH
|| fcode == SPU_MASKW) && p == 0))
- && !comptypes (TYPE_MAIN_VARIANT (param_type),
- TYPE_MAIN_VARIANT (arg_type)))
+ && !same_type_p (TYPE_MAIN_VARIANT (param_type),
+ TYPE_MAIN_VARIANT (arg_type)))
break;
}
if (param == void_list_node)
diff --git a/gcc/config/spu/spu-protos.h b/gcc/config/spu/spu-protos.h
index 48ec9697237..77492f43c59 100644
--- a/gcc/config/spu/spu-protos.h
+++ b/gcc/config/spu/spu-protos.h
@@ -19,6 +19,7 @@
#include "rtl.h"
+struct cpp_reader;
extern void spu_cpu_cpp_builtins (struct cpp_reader * pfile);
extern void builtin_define_std (const char *);
extern void spu_optimization_options (int level, int size);
@@ -39,7 +40,7 @@ extern int spu_split_immediate (rtx * ops);
extern int spu_saved_regs_size (void);
extern int direct_return (void);
extern void spu_expand_prologue (void);
-extern void spu_expand_epilogue (unsigned char sibcall_p);
+extern void spu_expand_epilogue (bool sibcall_p);
extern rtx spu_return_addr (int count, rtx frame);
extern rtx spu_const (enum machine_mode mode, HOST_WIDE_INT val);
extern rtx spu_const_from_ints (enum machine_mode mode,
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 6e0001b0a05..0b4d5be63ef 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -57,6 +57,9 @@
#include "sbitmap.h"
#include "timevar.h"
#include "df.h"
+#include "multi-target.h"
+
+START_TARGET_SPECIFIC
/* Builtin types, data and prototypes. */
struct spu_builtin_range
@@ -85,8 +88,8 @@ char regs_ever_allocated[FIRST_PSEUDO_REGISTER];
/* Prototypes and external defs. */
static void spu_init_builtins (void);
-static unsigned char spu_scalar_mode_supported_p (enum machine_mode mode);
-static unsigned char spu_vector_mode_supported_p (enum machine_mode mode);
+static bool spu_scalar_mode_supported_p (enum machine_mode mode);
+static bool spu_vector_mode_supported_p (enum machine_mode mode);
static rtx adjust_operand (rtx op, HOST_WIDE_INT * start);
static rtx get_pic_reg (void);
static int need_to_save_reg (int regno, int saving);
@@ -111,14 +114,12 @@ static void spu_sched_init_global (FILE *, int, int);
static void spu_sched_init (FILE *, int, int);
static int spu_sched_reorder (FILE *, int, rtx *, int *, int);
static tree spu_handle_fndecl_attribute (tree * node, tree name, tree args,
- int flags,
- unsigned char *no_add_attrs);
+ int flags, bool *no_add_attrs);
static tree spu_handle_vector_attribute (tree * node, tree name, tree args,
- int flags,
- unsigned char *no_add_attrs);
+ int flags, bool *no_add_attrs);
static int spu_naked_function_p (tree func);
-static unsigned char spu_pass_by_reference (CUMULATIVE_ARGS *cum, enum machine_mode mode,
- const_tree type, unsigned char named);
+static bool spu_pass_by_reference (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ const_tree type, bool named);
static tree spu_build_builtin_va_list (void);
static void spu_va_start (tree, rtx);
static tree spu_gimplify_va_arg_expr (tree valist, tree type,
@@ -128,9 +129,9 @@ static int store_with_one_insn_p (rtx mem);
static int mem_is_padded_component_ref (rtx x);
static bool spu_assemble_integer (rtx x, unsigned int size, int aligned_p);
static void spu_asm_globalize_label (FILE * file, const char *name);
-static unsigned char spu_rtx_costs (rtx x, int code, int outer_code,
+static bool spu_rtx_costs (rtx x, int code, int outer_code,
int *total, bool speed);
-static unsigned char spu_function_ok_for_sibcall (tree decl, tree exp);
+static bool spu_function_ok_for_sibcall (tree decl, tree exp);
static void spu_init_libfuncs (void);
static bool spu_return_in_memory (const_tree type, const_tree fntype);
static void fix_range (const char *);
@@ -248,7 +249,7 @@ tree spu_builtin_types[SPU_BTI_MAX];
#undef TARGET_SCHED_ADJUST_COST
#define TARGET_SCHED_ADJUST_COST spu_sched_adjust_cost
-const struct attribute_spec spu_attribute_table[];
+extern const struct attribute_spec spu_attribute_table[];
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE spu_attribute_table
@@ -786,7 +787,7 @@ spu_emit_branch_or_set (int is_set, enum rtx_code code, rtx operands[])
rtx target = operands[0];
enum machine_mode comp_mode;
enum machine_mode op_mode;
- enum spu_comp_code scode, eq_code, ior_code;
+ enum spu_comp_code scode, eq_code;
int index;
int eq_test = 0;
@@ -986,6 +987,8 @@ spu_emit_branch_or_set (int is_set, enum rtx_code code, rtx operands[])
if (eq_test)
{
+ enum insn_code ior_code;
+
eq_result = gen_reg_rtx (comp_mode);
eq_rtx = GEN_FCN (spu_comp_icode[index][eq_code]) (eq_result,
spu_compare_op0,
@@ -1893,7 +1896,7 @@ spu_expand_prologue (void)
RTX_FRAME_RELATED_P (insn) = 1;
real = gen_addsi3 (sp_reg, sp_reg, GEN_INT (-total_size));
REG_NOTES (insn) =
- gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, real, REG_NOTES (insn));
+ alloc_reg_note (REG_FRAME_RELATED_EXPR, real, REG_NOTES (insn));
if (total_size > 2000)
{
@@ -1911,8 +1914,7 @@ spu_expand_prologue (void)
RTX_FRAME_RELATED_P (insn) = 1;
real = gen_addsi3 (fp_reg, sp_reg, GEN_INT (fp_offset));
REG_NOTES (insn) =
- gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
- real, REG_NOTES (insn));
+ alloc_reg_note (REG_FRAME_RELATED_EXPR, real, REG_NOTES (insn));
REGNO_POINTER_ALIGN (HARD_FRAME_POINTER_REGNUM) = STACK_BOUNDARY;
}
}
@@ -5898,7 +5900,7 @@ expand_builtin_args (struct spu_builtin_description *d, tree exp,
tree arg = CALL_EXPR_ARG (exp, a);
if (arg == 0)
abort ();
- ops[i] = expand_expr (arg, NULL_RTX, VOIDmode, 0);
+ ops[i] = expand_expr (arg, NULL_RTX, VOIDmode, EXPAND_NORMAL);
}
/* The insn pattern may have additional operands (SCRATCH).
@@ -6298,3 +6300,4 @@ spu_section_type_flags (tree decl, const char *name, int reloc)
return default_section_type_flags (decl, name, reloc);
}
+END_TARGET_SPECIFIC
diff --git a/gcc/config/spu/spu.md b/gcc/config/spu/spu.md
index 1dccfcff66a..4c9ff751935 100644
--- a/gcc/config/spu/spu.md
+++ b/gcc/config/spu/spu.md
@@ -4322,7 +4322,8 @@ selb\t%0,%4,%0,%3"
(use (match_operand 1 "" "")) ; iterations; zero if unknown
(use (match_operand 2 "" "")) ; max iterations
(use (match_operand 3 "" "")) ; loop level
- (use (match_operand 4 "" ""))] ; label
+ (use (match_operand 4 "" "")) ; label
+ (match_operand 5 "" "")]
""
"
{
diff --git a/gcc/config/spu/t-spu-elf b/gcc/config/spu/t-spu-elf
index f8c5ba5b01d..959994e6f2f 100644
--- a/gcc/config/spu/t-spu-elf
+++ b/gcc/config/spu/t-spu-elf
@@ -92,7 +92,18 @@ spu-c.o: $(srcdir)/config/spu/spu-c.c \
$(srcdir)/config/spu/spu-protos.h \
$(srcdir)/config/spu/spu-builtins.h \
$(srcdir)/config/spu/spu-builtins.def \
- $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(CPPLIB_H) \
+ $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(CPPLIB_H) $(C_TREE_H) \
$(TM_P_H) c-pragma.h errors.h coretypes.h $(TM_H) insn-codes.h
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/spu/spu-c.c
+ $(CXXX) $(INCLUDES) $(srcdir)/config/spu/spu-c.c
+spu-cxx.o: $(srcdir)/config/spu/spu-c.c \
+ $(srcdir)/config/spu/spu-protos.h \
+ $(srcdir)/config/spu/spu-builtins.h \
+ $(srcdir)/config/spu/spu-builtins.def \
+ $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) \
+ $(TREE_H) cp/name-lookup.h cp/cp-tree.h $(C_COMMON_H) \
+ c-common.def $(FUNCTION_H) $(VARRAY_H) \
+ $(SYSTEM_H) coretypes.h $(TARGET_H) $(GGC_H) \
+ $(srcdir)/../include/hashtab.h $(srcdir)/../include/splay-tree.h \
+ $(TM_P_H) c-pragma.h errors.h coretypes.h $(TM_H) insn-codes.h
+ $(CXXX) $(INCLUDES) $(srcdir)/config/spu/spu-c.c -DCC1PLUS -o $@