(INCOMING_RETURN_ADDR_RTX) .. this. Use EPIPHANY_RETURN_REGNO.
(DWARF_FRAME_RETURN_COLUMN): New macro.
+ * config/epiphany/epiphany-protos.h (epiphany_start_function): Declare.
+ * config/epiphany/epiphany.c (epiphany_handle_interrupt_attribute):
+ Split "timer" value into "timer0" and "timer1".
+ Handle page_miss, message and wand. Don't handle static_flag.
+ Adjust warning text.
+ (epiphany_start_function): New function.
+ (epiphany_compute_function_type): Split "timer" value into "timer0"
+ and "timer1". Handle page_miss, message and wand.
+ Don't handle static_flag.
+ (epiphany_expand_epilogue): Don't use frame_insn for status / iret
+ restore.
+ * config/epiphany/epiphany.h: ASM_DECLARE_FUNCTION_NAME: Define.
+ (enum epiphany_function_type):
+ Split EPIPHANY_FUNCTION_TIMER value into EPIPHANY_FUNCTION_TIMER0
+ and EPIPHANY_FUNCTION_TIMER1.
+ Remove EPIPHANY_FUNCTION_ILINK1 and EPIPHANY_FUNCTION_ILINK2 values.
+ Add EPIPHANY_FUNCTION_PAGE_MISS and EPIPHANY_FUNCTION_MESSAGE values.
+ Rename EPIPHANY_FUNCTION_STATIC_FLAG to EPIPHANY_FUNCTION_WAND.
+
2011-12-10 Nathan Sidwell <nathan@acm.org>
PR gcov-profile/51449
}
else if (strcmp (TREE_STRING_POINTER (value), "reset")
&& strcmp (TREE_STRING_POINTER (value), "software_exception")
- && strcmp (TREE_STRING_POINTER (value), "timer")
+ && strcmp (TREE_STRING_POINTER (value), "page_miss")
+ && strcmp (TREE_STRING_POINTER (value), "timer0")
+ && strcmp (TREE_STRING_POINTER (value), "timer1")
+ && strcmp (TREE_STRING_POINTER (value), "message")
&& strcmp (TREE_STRING_POINTER (value), "dma0")
&& strcmp (TREE_STRING_POINTER (value), "dma1")
- && strcmp (TREE_STRING_POINTER (value), "static_flag")
+ && strcmp (TREE_STRING_POINTER (value), "wand")
&& strcmp (TREE_STRING_POINTER (value), "swi"))
{
warning (OPT_Wattributes,
- "argument of %qE attribute is not \"reset\", \"software_exception\", \"timer\", \"dma0\", \"dma1\", \"static_flag\" or \"swi\"",
+ "argument of %qE attribute is not \"reset\", \"software_exception\", \"page_miss\", \"timer0\", \"timer1\", \"message\", \"dma0\", \"dma1\", \"wand\" or \"swi\"",
name);
*no_add_attrs = true;
}
fn_type = EPIPHANY_FUNCTION_RESET;
else if (!strcmp (TREE_STRING_POINTER (value), "software_exception"))
fn_type = EPIPHANY_FUNCTION_SOFTWARE_EXCEPTION;
- else if (!strcmp (TREE_STRING_POINTER (value), "timer"))
- fn_type = EPIPHANY_FUNCTION_TIMER;
+ else if (!strcmp (TREE_STRING_POINTER (value), "page_miss"))
+ fn_type = EPIPHANY_FUNCTION_PAGE_MISS;
+ else if (!strcmp (TREE_STRING_POINTER (value), "timer0"))
+ fn_type = EPIPHANY_FUNCTION_TIMER0;
+ else if (!strcmp (TREE_STRING_POINTER (value), "timer1"))
+ fn_type = EPIPHANY_FUNCTION_TIMER1;
+ else if (!strcmp (TREE_STRING_POINTER (value), "message"))
+ fn_type = EPIPHANY_FUNCTION_MESSAGE;
else if (!strcmp (TREE_STRING_POINTER (value), "dma0"))
fn_type = EPIPHANY_FUNCTION_DMA0;
else if (!strcmp (TREE_STRING_POINTER (value), "dma1"))
fn_type = EPIPHANY_FUNCTION_DMA1;
- else if (!strcmp (TREE_STRING_POINTER (value), "static_flag"))
- fn_type = EPIPHANY_FUNCTION_STATIC_FLAG;
+ else if (!strcmp (TREE_STRING_POINTER (value), "wand"))
+ fn_type = EPIPHANY_FUNCTION_WAND;
else if (!strcmp (TREE_STRING_POINTER (value), "swi"))
fn_type = EPIPHANY_FUNCTION_SWI;
else
}
if (interrupt_p)
{
- frame_move_insn (gen_rtx_REG (word_mode, STATUS_REGNUM),
- gen_rtx_REG (SImode, GPR_0));
- frame_move_insn (gen_rtx_REG (word_mode, IRET_REGNUM),
- gen_rtx_REG (SImode, GPR_0+1));
+ emit_move_insn (gen_rtx_REG (word_mode, STATUS_REGNUM),
+ gen_rtx_REG (SImode, GPR_0));
+ emit_move_insn (gen_rtx_REG (word_mode, IRET_REGNUM),
+ gen_rtx_REG (SImode, GPR_0+1));
addr = plus_constant (stack_pointer_rtx,
- (HOST_WIDE_INT) 2 * UNITS_PER_WORD);
- frame_move_insn (gen_rtx_REG (DImode, GPR_0),
- gen_frame_mem (DImode, addr));
+ emit_move_insn (gen_rtx_REG (DImode, GPR_0),
+ gen_frame_mem (DImode, addr));
}
addr = plus_constant (stack_pointer_rtx,
epiphany_stack_offset - (HOST_WIDE_INT) UNITS_PER_WORD);
}
}
+void
+epiphany_start_function (FILE *file, const char *name, tree decl)
+{
+ tree attrs, int_attr;
+
+ attrs = DECL_ATTRIBUTES (decl);
+ int_attr = lookup_attribute ("interrupt", attrs);
+ if (int_attr)
+ {
+ char buf[99];
+ const char *fname;
+
+ int_attr = TREE_VALUE (TREE_VALUE (int_attr));
+ sprintf (buf, "ivt_entry_%.80s", TREE_STRING_POINTER (int_attr));
+ switch_to_section (get_section (buf, SECTION_CODE, decl));
+ fname = XSTR (XEXP (DECL_RTL (decl), 0), 0);
+ fputs ("\tb\t", file);
+ assemble_name (file, fname);
+ fputc ('\n', file);
+ switch_to_section (function_section (decl));
+ }
+ ASM_OUTPUT_FUNCTION_LABEL (file, name, decl);
+}
+
struct gcc_target targetm = TARGET_INITIALIZER;
enum epiphany_function_type
{
EPIPHANY_FUNCTION_UNKNOWN, EPIPHANY_FUNCTION_NORMAL,
- /* These are interrupt handlers. The name corresponds to the register
- name that contains the return address. */
- EPIPHANY_FUNCTION_ILINK1, EPIPHANY_FUNCTION_ILINK2,
/* These are interrupt handlers. The name corresponds to which type
of interrupt handler we're dealing with. */
EPIPHANY_FUNCTION_RESET, EPIPHANY_FUNCTION_SOFTWARE_EXCEPTION,
- EPIPHANY_FUNCTION_TIMER, EPIPHANY_FUNCTION_DMA0,
- EPIPHANY_FUNCTION_DMA1, EPIPHANY_FUNCTION_STATIC_FLAG,
+ EPIPHANY_FUNCTION_PAGE_MISS,
+ EPIPHANY_FUNCTION_TIMER0, EPIPHANY_FUNCTION_TIMER1, EPIPHANY_FUNCTION_MESSAGE,
+ EPIPHANY_FUNCTION_DMA0, EPIPHANY_FUNCTION_DMA1, EPIPHANY_FUNCTION_WAND,
EPIPHANY_FUNCTION_SWI
};
implemented. */
#define TARGET_FUSED_MADD (flag_fp_contract_mode == FP_CONTRACT_FAST)
+#undef ASM_DECLARE_FUNCTION_NAME
+#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
+ epiphany_start_function ((FILE), (NAME), (DECL))
+
#endif /* !GCC_EPIPHANY_H */