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]

Re: Multiple jumps in one instruction


On Fri, 25 May 2001, Jonathan Buzzard wrote:

> tm2@best.com said:
> 
> [SNIP]
> 
> > This scheme has huge problems.
> > Consider this:
> >
> > static int a = 5;
> > void func1(void)
> > {
> > 	return a *= 5;
> > }
> > void func2(void)
> > {
> > 	return a *= 3;
> > }
> > void main(void)
> > {
> > 	printf("%d\n", func1() + func2());
> > }
> >
> > This program semi-randomly print either 90 or 100 depending on the
> > timing between threads.
> 
> The same sort of problem that any multi-threaded program has. 
>
Agreed.

> I know all
> about the potential problems and ISO volations. The question still remains
> can I do it. All I can say is for the processor in question it makes sense
> to do this. The semi-random nature as you put it presumes the existence of
> only one execution unit by the way.
> 
It should be possible. Maybe it's easier if you try to detect the
pattern at the tree level, before RTL is generated and mark the
trees so that your backend can issue the appropriate thread
instructions.

Doing it the RTL level might be tricky depending on how your
target represents function calls.

Diego.


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