aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorJayant Sonar <jayants@kpitcummins.com>2007-05-07 23:13:15 +0000
committerDJ Delorie <dj@redhat.com>2007-05-07 23:13:15 +0000
commitff38bd7380c68f40cbe30f7c2a0ef977971574b8 (patch)
treeb4d7248e78a4d9cbf0ccb466af301868b241de83 /gcc/doc
parentf795b7557d2dd34e961dc6c90055072ad93f201e (diff)
* 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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@124523 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi36
1 files changed, 35 insertions, 1 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 45a632493de..1069892a50c 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