22; RUN: llc < %s -mtriple=x86_64-- -mcpu=x86-64-v2 | FileCheck %s --check-prefixes=CHECK,NOBMI
33; RUN: llc < %s -mtriple=x86_64-- -mcpu=x86-64-v3 | FileCheck %s --check-prefixes=CHECK,BMI
44
5- define i64 @test_i64 (i64 %w , i64 %x , i64 %y , i64 %z ) {
6- ; NOBMI-LABEL: test_i64 :
5+ define i64 @foo (i64 %w , i64 %x , i64 %y , i64 %z ) {
6+ ; NOBMI-LABEL: foo :
77; NOBMI: # %bb.0: # %Entry
88; NOBMI-NEXT: movq %rcx, %rax
99; NOBMI-NEXT: andq %rdx, %rsi
@@ -14,7 +14,7 @@ define i64 @test_i64(i64 %w, i64 %x, i64 %y, i64 %z) {
1414; NOBMI-NEXT: andq %rsi, %rax
1515; NOBMI-NEXT: retq
1616;
17- ; BMI-LABEL: test_i64 :
17+ ; BMI-LABEL: foo :
1818; BMI: # %bb.0: # %Entry
1919; BMI-NEXT: andq %rdx, %rsi
2020; BMI-NEXT: andnq %rdi, %rsi, %rax
@@ -31,91 +31,8 @@ Entry:
3131 ret i64 %and3
3232}
3333
34- define i32 @test_i32 (i32 %w , i32 %x , i32 %y , i32 %z ) {
35- ; NOBMI-LABEL: test_i32:
36- ; NOBMI: # %bb.0: # %Entry
37- ; NOBMI-NEXT: movl %ecx, %eax
38- ; NOBMI-NEXT: andl %edx, %esi
39- ; NOBMI-NEXT: notl %esi
40- ; NOBMI-NEXT: andl %edi, %esi
41- ; NOBMI-NEXT: notl %eax
42- ; NOBMI-NEXT: orl %edx, %eax
43- ; NOBMI-NEXT: andl %esi, %eax
44- ; NOBMI-NEXT: retq
45- ;
46- ; BMI-LABEL: test_i32:
47- ; BMI: # %bb.0: # %Entry
48- ; BMI-NEXT: andl %edx, %esi
49- ; BMI-NEXT: andnl %edi, %esi, %eax
50- ; BMI-NEXT: andnl %ecx, %edx, %ecx
51- ; BMI-NEXT: andnl %eax, %ecx, %eax
52- ; BMI-NEXT: retq
53- Entry:
54- %and1 = and i32 %y , %x
55- %xor1 = xor i32 %and1 , -1
56- %and2 = and i32 %xor1 , %w
57- %.not = xor i32 %z , -1
58- %or1 = or i32 %.not , %y
59- %and3 = and i32 %and2 , %or1
60- ret i32 %and3
61- }
62-
63- define i16 @test_i16 (i16 %w , i16 %x , i16 %y , i16 %z ) {
64- ; NOBMI-LABEL: test_i16:
65- ; NOBMI: # %bb.0: # %Entry
66- ; NOBMI-NEXT: movl %ecx, %eax
67- ; NOBMI-NEXT: andl %edx, %esi
68- ; NOBMI-NEXT: notl %esi
69- ; NOBMI-NEXT: andl %edi, %esi
70- ; NOBMI-NEXT: notl %eax
71- ; NOBMI-NEXT: orl %edx, %eax
72- ; NOBMI-NEXT: andl %esi, %eax
73- ; NOBMI-NEXT: # kill: def $ax killed $ax killed $eax
74- ; NOBMI-NEXT: retq
75- ;
76- ; BMI-LABEL: test_i16:
77- ; BMI: # %bb.0: # %Entry
78- ; BMI-NEXT: andl %edx, %esi
79- ; BMI-NEXT: andnl %edi, %esi, %eax
80- ; BMI-NEXT: notl %ecx
81- ; BMI-NEXT: orl %edx, %ecx
82- ; BMI-NEXT: andl %ecx, %eax
83- ; BMI-NEXT: # kill: def $ax killed $ax killed $eax
84- ; BMI-NEXT: retq
85- Entry:
86- %and1 = and i16 %y , %x
87- %xor1 = xor i16 %and1 , -1
88- %and2 = and i16 %xor1 , %w
89- %.not = xor i16 %z , -1
90- %or1 = or i16 %.not , %y
91- %and3 = and i16 %and2 , %or1
92- ret i16 %and3
93- }
94-
95- define i8 @test_i8 (i8 %w , i8 %x , i8 %y , i8 %z ) {
96- ; CHECK-LABEL: test_i8:
97- ; CHECK: # %bb.0: # %Entry
98- ; CHECK-NEXT: movl %edx, %eax
99- ; CHECK-NEXT: andl %edx, %esi
100- ; CHECK-NEXT: notb %sil
101- ; CHECK-NEXT: andb %dil, %sil
102- ; CHECK-NEXT: notb %cl
103- ; CHECK-NEXT: orb %cl, %al
104- ; CHECK-NEXT: andb %sil, %al
105- ; CHECK-NEXT: # kill: def $al killed $al killed $eax
106- ; CHECK-NEXT: retq
107- Entry:
108- %and1 = and i8 %y , %x
109- %xor1 = xor i8 %and1 , -1
110- %and2 = and i8 %xor1 , %w
111- %.not = xor i8 %z , -1
112- %or1 = or i8 %.not , %y
113- %and3 = and i8 %and2 , %or1
114- ret i8 %and3
115- }
116-
117- define <16 x i8 > @test_v16i8 (<16 x i8 > %w , <16 x i8 > %x , <16 x i8 > %y , <16 x i8 > %z ) {
118- ; NOBMI-LABEL: test_v16i8:
34+ define <16 x i8 > @fooVec (<16 x i8 > %w , <16 x i8 > %x , <16 x i8 > %y , <16 x i8 > %z ) {
35+ ; NOBMI-LABEL: fooVec:
11936; NOBMI: # %bb.0: # %Entry
12037; NOBMI-NEXT: andps %xmm2, %xmm1
12138; NOBMI-NEXT: andnps %xmm0, %xmm1
@@ -124,7 +41,7 @@ define <16 x i8> @test_v16i8(<16 x i8> %w, <16 x i8> %x, <16 x i8> %y, <16 x i8>
12441; NOBMI-NEXT: movaps %xmm2, %xmm0
12542; NOBMI-NEXT: retq
12643;
127- ; BMI-LABEL: test_v16i8 :
44+ ; BMI-LABEL: fooVec :
12845; BMI: # %bb.0: # %Entry
12946; BMI-NEXT: vandps %xmm1, %xmm2, %xmm1
13047; BMI-NEXT: vandnps %xmm0, %xmm1, %xmm0
0 commit comments