1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
4 @.str1 = private constant [4 x i8] c"\00\00\00\00", align 1
5 @.str2 = private constant [4 x i8] c"\ff\ff\ff\ff", align 1
7 declare i32 @memcmp(ptr, ptr, i64)
9 define i32 @length4_same() nounwind {
10 ; CHECK-LABEL: length4_same:
12 ; CHECK-NEXT: xorl %eax, %eax
14 %m = tail call i32 @memcmp(ptr @.str1, ptr @.str1, i64 4) nounwind
18 define i1 @length4_same_lt() nounwind {
19 ; CHECK-LABEL: length4_same_lt:
21 ; CHECK-NEXT: xorl %eax, %eax
23 %m = tail call i32 @memcmp(ptr @.str1, ptr @.str1, i64 4) nounwind
24 %c = icmp slt i32 %m, 0
28 define i1 @length4_same_gt() nounwind {
29 ; CHECK-LABEL: length4_same_gt:
31 ; CHECK-NEXT: xorl %eax, %eax
33 %m = tail call i32 @memcmp(ptr @.str1, ptr @.str1, i64 4) nounwind
34 %c = icmp sgt i32 %m, 0
38 define i1 @length4_same_le() nounwind {
39 ; CHECK-LABEL: length4_same_le:
41 ; CHECK-NEXT: movb $1, %al
43 %m = tail call i32 @memcmp(ptr @.str1, ptr @.str1, i64 4) nounwind
44 %c = icmp sle i32 %m, 0
48 define i1 @length4_same_ge() nounwind {
49 ; CHECK-LABEL: length4_same_ge:
51 ; CHECK-NEXT: movb $1, %al
53 %m = tail call i32 @memcmp(ptr @.str1, ptr @.str1, i64 4) nounwind
54 %c = icmp sge i32 %m, 0
59 define i32 @length4() nounwind {
60 ; CHECK-LABEL: length4:
62 ; CHECK-NEXT: movl $-1, %eax
64 %m = tail call i32 @memcmp(ptr @.str1, ptr @.str2, i64 4) nounwind
68 define i1 @length4_lt() nounwind {
69 ; CHECK-LABEL: length4_lt:
71 ; CHECK-NEXT: movb $1, %al
73 %m = tail call i32 @memcmp(ptr @.str1, ptr @.str2, i64 4) nounwind
74 %c = icmp slt i32 %m, 0
78 define i1 @length4_gt() nounwind {
79 ; CHECK-LABEL: length4_gt:
81 ; CHECK-NEXT: xorl %eax, %eax
83 %m = tail call i32 @memcmp(ptr @.str1, ptr @.str2, i64 4) nounwind
84 %c = icmp sgt i32 %m, 0
88 define i1 @length4_le() nounwind {
89 ; CHECK-LABEL: length4_le:
91 ; CHECK-NEXT: movb $1, %al
93 %m = tail call i32 @memcmp(ptr @.str1, ptr @.str2, i64 4) nounwind
94 %c = icmp sle i32 %m, 0
98 define i1 @length4_ge() nounwind {
99 ; CHECK-LABEL: length4_ge:
101 ; CHECK-NEXT: xorl %eax, %eax
103 %m = tail call i32 @memcmp(ptr @.str1, ptr @.str2, i64 4) nounwind
104 %c = icmp sge i32 %m, 0