You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
165 lines
8.3 KiB
HTML
165 lines
8.3 KiB
HTML
4 years ago
|
<html lang="en">
|
||
|
<head>
|
||
|
<title>Dispatch Tables - GNU Compiler Collection (GCC) Internals</title>
|
||
|
<meta http-equiv="Content-Type" content="text/html">
|
||
|
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||
|
<meta name="generator" content="makeinfo 4.13">
|
||
|
<link title="Top" rel="start" href="index.html#Top">
|
||
|
<link rel="up" href="Assembler-Format.html#Assembler-Format" title="Assembler Format">
|
||
|
<link rel="prev" href="Instruction-Output.html#Instruction-Output" title="Instruction Output">
|
||
|
<link rel="next" href="Exception-Region-Output.html#Exception-Region-Output" title="Exception Region Output">
|
||
|
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||
|
<!--
|
||
|
Copyright (C) 1988-2015 Free Software Foundation, Inc.
|
||
|
|
||
|
Permission is granted to copy, distribute and/or modify this document
|
||
|
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||
|
any later version published by the Free Software Foundation; with the
|
||
|
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||
|
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||
|
(see below). A copy of the license is included in the section entitled
|
||
|
``GNU Free Documentation License''.
|
||
|
|
||
|
(a) The FSF's Front-Cover Text is:
|
||
|
|
||
|
A GNU Manual
|
||
|
|
||
|
(b) The FSF's Back-Cover Text is:
|
||
|
|
||
|
You have freedom to copy and modify this GNU Manual, like GNU
|
||
|
software. Copies published by the Free Software Foundation raise
|
||
|
funds for GNU development.-->
|
||
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||
|
<style type="text/css"><!--
|
||
|
pre.display { font-family:inherit }
|
||
|
pre.format { font-family:inherit }
|
||
|
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||
|
pre.smallformat { font-family:inherit; font-size:smaller }
|
||
|
pre.smallexample { font-size:smaller }
|
||
|
pre.smalllisp { font-size:smaller }
|
||
|
span.sc { font-variant:small-caps }
|
||
|
span.roman { font-family:serif; font-weight:normal; }
|
||
|
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||
|
--></style>
|
||
|
</head>
|
||
|
<body>
|
||
|
<div class="node">
|
||
|
<a name="Dispatch-Tables"></a>
|
||
|
<p>
|
||
|
Next: <a rel="next" accesskey="n" href="Exception-Region-Output.html#Exception-Region-Output">Exception Region Output</a>,
|
||
|
Previous: <a rel="previous" accesskey="p" href="Instruction-Output.html#Instruction-Output">Instruction Output</a>,
|
||
|
Up: <a rel="up" accesskey="u" href="Assembler-Format.html#Assembler-Format">Assembler Format</a>
|
||
|
<hr>
|
||
|
</div>
|
||
|
|
||
|
<h4 class="subsection">17.20.8 Output of Dispatch Tables</h4>
|
||
|
|
||
|
<!-- prevent bad page break with this line -->
|
||
|
<p>This concerns dispatch tables.
|
||
|
|
||
|
<p><a name="index-dispatch-table-4711"></a>
|
||
|
|
||
|
<div class="defun">
|
||
|
— Macro: <b>ASM_OUTPUT_ADDR_DIFF_ELT</b> (<var>stream, body, value, rel</var>)<var><a name="index-ASM_005fOUTPUT_005fADDR_005fDIFF_005fELT-4712"></a></var><br>
|
||
|
<blockquote><p>A C statement to output to the stdio stream <var>stream</var> an assembler
|
||
|
pseudo-instruction to generate a difference between two labels.
|
||
|
<var>value</var> and <var>rel</var> are the numbers of two internal labels. The
|
||
|
definitions of these labels are output using
|
||
|
<code>(*targetm.asm_out.internal_label)</code>, and they must be printed in the same
|
||
|
way here. For example,
|
||
|
|
||
|
<pre class="smallexample"> fprintf (<var>stream</var>, "\t.word L%d-L%d\n",
|
||
|
<var>value</var>, <var>rel</var>)
|
||
|
</pre>
|
||
|
<p>You must provide this macro on machines where the addresses in a
|
||
|
dispatch table are relative to the table's own address. If defined, GCC
|
||
|
will also use this macro on all machines when producing PIC.
|
||
|
<var>body</var> is the body of the <code>ADDR_DIFF_VEC</code>; it is provided so that the
|
||
|
mode and flags can be read.
|
||
|
</p></blockquote></div>
|
||
|
|
||
|
<div class="defun">
|
||
|
— Macro: <b>ASM_OUTPUT_ADDR_VEC_ELT</b> (<var>stream, value</var>)<var><a name="index-ASM_005fOUTPUT_005fADDR_005fVEC_005fELT-4713"></a></var><br>
|
||
|
<blockquote><p>This macro should be provided on machines where the addresses
|
||
|
in a dispatch table are absolute.
|
||
|
|
||
|
<p>The definition should be a C statement to output to the stdio stream
|
||
|
<var>stream</var> an assembler pseudo-instruction to generate a reference to
|
||
|
a label. <var>value</var> is the number of an internal label whose
|
||
|
definition is output using <code>(*targetm.asm_out.internal_label)</code>.
|
||
|
For example,
|
||
|
|
||
|
<pre class="smallexample"> fprintf (<var>stream</var>, "\t.word L%d\n", <var>value</var>)
|
||
|
</pre>
|
||
|
</blockquote></div>
|
||
|
|
||
|
<div class="defun">
|
||
|
— Macro: <b>ASM_OUTPUT_CASE_LABEL</b> (<var>stream, prefix, num, table</var>)<var><a name="index-ASM_005fOUTPUT_005fCASE_005fLABEL-4714"></a></var><br>
|
||
|
<blockquote><p>Define this if the label before a jump-table needs to be output
|
||
|
specially. The first three arguments are the same as for
|
||
|
<code>(*targetm.asm_out.internal_label)</code>; the fourth argument is the
|
||
|
jump-table which follows (a <code>jump_table_data</code> containing an
|
||
|
<code>addr_vec</code> or <code>addr_diff_vec</code>).
|
||
|
|
||
|
<p>This feature is used on system V to output a <code>swbeg</code> statement
|
||
|
for the table.
|
||
|
|
||
|
<p>If this macro is not defined, these labels are output with
|
||
|
<code>(*targetm.asm_out.internal_label)</code>.
|
||
|
</p></blockquote></div>
|
||
|
|
||
|
<div class="defun">
|
||
|
— Macro: <b>ASM_OUTPUT_CASE_END</b> (<var>stream, num, table</var>)<var><a name="index-ASM_005fOUTPUT_005fCASE_005fEND-4715"></a></var><br>
|
||
|
<blockquote><p>Define this if something special must be output at the end of a
|
||
|
jump-table. The definition should be a C statement to be executed
|
||
|
after the assembler code for the table is written. It should write
|
||
|
the appropriate code to stdio stream <var>stream</var>. The argument
|
||
|
<var>table</var> is the jump-table insn, and <var>num</var> is the label-number
|
||
|
of the preceding label.
|
||
|
|
||
|
<p>If this macro is not defined, nothing special is output at the end of
|
||
|
the jump-table.
|
||
|
</p></blockquote></div>
|
||
|
|
||
|
<div class="defun">
|
||
|
— Target Hook: void <b>TARGET_ASM_EMIT_UNWIND_LABEL</b> (<var>FILE *stream, tree decl, int for_eh, int empty</var>)<var><a name="index-TARGET_005fASM_005fEMIT_005fUNWIND_005fLABEL-4716"></a></var><br>
|
||
|
<blockquote><p>This target hook emits a label at the beginning of each FDE. It
|
||
|
should be defined on targets where FDEs need special labels, and it
|
||
|
should write the appropriate label, for the FDE associated with the
|
||
|
function declaration <var>decl</var>, to the stdio stream <var>stream</var>.
|
||
|
The third argument, <var>for_eh</var>, is a boolean: true if this is for an
|
||
|
exception table. The fourth argument, <var>empty</var>, is a boolean:
|
||
|
true if this is a placeholder label for an omitted FDE.
|
||
|
|
||
|
<p>The default is that FDEs are not given nonlocal labels.
|
||
|
</p></blockquote></div>
|
||
|
|
||
|
<div class="defun">
|
||
|
— Target Hook: void <b>TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL</b> (<var>FILE *stream</var>)<var><a name="index-TARGET_005fASM_005fEMIT_005fEXCEPT_005fTABLE_005fLABEL-4717"></a></var><br>
|
||
|
<blockquote><p>This target hook emits a label at the beginning of the exception table.
|
||
|
It should be defined on targets where it is desirable for the table
|
||
|
to be broken up according to function.
|
||
|
|
||
|
<p>The default is that no label is emitted.
|
||
|
</p></blockquote></div>
|
||
|
|
||
|
<div class="defun">
|
||
|
— Target Hook: void <b>TARGET_ASM_EMIT_EXCEPT_PERSONALITY</b> (<var>rtx personality</var>)<var><a name="index-TARGET_005fASM_005fEMIT_005fEXCEPT_005fPERSONALITY-4718"></a></var><br>
|
||
|
<blockquote><p>If the target implements <code>TARGET_ASM_UNWIND_EMIT</code>, this hook may be used to emit a directive to install a personality hook into the unwind info. This hook should not be used if dwarf2 unwind info is used.
|
||
|
</p></blockquote></div>
|
||
|
|
||
|
<div class="defun">
|
||
|
— Target Hook: void <b>TARGET_ASM_UNWIND_EMIT</b> (<var>FILE *stream, rtx_insn *insn</var>)<var><a name="index-TARGET_005fASM_005fUNWIND_005fEMIT-4719"></a></var><br>
|
||
|
<blockquote><p>This target hook emits assembly directives required to unwind the
|
||
|
given instruction. This is only used when <code>TARGET_EXCEPT_UNWIND_INFO</code>
|
||
|
returns <code>UI_TARGET</code>.
|
||
|
</p></blockquote></div>
|
||
|
|
||
|
<div class="defun">
|
||
|
— Target Hook: bool <b>TARGET_ASM_UNWIND_EMIT_BEFORE_INSN</b><var><a name="index-TARGET_005fASM_005fUNWIND_005fEMIT_005fBEFORE_005fINSN-4720"></a></var><br>
|
||
|
<blockquote><p>True if the <code>TARGET_ASM_UNWIND_EMIT</code> hook should be called before the assembly for <var>insn</var> has been emitted, false if the hook should be called afterward.
|
||
|
</p></blockquote></div>
|
||
|
|
||
|
</body></html>
|
||
|
|