[G]CSE of extended asm statements

Richard Henderson rth@cygnus.com
Wed Aug 30 10:40:00 GMT 2000


On Wed, Aug 30, 2000 at 05:52:16PM +0100, Bernd Schmidt wrote:
> > Um, like I said, this construct already exists.  It's used on
> > MIPS, Sparc64, and IA-64 to describe multiple return registers.
> 
> Ugh.  May I ask why?

	struct s {
	  int x;
	  int y;
	  double a;
	  float b;
	};

On Sparc64, this structure is returned in

	x:	%o0
	y:	%o1
	a:	%d2
	b:	%f5

Or were you asking why we put a parallel in the call?  Well, that's a bit
tougher to answer.  Without doing archaeology (or asking Jim), I know that
FUNCTION_ARG and FUNCTION_VALUE return a parallel when they want to say
that an argument goes multiple places.

With arguments, we use emit_group_load which turns this into a series of
normal moves.  With the return value, we plop this struct in to the
SET_DEST of the call, then use emit_group_store to put it somewhere that
the compiler can deal with it.

Now, it's possible that the only reason we're currently getting away with
this is that all the registers in this parallel are hard regs, and they're
all call-clobbered, and they're attached to a call.  I know that sched 
has code to handle this case, but I can't think who else does.

However, I do kinda like it as an alternative to rtl replication, which
has also caused us problems.  I can think of at least one case where
asm_operands is special-cased to ignore all but the first replication.


r~


More information about the Gcc-patches mailing list