[PATCH] D30611: [x86] don't blindly transform SETB into SBB

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 11 13:27:18 PST 2017


RKSimon accepted this revision.
RKSimon added a comment.
This revision is now accepted and ready to land.

LGTM - but there is still a lot to do to improve partial register stalls.....



================
Comment at: test/CodeGen/X86/sse42-intrinsics-x86.ll:98
 
-define i32 @test_x86_sse42_pcmpestric128(<16 x i8> %a0, <16 x i8> %a2) {
+define i32 @test_x86_sse42_pcmpestric128(<16 x i8> %a0, <16 x i8> %a2) nounwind {
 ; SSE42-LABEL: test_x86_sse42_pcmpestric128:
----------------
spatel wrote:
> RKSimon wrote:
> > The stack usage is unfortunate.....
> Agreed - not sure where that goes wrong yet.
Seems to be due to pcmpestri being hardwired to use eax/ecx and that xor ebx, ebx needs to be set before pcmpestri to extract the flags correctly. Its beyond the scope of this, but it could be done as:
```
movl $7, %eax
movl $7, %edx
pcmpestri $7, %xmm1, %xmm0
movl $0, %eax
setb %al
```


https://reviews.llvm.org/D30611





More information about the llvm-commits mailing list