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: Defining special builtin functions for DFA/VLIW scheduling


Dan Towner wrote:
  gcc -mchannel=DanielsChannel -mchannel=OtherChannel source.c
yuck!

the channel names are just symbols. Can you not add a machine
specific type attribute? Something like
	int *__attribute_((channel)) DANS_CHANNEL;
(that would be for a channel of ints)
You'd obviously have to be careful how this was used, because you
couldn't pass it around. Alternatively, define a new section type, and
all symbols in it are channel.
	int *DANS_CHANNEL __attribute__((section ("channel")));

then you could wrap this in your inline fns with something like
	#define DEFINE_CHAN_OUT(NAME, TYPE) \
		inline void Put_##NAME (TYPE data) { \
		extern TYPE *NAME __attribute__((section ("channel"))); \
		builtin_chan_out (NAME, data); }
	DEFINE_CHAN_OUT (DANS_CHANNEL, int);

would that work for you?

The latter seems a cleaner solution, these channel names are simply names
in a different namespace. You can use the linker to arbitrarily map them
to numbers.

put's machine description can then only accept a SYMBOL_REF for the channel.
I don't think section information is available at that point, unfortunately
-- you might have to check that in your expand_chan_out function.

nathan
--
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org



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