[PATCH] D72302: [X86] Improve lowering of v2i64 sign bit tests on pre-sse4.2 targets
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 6 14:44:59 PST 2020
craig.topper marked 2 inline comments as done.
craig.topper added inline comments.
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:21579
+ static const int MaskHi[] = { 1, 1, 3, 3 };
+ SDValue Result = DAG.getVectorShuffle(MVT::v4i32, dl, GT, GT, MaskHi);
+
----------------
RKSimon wrote:
> emit PSHUFD directly?
Why? The code below generates 3 regular shuffles just like this.
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:21582
+ if (Invert)
+ Result = DAG.getNOT(dl, Result, MVT::v4i32);
+
----------------
RKSimon wrote:
> Would the invert case be better as a PSRAD xmm, 31 + the shuffle ?
I think PSRAD xmm, 31 is equivalent to the non-inverted case. I'm not sure which is better XOR+PCMPGT or PSRAD. There were more execution resources available for pcmpgt then psrad on SSE4.1 era CPU like Penryn. But we might not have handled the XOR in 0 cycles.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72302/new/
https://reviews.llvm.org/D72302
More information about the llvm-commits
mailing list