[llvm-commits] patch: x86 vector udiv
Peter Cooper
peter_cooper at apple.com
Tue Nov 1 18:53:57 PDT 2011
Ah yes thanks, i see where in InstCombine i should have put the udiv->shl change.
For the vector shift case. I'm not sure why a vector shift is different in behavior to multiple scalar shifts. The only thing I can see in the ISA is that scalar shifts set the CF flag but otherwise i think they are equivalent. Can you please give more explanation on this?
Pete
On Nov 1, 2011, at 6:04 PM, Eli Friedman wrote:
> On Tue, Nov 1, 2011 at 5:40 PM, Peter Cooper <peter_cooper at apple.com> wrote:
>> Hi
>>
>> Please review this patch for pr8429 to turn vector udiv into vector shrl instructions when dividing by powers of 2. This was already done on scalars but not on vectors.
>>
>> I also found that vector shifts were always scalarised on x86 even with SSE on so i turned these into the equivalent intrinsics.
>
> The change to X86ISelLowering.cpp is wrong; the psrld instruction is
> not equivalent to ISD::SRL in the general case.
>
> For the rest of the changes, it would be better to handle this
> transformation in instcombine.
>
> -Eli
More information about the llvm-commits
mailing list