diff options
| -rw-r--r-- | llvm/test/CodeGen/X86/memcmp.ll | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/X86/memcmp.ll b/llvm/test/CodeGen/X86/memcmp.ll index 064e383d84b..1da6c254e07 100644 --- a/llvm/test/CodeGen/X86/memcmp.ll +++ b/llvm/test/CodeGen/X86/memcmp.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s --check-prefix=X32 -; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefix=X64 +; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefix=X64 --check-prefix=SSE2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=AVX2 | FileCheck %s --check-prefix=X64 --check-prefix=AVX2 ; This tests codegen time inlining/optimization of memcmp @@ -178,6 +178,16 @@ define i1 @length16(i8* %x, i8* %y) nounwind { ; X32-NEXT: setne %al ; X32-NEXT: retl ; +; SSE2-LABEL: length16: +; SSE2: # BB#0: +; SSE2-NEXT: movdqu (%rsi), %xmm0 +; SSE2-NEXT: movdqu (%rdi), %xmm1 +; SSE2-NEXT: pcmpeqb %xmm0, %xmm1 +; SSE2-NEXT: pmovmskb %xmm1, %eax +; SSE2-NEXT: cmpl $65535, %eax # imm = 0xFFFF +; SSE2-NEXT: setne %al +; SSE2-NEXT: retq +; ; AVX2-LABEL: length16: ; AVX2: # BB#0: ; AVX2-NEXT: vmovdqu (%rdi), %xmm0 @@ -204,6 +214,15 @@ define i1 @length16_const(i8* %X, i32* nocapture %P) nounwind { ; X32-NEXT: sete %al ; X32-NEXT: retl ; +; SSE2-LABEL: length16_const: +; SSE2: # BB#0: +; SSE2-NEXT: movdqu (%rdi), %xmm0 +; SSE2-NEXT: pcmpeqb {{.*}}(%rip), %xmm0 +; SSE2-NEXT: pmovmskb %xmm0, %eax +; SSE2-NEXT: cmpl $65535, %eax # imm = 0xFFFF +; SSE2-NEXT: sete %al +; SSE2-NEXT: retq +; ; AVX2-LABEL: length16_const: ; AVX2: # BB#0: ; AVX2-NEXT: vmovdqu (%rdi), %xmm0 |

