This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Defining special builtin functions for DFA/VLIW scheduling
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Dan Towner <dant at picochip dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 17 Sep 2002 16:23:02 +0100
- Subject: Re: Defining special builtin functions for DFA/VLIW scheduling
- Organization: Codesourcery LLC
- References: <3D873C7C.2B6375EB@picochip.com>
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