diff options
author | Jayant Sonar <jayants@kpitcummins.com> | 2007-05-07 23:13:15 +0000 |
---|---|---|
committer | DJ Delorie <dj@gcc.gnu.org> | 2007-05-07 19:13:15 -0400 |
commit | 5abd2125f012351411df08f07918667ce3e418a9 (patch) | |
tree | b4d7248e78a4d9cbf0ccb466af301868b241de83 /gcc/doc/extend.texi | |
parent | 04055200edcb139e4be7088107191b7a1a9089fa (diff) | |
download | gcc-5abd2125f012351411df08f07918667ce3e418a9.zip gcc-5abd2125f012351411df08f07918667ce3e418a9.tar.gz gcc-5abd2125f012351411df08f07918667ce3e418a9.tar.bz2 |
m32c.c (SYMBOL_FLAG_FUNCVEC_FUNCTION): Define.
* config/m32c/m32c.c (SYMBOL_FLAG_FUNCVEC_FUNCTION): Define.
(TARGET_ENCODE_SECTION_INFO): Re-define.
(m32c_encode_section_info): New
(function_vector_handler): New
(current_function_special_page_vector): New
(m32c_special_page_vector_p): New.
* config/m32c/m32c-protos.h (m32c_special_page_vector_p):
Prototype.
* config/m32c/jump.md: Added instruction JSRS for functions
with attribute "function_vector".
* doc/extend.texi (function_vector): Added description
for M16C, M32C targets.
From-SVN: r124523
Diffstat (limited to 'gcc/doc/extend.texi')
-rw-r--r-- | gcc/doc/extend.texi | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 45a6324..1069892 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -1972,7 +1972,7 @@ is used. @xref{C Dialect Options,,Options Controlling C Dialect}. @item function_vector -@cindex calling functions through the function vector on the H8/300 processors +@cindex calling functions through the function vector on H8/300, M16C, and M32C 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; @@ -1982,6 +1982,40 @@ and 64 entries on the H8/300H and H8S) and shares space with the interrupt vecto You must use GAS and GLD from GNU binutils version 2.7 or later for this attribute to work correctly. +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 +subroutine. The argument to the attribute is the vector number entry +from the special page vector table which contains the 16 low-order +bits of the subroutine's entry address. Each vector table has special +page number (18 to 255) which are used in @code{jsrs} instruction. +Jump addresses of the routines are generated by adding 0x0F0000 (in +case of M16C targets) or 0xFF0000 (in case of M32C targets), to the 2 +byte addresses set in the vector table. Therefore you need to ensure +that all the special page vector routines should get mapped within the +address range 0x0F0000 to 0x0FFFFF (for M16C) and 0xFF0000 to 0xFFFFFF +(for M32C). + +In the following example 2 bytes will be saved for each call to +function @code{foo}. + +@smallexample +void foo (void) __attribute__((function_vector(0x18))); +void foo (void) +@{ +@} + +void bar (void) +@{ + foo(); +@} +@end smallexample + +If functions are defined in one file and are called in another file, +then be sure to write this declaration in both files. + +This attribute is ignored for R8C target. + @item interrupt @cindex interrupt handler functions Use this attribute on the ARM, AVR, C4x, CRX, M32C, M32R/D, MS1, and Xstormy16 |