aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSteve Ellcey <sje@cup.hp.com>2010-09-29 21:32:42 +0000
committerSteve Ellcey <sje@gcc.gnu.org>2010-09-29 21:32:42 +0000
commitb14446e2ff63e339f814681b8ec7c467de819b66 (patch)
treeeb3aa29786fa1866b1888e0ae4a8e7b730d3f63c /gcc
parent907c53bbdf5deda5bb247f535af5fc1f1968946d (diff)
downloadgcc-b14446e2ff63e339f814681b8ec7c467de819b66.zip
gcc-b14446e2ff63e339f814681b8ec7c467de819b66.tar.gz
gcc-b14446e2ff63e339f814681b8ec7c467de819b66.tar.bz2
ia64.c (ia64_builtin_decl): New.
2010-09-29 Steve Ellcey <sje@cup.hp.com> * config/ia64/ia64.c (ia64_builtin_decl): New. (TARGET_BUILTIN_DECL): Define. (ia64_builtins): New. (ia64_init_builtins): Save decls in ia64_builtins. From-SVN: r164734
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/ia64/ia64.c45
2 files changed, 42 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5da6057..67899b8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2010-09-29 Steve Ellcey <sje@cup.hp.com>
+
+ * config/ia64/ia64.c (ia64_builtin_decl): New.
+ (TARGET_BUILTIN_DECL): Define.
+ (ia64_builtins): New.
+ (ia64_init_builtins): Save decls in ia64_builtins.
+
2010-09-29 Bernd Schmidt <bernds@codesourcery.com>
PR target/40457
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index f75e42b..dcd88a0 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -322,6 +322,7 @@ static void ia64_trampoline_init (rtx, tree, rtx);
static void ia64_override_options_after_change (void);
static void ia64_dwarf_handle_frame_unspec (const char *, rtx, int);
+static tree ia64_builtin_decl (unsigned, bool);
/* Table of valid machine attributes. */
static const struct attribute_spec ia64_attribute_table[] =
@@ -347,6 +348,9 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN ia64_expand_builtin
+#undef TARGET_BUILTIN_DECL
+#define TARGET_BUILTIN_DECL ia64_builtin_decl
+
#undef TARGET_ASM_BYTE_OP
#define TARGET_ASM_BYTE_OP "\tdata1\t"
#undef TARGET_ASM_ALIGNED_HI_OP
@@ -10033,14 +10037,18 @@ enum ia64_builtins
IA64_BUILTIN_FABSQ,
IA64_BUILTIN_FLUSHRS,
IA64_BUILTIN_INFQ,
- IA64_BUILTIN_HUGE_VALQ
+ IA64_BUILTIN_HUGE_VALQ,
+ IA64_BUILTIN_max
};
+static GTY(()) tree ia64_builtins[(int) IA64_BUILTIN_max];
+
void
ia64_init_builtins (void)
{
tree fpreg_type;
tree float80_type;
+ tree decl;
/* The __fpreg type. */
fpreg_type = make_node (REAL_TYPE);
@@ -10057,7 +10065,7 @@ ia64_init_builtins (void)
/* The __float128 type. */
if (!TARGET_HPUX)
{
- tree ftype, decl;
+ tree ftype;
tree float128_type = make_node (REAL_TYPE);
TYPE_PRECISION (float128_type) = 128;
@@ -10066,13 +10074,15 @@ ia64_init_builtins (void)
/* TFmode support builtins. */
ftype = build_function_type (float128_type, void_list_node);
- add_builtin_function ("__builtin_infq", ftype,
- IA64_BUILTIN_INFQ, BUILT_IN_MD,
- NULL, NULL_TREE);
+ decl = add_builtin_function ("__builtin_infq", ftype,
+ IA64_BUILTIN_INFQ, BUILT_IN_MD,
+ NULL, NULL_TREE);
+ ia64_builtins[IA64_BUILTIN_INFQ] = decl;
- add_builtin_function ("__builtin_huge_valq", ftype,
- IA64_BUILTIN_HUGE_VALQ, BUILT_IN_MD,
- NULL, NULL_TREE);
+ decl = add_builtin_function ("__builtin_huge_valq", ftype,
+ IA64_BUILTIN_HUGE_VALQ, BUILT_IN_MD,
+ NULL, NULL_TREE);
+ ia64_builtins[IA64_BUILTIN_HUGE_VALQ] = decl;
ftype = build_function_type_list (float128_type,
float128_type,
@@ -10081,6 +10091,7 @@ ia64_init_builtins (void)
IA64_BUILTIN_FABSQ, BUILT_IN_MD,
"__fabstf2", NULL_TREE);
TREE_READONLY (decl) = 1;
+ ia64_builtins[IA64_BUILTIN_FABSQ] = decl;
ftype = build_function_type_list (float128_type,
float128_type,
@@ -10090,6 +10101,7 @@ ia64_init_builtins (void)
IA64_BUILTIN_COPYSIGNQ, BUILT_IN_MD,
"__copysigntf3", NULL_TREE);
TREE_READONLY (decl) = 1;
+ ia64_builtins[IA64_BUILTIN_COPYSIGNQ] = decl;
}
else
/* Under HPUX, this is a synonym for "long double". */
@@ -10107,13 +10119,15 @@ ia64_init_builtins (void)
add_builtin_function ((name), (type), (code), BUILT_IN_MD, \
NULL, NULL_TREE)
- def_builtin ("__builtin_ia64_bsp",
+ decl = def_builtin ("__builtin_ia64_bsp",
build_function_type (ptr_type_node, void_list_node),
IA64_BUILTIN_BSP);
+ ia64_builtins[IA64_BUILTIN_BSP] = decl;
- def_builtin ("__builtin_ia64_flushrs",
+ decl = def_builtin ("__builtin_ia64_flushrs",
build_function_type (void_type_node, void_list_node),
IA64_BUILTIN_FLUSHRS);
+ ia64_builtins[IA64_BUILTIN_FLUSHRS] = decl;
#undef def_builtin
@@ -10183,6 +10197,17 @@ ia64_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
return NULL_RTX;
}
+/* Return the ia64 builtin for CODE. */
+
+static tree
+ia64_builtin_decl (unsigned code, bool initialize_p ATTRIBUTE_UNUSED)
+{
+ if (code >= IA64_BUILTIN_max)
+ return error_mark_node;
+
+ return ia64_builtins[code];
+}
+
/* For the HP-UX IA64 aggregate parameters are passed stored in the
most significant bits of the stack slot. */