Request for review (L): 6378821: where available, bitCount() should use POPC on SPARC processors and AMD+10h
Christian Thalinger
Christian.Thalinger at Sun.COM
Fri Mar 13 07:34:20 PDT 2009
On Thu, 2009-03-12 at 16:16 -0700, Tom Rodriguez wrote:
> The PopCount nodes should only take one argument since they are never
> required to have control.
>
> I think there are problems with register usage with PopCountL in
> x86_32.ad. USEs (inputs) and TEMPs are guaranteed to be different
> registers but DEFs are not. KILLs and DEFs are guaranteed to be
> different. The model of register interference is like a single
> hardware instruction where all the effects occur simultaneously so the
> DEFs and USEs can't interfere. So for this:
>
> +instruct popCountL(eRegI dst, eRegL src, eRegI tmp, eFlagsReg cr) %{
> + match(Set dst (PopCountL src));
> + effect(KILL cr, TEMP tmp);
>
> dst isn't required to be different than src or tmp which will break
> you code generation. If you add TEMP dst to the effects then the
> register allocator will make the output interfere with the inputs so
> you can use it as a temp in the code generation. The memory one has
> the same problem.
I see. Thanks for the detailed explanation, I will fix that.
-- Christian
More information about the hotspot-compiler-dev
mailing list