summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/memcmp.ll
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-07-01 13:22:02 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-07-01 13:22:02 +0000
commit9df3605dea17e84f8183581f6103bd0c79e2a606 (patch)
tree70a2f36ce9eb9bb213603cd7f2f120af53fc176f /test/CodeGen/X86/memcmp.ll
parent08bbd35a80bf7765fe0d3043f9eb5a2f2786b649 (diff)
downloadsrc-test-9df3605dea17e84f8183581f6103bd0c79e2a606.tar.gz
src-test-9df3605dea17e84f8183581f6103bd0c79e2a606.zip
Notes
Diffstat (limited to 'test/CodeGen/X86/memcmp.ll')
-rw-r--r--test/CodeGen/X86/memcmp.ll782
1 files changed, 413 insertions, 369 deletions
diff --git a/test/CodeGen/X86/memcmp.ll b/test/CodeGen/X86/memcmp.ll
index 9d26aee2e8b88..0e09abf73c8c9 100644
--- a/test/CodeGen/X86/memcmp.ll
+++ b/test/CodeGen/X86/memcmp.ll
@@ -1,7 +1,8 @@
; 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 --check-prefix=SSE2
-; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=AVX2 | FileCheck %s --check-prefix=X64 --check-prefix=AVX2
+; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s --check-prefix=X86 --check-prefix=X86-NOSSE
+; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X86 --check-prefix=X86-SSE2
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefix=X64 --check-prefix=X64-SSE2
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=AVX2 | FileCheck %s --check-prefix=X64 --check-prefix=X64-AVX2
; This tests codegen time inlining/optimization of memcmp
; rdar://6480398
@@ -11,60 +12,70 @@
declare i32 @memcmp(i8*, i8*, i64)
define i32 @length2(i8* %X, i8* %Y) nounwind {
-; X32-LABEL: length2:
-; X32: # BB#0: # %loadbb
-; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
-; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
-; X32-NEXT: movzwl (%ecx), %ecx
-; X32-NEXT: movzwl (%eax), %eax
-; X32-NEXT: rolw $8, %cx
-; X32-NEXT: rolw $8, %ax
-; X32-NEXT: movzwl %cx, %ecx
-; X32-NEXT: movzwl %ax, %eax
-; X32-NEXT: cmpl %eax, %ecx
-; X32-NEXT: je .LBB0_1
-; X32-NEXT: # BB#2: # %res_block
-; X32-NEXT: movl $-1, %eax
-; X32-NEXT: jb .LBB0_4
-; X32-NEXT: # BB#3: # %res_block
-; X32-NEXT: movl $1, %eax
-; X32-NEXT: .LBB0_4: # %endblock
-; X32-NEXT: retl
-; X32-NEXT: .LBB0_1:
-; X32-NEXT: xorl %eax, %eax
-; X32-NEXT: retl
+; X86-NOSSE-LABEL: length2:
+; X86-NOSSE: # BB#0:
+; X86-NOSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NOSSE-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NOSSE-NEXT: movzwl (%ecx), %ecx
+; X86-NOSSE-NEXT: movzwl (%eax), %eax
+; X86-NOSSE-NEXT: rolw $8, %cx
+; X86-NOSSE-NEXT: rolw $8, %ax
+; X86-NOSSE-NEXT: cmpw %ax, %cx
+; X86-NOSSE-NEXT: movl $-1, %eax
+; X86-NOSSE-NEXT: jae .LBB0_1
+; X86-NOSSE-NEXT: # BB#2:
+; X86-NOSSE-NEXT: je .LBB0_3
+; X86-NOSSE-NEXT: .LBB0_4:
+; X86-NOSSE-NEXT: retl
+; X86-NOSSE-NEXT: .LBB0_1:
+; X86-NOSSE-NEXT: movl $1, %eax
+; X86-NOSSE-NEXT: jne .LBB0_4
+; X86-NOSSE-NEXT: .LBB0_3:
+; X86-NOSSE-NEXT: xorl %eax, %eax
+; X86-NOSSE-NEXT: retl
+;
+; X86-SSE2-LABEL: length2:
+; X86-SSE2: # BB#0:
+; X86-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-SSE2-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-SSE2-NEXT: movzwl (%ecx), %ecx
+; X86-SSE2-NEXT: movzwl (%eax), %eax
+; X86-SSE2-NEXT: rolw $8, %cx
+; X86-SSE2-NEXT: rolw $8, %ax
+; X86-SSE2-NEXT: xorl %edx, %edx
+; X86-SSE2-NEXT: cmpw %ax, %cx
+; X86-SSE2-NEXT: movl $-1, %ecx
+; X86-SSE2-NEXT: movl $1, %eax
+; X86-SSE2-NEXT: cmovbl %ecx, %eax
+; X86-SSE2-NEXT: cmovel %edx, %eax
+; X86-SSE2-NEXT: retl
;
; X64-LABEL: length2:
-; X64: # BB#0: # %loadbb
+; X64: # BB#0:
; X64-NEXT: movzwl (%rdi), %eax
; X64-NEXT: movzwl (%rsi), %ecx
; X64-NEXT: rolw $8, %ax
; X64-NEXT: rolw $8, %cx
-; X64-NEXT: movzwl %ax, %eax
-; X64-NEXT: movzwl %cx, %ecx
-; X64-NEXT: cmpq %rcx, %rax
-; X64-NEXT: je .LBB0_1
-; X64-NEXT: # BB#2: # %res_block
+; X64-NEXT: xorl %edx, %edx
+; X64-NEXT: cmpw %cx, %ax
; X64-NEXT: movl $-1, %ecx
; X64-NEXT: movl $1, %eax
; X64-NEXT: cmovbl %ecx, %eax
-; X64-NEXT: retq
-; X64-NEXT: .LBB0_1:
-; X64-NEXT: xorl %eax, %eax
+; X64-NEXT: cmovel %edx, %eax
; X64-NEXT: retq
%m = tail call i32 @memcmp(i8* %X, i8* %Y, i64 2) nounwind
ret i32 %m
}
define i1 @length2_eq(i8* %X, i8* %Y) nounwind {
-; X32-LABEL: length2_eq:
-; X32: # BB#0:
-; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
-; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
-; X32-NEXT: movzwl (%ecx), %ecx
-; X32-NEXT: cmpw (%eax), %cx
-; X32-NEXT: sete %al
-; X32-NEXT: retl
+; X86-LABEL: length2_eq:
+; X86: # BB#0:
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: movzwl (%ecx), %ecx
+; X86-NEXT: cmpw (%eax), %cx
+; X86-NEXT: sete %al
+; X86-NEXT: retl
;
; X64-LABEL: length2_eq:
; X64: # BB#0:
@@ -78,13 +89,13 @@ define i1 @length2_eq(i8* %X, i8* %Y) nounwind {
}
define i1 @length2_eq_const(i8* %X) nounwind {
-; X32-LABEL: length2_eq_const:
-; X32: # BB#0:
-; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
-; X32-NEXT: movzwl (%eax), %eax
-; X32-NEXT: cmpl $12849, %eax # imm = 0x3231
-; X32-NEXT: setne %al
-; X32-NEXT: retl
+; X86-LABEL: length2_eq_const:
+; X86: # BB#0:
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movzwl (%eax), %eax
+; X86-NEXT: cmpl $12849, %eax # imm = 0x3231
+; X86-NEXT: setne %al
+; X86-NEXT: retl
;
; X64-LABEL: length2_eq_const:
; X64: # BB#0:
@@ -98,17 +109,17 @@ define i1 @length2_eq_const(i8* %X) nounwind {
}
define i1 @length2_eq_nobuiltin_attr(i8* %X, i8* %Y) nounwind {
-; X32-LABEL: length2_eq_nobuiltin_attr:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $2
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: testl %eax, %eax
-; X32-NEXT: sete %al
-; X32-NEXT: retl
+; X86-LABEL: length2_eq_nobuiltin_attr:
+; X86: # BB#0:
+; X86-NEXT: pushl $0
+; X86-NEXT: pushl $2
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: calll memcmp
+; X86-NEXT: addl $16, %esp
+; X86-NEXT: testl %eax, %eax
+; X86-NEXT: sete %al
+; X86-NEXT: retl
;
; X64-LABEL: length2_eq_nobuiltin_attr:
; X64: # BB#0:
@@ -125,15 +136,15 @@ define i1 @length2_eq_nobuiltin_attr(i8* %X, i8* %Y) nounwind {
}
define i32 @length3(i8* %X, i8* %Y) nounwind {
-; X32-LABEL: length3:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $3
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: retl
+; X86-LABEL: length3:
+; X86: # BB#0:
+; X86-NEXT: pushl $0
+; X86-NEXT: pushl $3
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: calll memcmp
+; X86-NEXT: addl $16, %esp
+; X86-NEXT: retl
;
; X64-LABEL: length3:
; X64: # BB#0:
@@ -144,17 +155,17 @@ define i32 @length3(i8* %X, i8* %Y) nounwind {
}
define i1 @length3_eq(i8* %X, i8* %Y) nounwind {
-; X32-LABEL: length3_eq:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $3
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: testl %eax, %eax
-; X32-NEXT: setne %al
-; X32-NEXT: retl
+; X86-LABEL: length3_eq:
+; X86: # BB#0:
+; X86-NEXT: pushl $0
+; X86-NEXT: pushl $3
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: calll memcmp
+; X86-NEXT: addl $16, %esp
+; X86-NEXT: testl %eax, %eax
+; X86-NEXT: setne %al
+; X86-NEXT: retl
;
; X64-LABEL: length3_eq:
; X64: # BB#0:
@@ -171,56 +182,70 @@ define i1 @length3_eq(i8* %X, i8* %Y) nounwind {
}
define i32 @length4(i8* %X, i8* %Y) nounwind {
-; X32-LABEL: length4:
-; X32: # BB#0: # %loadbb
-; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
-; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
-; X32-NEXT: movl (%ecx), %ecx
-; X32-NEXT: movl (%eax), %eax
-; X32-NEXT: bswapl %ecx
-; X32-NEXT: bswapl %eax
-; X32-NEXT: cmpl %eax, %ecx
-; X32-NEXT: je .LBB6_1
-; X32-NEXT: # BB#2: # %res_block
-; X32-NEXT: movl $-1, %eax
-; X32-NEXT: jb .LBB6_4
-; X32-NEXT: # BB#3: # %res_block
-; X32-NEXT: movl $1, %eax
-; X32-NEXT: .LBB6_4: # %endblock
-; X32-NEXT: retl
-; X32-NEXT: .LBB6_1:
-; X32-NEXT: xorl %eax, %eax
-; X32-NEXT: retl
+; X86-NOSSE-LABEL: length4:
+; X86-NOSSE: # BB#0:
+; X86-NOSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NOSSE-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NOSSE-NEXT: movl (%ecx), %ecx
+; X86-NOSSE-NEXT: movl (%eax), %eax
+; X86-NOSSE-NEXT: bswapl %ecx
+; X86-NOSSE-NEXT: bswapl %eax
+; X86-NOSSE-NEXT: cmpl %eax, %ecx
+; X86-NOSSE-NEXT: movl $-1, %eax
+; X86-NOSSE-NEXT: jae .LBB6_1
+; X86-NOSSE-NEXT: # BB#2:
+; X86-NOSSE-NEXT: je .LBB6_3
+; X86-NOSSE-NEXT: .LBB6_4:
+; X86-NOSSE-NEXT: retl
+; X86-NOSSE-NEXT: .LBB6_1:
+; X86-NOSSE-NEXT: movl $1, %eax
+; X86-NOSSE-NEXT: jne .LBB6_4
+; X86-NOSSE-NEXT: .LBB6_3:
+; X86-NOSSE-NEXT: xorl %eax, %eax
+; X86-NOSSE-NEXT: retl
+;
+; X86-SSE2-LABEL: length4:
+; X86-SSE2: # BB#0:
+; X86-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-SSE2-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-SSE2-NEXT: movl (%ecx), %ecx
+; X86-SSE2-NEXT: movl (%eax), %eax
+; X86-SSE2-NEXT: bswapl %ecx
+; X86-SSE2-NEXT: bswapl %eax
+; X86-SSE2-NEXT: xorl %edx, %edx
+; X86-SSE2-NEXT: cmpl %eax, %ecx
+; X86-SSE2-NEXT: movl $-1, %ecx
+; X86-SSE2-NEXT: movl $1, %eax
+; X86-SSE2-NEXT: cmovbl %ecx, %eax
+; X86-SSE2-NEXT: cmovel %edx, %eax
+; X86-SSE2-NEXT: retl
;
; X64-LABEL: length4:
-; X64: # BB#0: # %loadbb
+; X64: # BB#0:
; X64-NEXT: movl (%rdi), %eax
; X64-NEXT: movl (%rsi), %ecx
; X64-NEXT: bswapl %eax
; X64-NEXT: bswapl %ecx
-; X64-NEXT: cmpq %rcx, %rax
-; X64-NEXT: je .LBB6_1
-; X64-NEXT: # BB#2: # %res_block
+; X64-NEXT: xorl %edx, %edx
+; X64-NEXT: cmpl %ecx, %eax
; X64-NEXT: movl $-1, %ecx
; X64-NEXT: movl $1, %eax
; X64-NEXT: cmovbl %ecx, %eax
-; X64-NEXT: retq
-; X64-NEXT: .LBB6_1:
-; X64-NEXT: xorl %eax, %eax
+; X64-NEXT: cmovel %edx, %eax
; X64-NEXT: retq
%m = tail call i32 @memcmp(i8* %X, i8* %Y, i64 4) nounwind
ret i32 %m
}
define i1 @length4_eq(i8* %X, i8* %Y) nounwind {
-; X32-LABEL: length4_eq:
-; X32: # BB#0:
-; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
-; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
-; X32-NEXT: movl (%ecx), %ecx
-; X32-NEXT: cmpl (%eax), %ecx
-; X32-NEXT: setne %al
-; X32-NEXT: retl
+; X86-LABEL: length4_eq:
+; X86: # BB#0:
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT: movl (%ecx), %ecx
+; X86-NEXT: cmpl (%eax), %ecx
+; X86-NEXT: setne %al
+; X86-NEXT: retl
;
; X64-LABEL: length4_eq:
; X64: # BB#0:
@@ -234,12 +259,12 @@ define i1 @length4_eq(i8* %X, i8* %Y) nounwind {
}
define i1 @length4_eq_const(i8* %X) nounwind {
-; X32-LABEL: length4_eq_const:
-; X32: # BB#0:
-; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
-; X32-NEXT: cmpl $875770417, (%eax) # imm = 0x34333231
-; X32-NEXT: sete %al
-; X32-NEXT: retl
+; X86-LABEL: length4_eq_const:
+; X86: # BB#0:
+; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT: cmpl $875770417, (%eax) # imm = 0x34333231
+; X86-NEXT: sete %al
+; X86-NEXT: retl
;
; X64-LABEL: length4_eq_const:
; X64: # BB#0:
@@ -252,15 +277,15 @@ define i1 @length4_eq_const(i8* %X) nounwind {
}
define i32 @length5(i8* %X, i8* %Y) nounwind {
-; X32-LABEL: length5:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $5
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: retl
+; X86-LABEL: length5:
+; X86: # BB#0:
+; X86-NEXT: pushl $0
+; X86-NEXT: pushl $5
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: calll memcmp
+; X86-NEXT: addl $16, %esp
+; X86-NEXT: retl
;
; X64-LABEL: length5:
; X64: # BB#0:
@@ -271,17 +296,17 @@ define i32 @length5(i8* %X, i8* %Y) nounwind {
}
define i1 @length5_eq(i8* %X, i8* %Y) nounwind {
-; X32-LABEL: length5_eq:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $5
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: testl %eax, %eax
-; X32-NEXT: setne %al
-; X32-NEXT: retl
+; X86-LABEL: length5_eq:
+; X86: # BB#0:
+; X86-NEXT: pushl $0
+; X86-NEXT: pushl $5
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: calll memcmp
+; X86-NEXT: addl $16, %esp
+; X86-NEXT: testl %eax, %eax
+; X86-NEXT: setne %al
+; X86-NEXT: retl
;
; X64-LABEL: length5_eq:
; X64: # BB#0:
@@ -298,48 +323,45 @@ define i1 @length5_eq(i8* %X, i8* %Y) nounwind {
}
define i32 @length8(i8* %X, i8* %Y) nounwind {
-; X32-LABEL: length8:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $8
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: retl
+; X86-LABEL: length8:
+; X86: # BB#0:
+; X86-NEXT: pushl $0
+; X86-NEXT: pushl $8
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: calll memcmp
+; X86-NEXT: addl $16, %esp
+; X86-NEXT: retl
;
; X64-LABEL: length8:
-; X64: # BB#0: # %loadbb
+; X64: # BB#0:
; X64-NEXT: movq (%rdi), %rax
; X64-NEXT: movq (%rsi), %rcx
; X64-NEXT: bswapq %rax
; X64-NEXT: bswapq %rcx
+; X64-NEXT: xorl %edx, %edx
; X64-NEXT: cmpq %rcx, %rax
-; X64-NEXT: je .LBB11_1
-; X64-NEXT: # BB#2: # %res_block
; X64-NEXT: movl $-1, %ecx
; X64-NEXT: movl $1, %eax
; X64-NEXT: cmovbl %ecx, %eax
-; X64-NEXT: retq
-; X64-NEXT: .LBB11_1:
-; X64-NEXT: xorl %eax, %eax
+; X64-NEXT: cmovel %edx, %eax
; X64-NEXT: retq
%m = tail call i32 @memcmp(i8* %X, i8* %Y, i64 8) nounwind
ret i32 %m
}
define i1 @length8_eq(i8* %X, i8* %Y) nounwind {
-; X32-LABEL: length8_eq:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $8
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: testl %eax, %eax
-; X32-NEXT: sete %al
-; X32-NEXT: retl
+; X86-LABEL: length8_eq:
+; X86: # BB#0:
+; X86-NEXT: pushl $0
+; X86-NEXT: pushl $8
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: calll memcmp
+; X86-NEXT: addl $16, %esp
+; X86-NEXT: testl %eax, %eax
+; X86-NEXT: sete %al
+; X86-NEXT: retl
;
; X64-LABEL: length8_eq:
; X64: # BB#0:
@@ -353,17 +375,17 @@ define i1 @length8_eq(i8* %X, i8* %Y) nounwind {
}
define i1 @length8_eq_const(i8* %X) nounwind {
-; X32-LABEL: length8_eq_const:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $8
-; X32-NEXT: pushl $.L.str
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: testl %eax, %eax
-; X32-NEXT: setne %al
-; X32-NEXT: retl
+; X86-LABEL: length8_eq_const:
+; X86: # BB#0:
+; X86-NEXT: pushl $0
+; X86-NEXT: pushl $8
+; X86-NEXT: pushl $.L.str
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: calll memcmp
+; X86-NEXT: addl $16, %esp
+; X86-NEXT: testl %eax, %eax
+; X86-NEXT: setne %al
+; X86-NEXT: retl
;
; X64-LABEL: length8_eq_const:
; X64: # BB#0:
@@ -377,17 +399,17 @@ define i1 @length8_eq_const(i8* %X) nounwind {
}
define i1 @length12_eq(i8* %X, i8* %Y) nounwind {
-; X32-LABEL: length12_eq:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $12
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: testl %eax, %eax
-; X32-NEXT: setne %al
-; X32-NEXT: retl
+; X86-LABEL: length12_eq:
+; X86: # BB#0:
+; X86-NEXT: pushl $0
+; X86-NEXT: pushl $12
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: calll memcmp
+; X86-NEXT: addl $16, %esp
+; X86-NEXT: testl %eax, %eax
+; X86-NEXT: setne %al
+; X86-NEXT: retl
;
; X64-LABEL: length12_eq:
; X64: # BB#0:
@@ -404,15 +426,15 @@ define i1 @length12_eq(i8* %X, i8* %Y) nounwind {
}
define i32 @length12(i8* %X, i8* %Y) nounwind {
-; X32-LABEL: length12:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $12
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: retl
+; X86-LABEL: length12:
+; X86: # BB#0:
+; X86-NEXT: pushl $0
+; X86-NEXT: pushl $12
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: calll memcmp
+; X86-NEXT: addl $16, %esp
+; X86-NEXT: retl
;
; X64-LABEL: length12:
; X64: # BB#0:
@@ -425,15 +447,15 @@ define i32 @length12(i8* %X, i8* %Y) nounwind {
; PR33329 - https://bugs.llvm.org/show_bug.cgi?id=33329
define i32 @length16(i8* %X, i8* %Y) nounwind {
-; X32-LABEL: length16:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $16
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: retl
+; X86-LABEL: length16:
+; X86: # BB#0:
+; X86-NEXT: pushl $0
+; X86-NEXT: pushl $16
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: calll memcmp
+; X86-NEXT: addl $16, %esp
+; X86-NEXT: retl
;
; X64-LABEL: length16:
; X64: # BB#0:
@@ -444,86 +466,108 @@ define i32 @length16(i8* %X, i8* %Y) nounwind {
}
define i1 @length16_eq(i8* %x, i8* %y) nounwind {
-; X32-LABEL: length16_eq:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $16
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: testl %eax, %eax
-; X32-NEXT: setne %al
-; X32-NEXT: retl
-;
-; SSE2-LABEL: length16_eq:
-; 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_eq:
-; AVX2: # BB#0:
-; AVX2-NEXT: vmovdqu (%rdi), %xmm0
-; AVX2-NEXT: vpcmpeqb (%rsi), %xmm0, %xmm0
-; AVX2-NEXT: vpmovmskb %xmm0, %eax
-; AVX2-NEXT: cmpl $65535, %eax # imm = 0xFFFF
-; AVX2-NEXT: setne %al
-; AVX2-NEXT: retq
+; X86-NOSSE-LABEL: length16_eq:
+; X86-NOSSE: # BB#0:
+; X86-NOSSE-NEXT: pushl $0
+; X86-NOSSE-NEXT: pushl $16
+; X86-NOSSE-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NOSSE-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NOSSE-NEXT: calll memcmp
+; X86-NOSSE-NEXT: addl $16, %esp
+; X86-NOSSE-NEXT: testl %eax, %eax
+; X86-NOSSE-NEXT: setne %al
+; X86-NOSSE-NEXT: retl
+;
+; X86-SSE2-LABEL: length16_eq:
+; X86-SSE2: # BB#0:
+; X86-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-SSE2-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-SSE2-NEXT: movdqu (%ecx), %xmm0
+; X86-SSE2-NEXT: movdqu (%eax), %xmm1
+; X86-SSE2-NEXT: pcmpeqb %xmm0, %xmm1
+; X86-SSE2-NEXT: pmovmskb %xmm1, %eax
+; X86-SSE2-NEXT: cmpl $65535, %eax # imm = 0xFFFF
+; X86-SSE2-NEXT: setne %al
+; X86-SSE2-NEXT: retl
+;
+; X64-SSE2-LABEL: length16_eq:
+; X64-SSE2: # BB#0:
+; X64-SSE2-NEXT: movdqu (%rsi), %xmm0
+; X64-SSE2-NEXT: movdqu (%rdi), %xmm1
+; X64-SSE2-NEXT: pcmpeqb %xmm0, %xmm1
+; X64-SSE2-NEXT: pmovmskb %xmm1, %eax
+; X64-SSE2-NEXT: cmpl $65535, %eax # imm = 0xFFFF
+; X64-SSE2-NEXT: setne %al
+; X64-SSE2-NEXT: retq
+;
+; X64-AVX2-LABEL: length16_eq:
+; X64-AVX2: # BB#0:
+; X64-AVX2-NEXT: vmovdqu (%rdi), %xmm0
+; X64-AVX2-NEXT: vpcmpeqb (%rsi), %xmm0, %xmm0
+; X64-AVX2-NEXT: vpmovmskb %xmm0, %eax
+; X64-AVX2-NEXT: cmpl $65535, %eax # imm = 0xFFFF
+; X64-AVX2-NEXT: setne %al
+; X64-AVX2-NEXT: retq
%call = tail call i32 @memcmp(i8* %x, i8* %y, i64 16) nounwind
%cmp = icmp ne i32 %call, 0
ret i1 %cmp
}
define i1 @length16_eq_const(i8* %X) nounwind {
-; X32-LABEL: length16_eq_const:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $16
-; X32-NEXT: pushl $.L.str
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: testl %eax, %eax
-; X32-NEXT: sete %al
-; X32-NEXT: retl
-;
-; SSE2-LABEL: length16_eq_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_eq_const:
-; AVX2: # BB#0:
-; AVX2-NEXT: vmovdqu (%rdi), %xmm0
-; AVX2-NEXT: vpcmpeqb {{.*}}(%rip), %xmm0, %xmm0
-; AVX2-NEXT: vpmovmskb %xmm0, %eax
-; AVX2-NEXT: cmpl $65535, %eax # imm = 0xFFFF
-; AVX2-NEXT: sete %al
-; AVX2-NEXT: retq
+; X86-NOSSE-LABEL: length16_eq_const:
+; X86-NOSSE: # BB#0:
+; X86-NOSSE-NEXT: pushl $0
+; X86-NOSSE-NEXT: pushl $16
+; X86-NOSSE-NEXT: pushl $.L.str
+; X86-NOSSE-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NOSSE-NEXT: calll memcmp
+; X86-NOSSE-NEXT: addl $16, %esp
+; X86-NOSSE-NEXT: testl %eax, %eax
+; X86-NOSSE-NEXT: sete %al
+; X86-NOSSE-NEXT: retl
+;
+; X86-SSE2-LABEL: length16_eq_const:
+; X86-SSE2: # BB#0:
+; X86-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-SSE2-NEXT: movdqu (%eax), %xmm0
+; X86-SSE2-NEXT: pcmpeqb {{\.LCPI.*}}, %xmm0
+; X86-SSE2-NEXT: pmovmskb %xmm0, %eax
+; X86-SSE2-NEXT: cmpl $65535, %eax # imm = 0xFFFF
+; X86-SSE2-NEXT: sete %al
+; X86-SSE2-NEXT: retl
+;
+; X64-SSE2-LABEL: length16_eq_const:
+; X64-SSE2: # BB#0:
+; X64-SSE2-NEXT: movdqu (%rdi), %xmm0
+; X64-SSE2-NEXT: pcmpeqb {{.*}}(%rip), %xmm0
+; X64-SSE2-NEXT: pmovmskb %xmm0, %eax
+; X64-SSE2-NEXT: cmpl $65535, %eax # imm = 0xFFFF
+; X64-SSE2-NEXT: sete %al
+; X64-SSE2-NEXT: retq
+;
+; X64-AVX2-LABEL: length16_eq_const:
+; X64-AVX2: # BB#0:
+; X64-AVX2-NEXT: vmovdqu (%rdi), %xmm0
+; X64-AVX2-NEXT: vpcmpeqb {{.*}}(%rip), %xmm0, %xmm0
+; X64-AVX2-NEXT: vpmovmskb %xmm0, %eax
+; X64-AVX2-NEXT: cmpl $65535, %eax # imm = 0xFFFF
+; X64-AVX2-NEXT: sete %al
+; X64-AVX2-NEXT: retq
%m = tail call i32 @memcmp(i8* %X, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i32 0, i32 0), i64 16) nounwind
%c = icmp eq i32 %m, 0
ret i1 %c
}
define i32 @length32(i8* %X, i8* %Y) nounwind {
-; X32-LABEL: length32:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $32
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: retl
+; X86-LABEL: length32:
+; X86: # BB#0:
+; X86-NEXT: pushl $0
+; X86-NEXT: pushl $32
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: calll memcmp
+; X86-NEXT: addl $16, %esp
+; X86-NEXT: retl
;
; X64-LABEL: length32:
; X64: # BB#0:
@@ -536,90 +580,90 @@ define i32 @length32(i8* %X, i8* %Y) nounwind {
; PR33325 - https://bugs.llvm.org/show_bug.cgi?id=33325
define i1 @length32_eq(i8* %x, i8* %y) nounwind {
-; X32-LABEL: length32_eq:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $32
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: testl %eax, %eax
-; X32-NEXT: sete %al
-; X32-NEXT: retl
-;
-; SSE2-LABEL: length32_eq:
-; SSE2: # BB#0:
-; SSE2-NEXT: pushq %rax
-; SSE2-NEXT: movl $32, %edx
-; SSE2-NEXT: callq memcmp
-; SSE2-NEXT: testl %eax, %eax
-; SSE2-NEXT: sete %al
-; SSE2-NEXT: popq %rcx
-; SSE2-NEXT: retq
-;
-; AVX2-LABEL: length32_eq:
-; AVX2: # BB#0:
-; AVX2-NEXT: vmovdqu (%rdi), %ymm0
-; AVX2-NEXT: vpcmpeqb (%rsi), %ymm0, %ymm0
-; AVX2-NEXT: vpmovmskb %ymm0, %eax
-; AVX2-NEXT: cmpl $-1, %eax
-; AVX2-NEXT: sete %al
-; AVX2-NEXT: vzeroupper
-; AVX2-NEXT: retq
+; X86-LABEL: length32_eq:
+; X86: # BB#0:
+; X86-NEXT: pushl $0
+; X86-NEXT: pushl $32
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: calll memcmp
+; X86-NEXT: addl $16, %esp
+; X86-NEXT: testl %eax, %eax
+; X86-NEXT: sete %al
+; X86-NEXT: retl
+;
+; X64-SSE2-LABEL: length32_eq:
+; X64-SSE2: # BB#0:
+; X64-SSE2-NEXT: pushq %rax
+; X64-SSE2-NEXT: movl $32, %edx
+; X64-SSE2-NEXT: callq memcmp
+; X64-SSE2-NEXT: testl %eax, %eax
+; X64-SSE2-NEXT: sete %al
+; X64-SSE2-NEXT: popq %rcx
+; X64-SSE2-NEXT: retq
+;
+; X64-AVX2-LABEL: length32_eq:
+; X64-AVX2: # BB#0:
+; X64-AVX2-NEXT: vmovdqu (%rdi), %ymm0
+; X64-AVX2-NEXT: vpcmpeqb (%rsi), %ymm0, %ymm0
+; X64-AVX2-NEXT: vpmovmskb %ymm0, %eax
+; X64-AVX2-NEXT: cmpl $-1, %eax
+; X64-AVX2-NEXT: sete %al
+; X64-AVX2-NEXT: vzeroupper
+; X64-AVX2-NEXT: retq
%call = tail call i32 @memcmp(i8* %x, i8* %y, i64 32) nounwind
%cmp = icmp eq i32 %call, 0
ret i1 %cmp
}
define i1 @length32_eq_const(i8* %X) nounwind {
-; X32-LABEL: length32_eq_const:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $32
-; X32-NEXT: pushl $.L.str
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: testl %eax, %eax
-; X32-NEXT: setne %al
-; X32-NEXT: retl
-;
-; SSE2-LABEL: length32_eq_const:
-; SSE2: # BB#0:
-; SSE2-NEXT: pushq %rax
-; SSE2-NEXT: movl $.L.str, %esi
-; SSE2-NEXT: movl $32, %edx
-; SSE2-NEXT: callq memcmp
-; SSE2-NEXT: testl %eax, %eax
-; SSE2-NEXT: setne %al
-; SSE2-NEXT: popq %rcx
-; SSE2-NEXT: retq
-;
-; AVX2-LABEL: length32_eq_const:
-; AVX2: # BB#0:
-; AVX2-NEXT: vmovdqu (%rdi), %ymm0
-; AVX2-NEXT: vpcmpeqb {{.*}}(%rip), %ymm0, %ymm0
-; AVX2-NEXT: vpmovmskb %ymm0, %eax
-; AVX2-NEXT: cmpl $-1, %eax
-; AVX2-NEXT: setne %al
-; AVX2-NEXT: vzeroupper
-; AVX2-NEXT: retq
+; X86-LABEL: length32_eq_const:
+; X86: # BB#0:
+; X86-NEXT: pushl $0
+; X86-NEXT: pushl $32
+; X86-NEXT: pushl $.L.str
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: calll memcmp
+; X86-NEXT: addl $16, %esp
+; X86-NEXT: testl %eax, %eax
+; X86-NEXT: setne %al
+; X86-NEXT: retl
+;
+; X64-SSE2-LABEL: length32_eq_const:
+; X64-SSE2: # BB#0:
+; X64-SSE2-NEXT: pushq %rax
+; X64-SSE2-NEXT: movl $.L.str, %esi
+; X64-SSE2-NEXT: movl $32, %edx
+; X64-SSE2-NEXT: callq memcmp
+; X64-SSE2-NEXT: testl %eax, %eax
+; X64-SSE2-NEXT: setne %al
+; X64-SSE2-NEXT: popq %rcx
+; X64-SSE2-NEXT: retq
+;
+; X64-AVX2-LABEL: length32_eq_const:
+; X64-AVX2: # BB#0:
+; X64-AVX2-NEXT: vmovdqu (%rdi), %ymm0
+; X64-AVX2-NEXT: vpcmpeqb {{.*}}(%rip), %ymm0, %ymm0
+; X64-AVX2-NEXT: vpmovmskb %ymm0, %eax
+; X64-AVX2-NEXT: cmpl $-1, %eax
+; X64-AVX2-NEXT: setne %al
+; X64-AVX2-NEXT: vzeroupper
+; X64-AVX2-NEXT: retq
%m = tail call i32 @memcmp(i8* %X, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i32 0, i32 0), i64 32) nounwind
%c = icmp ne i32 %m, 0
ret i1 %c
}
define i32 @length64(i8* %X, i8* %Y) nounwind {
-; X32-LABEL: length64:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $64
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: retl
+; X86-LABEL: length64:
+; X86: # BB#0:
+; X86-NEXT: pushl $0
+; X86-NEXT: pushl $64
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: calll memcmp
+; X86-NEXT: addl $16, %esp
+; X86-NEXT: retl
;
; X64-LABEL: length64:
; X64: # BB#0:
@@ -630,17 +674,17 @@ define i32 @length64(i8* %X, i8* %Y) nounwind {
}
define i1 @length64_eq(i8* %x, i8* %y) nounwind {
-; X32-LABEL: length64_eq:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $64
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: testl %eax, %eax
-; X32-NEXT: setne %al
-; X32-NEXT: retl
+; X86-LABEL: length64_eq:
+; X86: # BB#0:
+; X86-NEXT: pushl $0
+; X86-NEXT: pushl $64
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: calll memcmp
+; X86-NEXT: addl $16, %esp
+; X86-NEXT: testl %eax, %eax
+; X86-NEXT: setne %al
+; X86-NEXT: retl
;
; X64-LABEL: length64_eq:
; X64: # BB#0:
@@ -657,17 +701,17 @@ define i1 @length64_eq(i8* %x, i8* %y) nounwind {
}
define i1 @length64_eq_const(i8* %X) nounwind {
-; X32-LABEL: length64_eq_const:
-; X32: # BB#0:
-; X32-NEXT: pushl $0
-; X32-NEXT: pushl $64
-; X32-NEXT: pushl $.L.str
-; X32-NEXT: pushl {{[0-9]+}}(%esp)
-; X32-NEXT: calll memcmp
-; X32-NEXT: addl $16, %esp
-; X32-NEXT: testl %eax, %eax
-; X32-NEXT: sete %al
-; X32-NEXT: retl
+; X86-LABEL: length64_eq_const:
+; X86: # BB#0:
+; X86-NEXT: pushl $0
+; X86-NEXT: pushl $64
+; X86-NEXT: pushl $.L.str
+; X86-NEXT: pushl {{[0-9]+}}(%esp)
+; X86-NEXT: calll memcmp
+; X86-NEXT: addl $16, %esp
+; X86-NEXT: testl %eax, %eax
+; X86-NEXT: sete %al
+; X86-NEXT: retl
;
; X64-LABEL: length64_eq_const:
; X64: # BB#0: