Commit b6e46ca1 by Roger Sayle Committed by Roger Sayle

alpha.c (alpha_add_builtins): New Helper function.


	* config/alpha/alpha.c (alpha_add_builtins): New Helper function.
	Set TREE_READONLY and TREE_NOTHROW directly, not via attributes.
	(alpha_init_builtins): Use alpha_add_builtins to process tables.

From-SVN: r121603
parent 8d0510dd
2007-02-05 Roger Sayle <roger@eyesopen.com> 2007-02-05 Roger Sayle <roger@eyesopen.com>
* config/alpha/alpha.c (alpha_add_builtins): New Helper function.
Set TREE_READONLY and TREE_NOTHROW directly, not via attributes.
(alpha_init_builtins): Use alpha_add_builtins to process tables.
2007-02-05 Roger Sayle <roger@eyesopen.com>
* mips-tfile.c (initialize_init_file): Correct endianness test. * mips-tfile.c (initialize_init_file): Correct endianness test.
2007-02-05 Kazu Hirata <kazu@codesourcery.com> 2007-02-05 Kazu Hirata <kazu@codesourcery.com>
......
/* Subroutines used for code generation on the DEC Alpha. /* Subroutines used for code generation on the DEC Alpha.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
This file is part of GCC. This file is part of GCC.
...@@ -6506,55 +6506,62 @@ static GTY(()) tree alpha_v8qi_s; ...@@ -6506,55 +6506,62 @@ static GTY(()) tree alpha_v8qi_s;
static GTY(()) tree alpha_v4hi_u; static GTY(()) tree alpha_v4hi_u;
static GTY(()) tree alpha_v4hi_s; static GTY(()) tree alpha_v4hi_s;
/* Helper function of alpha_init_builtins. Add the COUNT built-in
functions pointed to by P, with function type FTYPE. */
static void
alpha_add_builtins (const struct alpha_builtin_def *p, size_t count,
tree ftype)
{
tree decl;
size_t i;
for (i = 0; i < count; ++i, ++p)
if ((target_flags & p->target_mask) == p->target_mask)
{
decl = add_builtin_function (p->name, ftype, p->code, BUILT_IN_MD,
NULL, NULL);
if (p->is_const)
TREE_READONLY (decl) = 1;
TREE_NOTHROW (decl) = 1;
}
}
static void static void
alpha_init_builtins (void) alpha_init_builtins (void)
{ {
const struct alpha_builtin_def *p;
tree dimode_integer_type_node; tree dimode_integer_type_node;
tree ftype, attrs[2]; tree ftype, decl;
size_t i;
dimode_integer_type_node = lang_hooks.types.type_for_mode (DImode, 0); dimode_integer_type_node = lang_hooks.types.type_for_mode (DImode, 0);
attrs[0] = tree_cons (get_identifier ("nothrow"), NULL, NULL);
attrs[1] = tree_cons (get_identifier ("const"), NULL, attrs[0]);
ftype = build_function_type (dimode_integer_type_node, void_list_node); ftype = build_function_type (dimode_integer_type_node, void_list_node);
alpha_add_builtins (zero_arg_builtins, ARRAY_SIZE (zero_arg_builtins),
p = zero_arg_builtins; ftype);
for (i = 0; i < ARRAY_SIZE (zero_arg_builtins); ++i, ++p)
if ((target_flags & p->target_mask) == p->target_mask)
add_builtin_function (p->name, ftype, p->code, BUILT_IN_MD,
NULL, attrs[p->is_const]);
ftype = build_function_type_list (dimode_integer_type_node, ftype = build_function_type_list (dimode_integer_type_node,
dimode_integer_type_node, NULL_TREE); dimode_integer_type_node, NULL_TREE);
alpha_add_builtins (one_arg_builtins, ARRAY_SIZE (one_arg_builtins),
p = one_arg_builtins; ftype);
for (i = 0; i < ARRAY_SIZE (one_arg_builtins); ++i, ++p)
if ((target_flags & p->target_mask) == p->target_mask)
add_builtin_function (p->name, ftype, p->code, BUILT_IN_MD,
NULL, attrs[p->is_const]);
ftype = build_function_type_list (dimode_integer_type_node, ftype = build_function_type_list (dimode_integer_type_node,
dimode_integer_type_node, dimode_integer_type_node,
dimode_integer_type_node, NULL_TREE); dimode_integer_type_node, NULL_TREE);
alpha_add_builtins (two_arg_builtins, ARRAY_SIZE (two_arg_builtins),
p = two_arg_builtins; ftype);
for (i = 0; i < ARRAY_SIZE (two_arg_builtins); ++i, ++p)
if ((target_flags & p->target_mask) == p->target_mask)
add_builtin_function (p->name, ftype, p->code, BUILT_IN_MD,
NULL, attrs[p->is_const]);
ftype = build_function_type (ptr_type_node, void_list_node); ftype = build_function_type (ptr_type_node, void_list_node);
add_builtin_function ("__builtin_thread_pointer", ftype, decl = add_builtin_function ("__builtin_thread_pointer", ftype,
ALPHA_BUILTIN_THREAD_POINTER, BUILT_IN_MD, ALPHA_BUILTIN_THREAD_POINTER, BUILT_IN_MD,
NULL, attrs[0]); NULL, NULL);
TREE_NOTHROW (decl) = 1;
ftype = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE); ftype = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
add_builtin_function ("__builtin_set_thread_pointer", ftype, decl = add_builtin_function ("__builtin_set_thread_pointer", ftype,
ALPHA_BUILTIN_SET_THREAD_POINTER, BUILT_IN_MD, ALPHA_BUILTIN_SET_THREAD_POINTER, BUILT_IN_MD,
NULL, attrs[0]); NULL, NULL);
TREE_NOTHROW (decl) = 1;
alpha_v8qi_u = build_vector_type (unsigned_intQI_type_node, 8); alpha_v8qi_u = build_vector_type (unsigned_intQI_type_node, 8);
alpha_v8qi_s = build_vector_type (intQI_type_node, 8); alpha_v8qi_s = build_vector_type (intQI_type_node, 8);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment