diff options
author | aesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-25 04:34:27 +0000 |
---|---|---|
committer | aesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-25 04:34:27 +0000 |
commit | 906bb5c363f525c69bf1611dc6489036796cd154 (patch) | |
tree | bd2fa4d98f26b6a7e12e507b3e3a46601d1ed5c3 /gcc/targhooks.c | |
parent | bff7ea4aca62f23ab3f7e7f02909437c66f00930 (diff) | |
download | gcc-906bb5c363f525c69bf1611dc6489036796cd154.tar.gz |
* target.h (struct gcc_target): Add case_values_threshold field.
* target-def.h (TARGET_CASE_VALUES_THRESHOLD): New.
(TARGET_INITIALIZER): Use TARGET_CASE_VALUES_THRESHOLD.
* targhooks.c (default_case_values_threshold): New function.
* targhooks.h (default_case_values_threshold): Declare function.
* stmt.c (expand_case): Use case_values_threshold target hook.
* expr.h (case_values_threshold): Remove declartation.
* expr.c (case_values_threshold): Remove function.
* doc/tm.texi (CASE_VALUES_THRESHOLD): Revise documentation.
* config/avr/avr.h (CASE_VALUES_THRESHOLD): Remove macro.
* config/avr/avr.c (TARGET_CASE_VALUES_THRESHOLD): Define macro.
(avr_case_values_threshold): Declare as static.
* config/avr/avr-protos.h (avr_case_values_threshold): Remove.
* config/avr/mn10300.h (CASE_VALUES_THRESHOLD): Remove macro.
* config/avr/mn10300.c (TARGET_CASE_VALUES_THRESHOLD): Define macro.
(mn10300_case_values_threshold): New function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146756 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/targhooks.c')
-rw-r--r-- | gcc/targhooks.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 5b7b8751ba6..c0bcac0d054 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -1,5 +1,6 @@ /* Default target hook functions. - Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009 + Free Software Foundation, Inc. This file is part of GCC. @@ -765,4 +766,17 @@ default_target_option_can_inline_p (tree caller, tree callee) return ret; } +#ifndef HAVE_casesi +# define HAVE_casesi 0 +#endif + +/* If the machine does not have a case insn that compares the bounds, + this means extra overhead for dispatch tables, which raises the + threshold for using them. */ + +unsigned int default_case_values_threshold (void) +{ + return (HAVE_casesi ? 4 : 5); +} + #include "gt-targhooks.h" |