This is the mail archive of the gcc-patches@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: rs6000 fused multiply-add patch [+ patchlet]


Geoff Keating wrote:
> 
> What you usually do in this case is create a combination insn+splitter
> to give combine an appropriate intermediate result.
> 
> If you could provide testcases/code samples for the cases you mention,
> it would be easier to see precisely what's going on.  Often several
> iterations and many eyes are necessary to get the proper fix.

Here are some of the cases that happen most on PowerPC:

-- comparing an SI to a "big" constant.
	(set (reg2) (big_constant))
	(set:CC (compare:CC (reg1) (reg2)))
		becomes
	(set (reg1) (xor (reg1) (hi_constant)))
	(set:CC (compare:CC (reg1) (lo_constant)))

	There is a define_split to handle this; it splits two rtl insns
	into two different rtl insns.  In actual machine insns this is
	an improvement, though (either less insns, or less register
	pressure if lo == 0).  So you're saying there should be a define_insn
	for this too, so combine would think this is just one insn?

-- sign extend of xor (twice) => xor (twice) of sign extend.

	Swapping an xor with a sign extend doesn't help per se, but it
	does in cases like this.  combine can't help it: it would need
	to look at 4 insns.

> It is also possible that some rearchitecting of combine might be
> necessary, but that's something that would require careful
> consideration and an examination of all the possible alternatives,
> not an ad-hoc patch to solve a specific problem.

Small progress is progress too.  Of course there's more to be gained
by writing a new'n'improved combine pass, or a new separate pass, but
that's not a reason to not accept other improvements.  All IMHO of course,
and assuming it is actually an improvement :)


Segher



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