On Fri, May 06, 2011 at 06:30:07PM +0200, Jakub Jelinek wrote: > On Fri, May 06, 2011 at 12:21:24PM -0400, Michael Meissner wrote: > > On Thu, Apr 21, 2011 at 03:02:10PM -0400, Michael Meissner wrote: > > > In looking at some improvements to the powerpc, we wanted to change the > > > default > > > for when a table jump is generated vs. a series of if statements. Now, we > > > could just add a powerpc specific TARGET_CASE_VALUES_THRESHOLD, but I > > > tend to > > > think that these should be settable on all/most ports with --param. > > > > > > At present, there are only two ports (avr and mn10300) that define their > > > own > > > TARGET_CASE_VALUES_THRESHOLD hook. My first patch does not remove the > > > target > > > hook and modify the avr/mn10300 ports to use maybe_set_param_value, but > > > that > > > can be done if desired. > > > > > > The patch adds two --param values, one for when the port is using the > > > casesi > > > insn, and the other when it uses the more primitive tablejump insn. > > > > > > I have bootstrapped the compiler with this patch and run the test suite > > > with no > > > regressions. Is it ok to apply as is? Should I modify the avr and > > > mn10300 > > > ports to use the parameters and do away with the target hook? Or should > > > I do > > > this just as a powerpc target hook? > > > > I never got a response for this, and my earlier ping didn't seem to go out. > > I'll check it in on Monday if there are no objections. > > I think it is very weird to have two different params, if we need any such > param, there should be just one and its default value should depend on > HAVE_casesi.
The problem is the values in params.def must be constant, and can't depend on switches. I imagine we can have a single param that is normally 0, and if it is non-zero use that value, otherwise fall back to (HAVE_casesi ? 4 : 5). Or we could set it in finish_options in opts.c. Any preference? -- Michael Meissner, IBM 5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA meiss...@linux.vnet.ibm.com fax +1 (978) 399-6899