]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/libfuncs.h
Add march=knl.
[thirdparty/gcc.git] / gcc / libfuncs.h
CommitLineData
e78d8e51 1/* Definitions for code generation pass of GNU compiler.
23a5b65a 2 Copyright (C) 2001-2014 Free Software Foundation, Inc.
e78d8e51 3
40803cd5 4This file is part of GCC.
e78d8e51 5
40803cd5 6GCC is free software; you can redistribute it and/or modify
e78d8e51 7it under the terms of the GNU General Public License as published by
9dcd6f09 8the Free Software Foundation; either version 3, or (at your option)
e78d8e51
ZW
9any later version.
10
40803cd5 11GCC is distributed in the hope that it will be useful,
e78d8e51
ZW
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
9dcd6f09
NC
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
e78d8e51
ZW
19
20#ifndef GCC_LIBFUNCS_H
21#define GCC_LIBFUNCS_H
22
3e9c326a
RS
23#include "hashtab.h"
24
e78d8e51
ZW
25/* Enumeration of indexes into libfunc_table. */
26enum libfunc_index
27{
9602f5a0 28 LTI_abort,
e78d8e51
ZW
29 LTI_memcpy,
30 LTI_memmove,
e78d8e51 31 LTI_memcmp,
e78d8e51 32 LTI_memset,
68d28100 33 LTI_setbits,
e78d8e51 34
e78d8e51
ZW
35 LTI_setjmp,
36 LTI_longjmp,
37 LTI_unwind_sjlj_register,
38 LTI_unwind_sjlj_unregister,
39
e78d8e51
ZW
40 LTI_profile_function_entry,
41 LTI_profile_function_exit,
42
e2ff10a9
RS
43 LTI_synchronize,
44
68d28100 45 LTI_gcov_flush,
68d28100 46
e78d8e51
ZW
47 LTI_MAX
48};
49
5714c34f 50/* Information about an optab-related libfunc. The op field is logically
ef4bddc2 51 an enum optab_d, and the mode fields are logically machine_mode.
5714c34f
RH
52 However, in the absence of forward-declared enums, there's no practical
53 benefit of pulling in the defining headers.
54
55 We use the same hashtable for normal optabs and conversion optabs. In
56 the first case mode2 is forced to VOIDmode. */
57
2a22f99c 58struct GTY((for_user)) libfunc_entry {
5714c34f 59 int op, mode1, mode2;
3e9c326a
RS
60 rtx libfunc;
61};
62
2a22f99c
TS
63/* Descriptor for libfunc_entry. */
64
65struct libfunc_hasher : ggc_hasher<libfunc_entry *>
66{
67 static hashval_t hash (libfunc_entry *);
68 static bool equal (libfunc_entry *, libfunc_entry *);
69};
70
3e9c326a
RS
71/* Target-dependent globals. */
72struct GTY(()) target_libfuncs {
73 /* SYMBOL_REF rtx's for the library functions that are called
74 implicitly and not via optabs. */
75 rtx x_libfunc_table[LTI_MAX];
76
77 /* Hash table used to convert declarations into nodes. */
2a22f99c 78 hash_table<libfunc_hasher> *GTY(()) x_libfunc_hash;
3e9c326a
RS
79};
80
81extern GTY(()) struct target_libfuncs default_target_libfuncs;
82#if SWITCHABLE_TARGET
83extern struct target_libfuncs *this_target_libfuncs;
84#else
85#define this_target_libfuncs (&default_target_libfuncs)
86#endif
87
88#define libfunc_table \
89 (this_target_libfuncs->x_libfunc_table)
e78d8e51
ZW
90
91/* Accessor macros for libfunc_table. */
e78d8e51 92
9602f5a0 93#define abort_libfunc (libfunc_table[LTI_abort])
e78d8e51
ZW
94#define memcpy_libfunc (libfunc_table[LTI_memcpy])
95#define memmove_libfunc (libfunc_table[LTI_memmove])
e78d8e51 96#define memcmp_libfunc (libfunc_table[LTI_memcmp])
e78d8e51 97#define memset_libfunc (libfunc_table[LTI_memset])
68d28100 98#define setbits_libfunc (libfunc_table[LTI_setbits])
e78d8e51 99
e78d8e51
ZW
100#define setjmp_libfunc (libfunc_table[LTI_setjmp])
101#define longjmp_libfunc (libfunc_table[LTI_longjmp])
102#define unwind_sjlj_register_libfunc (libfunc_table[LTI_unwind_sjlj_register])
103#define unwind_sjlj_unregister_libfunc \
104 (libfunc_table[LTI_unwind_sjlj_unregister])
105
e78d8e51
ZW
106#define profile_function_entry_libfunc (libfunc_table[LTI_profile_function_entry])
107#define profile_function_exit_libfunc (libfunc_table[LTI_profile_function_exit])
108
e2ff10a9
RS
109#define synchronize_libfunc (libfunc_table[LTI_synchronize])
110
68d28100 111#define gcov_flush_libfunc (libfunc_table[LTI_gcov_flush])
68d28100 112
d477d1fe
SB
113/* In explow.c */
114extern void set_stack_check_libfunc (const char *);
115
e78d8e51 116#endif /* GCC_LIBFUNCS_H */