[PATCH] D60333: [X86][SSE] SimplifyDemandedBitsForTargetNode - Add PACKSS support

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 5 14:59:31 PDT 2019


RKSimon added a comment.

In D60333#1456877 <https://reviews.llvm.org/D60333#1456877>, @nikic wrote:

> This looks right to me, but I think we should be able to do better. The sign bit of the result is determined only by the sign bit of the input. Any other bit is determined by the same bit in the input, as well as the high BitWidth+1 bits of the input. I'm thinking something along these lines:
>
>   APInt DemandedBits;
>   if (OriginalDemandedBits.isSignMask()) {
>       DemandedBits = APInt::getSignMask(BitWidth * 2);
>   } else {
>       DemandedBits = OriginalDemandedBits.zext(BitWidth * 2);
>       DemandedBits.setHighBits(BitWidth + 1);
>   }
>


I agree, I hope to do that in the future (and something similar for PACKUS) once I have suitable test coverage (its related to better support for TRUNCATE vector SimplifiedDemandedBits support as well) - but for now I'd prefer just to get this MOVMSK fix in.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60333/new/

https://reviews.llvm.org/D60333





More information about the llvm-commits mailing list