Lines Matching refs:BMI2

5 …86-unknown-linux-gnu -mattr=+cmov,+bmi,+tbm,+bmi2 < %s | FileCheck %s --check-prefixes=X86,X86-BMI2
6 …86-unknown-linux-gnu -mattr=+cmov,+bmi,-tbm,+bmi2 < %s | FileCheck %s --check-prefixes=X86,X86-BMI2
10 …e=x86_64-unknown-linux-gnu -mattr=+bmi,+tbm,+bmi2 < %s | FileCheck %s --check-prefixes=X64,X64-BMI2
11 …e=x86_64-unknown-linux-gnu -mattr=+bmi,-tbm,+bmi2 < %s | FileCheck %s --check-prefixes=X64,X64-BMI2
16 ; are equivalent, but we prefer the second variant if we have BMI2.
18 ; We do not test the variant where y = (32 - z), because that is BMI2's BZHI.
109 ; X86-BMI2-LABEL: clear_highbits16_c0:
110 ; X86-BMI2: # %bb.0:
111 ; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
112 ; X86-BMI2-NEXT: shlxl %eax, {{[0-9]+}}(%esp), %ecx
113 ; X86-BMI2-NEXT: movzwl %cx, %ecx
114 ; X86-BMI2-NEXT: shrxl %eax, %ecx, %eax
115 ; X86-BMI2-NEXT: # kill: def $ax killed $ax killed $eax
116 ; X86-BMI2-NEXT: retl
128 ; X64-BMI2-LABEL: clear_highbits16_c0:
129 ; X64-BMI2: # %bb.0:
130 ; X64-BMI2-NEXT: shlxl %esi, %edi, %eax
131 ; X64-BMI2-NEXT: movzwl %ax, %eax
132 ; X64-BMI2-NEXT: shrxl %esi, %eax, %eax
133 ; X64-BMI2-NEXT: # kill: def $ax killed $ax killed $eax
134 ; X64-BMI2-NEXT: retq
151 ; X86-BMI2-LABEL: clear_highbits16_c1_indexzext:
152 ; X86-BMI2: # %bb.0:
153 ; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
154 ; X86-BMI2-NEXT: shlxl %eax, {{[0-9]+}}(%esp), %ecx
155 ; X86-BMI2-NEXT: movzwl %cx, %ecx
156 ; X86-BMI2-NEXT: shrxl %eax, %ecx, %eax
157 ; X86-BMI2-NEXT: # kill: def $ax killed $ax killed $eax
158 ; X86-BMI2-NEXT: retl
170 ; X64-BMI2-LABEL: clear_highbits16_c1_indexzext:
171 ; X64-BMI2: # %bb.0:
172 ; X64-BMI2-NEXT: shlxl %esi, %edi, %eax
173 ; X64-BMI2-NEXT: movzwl %ax, %eax
174 ; X64-BMI2-NEXT: shrxl %esi, %eax, %eax
175 ; X64-BMI2-NEXT: # kill: def $ax killed $ax killed $eax
176 ; X64-BMI2-NEXT: retq
195 ; X86-BMI2-LABEL: clear_highbits16_c2_load:
196 ; X86-BMI2: # %bb.0:
197 ; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
198 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %ecx
199 ; X86-BMI2-NEXT: movzwl (%ecx), %ecx
200 ; X86-BMI2-NEXT: shlxl %eax, %ecx, %ecx
201 ; X86-BMI2-NEXT: movzwl %cx, %ecx
202 ; X86-BMI2-NEXT: shrxl %eax, %ecx, %eax
203 ; X86-BMI2-NEXT: # kill: def $ax killed $ax killed $eax
204 ; X86-BMI2-NEXT: retl
217 ; X64-BMI2-LABEL: clear_highbits16_c2_load:
218 ; X64-BMI2: # %bb.0:
219 ; X64-BMI2-NEXT: movzwl (%rdi), %eax
220 ; X64-BMI2-NEXT: shlxl %esi, %eax, %eax
221 ; X64-BMI2-NEXT: movzwl %ax, %eax
222 ; X64-BMI2-NEXT: shrxl %esi, %eax, %eax
223 ; X64-BMI2-NEXT: # kill: def $ax killed $ax killed $eax
224 ; X64-BMI2-NEXT: retq
243 ; X86-BMI2-LABEL: clear_highbits16_c3_load_indexzext:
244 ; X86-BMI2: # %bb.0:
245 ; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
246 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %ecx
247 ; X86-BMI2-NEXT: movzwl (%ecx), %ecx
248 ; X86-BMI2-NEXT: shlxl %eax, %ecx, %ecx
249 ; X86-BMI2-NEXT: movzwl %cx, %ecx
250 ; X86-BMI2-NEXT: shrxl %eax, %ecx, %eax
251 ; X86-BMI2-NEXT: # kill: def $ax killed $ax killed $eax
252 ; X86-BMI2-NEXT: retl
265 ; X64-BMI2-LABEL: clear_highbits16_c3_load_indexzext:
266 ; X64-BMI2: # %bb.0:
267 ; X64-BMI2-NEXT: movzwl (%rdi), %eax
268 ; X64-BMI2-NEXT: shlxl %esi, %eax, %eax
269 ; X64-BMI2-NEXT: movzwl %ax, %eax
270 ; X64-BMI2-NEXT: shrxl %esi, %eax, %eax
271 ; X64-BMI2-NEXT: # kill: def $ax killed $ax killed $eax
272 ; X64-BMI2-NEXT: retq
291 ; X86-BMI2-LABEL: clear_highbits16_c4_commutative:
292 ; X86-BMI2: # %bb.0:
293 ; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
294 ; X86-BMI2-NEXT: shlxl %eax, {{[0-9]+}}(%esp), %ecx
295 ; X86-BMI2-NEXT: movzwl %cx, %ecx
296 ; X86-BMI2-NEXT: shrxl %eax, %ecx, %eax
297 ; X86-BMI2-NEXT: # kill: def $ax killed $ax killed $eax
298 ; X86-BMI2-NEXT: retl
310 ; X64-BMI2-LABEL: clear_highbits16_c4_commutative:
311 ; X64-BMI2: # %bb.0:
312 ; X64-BMI2-NEXT: shlxl %esi, %edi, %eax
313 ; X64-BMI2-NEXT: movzwl %ax, %eax
314 ; X64-BMI2-NEXT: shrxl %esi, %eax, %eax
315 ; X64-BMI2-NEXT: # kill: def $ax killed $ax killed $eax
316 ; X64-BMI2-NEXT: retq
335 ; X86-BMI2-LABEL: clear_highbits32_c0:
336 ; X86-BMI2: # %bb.0:
337 ; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
338 ; X86-BMI2-NEXT: shlxl %eax, {{[0-9]+}}(%esp), %ecx
339 ; X86-BMI2-NEXT: shrxl %eax, %ecx, %eax
340 ; X86-BMI2-NEXT: retl
351 ; X64-BMI2-LABEL: clear_highbits32_c0:
352 ; X64-BMI2: # %bb.0:
353 ; X64-BMI2-NEXT: shlxl %esi, %edi, %eax
354 ; X64-BMI2-NEXT: shrxl %esi, %eax, %eax
355 ; X64-BMI2-NEXT: retq
370 ; X86-BMI2-LABEL: clear_highbits32_c1_indexzext:
371 ; X86-BMI2: # %bb.0:
372 ; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
373 ; X86-BMI2-NEXT: shlxl %eax, {{[0-9]+}}(%esp), %ecx
374 ; X86-BMI2-NEXT: shrxl %eax, %ecx, %eax
375 ; X86-BMI2-NEXT: retl
386 ; X64-BMI2-LABEL: clear_highbits32_c1_indexzext:
387 ; X64-BMI2: # %bb.0:
388 ; X64-BMI2-NEXT: shlxl %esi, %edi, %eax
389 ; X64-BMI2-NEXT: shrxl %esi, %eax, %eax
390 ; X64-BMI2-NEXT: retq
407 ; X86-BMI2-LABEL: clear_highbits32_c2_load:
408 ; X86-BMI2: # %bb.0:
409 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
410 ; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %cl
411 ; X86-BMI2-NEXT: shlxl %ecx, (%eax), %eax
412 ; X86-BMI2-NEXT: shrxl %ecx, %eax, %eax
413 ; X86-BMI2-NEXT: retl
424 ; X64-BMI2-LABEL: clear_highbits32_c2_load:
425 ; X64-BMI2: # %bb.0:
426 ; X64-BMI2-NEXT: shlxl %esi, (%rdi), %eax
427 ; X64-BMI2-NEXT: shrxl %esi, %eax, %eax
428 ; X64-BMI2-NEXT: retq
445 ; X86-BMI2-LABEL: clear_highbits32_c3_load_indexzext:
446 ; X86-BMI2: # %bb.0:
447 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
448 ; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %cl
449 ; X86-BMI2-NEXT: shlxl %ecx, (%eax), %eax
450 ; X86-BMI2-NEXT: shrxl %ecx, %eax, %eax
451 ; X86-BMI2-NEXT: retl
462 ; X64-BMI2-LABEL: clear_highbits32_c3_load_indexzext:
463 ; X64-BMI2: # %bb.0:
464 ; X64-BMI2-NEXT: shlxl %esi, (%rdi), %eax
465 ; X64-BMI2-NEXT: shrxl %esi, %eax, %eax
466 ; X64-BMI2-NEXT: retq
483 ; X86-BMI2-LABEL: clear_highbits32_c4_commutative:
484 ; X86-BMI2: # %bb.0:
485 ; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
486 ; X86-BMI2-NEXT: shlxl %eax, {{[0-9]+}}(%esp), %ecx
487 ; X86-BMI2-NEXT: shrxl %eax, %ecx, %eax
488 ; X86-BMI2-NEXT: retl
499 ; X64-BMI2-LABEL: clear_highbits32_c4_commutative:
500 ; X64-BMI2: # %bb.0:
501 ; X64-BMI2-NEXT: shlxl %esi, %edi, %eax
502 ; X64-BMI2-NEXT: shrxl %esi, %eax, %eax
503 ; X64-BMI2-NEXT: retq
567 ; X86-BMI2-LABEL: clear_highbits64_c0:
568 ; X86-BMI2: # %bb.0:
569 ; X86-BMI2-NEXT: pushl %esi
570 ; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %cl
571 ; X86-BMI2-NEXT: movl $-1, %eax
572 ; X86-BMI2-NEXT: shrxl %ecx, %eax, %esi
573 ; X86-BMI2-NEXT: xorl %edx, %edx
574 ; X86-BMI2-NEXT: testb $32, %cl
575 ; X86-BMI2-NEXT: cmovel %esi, %edx
576 ; X86-BMI2-NEXT: cmovnel %esi, %eax
577 ; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %eax
578 ; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %edx
579 ; X86-BMI2-NEXT: popl %esi
580 ; X86-BMI2-NEXT: retl
591 ; X64-BMI2-LABEL: clear_highbits64_c0:
592 ; X64-BMI2: # %bb.0:
593 ; X64-BMI2-NEXT: shlxq %rsi, %rdi, %rax
594 ; X64-BMI2-NEXT: shrxq %rsi, %rax, %rax
595 ; X64-BMI2-NEXT: retq
655 ; X86-BMI2-LABEL: clear_highbits64_c1_indexzext:
656 ; X86-BMI2: # %bb.0:
657 ; X86-BMI2-NEXT: pushl %esi
658 ; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %cl
659 ; X86-BMI2-NEXT: movl $-1, %eax
660 ; X86-BMI2-NEXT: shrxl %ecx, %eax, %esi
661 ; X86-BMI2-NEXT: xorl %edx, %edx
662 ; X86-BMI2-NEXT: testb $32, %cl
663 ; X86-BMI2-NEXT: cmovel %esi, %edx
664 ; X86-BMI2-NEXT: cmovnel %esi, %eax
665 ; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %eax
666 ; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %edx
667 ; X86-BMI2-NEXT: popl %esi
668 ; X86-BMI2-NEXT: retl
679 ; X64-BMI2-LABEL: clear_highbits64_c1_indexzext:
680 ; X64-BMI2: # %bb.0:
681 ; X64-BMI2-NEXT: # kill: def $esi killed $esi def $rsi
682 ; X64-BMI2-NEXT: shlxq %rsi, %rdi, %rax
683 ; X64-BMI2-NEXT: shrxq %rsi, %rax, %rax
684 ; X64-BMI2-NEXT: retq
754 ; X86-BMI2-LABEL: clear_highbits64_c2_load:
755 ; X86-BMI2: # %bb.0:
756 ; X86-BMI2-NEXT: pushl %ebx
757 ; X86-BMI2-NEXT: pushl %esi
758 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %ecx
759 ; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %bl
760 ; X86-BMI2-NEXT: movl $-1, %eax
761 ; X86-BMI2-NEXT: shrxl %ebx, %eax, %esi
762 ; X86-BMI2-NEXT: xorl %edx, %edx
763 ; X86-BMI2-NEXT: testb $32, %bl
764 ; X86-BMI2-NEXT: cmovel %esi, %edx
765 ; X86-BMI2-NEXT: cmovnel %esi, %eax
766 ; X86-BMI2-NEXT: andl (%ecx), %eax
767 ; X86-BMI2-NEXT: andl 4(%ecx), %edx
768 ; X86-BMI2-NEXT: popl %esi
769 ; X86-BMI2-NEXT: popl %ebx
770 ; X86-BMI2-NEXT: retl
781 ; X64-BMI2-LABEL: clear_highbits64_c2_load:
782 ; X64-BMI2: # %bb.0:
783 ; X64-BMI2-NEXT: shlxq %rsi, (%rdi), %rax
784 ; X64-BMI2-NEXT: shrxq %rsi, %rax, %rax
785 ; X64-BMI2-NEXT: retq
855 ; X86-BMI2-LABEL: clear_highbits64_c3_load_indexzext:
856 ; X86-BMI2: # %bb.0:
857 ; X86-BMI2-NEXT: pushl %ebx
858 ; X86-BMI2-NEXT: pushl %esi
859 ; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %ecx
860 ; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %bl
861 ; X86-BMI2-NEXT: movl $-1, %eax
862 ; X86-BMI2-NEXT: shrxl %ebx, %eax, %esi
863 ; X86-BMI2-NEXT: xorl %edx, %edx
864 ; X86-BMI2-NEXT: testb $32, %bl
865 ; X86-BMI2-NEXT: cmovel %esi, %edx
866 ; X86-BMI2-NEXT: cmovnel %esi, %eax
867 ; X86-BMI2-NEXT: andl (%ecx), %eax
868 ; X86-BMI2-NEXT: andl 4(%ecx), %edx
869 ; X86-BMI2-NEXT: popl %esi
870 ; X86-BMI2-NEXT: popl %ebx
871 ; X86-BMI2-NEXT: retl
882 ; X64-BMI2-LABEL: clear_highbits64_c3_load_indexzext:
883 ; X64-BMI2: # %bb.0:
884 ; X64-BMI2-NEXT: # kill: def $esi killed $esi def $rsi
885 ; X64-BMI2-NEXT: shlxq %rsi, (%rdi), %rax
886 ; X64-BMI2-NEXT: shrxq %rsi, %rax, %rax
887 ; X64-BMI2-NEXT: retq
949 ; X86-BMI2-LABEL: clear_highbits64_c4_commutative:
950 ; X86-BMI2: # %bb.0:
951 ; X86-BMI2-NEXT: pushl %esi
952 ; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %cl
953 ; X86-BMI2-NEXT: movl $-1, %eax
954 ; X86-BMI2-NEXT: shrxl %ecx, %eax, %esi
955 ; X86-BMI2-NEXT: xorl %edx, %edx
956 ; X86-BMI2-NEXT: testb $32, %cl
957 ; X86-BMI2-NEXT: cmovel %esi, %edx
958 ; X86-BMI2-NEXT: cmovnel %esi, %eax
959 ; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %eax
960 ; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %edx
961 ; X86-BMI2-NEXT: popl %esi
962 ; X86-BMI2-NEXT: retl
973 ; X64-BMI2-LABEL: clear_highbits64_c4_commutative:
974 ; X64-BMI2: # %bb.0:
975 ; X64-BMI2-NEXT: shlxq %rsi, %rdi, %rax
976 ; X64-BMI2-NEXT: shrxq %rsi, %rax, %rax
977 ; X64-BMI2-NEXT: retq
1006 ; X86-BMI2-LABEL: oneuse32:
1007 ; X86-BMI2: # %bb.0:
1008 ; X86-BMI2-NEXT: pushl %esi
1009 ; X86-BMI2-NEXT: subl $8, %esp
1010 ; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
1011 ; X86-BMI2-NEXT: movl $-1, %ecx
1012 ; X86-BMI2-NEXT: shrxl %eax, %ecx, %esi
1013 ; X86-BMI2-NEXT: movl %esi, (%esp)
1014 ; X86-BMI2-NEXT: calll use32
1015 ; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %esi
1016 ; X86-BMI2-NEXT: movl %esi, %eax
1017 ; X86-BMI2-NEXT: addl $8, %esp
1018 ; X86-BMI2-NEXT: popl %esi
1019 ; X86-BMI2-NEXT: retl
1040 ; X64-BMI2-LABEL: oneuse32:
1041 ; X64-BMI2: # %bb.0:
1042 ; X64-BMI2-NEXT: pushq %rbp
1043 ; X64-BMI2-NEXT: pushq %rbx
1044 ; X64-BMI2-NEXT: pushq %rax
1045 ; X64-BMI2-NEXT: movl %edi, %ebx
1046 ; X64-BMI2-NEXT: movl $-1, %eax
1047 ; X64-BMI2-NEXT: shrxl %esi, %eax, %ebp
1048 ; X64-BMI2-NEXT: movl %ebp, %edi
1049 ; X64-BMI2-NEXT: callq use32
1050 ; X64-BMI2-NEXT: andl %ebx, %ebp
1051 ; X64-BMI2-NEXT: movl %ebp, %eax
1052 ; X64-BMI2-NEXT: addq $8, %rsp
1053 ; X64-BMI2-NEXT: popq %rbx
1054 ; X64-BMI2-NEXT: popq %rbp
1055 ; X64-BMI2-NEXT: retq
1146 ; X86-BMI2-LABEL: oneuse64:
1147 ; X86-BMI2: # %bb.0:
1148 ; X86-BMI2-NEXT: pushl %edi
1149 ; X86-BMI2-NEXT: pushl %esi
1150 ; X86-BMI2-NEXT: pushl %eax
1151 ; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
1152 ; X86-BMI2-NEXT: movl $-1, %esi
1153 ; X86-BMI2-NEXT: shrxl %eax, %esi, %ecx
1154 ; X86-BMI2-NEXT: xorl %edi, %edi
1155 ; X86-BMI2-NEXT: testb $32, %al
1156 ; X86-BMI2-NEXT: cmovnel %ecx, %esi
1157 ; X86-BMI2-NEXT: cmovel %ecx, %edi
1158 ; X86-BMI2-NEXT: subl $8, %esp
1159 ; X86-BMI2-NEXT: pushl %edi
1160 ; X86-BMI2-NEXT: pushl %esi
1161 ; X86-BMI2-NEXT: calll use64
1162 ; X86-BMI2-NEXT: addl $16, %esp
1163 ; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %esi
1164 ; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %edi
1165 ; X86-BMI2-NEXT: movl %esi, %eax
1166 ; X86-BMI2-NEXT: movl %edi, %edx
1167 ; X86-BMI2-NEXT: addl $4, %esp
1168 ; X86-BMI2-NEXT: popl %esi
1169 ; X86-BMI2-NEXT: popl %edi
1170 ; X86-BMI2-NEXT: retl
1191 ; X64-BMI2-LABEL: oneuse64:
1192 ; X64-BMI2: # %bb.0:
1193 ; X64-BMI2-NEXT: pushq %r14
1194 ; X64-BMI2-NEXT: pushq %rbx
1195 ; X64-BMI2-NEXT: pushq %rax
1196 ; X64-BMI2-NEXT: movq %rdi, %r14
1197 ; X64-BMI2-NEXT: movq $-1, %rax
1198 ; X64-BMI2-NEXT: shrxq %rsi, %rax, %rbx
1199 ; X64-BMI2-NEXT: movq %rbx, %rdi
1200 ; X64-BMI2-NEXT: callq use64
1201 ; X64-BMI2-NEXT: andq %r14, %rbx
1202 ; X64-BMI2-NEXT: movq %rbx, %rax
1203 ; X64-BMI2-NEXT: addq $8, %rsp
1204 ; X64-BMI2-NEXT: popq %rbx
1205 ; X64-BMI2-NEXT: popq %r14
1206 ; X64-BMI2-NEXT: retq