This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Can we speed up the gcc_target structure?


On Mon, 19 Jan 2004, Richard Kenner wrote:

> My sense would be to revert these changes and eliminate the target stucture
> in favor of the simpler macro approach.
>
> Am I the only one who feels this way?  If not, this may be an issue for the
> SC to address.

A better way would be to handle those target functions that can be const
with a hybrid approach like

#define TARGET_FUNCTION_FOO_CONST_VALUE false

static inline bool target_function_foo(...)
{
#ifdef TARGET_FUNCTION_FOO_CONST_VALUE
   return TARGET_FUNCTION_FOO_CONST_VALUE;
#else
   return vec->target_function_foo(...);
#endif
}

and for sanity

struct target_vector {
  ...
#ifndef TARGET_FUNCTION_FOO_CONST_VALUE
  bool (*target_function_foo)(...);
#endif
  ...
};

or semantically similar approach.  This way targets can decide, if they
want a modifiable target vector, or if they have a more complex
requirement.

Richard.

--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]