Commit 188b7e23 by Joern Rennecke Committed by Joern Rennecke

epiphany-protos.h (epiphany_start_function): Declare.

gcc:
        * 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.
gcc/testsuite:
        * gcc.target/epiphany/interrupt.c: Add dg-options "-g".
        Add a scan-assembler-time clause to test for the interupt vector jump.
        (f): Rename to ...
        (dma0_handler): ... this.

From-SVN: r182187
parent b149e5a2
......@@ -9,6 +9,25 @@
(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
......@@ -53,3 +53,4 @@ extern bool epiphany_optimize_mode_switching (int entity);
extern bool epiphany_is_interrupt_p (tree);
extern unsigned epiphany_special_round_type_align (tree, unsigned, unsigned);
extern unsigned epiphany_adjust_field_align (tree, unsigned);
extern void epiphany_start_function (FILE *f, const char *name, tree decl);
......@@ -435,14 +435,17 @@ epiphany_handle_interrupt_attribute (tree *node ATTRIBUTE_UNUSED,
}
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;
}
......@@ -892,14 +895,20 @@ epiphany_compute_function_type (tree decl)
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
......@@ -1812,14 +1821,14 @@ epiphany_expand_epilogue (int sibcall_p)
}
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);
......@@ -2748,4 +2757,28 @@ epiphany_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
}
}
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;
......@@ -831,14 +831,12 @@ do { if ((LOG) != 0) fprintf (FILE, "\t.balign %d\n", 1 << (LOG)); } while (0)
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
};
......@@ -895,4 +893,8 @@ extern struct rtl_opt_pass pass_resolve_sw_modes;
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 */
2011-12-10 Joern Rennecke <joern.rennecke@embecosm.com>
* gcc.target/epiphany/interrupt.c: Add dg-options "-g".
Add a scan-assembler-time clause to test for the interupt vector jump.
(f): Rename to ...
(dma0_handler): ... this.
2011-12-10 Nathan Sidwell <nathan@acm.org>
PR gcov-profile/51449
......
/* { dg-options "-g" } */
void __attribute__((interrupt("dma0")))
f (void)
dma0_handler (void)
{
}
......@@ -12,3 +14,5 @@ void __attribute__((interrupt(42)))
h (void)
{ /* { dg-warning "is not a string constant" } */
}
/* { dg-final { scan-assembler-times "b\[ \t\]*_dma0_handler" 1 } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment