diff options
author | Anil Paranjape <anil.paranjape@kpitcummins.com> | 2008-03-25 13:32:13 +0000 |
---|---|---|
committer | Kaz Kojima <kkojima@gcc.gnu.org> | 2008-03-25 13:32:13 +0000 |
commit | 561642fa67798158762265f5100e3052275fe970 (patch) | |
tree | 9d545fbf7312945f348908340895704e9ccd4110 /gcc/doc | |
parent | 53b308f61e96c47b54abf5c7db2e9831cbc43e66 (diff) | |
download | gcc-561642fa67798158762265f5100e3052275fe970.zip gcc-561642fa67798158762265f5100e3052275fe970.tar.gz gcc-561642fa67798158762265f5100e3052275fe970.tar.bz2 |
sh.c (SH_ATTRIBUTES): Define.
* config/sh/sh.c (SH_ATTRIBUTES): Define.
(SYMBOL_FLAG_FUNCVEC_FUNCTION): Define.
(print_operand): Handle resbank in %@ operand code.
(sh_encode_section_info): New.
(push_regs): Add conditions for resbank.
(sh_expand_epilogue): Likewise.
(sh_insert_attributes): Likewise.
(sh_attribute_table): Likewise.
(sh_handle_resbank_handler_attribute): New.
(sh2a_handle_function_vector_handler_attribute): New.
(sh2a_is_function_vector_call): New.
(sh2a_get_function_vector_number): New.
(sh2a_function_vector_p): New.
(sh_cfun_resbank_handler_p): New.
* config/sh/sh.md (calli): Emit jsr/n if possible.
(calli_tbr_rel): New.
(calli_pcrel): Emit jsr/n if possible.
(return_i): Emit rts/n if possible.
(call_valuei_tbr_rel): New.
(call_valuei_pcrel): Add condition for SH2A target.
(call_value): Likewise.
* config/sh/sh-protos.h (sh_cfun_resbank_handler_p): Declare.
(sh2a_get_function_vector_number): Likewise.
(sh2a_is_function_vector_call): Likewise.
* doc/extend.texi: Document TBR relative addressing of SH2A.
(resbank): Add description for SH2A.
* gcc.target/sh/sh2a-resbank.c: New test.
* gcc.target/sh/sh2a-tbr-jump.c: New test.
* gcc.target/sh/sh2a-jsrn.c: New test.
* gcc.target/sh/sh2a-rtsn.c: New test.
Co-Authored-By: Jayant R Sonar <jayant.sonar@kpitcummins.com>
Co-Authored-By: Naveen.H.S <naveen.hs@kpitcummins.com>
From-SVN: r133513
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/extend.texi | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index b28d9df..1fa7fc2 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -2299,16 +2299,33 @@ is used. @xref{C Dialect Options,,Options Controlling C Dialect}. @item function_vector -@cindex calling functions through the function vector on H8/300, M16C, and M32C processors +@cindex calling functions through the function vector on H8/300, M16C, M32C and SH2A processors Use this attribute on the H8/300, H8/300H, and H8S to indicate that the specified function should be called through the function vector. Calling a function through the function vector will reduce code size, however; the function vector has a limited size (maximum 128 entries on the H8/300 and 64 entries on the H8/300H and H8S) and shares space with the interrupt vector. +In SH2A target, this attribute declares a function to be called using the +TBR relative addressing mode. The argument to this attribute is the entry +number of the same function in a vector table containing all the TBR +relative addressable functions. For the successful jump, register TBR +should contain the start address of this TBR relative vector table. +In the startup routine of the user application, user needs to care of this +TBR register initialization. The TBR relative vector table can have at +max 256 function entries. The jumps to these functions will be generated +using a SH2A specific, non delayed branch instruction JSR/N @@(disp8,TBR). You must use GAS and GLD from GNU binutils version 2.7 or later for this attribute to work correctly. +Please refer the example of M16C target, to see the use of this +attribute while declaring a function, + +In an application, for a function being called once, this attribute will +save at least 8 bytes of code; and if other successive calls are being +made to the same function, it will save 2 bytes of code per each of these +calls. + On M16C/M32C targets, the @code{function_vector} attribute declares a special page subroutine call function. Use of this attribute reduces the code size by 2 bytes for each call generated to the @@ -2722,6 +2739,19 @@ number of registers available if used in conjunction with the attribute is incompatible with nested functions; this is considered a hard error. +@item resbank +@cindex @code{resbank} attribute +On the SH2A target, this attribute enables the high-speed register +saving and restoration using a register bank for @code{interrupt_handler} +routines. Saving to the bank is performed automatcially after the CPU +accepts an interrupt that uses a register bank. + +The nineteen 32-bit registers comprising general register R0 to R14, +control register GBR, and system registers MACH, MACL, and PR and the +vector table address offset are saved into a register bank. Register +banks are stacked in first-in last-out (FILO) sequence. Restoration +from the bank is executed by issuing a RESBANK instruction. + @item returns_twice @cindex @code{returns_twice} attribute The @code{returns_twice} attribute tells the compiler that a function may |