xref: /dflybsd-src/contrib/gcc-4.7/gcc/libfuncs.h (revision 04febcfb30580676d3e95f58a16c5137ee478b32)
1*e4b17023SJohn Marino /* Definitions for code generation pass of GNU compiler.
2*e4b17023SJohn Marino    Copyright (C) 2001, 2004, 2007, 2008, 2010 Free Software Foundation, Inc.
3*e4b17023SJohn Marino 
4*e4b17023SJohn Marino This file is part of GCC.
5*e4b17023SJohn Marino 
6*e4b17023SJohn Marino GCC is free software; you can redistribute it and/or modify
7*e4b17023SJohn Marino it under the terms of the GNU General Public License as published by
8*e4b17023SJohn Marino the Free Software Foundation; either version 3, or (at your option)
9*e4b17023SJohn Marino any later version.
10*e4b17023SJohn Marino 
11*e4b17023SJohn Marino GCC is distributed in the hope that it will be useful,
12*e4b17023SJohn Marino but WITHOUT ANY WARRANTY; without even the implied warranty of
13*e4b17023SJohn Marino MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*e4b17023SJohn Marino GNU General Public License for more details.
15*e4b17023SJohn Marino 
16*e4b17023SJohn Marino You should have received a copy of the GNU General Public License
17*e4b17023SJohn Marino along with GCC; see the file COPYING3.  If not see
18*e4b17023SJohn Marino <http://www.gnu.org/licenses/>.  */
19*e4b17023SJohn Marino 
20*e4b17023SJohn Marino #ifndef GCC_LIBFUNCS_H
21*e4b17023SJohn Marino #define GCC_LIBFUNCS_H
22*e4b17023SJohn Marino 
23*e4b17023SJohn Marino #include "hashtab.h"
24*e4b17023SJohn Marino 
25*e4b17023SJohn Marino /* Enumeration of indexes into libfunc_table.  */
26*e4b17023SJohn Marino enum libfunc_index
27*e4b17023SJohn Marino {
28*e4b17023SJohn Marino   LTI_abort,
29*e4b17023SJohn Marino   LTI_memcpy,
30*e4b17023SJohn Marino   LTI_memmove,
31*e4b17023SJohn Marino   LTI_memcmp,
32*e4b17023SJohn Marino   LTI_memset,
33*e4b17023SJohn Marino   LTI_setbits,
34*e4b17023SJohn Marino 
35*e4b17023SJohn Marino   LTI_setjmp,
36*e4b17023SJohn Marino   LTI_longjmp,
37*e4b17023SJohn Marino   LTI_unwind_sjlj_register,
38*e4b17023SJohn Marino   LTI_unwind_sjlj_unregister,
39*e4b17023SJohn Marino 
40*e4b17023SJohn Marino   LTI_profile_function_entry,
41*e4b17023SJohn Marino   LTI_profile_function_exit,
42*e4b17023SJohn Marino 
43*e4b17023SJohn Marino   LTI_synchronize,
44*e4b17023SJohn Marino 
45*e4b17023SJohn Marino   LTI_gcov_flush,
46*e4b17023SJohn Marino 
47*e4b17023SJohn Marino   LTI_MAX
48*e4b17023SJohn Marino };
49*e4b17023SJohn Marino 
50*e4b17023SJohn Marino /* Information about an optab-related libfunc.  We use the same hashtable
51*e4b17023SJohn Marino    for normal optabs and conversion optabs.  In the first case mode2
52*e4b17023SJohn Marino    is unused.  */
53*e4b17023SJohn Marino struct GTY(()) libfunc_entry {
54*e4b17023SJohn Marino   size_t optab;
55*e4b17023SJohn Marino   enum machine_mode mode1, mode2;
56*e4b17023SJohn Marino   rtx libfunc;
57*e4b17023SJohn Marino };
58*e4b17023SJohn Marino 
59*e4b17023SJohn Marino /* Target-dependent globals.  */
60*e4b17023SJohn Marino struct GTY(()) target_libfuncs {
61*e4b17023SJohn Marino   /* SYMBOL_REF rtx's for the library functions that are called
62*e4b17023SJohn Marino      implicitly and not via optabs.  */
63*e4b17023SJohn Marino   rtx x_libfunc_table[LTI_MAX];
64*e4b17023SJohn Marino 
65*e4b17023SJohn Marino   /* Hash table used to convert declarations into nodes.  */
66*e4b17023SJohn Marino   htab_t GTY((param_is (struct libfunc_entry))) x_libfunc_hash;
67*e4b17023SJohn Marino };
68*e4b17023SJohn Marino 
69*e4b17023SJohn Marino extern GTY(()) struct target_libfuncs default_target_libfuncs;
70*e4b17023SJohn Marino #if SWITCHABLE_TARGET
71*e4b17023SJohn Marino extern struct target_libfuncs *this_target_libfuncs;
72*e4b17023SJohn Marino #else
73*e4b17023SJohn Marino #define this_target_libfuncs (&default_target_libfuncs)
74*e4b17023SJohn Marino #endif
75*e4b17023SJohn Marino 
76*e4b17023SJohn Marino #define libfunc_table \
77*e4b17023SJohn Marino   (this_target_libfuncs->x_libfunc_table)
78*e4b17023SJohn Marino 
79*e4b17023SJohn Marino /* Accessor macros for libfunc_table.  */
80*e4b17023SJohn Marino 
81*e4b17023SJohn Marino #define abort_libfunc	(libfunc_table[LTI_abort])
82*e4b17023SJohn Marino #define memcpy_libfunc	(libfunc_table[LTI_memcpy])
83*e4b17023SJohn Marino #define memmove_libfunc	(libfunc_table[LTI_memmove])
84*e4b17023SJohn Marino #define memcmp_libfunc	(libfunc_table[LTI_memcmp])
85*e4b17023SJohn Marino #define memset_libfunc	(libfunc_table[LTI_memset])
86*e4b17023SJohn Marino #define setbits_libfunc	(libfunc_table[LTI_setbits])
87*e4b17023SJohn Marino 
88*e4b17023SJohn Marino #define setjmp_libfunc	(libfunc_table[LTI_setjmp])
89*e4b17023SJohn Marino #define longjmp_libfunc	(libfunc_table[LTI_longjmp])
90*e4b17023SJohn Marino #define unwind_sjlj_register_libfunc (libfunc_table[LTI_unwind_sjlj_register])
91*e4b17023SJohn Marino #define unwind_sjlj_unregister_libfunc \
92*e4b17023SJohn Marino   (libfunc_table[LTI_unwind_sjlj_unregister])
93*e4b17023SJohn Marino 
94*e4b17023SJohn Marino #define profile_function_entry_libfunc	(libfunc_table[LTI_profile_function_entry])
95*e4b17023SJohn Marino #define profile_function_exit_libfunc	(libfunc_table[LTI_profile_function_exit])
96*e4b17023SJohn Marino 
97*e4b17023SJohn Marino #define synchronize_libfunc	(libfunc_table[LTI_synchronize])
98*e4b17023SJohn Marino 
99*e4b17023SJohn Marino #define gcov_flush_libfunc	(libfunc_table[LTI_gcov_flush])
100*e4b17023SJohn Marino 
101*e4b17023SJohn Marino /* In explow.c */
102*e4b17023SJohn Marino extern void set_stack_check_libfunc (const char *);
103*e4b17023SJohn Marino 
104*e4b17023SJohn Marino #endif /* GCC_LIBFUNCS_H */
105