[PATCH] D28810: [X86][SSE] Use MOVMSK for all_of/any_of reduction patterns
Andrea Di Biagio via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 1 10:36:42 PST 2017
andreadb added inline comments.
================
Comment at: test/CodeGen/X86/vector-compare-all_of.ll:739-746
+; SSE-NEXT: pmovmskb %xmm0, %eax
+; SSE-NEXT: cmpl $65535, %eax # imm = 0xFFFF
+; SSE-NEXT: movb $-1, %al
+; SSE-NEXT: je .LBB14_2
+; SSE-NEXT: # BB#1:
+; SSE-NEXT: xorl %eax, %eax
+; SSE-NEXT: .LBB14_2:
----------------
RKSimon wrote:
> andreadb wrote:
> > I was expecting to see the usual `cmpl+movw+cmov` pattern here.
> > Is it because you would end up with a conditional move of i8 quantities?
> Hmm, it might be possible to lower this as:
> ```
> pmovmskb %xmm0, %edi
> xor %eax, %eax
> cmpl $65535, %edi
> sete %al
> negl %eax
> retq
> ```
I was about to suggest cmp+set+sra, but neg is even better :-).
Repository:
rL LLVM
https://reviews.llvm.org/D28810
More information about the llvm-commits
mailing list