[llvm] f549977 - [NFC][X86] Adjust multi-use tests in clear-highbits.ll, add pat. d tests
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 7 12:38:22 PDT 2021
Author: Roman Lebedev
Date: 2021-09-07T22:38:11+03:00
New Revision: f549977397f5d68d91174e32f47aae9bc5e293f1
URL: https://github.com/llvm/llvm-project/commit/f549977397f5d68d91174e32f47aae9bc5e293f1
DIFF: https://github.com/llvm/llvm-project/commit/f549977397f5d68d91174e32f47aae9bc5e293f1.diff
LOG: [NFC][X86] Adjust multi-use tests in clear-highbits.ll, add pat. d tests
Added:
Modified:
llvm/test/CodeGen/X86/clear-highbits.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/clear-highbits.ll b/llvm/test/CodeGen/X86/clear-highbits.ll
index 58054dcaaac9..1f1df3d2d731 100644
--- a/llvm/test/CodeGen/X86/clear-highbits.ll
+++ b/llvm/test/CodeGen/X86/clear-highbits.ll
@@ -1,7 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=-bmi,-tbm,-bmi2 < %s | FileCheck %s --check-prefixes=X86,X86-NOBMI2,X86-FALLBACK0
-; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+cmov,+bmi,-tbm,-bmi2 < %s | FileCheck %s --check-prefixes=X86,X86-NOBMI2,X86-FALLBACK1
-; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+cmov,+bmi,+tbm,-bmi2 < %s | FileCheck %s --check-prefixes=X86,X86-NOBMI2,X86-FALLBACK2
+; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=-bmi,-tbm,-bmi2 < %s | FileCheck %s --check-prefixes=X86,X86-NOBMI2,X86-BASELINE
+; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+cmov,+bmi,-tbm,-bmi2 < %s | FileCheck %s --check-prefixes=X86,X86-NOBMI2,X86-BMI1
+; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+cmov,+bmi,+tbm,-bmi2 < %s | FileCheck %s --check-prefixes=X86,X86-NOBMI2,X86-BMI1
; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+cmov,+bmi,+tbm,+bmi2 < %s | FileCheck %s --check-prefixes=X86,X86-BMI2
; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+cmov,+bmi,-tbm,+bmi2 < %s | FileCheck %s --check-prefixes=X86,X86-BMI2
; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=-bmi,-tbm,-bmi2 < %s | FileCheck %s --check-prefixes=X64,X64-NOBMI2
@@ -511,58 +511,42 @@ define i32 @clear_highbits32_c4_commutative(i32 %val, i32 %numhighbits) nounwind
; ---------------------------------------------------------------------------- ;
define i64 @clear_highbits64_c0(i64 %val, i64 %numhighbits) nounwind {
-; X86-FALLBACK0-LABEL: clear_highbits64_c0:
-; X86-FALLBACK0: # %bb.0:
-; X86-FALLBACK0-NEXT: pushl %esi
-; X86-FALLBACK0-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-FALLBACK0-NEXT: movl $-1, %eax
-; X86-FALLBACK0-NEXT: movl $-1, %esi
-; X86-FALLBACK0-NEXT: shrl %cl, %esi
-; X86-FALLBACK0-NEXT: xorl %edx, %edx
-; X86-FALLBACK0-NEXT: testb $32, %cl
-; X86-FALLBACK0-NEXT: jne .LBB13_1
-; X86-FALLBACK0-NEXT: # %bb.2:
-; X86-FALLBACK0-NEXT: movl %esi, %edx
-; X86-FALLBACK0-NEXT: jmp .LBB13_3
-; X86-FALLBACK0-NEXT: .LBB13_1:
-; X86-FALLBACK0-NEXT: movl %esi, %eax
-; X86-FALLBACK0-NEXT: .LBB13_3:
-; X86-FALLBACK0-NEXT: andl {{[0-9]+}}(%esp), %eax
-; X86-FALLBACK0-NEXT: andl {{[0-9]+}}(%esp), %edx
-; X86-FALLBACK0-NEXT: popl %esi
-; X86-FALLBACK0-NEXT: retl
-;
-; X86-FALLBACK1-LABEL: clear_highbits64_c0:
-; X86-FALLBACK1: # %bb.0:
-; X86-FALLBACK1-NEXT: pushl %esi
-; X86-FALLBACK1-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-FALLBACK1-NEXT: movl $-1, %esi
-; X86-FALLBACK1-NEXT: movl $-1, %eax
-; X86-FALLBACK1-NEXT: shrl %cl, %eax
-; X86-FALLBACK1-NEXT: xorl %edx, %edx
-; X86-FALLBACK1-NEXT: testb $32, %cl
-; X86-FALLBACK1-NEXT: cmovel %eax, %edx
-; X86-FALLBACK1-NEXT: cmovel %esi, %eax
-; X86-FALLBACK1-NEXT: andl {{[0-9]+}}(%esp), %eax
-; X86-FALLBACK1-NEXT: andl {{[0-9]+}}(%esp), %edx
-; X86-FALLBACK1-NEXT: popl %esi
-; X86-FALLBACK1-NEXT: retl
-;
-; X86-FALLBACK2-LABEL: clear_highbits64_c0:
-; X86-FALLBACK2: # %bb.0:
-; X86-FALLBACK2-NEXT: pushl %esi
-; X86-FALLBACK2-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-FALLBACK2-NEXT: movl $-1, %esi
-; X86-FALLBACK2-NEXT: movl $-1, %eax
-; X86-FALLBACK2-NEXT: shrl %cl, %eax
-; X86-FALLBACK2-NEXT: xorl %edx, %edx
-; X86-FALLBACK2-NEXT: testb $32, %cl
-; X86-FALLBACK2-NEXT: cmovel %eax, %edx
-; X86-FALLBACK2-NEXT: cmovel %esi, %eax
-; X86-FALLBACK2-NEXT: andl {{[0-9]+}}(%esp), %eax
-; X86-FALLBACK2-NEXT: andl {{[0-9]+}}(%esp), %edx
-; X86-FALLBACK2-NEXT: popl %esi
-; X86-FALLBACK2-NEXT: retl
+; X86-BASELINE-LABEL: clear_highbits64_c0:
+; X86-BASELINE: # %bb.0:
+; X86-BASELINE-NEXT: pushl %esi
+; X86-BASELINE-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BASELINE-NEXT: movl $-1, %eax
+; X86-BASELINE-NEXT: movl $-1, %esi
+; X86-BASELINE-NEXT: shrl %cl, %esi
+; X86-BASELINE-NEXT: xorl %edx, %edx
+; X86-BASELINE-NEXT: testb $32, %cl
+; X86-BASELINE-NEXT: jne .LBB13_1
+; X86-BASELINE-NEXT: # %bb.2:
+; X86-BASELINE-NEXT: movl %esi, %edx
+; X86-BASELINE-NEXT: jmp .LBB13_3
+; X86-BASELINE-NEXT: .LBB13_1:
+; X86-BASELINE-NEXT: movl %esi, %eax
+; X86-BASELINE-NEXT: .LBB13_3:
+; X86-BASELINE-NEXT: andl {{[0-9]+}}(%esp), %eax
+; X86-BASELINE-NEXT: andl {{[0-9]+}}(%esp), %edx
+; X86-BASELINE-NEXT: popl %esi
+; X86-BASELINE-NEXT: retl
+;
+; X86-BMI1-LABEL: clear_highbits64_c0:
+; X86-BMI1: # %bb.0:
+; X86-BMI1-NEXT: pushl %esi
+; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BMI1-NEXT: movl $-1, %esi
+; X86-BMI1-NEXT: movl $-1, %eax
+; X86-BMI1-NEXT: shrl %cl, %eax
+; X86-BMI1-NEXT: xorl %edx, %edx
+; X86-BMI1-NEXT: testb $32, %cl
+; X86-BMI1-NEXT: cmovel %eax, %edx
+; X86-BMI1-NEXT: cmovel %esi, %eax
+; X86-BMI1-NEXT: andl {{[0-9]+}}(%esp), %eax
+; X86-BMI1-NEXT: andl {{[0-9]+}}(%esp), %edx
+; X86-BMI1-NEXT: popl %esi
+; X86-BMI1-NEXT: retl
;
; X86-BMI2-LABEL: clear_highbits64_c0:
; X86-BMI2: # %bb.0:
@@ -599,58 +583,42 @@ define i64 @clear_highbits64_c0(i64 %val, i64 %numhighbits) nounwind {
}
define i64 @clear_highbits64_c1_indexzext(i64 %val, i8 %numhighbits) nounwind {
-; X86-FALLBACK0-LABEL: clear_highbits64_c1_indexzext:
-; X86-FALLBACK0: # %bb.0:
-; X86-FALLBACK0-NEXT: pushl %esi
-; X86-FALLBACK0-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-FALLBACK0-NEXT: movl $-1, %eax
-; X86-FALLBACK0-NEXT: movl $-1, %esi
-; X86-FALLBACK0-NEXT: shrl %cl, %esi
-; X86-FALLBACK0-NEXT: xorl %edx, %edx
-; X86-FALLBACK0-NEXT: testb $32, %cl
-; X86-FALLBACK0-NEXT: jne .LBB14_1
-; X86-FALLBACK0-NEXT: # %bb.2:
-; X86-FALLBACK0-NEXT: movl %esi, %edx
-; X86-FALLBACK0-NEXT: jmp .LBB14_3
-; X86-FALLBACK0-NEXT: .LBB14_1:
-; X86-FALLBACK0-NEXT: movl %esi, %eax
-; X86-FALLBACK0-NEXT: .LBB14_3:
-; X86-FALLBACK0-NEXT: andl {{[0-9]+}}(%esp), %eax
-; X86-FALLBACK0-NEXT: andl {{[0-9]+}}(%esp), %edx
-; X86-FALLBACK0-NEXT: popl %esi
-; X86-FALLBACK0-NEXT: retl
-;
-; X86-FALLBACK1-LABEL: clear_highbits64_c1_indexzext:
-; X86-FALLBACK1: # %bb.0:
-; X86-FALLBACK1-NEXT: pushl %esi
-; X86-FALLBACK1-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-FALLBACK1-NEXT: movl $-1, %esi
-; X86-FALLBACK1-NEXT: movl $-1, %eax
-; X86-FALLBACK1-NEXT: shrl %cl, %eax
-; X86-FALLBACK1-NEXT: xorl %edx, %edx
-; X86-FALLBACK1-NEXT: testb $32, %cl
-; X86-FALLBACK1-NEXT: cmovel %eax, %edx
-; X86-FALLBACK1-NEXT: cmovel %esi, %eax
-; X86-FALLBACK1-NEXT: andl {{[0-9]+}}(%esp), %eax
-; X86-FALLBACK1-NEXT: andl {{[0-9]+}}(%esp), %edx
-; X86-FALLBACK1-NEXT: popl %esi
-; X86-FALLBACK1-NEXT: retl
-;
-; X86-FALLBACK2-LABEL: clear_highbits64_c1_indexzext:
-; X86-FALLBACK2: # %bb.0:
-; X86-FALLBACK2-NEXT: pushl %esi
-; X86-FALLBACK2-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-FALLBACK2-NEXT: movl $-1, %esi
-; X86-FALLBACK2-NEXT: movl $-1, %eax
-; X86-FALLBACK2-NEXT: shrl %cl, %eax
-; X86-FALLBACK2-NEXT: xorl %edx, %edx
-; X86-FALLBACK2-NEXT: testb $32, %cl
-; X86-FALLBACK2-NEXT: cmovel %eax, %edx
-; X86-FALLBACK2-NEXT: cmovel %esi, %eax
-; X86-FALLBACK2-NEXT: andl {{[0-9]+}}(%esp), %eax
-; X86-FALLBACK2-NEXT: andl {{[0-9]+}}(%esp), %edx
-; X86-FALLBACK2-NEXT: popl %esi
-; X86-FALLBACK2-NEXT: retl
+; X86-BASELINE-LABEL: clear_highbits64_c1_indexzext:
+; X86-BASELINE: # %bb.0:
+; X86-BASELINE-NEXT: pushl %esi
+; X86-BASELINE-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BASELINE-NEXT: movl $-1, %eax
+; X86-BASELINE-NEXT: movl $-1, %esi
+; X86-BASELINE-NEXT: shrl %cl, %esi
+; X86-BASELINE-NEXT: xorl %edx, %edx
+; X86-BASELINE-NEXT: testb $32, %cl
+; X86-BASELINE-NEXT: jne .LBB14_1
+; X86-BASELINE-NEXT: # %bb.2:
+; X86-BASELINE-NEXT: movl %esi, %edx
+; X86-BASELINE-NEXT: jmp .LBB14_3
+; X86-BASELINE-NEXT: .LBB14_1:
+; X86-BASELINE-NEXT: movl %esi, %eax
+; X86-BASELINE-NEXT: .LBB14_3:
+; X86-BASELINE-NEXT: andl {{[0-9]+}}(%esp), %eax
+; X86-BASELINE-NEXT: andl {{[0-9]+}}(%esp), %edx
+; X86-BASELINE-NEXT: popl %esi
+; X86-BASELINE-NEXT: retl
+;
+; X86-BMI1-LABEL: clear_highbits64_c1_indexzext:
+; X86-BMI1: # %bb.0:
+; X86-BMI1-NEXT: pushl %esi
+; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BMI1-NEXT: movl $-1, %esi
+; X86-BMI1-NEXT: movl $-1, %eax
+; X86-BMI1-NEXT: shrl %cl, %eax
+; X86-BMI1-NEXT: xorl %edx, %edx
+; X86-BMI1-NEXT: testb $32, %cl
+; X86-BMI1-NEXT: cmovel %eax, %edx
+; X86-BMI1-NEXT: cmovel %esi, %eax
+; X86-BMI1-NEXT: andl {{[0-9]+}}(%esp), %eax
+; X86-BMI1-NEXT: andl {{[0-9]+}}(%esp), %edx
+; X86-BMI1-NEXT: popl %esi
+; X86-BMI1-NEXT: retl
;
; X86-BMI2-LABEL: clear_highbits64_c1_indexzext:
; X86-BMI2: # %bb.0:
@@ -689,67 +657,48 @@ define i64 @clear_highbits64_c1_indexzext(i64 %val, i8 %numhighbits) nounwind {
}
define i64 @clear_highbits64_c2_load(i64* %w, i64 %numhighbits) nounwind {
-; X86-FALLBACK0-LABEL: clear_highbits64_c2_load:
-; X86-FALLBACK0: # %bb.0:
-; X86-FALLBACK0-NEXT: pushl %edi
-; X86-FALLBACK0-NEXT: pushl %esi
-; X86-FALLBACK0-NEXT: movl {{[0-9]+}}(%esp), %esi
-; X86-FALLBACK0-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-FALLBACK0-NEXT: movl $-1, %eax
-; X86-FALLBACK0-NEXT: movl $-1, %edi
-; X86-FALLBACK0-NEXT: shrl %cl, %edi
-; X86-FALLBACK0-NEXT: xorl %edx, %edx
-; X86-FALLBACK0-NEXT: testb $32, %cl
-; X86-FALLBACK0-NEXT: jne .LBB15_1
-; X86-FALLBACK0-NEXT: # %bb.2:
-; X86-FALLBACK0-NEXT: movl %edi, %edx
-; X86-FALLBACK0-NEXT: jmp .LBB15_3
-; X86-FALLBACK0-NEXT: .LBB15_1:
-; X86-FALLBACK0-NEXT: movl %edi, %eax
-; X86-FALLBACK0-NEXT: .LBB15_3:
-; X86-FALLBACK0-NEXT: andl (%esi), %eax
-; X86-FALLBACK0-NEXT: andl 4(%esi), %edx
-; X86-FALLBACK0-NEXT: popl %esi
-; X86-FALLBACK0-NEXT: popl %edi
-; X86-FALLBACK0-NEXT: retl
-;
-; X86-FALLBACK1-LABEL: clear_highbits64_c2_load:
-; X86-FALLBACK1: # %bb.0:
-; X86-FALLBACK1-NEXT: pushl %edi
-; X86-FALLBACK1-NEXT: pushl %esi
-; X86-FALLBACK1-NEXT: movl {{[0-9]+}}(%esp), %esi
-; X86-FALLBACK1-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-FALLBACK1-NEXT: movl $-1, %edi
-; X86-FALLBACK1-NEXT: movl $-1, %eax
-; X86-FALLBACK1-NEXT: shrl %cl, %eax
-; X86-FALLBACK1-NEXT: xorl %edx, %edx
-; X86-FALLBACK1-NEXT: testb $32, %cl
-; X86-FALLBACK1-NEXT: cmovel %eax, %edx
-; X86-FALLBACK1-NEXT: cmovel %edi, %eax
-; X86-FALLBACK1-NEXT: andl (%esi), %eax
-; X86-FALLBACK1-NEXT: andl 4(%esi), %edx
-; X86-FALLBACK1-NEXT: popl %esi
-; X86-FALLBACK1-NEXT: popl %edi
-; X86-FALLBACK1-NEXT: retl
-;
-; X86-FALLBACK2-LABEL: clear_highbits64_c2_load:
-; X86-FALLBACK2: # %bb.0:
-; X86-FALLBACK2-NEXT: pushl %edi
-; X86-FALLBACK2-NEXT: pushl %esi
-; X86-FALLBACK2-NEXT: movl {{[0-9]+}}(%esp), %esi
-; X86-FALLBACK2-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-FALLBACK2-NEXT: movl $-1, %edi
-; X86-FALLBACK2-NEXT: movl $-1, %eax
-; X86-FALLBACK2-NEXT: shrl %cl, %eax
-; X86-FALLBACK2-NEXT: xorl %edx, %edx
-; X86-FALLBACK2-NEXT: testb $32, %cl
-; X86-FALLBACK2-NEXT: cmovel %eax, %edx
-; X86-FALLBACK2-NEXT: cmovel %edi, %eax
-; X86-FALLBACK2-NEXT: andl (%esi), %eax
-; X86-FALLBACK2-NEXT: andl 4(%esi), %edx
-; X86-FALLBACK2-NEXT: popl %esi
-; X86-FALLBACK2-NEXT: popl %edi
-; X86-FALLBACK2-NEXT: retl
+; X86-BASELINE-LABEL: clear_highbits64_c2_load:
+; X86-BASELINE: # %bb.0:
+; X86-BASELINE-NEXT: pushl %edi
+; X86-BASELINE-NEXT: pushl %esi
+; X86-BASELINE-NEXT: movl {{[0-9]+}}(%esp), %esi
+; X86-BASELINE-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BASELINE-NEXT: movl $-1, %eax
+; X86-BASELINE-NEXT: movl $-1, %edi
+; X86-BASELINE-NEXT: shrl %cl, %edi
+; X86-BASELINE-NEXT: xorl %edx, %edx
+; X86-BASELINE-NEXT: testb $32, %cl
+; X86-BASELINE-NEXT: jne .LBB15_1
+; X86-BASELINE-NEXT: # %bb.2:
+; X86-BASELINE-NEXT: movl %edi, %edx
+; X86-BASELINE-NEXT: jmp .LBB15_3
+; X86-BASELINE-NEXT: .LBB15_1:
+; X86-BASELINE-NEXT: movl %edi, %eax
+; X86-BASELINE-NEXT: .LBB15_3:
+; X86-BASELINE-NEXT: andl (%esi), %eax
+; X86-BASELINE-NEXT: andl 4(%esi), %edx
+; X86-BASELINE-NEXT: popl %esi
+; X86-BASELINE-NEXT: popl %edi
+; X86-BASELINE-NEXT: retl
+;
+; X86-BMI1-LABEL: clear_highbits64_c2_load:
+; X86-BMI1: # %bb.0:
+; X86-BMI1-NEXT: pushl %edi
+; X86-BMI1-NEXT: pushl %esi
+; X86-BMI1-NEXT: movl {{[0-9]+}}(%esp), %esi
+; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BMI1-NEXT: movl $-1, %edi
+; X86-BMI1-NEXT: movl $-1, %eax
+; X86-BMI1-NEXT: shrl %cl, %eax
+; X86-BMI1-NEXT: xorl %edx, %edx
+; X86-BMI1-NEXT: testb $32, %cl
+; X86-BMI1-NEXT: cmovel %eax, %edx
+; X86-BMI1-NEXT: cmovel %edi, %eax
+; X86-BMI1-NEXT: andl (%esi), %eax
+; X86-BMI1-NEXT: andl 4(%esi), %edx
+; X86-BMI1-NEXT: popl %esi
+; X86-BMI1-NEXT: popl %edi
+; X86-BMI1-NEXT: retl
;
; X86-BMI2-LABEL: clear_highbits64_c2_load:
; X86-BMI2: # %bb.0:
@@ -790,67 +739,48 @@ define i64 @clear_highbits64_c2_load(i64* %w, i64 %numhighbits) nounwind {
}
define i64 @clear_highbits64_c3_load_indexzext(i64* %w, i8 %numhighbits) nounwind {
-; X86-FALLBACK0-LABEL: clear_highbits64_c3_load_indexzext:
-; X86-FALLBACK0: # %bb.0:
-; X86-FALLBACK0-NEXT: pushl %edi
-; X86-FALLBACK0-NEXT: pushl %esi
-; X86-FALLBACK0-NEXT: movl {{[0-9]+}}(%esp), %esi
-; X86-FALLBACK0-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-FALLBACK0-NEXT: movl $-1, %eax
-; X86-FALLBACK0-NEXT: movl $-1, %edi
-; X86-FALLBACK0-NEXT: shrl %cl, %edi
-; X86-FALLBACK0-NEXT: xorl %edx, %edx
-; X86-FALLBACK0-NEXT: testb $32, %cl
-; X86-FALLBACK0-NEXT: jne .LBB16_1
-; X86-FALLBACK0-NEXT: # %bb.2:
-; X86-FALLBACK0-NEXT: movl %edi, %edx
-; X86-FALLBACK0-NEXT: jmp .LBB16_3
-; X86-FALLBACK0-NEXT: .LBB16_1:
-; X86-FALLBACK0-NEXT: movl %edi, %eax
-; X86-FALLBACK0-NEXT: .LBB16_3:
-; X86-FALLBACK0-NEXT: andl (%esi), %eax
-; X86-FALLBACK0-NEXT: andl 4(%esi), %edx
-; X86-FALLBACK0-NEXT: popl %esi
-; X86-FALLBACK0-NEXT: popl %edi
-; X86-FALLBACK0-NEXT: retl
-;
-; X86-FALLBACK1-LABEL: clear_highbits64_c3_load_indexzext:
-; X86-FALLBACK1: # %bb.0:
-; X86-FALLBACK1-NEXT: pushl %edi
-; X86-FALLBACK1-NEXT: pushl %esi
-; X86-FALLBACK1-NEXT: movl {{[0-9]+}}(%esp), %esi
-; X86-FALLBACK1-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-FALLBACK1-NEXT: movl $-1, %edi
-; X86-FALLBACK1-NEXT: movl $-1, %eax
-; X86-FALLBACK1-NEXT: shrl %cl, %eax
-; X86-FALLBACK1-NEXT: xorl %edx, %edx
-; X86-FALLBACK1-NEXT: testb $32, %cl
-; X86-FALLBACK1-NEXT: cmovel %eax, %edx
-; X86-FALLBACK1-NEXT: cmovel %edi, %eax
-; X86-FALLBACK1-NEXT: andl (%esi), %eax
-; X86-FALLBACK1-NEXT: andl 4(%esi), %edx
-; X86-FALLBACK1-NEXT: popl %esi
-; X86-FALLBACK1-NEXT: popl %edi
-; X86-FALLBACK1-NEXT: retl
-;
-; X86-FALLBACK2-LABEL: clear_highbits64_c3_load_indexzext:
-; X86-FALLBACK2: # %bb.0:
-; X86-FALLBACK2-NEXT: pushl %edi
-; X86-FALLBACK2-NEXT: pushl %esi
-; X86-FALLBACK2-NEXT: movl {{[0-9]+}}(%esp), %esi
-; X86-FALLBACK2-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-FALLBACK2-NEXT: movl $-1, %edi
-; X86-FALLBACK2-NEXT: movl $-1, %eax
-; X86-FALLBACK2-NEXT: shrl %cl, %eax
-; X86-FALLBACK2-NEXT: xorl %edx, %edx
-; X86-FALLBACK2-NEXT: testb $32, %cl
-; X86-FALLBACK2-NEXT: cmovel %eax, %edx
-; X86-FALLBACK2-NEXT: cmovel %edi, %eax
-; X86-FALLBACK2-NEXT: andl (%esi), %eax
-; X86-FALLBACK2-NEXT: andl 4(%esi), %edx
-; X86-FALLBACK2-NEXT: popl %esi
-; X86-FALLBACK2-NEXT: popl %edi
-; X86-FALLBACK2-NEXT: retl
+; X86-BASELINE-LABEL: clear_highbits64_c3_load_indexzext:
+; X86-BASELINE: # %bb.0:
+; X86-BASELINE-NEXT: pushl %edi
+; X86-BASELINE-NEXT: pushl %esi
+; X86-BASELINE-NEXT: movl {{[0-9]+}}(%esp), %esi
+; X86-BASELINE-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BASELINE-NEXT: movl $-1, %eax
+; X86-BASELINE-NEXT: movl $-1, %edi
+; X86-BASELINE-NEXT: shrl %cl, %edi
+; X86-BASELINE-NEXT: xorl %edx, %edx
+; X86-BASELINE-NEXT: testb $32, %cl
+; X86-BASELINE-NEXT: jne .LBB16_1
+; X86-BASELINE-NEXT: # %bb.2:
+; X86-BASELINE-NEXT: movl %edi, %edx
+; X86-BASELINE-NEXT: jmp .LBB16_3
+; X86-BASELINE-NEXT: .LBB16_1:
+; X86-BASELINE-NEXT: movl %edi, %eax
+; X86-BASELINE-NEXT: .LBB16_3:
+; X86-BASELINE-NEXT: andl (%esi), %eax
+; X86-BASELINE-NEXT: andl 4(%esi), %edx
+; X86-BASELINE-NEXT: popl %esi
+; X86-BASELINE-NEXT: popl %edi
+; X86-BASELINE-NEXT: retl
+;
+; X86-BMI1-LABEL: clear_highbits64_c3_load_indexzext:
+; X86-BMI1: # %bb.0:
+; X86-BMI1-NEXT: pushl %edi
+; X86-BMI1-NEXT: pushl %esi
+; X86-BMI1-NEXT: movl {{[0-9]+}}(%esp), %esi
+; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BMI1-NEXT: movl $-1, %edi
+; X86-BMI1-NEXT: movl $-1, %eax
+; X86-BMI1-NEXT: shrl %cl, %eax
+; X86-BMI1-NEXT: xorl %edx, %edx
+; X86-BMI1-NEXT: testb $32, %cl
+; X86-BMI1-NEXT: cmovel %eax, %edx
+; X86-BMI1-NEXT: cmovel %edi, %eax
+; X86-BMI1-NEXT: andl (%esi), %eax
+; X86-BMI1-NEXT: andl 4(%esi), %edx
+; X86-BMI1-NEXT: popl %esi
+; X86-BMI1-NEXT: popl %edi
+; X86-BMI1-NEXT: retl
;
; X86-BMI2-LABEL: clear_highbits64_c3_load_indexzext:
; X86-BMI2: # %bb.0:
@@ -893,58 +823,42 @@ define i64 @clear_highbits64_c3_load_indexzext(i64* %w, i8 %numhighbits) nounwin
}
define i64 @clear_highbits64_c4_commutative(i64 %val, i64 %numhighbits) nounwind {
-; X86-FALLBACK0-LABEL: clear_highbits64_c4_commutative:
-; X86-FALLBACK0: # %bb.0:
-; X86-FALLBACK0-NEXT: pushl %esi
-; X86-FALLBACK0-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-FALLBACK0-NEXT: movl $-1, %eax
-; X86-FALLBACK0-NEXT: movl $-1, %esi
-; X86-FALLBACK0-NEXT: shrl %cl, %esi
-; X86-FALLBACK0-NEXT: xorl %edx, %edx
-; X86-FALLBACK0-NEXT: testb $32, %cl
-; X86-FALLBACK0-NEXT: jne .LBB17_1
-; X86-FALLBACK0-NEXT: # %bb.2:
-; X86-FALLBACK0-NEXT: movl %esi, %edx
-; X86-FALLBACK0-NEXT: jmp .LBB17_3
-; X86-FALLBACK0-NEXT: .LBB17_1:
-; X86-FALLBACK0-NEXT: movl %esi, %eax
-; X86-FALLBACK0-NEXT: .LBB17_3:
-; X86-FALLBACK0-NEXT: andl {{[0-9]+}}(%esp), %eax
-; X86-FALLBACK0-NEXT: andl {{[0-9]+}}(%esp), %edx
-; X86-FALLBACK0-NEXT: popl %esi
-; X86-FALLBACK0-NEXT: retl
-;
-; X86-FALLBACK1-LABEL: clear_highbits64_c4_commutative:
-; X86-FALLBACK1: # %bb.0:
-; X86-FALLBACK1-NEXT: pushl %esi
-; X86-FALLBACK1-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-FALLBACK1-NEXT: movl $-1, %esi
-; X86-FALLBACK1-NEXT: movl $-1, %eax
-; X86-FALLBACK1-NEXT: shrl %cl, %eax
-; X86-FALLBACK1-NEXT: xorl %edx, %edx
-; X86-FALLBACK1-NEXT: testb $32, %cl
-; X86-FALLBACK1-NEXT: cmovel %eax, %edx
-; X86-FALLBACK1-NEXT: cmovel %esi, %eax
-; X86-FALLBACK1-NEXT: andl {{[0-9]+}}(%esp), %eax
-; X86-FALLBACK1-NEXT: andl {{[0-9]+}}(%esp), %edx
-; X86-FALLBACK1-NEXT: popl %esi
-; X86-FALLBACK1-NEXT: retl
-;
-; X86-FALLBACK2-LABEL: clear_highbits64_c4_commutative:
-; X86-FALLBACK2: # %bb.0:
-; X86-FALLBACK2-NEXT: pushl %esi
-; X86-FALLBACK2-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-FALLBACK2-NEXT: movl $-1, %esi
-; X86-FALLBACK2-NEXT: movl $-1, %eax
-; X86-FALLBACK2-NEXT: shrl %cl, %eax
-; X86-FALLBACK2-NEXT: xorl %edx, %edx
-; X86-FALLBACK2-NEXT: testb $32, %cl
-; X86-FALLBACK2-NEXT: cmovel %eax, %edx
-; X86-FALLBACK2-NEXT: cmovel %esi, %eax
-; X86-FALLBACK2-NEXT: andl {{[0-9]+}}(%esp), %eax
-; X86-FALLBACK2-NEXT: andl {{[0-9]+}}(%esp), %edx
-; X86-FALLBACK2-NEXT: popl %esi
-; X86-FALLBACK2-NEXT: retl
+; X86-BASELINE-LABEL: clear_highbits64_c4_commutative:
+; X86-BASELINE: # %bb.0:
+; X86-BASELINE-NEXT: pushl %esi
+; X86-BASELINE-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BASELINE-NEXT: movl $-1, %eax
+; X86-BASELINE-NEXT: movl $-1, %esi
+; X86-BASELINE-NEXT: shrl %cl, %esi
+; X86-BASELINE-NEXT: xorl %edx, %edx
+; X86-BASELINE-NEXT: testb $32, %cl
+; X86-BASELINE-NEXT: jne .LBB17_1
+; X86-BASELINE-NEXT: # %bb.2:
+; X86-BASELINE-NEXT: movl %esi, %edx
+; X86-BASELINE-NEXT: jmp .LBB17_3
+; X86-BASELINE-NEXT: .LBB17_1:
+; X86-BASELINE-NEXT: movl %esi, %eax
+; X86-BASELINE-NEXT: .LBB17_3:
+; X86-BASELINE-NEXT: andl {{[0-9]+}}(%esp), %eax
+; X86-BASELINE-NEXT: andl {{[0-9]+}}(%esp), %edx
+; X86-BASELINE-NEXT: popl %esi
+; X86-BASELINE-NEXT: retl
+;
+; X86-BMI1-LABEL: clear_highbits64_c4_commutative:
+; X86-BMI1: # %bb.0:
+; X86-BMI1-NEXT: pushl %esi
+; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BMI1-NEXT: movl $-1, %esi
+; X86-BMI1-NEXT: movl $-1, %eax
+; X86-BMI1-NEXT: shrl %cl, %eax
+; X86-BMI1-NEXT: xorl %edx, %edx
+; X86-BMI1-NEXT: testb $32, %cl
+; X86-BMI1-NEXT: cmovel %eax, %edx
+; X86-BMI1-NEXT: cmovel %esi, %eax
+; X86-BMI1-NEXT: andl {{[0-9]+}}(%esp), %eax
+; X86-BMI1-NEXT: andl {{[0-9]+}}(%esp), %edx
+; X86-BMI1-NEXT: popl %esi
+; X86-BMI1-NEXT: retl
;
; X86-BMI2-LABEL: clear_highbits64_c4_commutative:
; X86-BMI2: # %bb.0:
@@ -984,228 +898,299 @@ define i64 @clear_highbits64_c4_commutative(i64 %val, i64 %numhighbits) nounwind
; Multi-use tests
; ---------------------------------------------------------------------------- ;
-declare void @use32(i32)
-declare void @use64(i64)
-
-define i32 @oneuse32(i32 %val, i32 %numhighbits) nounwind {
-; X86-NOBMI2-LABEL: oneuse32:
+define i32 @oneuse32_c(i32 %val, i32 %numhighbits, i32* %escape) nounwind {
+; X86-NOBMI2-LABEL: oneuse32_c:
; X86-NOBMI2: # %bb.0:
-; X86-NOBMI2-NEXT: pushl %esi
-; X86-NOBMI2-NEXT: subl $8, %esp
+; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-NOBMI2-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NOBMI2-NEXT: movl $-1, %esi
-; X86-NOBMI2-NEXT: shrl %cl, %esi
-; X86-NOBMI2-NEXT: movl %esi, (%esp)
-; X86-NOBMI2-NEXT: calll use32 at PLT
-; X86-NOBMI2-NEXT: andl {{[0-9]+}}(%esp), %esi
-; X86-NOBMI2-NEXT: movl %esi, %eax
-; X86-NOBMI2-NEXT: addl $8, %esp
-; X86-NOBMI2-NEXT: popl %esi
+; X86-NOBMI2-NEXT: movl $-1, %eax
+; X86-NOBMI2-NEXT: shrl %cl, %eax
+; X86-NOBMI2-NEXT: movl %eax, (%edx)
+; X86-NOBMI2-NEXT: andl {{[0-9]+}}(%esp), %eax
; X86-NOBMI2-NEXT: retl
;
-; X86-BMI2-LABEL: oneuse32:
+; X86-BMI2-LABEL: oneuse32_c:
; X86-BMI2: # %bb.0:
-; X86-BMI2-NEXT: pushl %esi
-; X86-BMI2-NEXT: subl $8, %esp
+; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI2-NEXT: movl $-1, %ecx
-; X86-BMI2-NEXT: shrxl %eax, %ecx, %esi
-; X86-BMI2-NEXT: movl %esi, (%esp)
-; X86-BMI2-NEXT: calll use32 at PLT
-; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %esi
-; X86-BMI2-NEXT: movl %esi, %eax
-; X86-BMI2-NEXT: addl $8, %esp
-; X86-BMI2-NEXT: popl %esi
+; X86-BMI2-NEXT: movl $-1, %edx
+; X86-BMI2-NEXT: shrxl %eax, %edx, %eax
+; X86-BMI2-NEXT: movl %eax, (%ecx)
+; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %eax
; X86-BMI2-NEXT: retl
;
-; X64-NOBMI2-LABEL: oneuse32:
+; X64-NOBMI2-LABEL: oneuse32_c:
; X64-NOBMI2: # %bb.0:
-; X64-NOBMI2-NEXT: pushq %rbp
-; X64-NOBMI2-NEXT: pushq %rbx
-; X64-NOBMI2-NEXT: pushq %rax
; X64-NOBMI2-NEXT: movl %esi, %ecx
-; X64-NOBMI2-NEXT: movl %edi, %ebx
-; X64-NOBMI2-NEXT: movl $-1, %ebp
+; X64-NOBMI2-NEXT: movl $-1, %eax
; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-NOBMI2-NEXT: shrl %cl, %ebp
-; X64-NOBMI2-NEXT: movl %ebp, %edi
-; X64-NOBMI2-NEXT: callq use32 at PLT
-; X64-NOBMI2-NEXT: andl %ebx, %ebp
-; X64-NOBMI2-NEXT: movl %ebp, %eax
-; X64-NOBMI2-NEXT: addq $8, %rsp
-; X64-NOBMI2-NEXT: popq %rbx
-; X64-NOBMI2-NEXT: popq %rbp
+; X64-NOBMI2-NEXT: shrl %cl, %eax
+; X64-NOBMI2-NEXT: movl %eax, (%rdx)
+; X64-NOBMI2-NEXT: andl %edi, %eax
; X64-NOBMI2-NEXT: retq
;
-; X64-BMI2-LABEL: oneuse32:
+; X64-BMI2-LABEL: oneuse32_c:
; X64-BMI2: # %bb.0:
-; X64-BMI2-NEXT: pushq %rbp
-; X64-BMI2-NEXT: pushq %rbx
-; X64-BMI2-NEXT: pushq %rax
-; X64-BMI2-NEXT: movl %edi, %ebx
; X64-BMI2-NEXT: movl $-1, %eax
-; X64-BMI2-NEXT: shrxl %esi, %eax, %ebp
-; X64-BMI2-NEXT: movl %ebp, %edi
-; X64-BMI2-NEXT: callq use32 at PLT
-; X64-BMI2-NEXT: andl %ebx, %ebp
-; X64-BMI2-NEXT: movl %ebp, %eax
-; X64-BMI2-NEXT: addq $8, %rsp
-; X64-BMI2-NEXT: popq %rbx
-; X64-BMI2-NEXT: popq %rbp
+; X64-BMI2-NEXT: shrxl %esi, %eax, %eax
+; X64-BMI2-NEXT: movl %eax, (%rdx)
+; X64-BMI2-NEXT: andl %edi, %eax
; X64-BMI2-NEXT: retq
%mask = lshr i32 -1, %numhighbits
- call void @use32(i32 %mask)
+ store i32 %mask, i32* %escape
%masked = and i32 %mask, %val
ret i32 %masked
}
-define i64 @oneuse64(i64 %val, i64 %numhighbits) nounwind {
-; X86-FALLBACK0-LABEL: oneuse64:
-; X86-FALLBACK0: # %bb.0:
-; X86-FALLBACK0-NEXT: pushl %edi
-; X86-FALLBACK0-NEXT: pushl %esi
-; X86-FALLBACK0-NEXT: pushl %eax
-; X86-FALLBACK0-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-FALLBACK0-NEXT: movl $-1, %esi
-; X86-FALLBACK0-NEXT: movl $-1, %edi
-; X86-FALLBACK0-NEXT: shrl %cl, %edi
-; X86-FALLBACK0-NEXT: testb $32, %cl
-; X86-FALLBACK0-NEXT: je .LBB19_2
-; X86-FALLBACK0-NEXT: # %bb.1:
-; X86-FALLBACK0-NEXT: movl %edi, %esi
-; X86-FALLBACK0-NEXT: xorl %edi, %edi
-; X86-FALLBACK0-NEXT: .LBB19_2:
-; X86-FALLBACK0-NEXT: subl $8, %esp
-; X86-FALLBACK0-NEXT: pushl %edi
-; X86-FALLBACK0-NEXT: pushl %esi
-; X86-FALLBACK0-NEXT: calll use64 at PLT
-; X86-FALLBACK0-NEXT: addl $16, %esp
-; X86-FALLBACK0-NEXT: andl {{[0-9]+}}(%esp), %esi
-; X86-FALLBACK0-NEXT: andl {{[0-9]+}}(%esp), %edi
-; X86-FALLBACK0-NEXT: movl %esi, %eax
-; X86-FALLBACK0-NEXT: movl %edi, %edx
-; X86-FALLBACK0-NEXT: addl $4, %esp
-; X86-FALLBACK0-NEXT: popl %esi
-; X86-FALLBACK0-NEXT: popl %edi
-; X86-FALLBACK0-NEXT: retl
-;
-; X86-FALLBACK1-LABEL: oneuse64:
-; X86-FALLBACK1: # %bb.0:
-; X86-FALLBACK1-NEXT: pushl %edi
-; X86-FALLBACK1-NEXT: pushl %esi
-; X86-FALLBACK1-NEXT: pushl %eax
-; X86-FALLBACK1-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-FALLBACK1-NEXT: movl $-1, %esi
-; X86-FALLBACK1-NEXT: movl $-1, %eax
-; X86-FALLBACK1-NEXT: shrl %cl, %eax
-; X86-FALLBACK1-NEXT: xorl %edi, %edi
-; X86-FALLBACK1-NEXT: testb $32, %cl
-; X86-FALLBACK1-NEXT: cmovnel %eax, %esi
-; X86-FALLBACK1-NEXT: cmovel %eax, %edi
-; X86-FALLBACK1-NEXT: subl $8, %esp
-; X86-FALLBACK1-NEXT: pushl %edi
-; X86-FALLBACK1-NEXT: pushl %esi
-; X86-FALLBACK1-NEXT: calll use64 at PLT
-; X86-FALLBACK1-NEXT: addl $16, %esp
-; X86-FALLBACK1-NEXT: andl {{[0-9]+}}(%esp), %esi
-; X86-FALLBACK1-NEXT: andl {{[0-9]+}}(%esp), %edi
-; X86-FALLBACK1-NEXT: movl %esi, %eax
-; X86-FALLBACK1-NEXT: movl %edi, %edx
-; X86-FALLBACK1-NEXT: addl $4, %esp
-; X86-FALLBACK1-NEXT: popl %esi
-; X86-FALLBACK1-NEXT: popl %edi
-; X86-FALLBACK1-NEXT: retl
-;
-; X86-FALLBACK2-LABEL: oneuse64:
-; X86-FALLBACK2: # %bb.0:
-; X86-FALLBACK2-NEXT: pushl %edi
-; X86-FALLBACK2-NEXT: pushl %esi
-; X86-FALLBACK2-NEXT: pushl %eax
-; X86-FALLBACK2-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-FALLBACK2-NEXT: movl $-1, %esi
-; X86-FALLBACK2-NEXT: movl $-1, %eax
-; X86-FALLBACK2-NEXT: shrl %cl, %eax
-; X86-FALLBACK2-NEXT: xorl %edi, %edi
-; X86-FALLBACK2-NEXT: testb $32, %cl
-; X86-FALLBACK2-NEXT: cmovnel %eax, %esi
-; X86-FALLBACK2-NEXT: cmovel %eax, %edi
-; X86-FALLBACK2-NEXT: subl $8, %esp
-; X86-FALLBACK2-NEXT: pushl %edi
-; X86-FALLBACK2-NEXT: pushl %esi
-; X86-FALLBACK2-NEXT: calll use64 at PLT
-; X86-FALLBACK2-NEXT: addl $16, %esp
-; X86-FALLBACK2-NEXT: andl {{[0-9]+}}(%esp), %esi
-; X86-FALLBACK2-NEXT: andl {{[0-9]+}}(%esp), %edi
-; X86-FALLBACK2-NEXT: movl %esi, %eax
-; X86-FALLBACK2-NEXT: movl %edi, %edx
-; X86-FALLBACK2-NEXT: addl $4, %esp
-; X86-FALLBACK2-NEXT: popl %esi
-; X86-FALLBACK2-NEXT: popl %edi
-; X86-FALLBACK2-NEXT: retl
-;
-; X86-BMI2-LABEL: oneuse64:
+define i64 @oneuse64_c(i64 %val, i64 %numhighbits, i64* %escape) nounwind {
+; X86-BASELINE-LABEL: oneuse64_c:
+; X86-BASELINE: # %bb.0:
+; X86-BASELINE-NEXT: pushl %esi
+; X86-BASELINE-NEXT: movl {{[0-9]+}}(%esp), %esi
+; X86-BASELINE-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BASELINE-NEXT: movl $-1, %eax
+; X86-BASELINE-NEXT: movl $-1, %edx
+; X86-BASELINE-NEXT: shrl %cl, %edx
+; X86-BASELINE-NEXT: testb $32, %cl
+; X86-BASELINE-NEXT: je .LBB19_2
+; X86-BASELINE-NEXT: # %bb.1:
+; X86-BASELINE-NEXT: movl %edx, %eax
+; X86-BASELINE-NEXT: xorl %edx, %edx
+; X86-BASELINE-NEXT: .LBB19_2:
+; X86-BASELINE-NEXT: movl %edx, 4(%esi)
+; X86-BASELINE-NEXT: movl %eax, (%esi)
+; X86-BASELINE-NEXT: andl {{[0-9]+}}(%esp), %eax
+; X86-BASELINE-NEXT: andl {{[0-9]+}}(%esp), %edx
+; X86-BASELINE-NEXT: popl %esi
+; X86-BASELINE-NEXT: retl
+;
+; X86-BMI1-LABEL: oneuse64_c:
+; X86-BMI1: # %bb.0:
+; X86-BMI1-NEXT: pushl %edi
+; X86-BMI1-NEXT: pushl %esi
+; X86-BMI1-NEXT: movl {{[0-9]+}}(%esp), %esi
+; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BMI1-NEXT: movl $-1, %eax
+; X86-BMI1-NEXT: movl $-1, %edi
+; X86-BMI1-NEXT: shrl %cl, %edi
+; X86-BMI1-NEXT: xorl %edx, %edx
+; X86-BMI1-NEXT: testb $32, %cl
+; X86-BMI1-NEXT: cmovnel %edi, %eax
+; X86-BMI1-NEXT: cmovel %edi, %edx
+; X86-BMI1-NEXT: movl %edx, 4(%esi)
+; X86-BMI1-NEXT: movl %eax, (%esi)
+; X86-BMI1-NEXT: andl {{[0-9]+}}(%esp), %eax
+; X86-BMI1-NEXT: andl {{[0-9]+}}(%esp), %edx
+; X86-BMI1-NEXT: popl %esi
+; X86-BMI1-NEXT: popl %edi
+; X86-BMI1-NEXT: retl
+;
+; X86-BMI2-LABEL: oneuse64_c:
; X86-BMI2: # %bb.0:
-; X86-BMI2-NEXT: pushl %edi
-; X86-BMI2-NEXT: pushl %esi
-; X86-BMI2-NEXT: pushl %eax
-; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI2-NEXT: movl $-1, %esi
-; X86-BMI2-NEXT: shrxl %eax, %esi, %ecx
-; X86-BMI2-NEXT: xorl %edi, %edi
-; X86-BMI2-NEXT: testb $32, %al
-; X86-BMI2-NEXT: cmovnel %ecx, %esi
-; X86-BMI2-NEXT: cmovel %ecx, %edi
-; X86-BMI2-NEXT: subl $8, %esp
-; X86-BMI2-NEXT: pushl %edi
+; X86-BMI2-NEXT: pushl %ebx
; X86-BMI2-NEXT: pushl %esi
-; X86-BMI2-NEXT: calll use64 at PLT
-; X86-BMI2-NEXT: addl $16, %esp
-; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %esi
-; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %edi
-; X86-BMI2-NEXT: movl %esi, %eax
-; X86-BMI2-NEXT: movl %edi, %edx
-; X86-BMI2-NEXT: addl $4, %esp
+; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %bl
+; X86-BMI2-NEXT: movl $-1, %eax
+; X86-BMI2-NEXT: shrxl %ebx, %eax, %esi
+; X86-BMI2-NEXT: xorl %edx, %edx
+; X86-BMI2-NEXT: testb $32, %bl
+; X86-BMI2-NEXT: cmovnel %esi, %eax
+; X86-BMI2-NEXT: cmovel %esi, %edx
+; X86-BMI2-NEXT: movl %edx, 4(%ecx)
+; X86-BMI2-NEXT: movl %eax, (%ecx)
+; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %eax
+; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %edx
; X86-BMI2-NEXT: popl %esi
-; X86-BMI2-NEXT: popl %edi
+; X86-BMI2-NEXT: popl %ebx
; X86-BMI2-NEXT: retl
;
-; X64-NOBMI2-LABEL: oneuse64:
+; X64-NOBMI2-LABEL: oneuse64_c:
; X64-NOBMI2: # %bb.0:
-; X64-NOBMI2-NEXT: pushq %r14
-; X64-NOBMI2-NEXT: pushq %rbx
-; X64-NOBMI2-NEXT: pushq %rax
; X64-NOBMI2-NEXT: movq %rsi, %rcx
-; X64-NOBMI2-NEXT: movq %rdi, %r14
-; X64-NOBMI2-NEXT: movq $-1, %rbx
+; X64-NOBMI2-NEXT: movq $-1, %rax
; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $rcx
-; X64-NOBMI2-NEXT: shrq %cl, %rbx
-; X64-NOBMI2-NEXT: movq %rbx, %rdi
-; X64-NOBMI2-NEXT: callq use64 at PLT
-; X64-NOBMI2-NEXT: andq %r14, %rbx
-; X64-NOBMI2-NEXT: movq %rbx, %rax
-; X64-NOBMI2-NEXT: addq $8, %rsp
-; X64-NOBMI2-NEXT: popq %rbx
-; X64-NOBMI2-NEXT: popq %r14
+; X64-NOBMI2-NEXT: shrq %cl, %rax
+; X64-NOBMI2-NEXT: movq %rax, (%rdx)
+; X64-NOBMI2-NEXT: andq %rdi, %rax
; X64-NOBMI2-NEXT: retq
;
-; X64-BMI2-LABEL: oneuse64:
+; X64-BMI2-LABEL: oneuse64_c:
; X64-BMI2: # %bb.0:
-; X64-BMI2-NEXT: pushq %r14
-; X64-BMI2-NEXT: pushq %rbx
-; X64-BMI2-NEXT: pushq %rax
-; X64-BMI2-NEXT: movq %rdi, %r14
; X64-BMI2-NEXT: movq $-1, %rax
-; X64-BMI2-NEXT: shrxq %rsi, %rax, %rbx
-; X64-BMI2-NEXT: movq %rbx, %rdi
-; X64-BMI2-NEXT: callq use64 at PLT
-; X64-BMI2-NEXT: andq %r14, %rbx
-; X64-BMI2-NEXT: movq %rbx, %rax
-; X64-BMI2-NEXT: addq $8, %rsp
-; X64-BMI2-NEXT: popq %rbx
-; X64-BMI2-NEXT: popq %r14
+; X64-BMI2-NEXT: shrxq %rsi, %rax, %rax
+; X64-BMI2-NEXT: movq %rax, (%rdx)
+; X64-BMI2-NEXT: andq %rdi, %rax
; X64-BMI2-NEXT: retq
%mask = lshr i64 -1, %numhighbits
- call void @use64(i64 %mask)
+ store i64 %mask, i64* %escape
%masked = and i64 %mask, %val
ret i64 %masked
}
+
+define i32 @oneuse32_d(i32 %val, i32 %numhighbits, i32* %escape) nounwind {
+; X86-NOBMI2-LABEL: oneuse32_d:
+; X86-NOBMI2: # %bb.0:
+; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %edx
+; X86-NOBMI2-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-NOBMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NOBMI2-NEXT: shll %cl, %eax
+; X86-NOBMI2-NEXT: movl %eax, (%edx)
+; X86-NOBMI2-NEXT: shrl %cl, %eax
+; X86-NOBMI2-NEXT: retl
+;
+; X86-BMI2-LABEL: oneuse32_d:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BMI2-NEXT: shlxl %ecx, {{[0-9]+}}(%esp), %edx
+; X86-BMI2-NEXT: movl %edx, (%eax)
+; X86-BMI2-NEXT: shrxl %ecx, %edx, %eax
+; X86-BMI2-NEXT: retl
+;
+; X64-NOBMI2-LABEL: oneuse32_d:
+; X64-NOBMI2: # %bb.0:
+; X64-NOBMI2-NEXT: movl %esi, %ecx
+; X64-NOBMI2-NEXT: movl %edi, %eax
+; X64-NOBMI2-NEXT: shll %cl, %eax
+; X64-NOBMI2-NEXT: movl %eax, (%rdx)
+; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $ecx
+; X64-NOBMI2-NEXT: shrl %cl, %eax
+; X64-NOBMI2-NEXT: retq
+;
+; X64-BMI2-LABEL: oneuse32_d:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: shlxl %esi, %edi, %eax
+; X64-BMI2-NEXT: movl %eax, (%rdx)
+; X64-BMI2-NEXT: shrxl %esi, %eax, %eax
+; X64-BMI2-NEXT: retq
+ %sh1 = shl i32 %val, %numhighbits
+ store i32 %sh1, i32* %escape
+ %masked = lshr i32 %sh1, %numhighbits
+ ret i32 %masked
+}
+
+define i64 @oneusei64_d(i64 %val, i64 %numhighbits, i64* %escape) nounwind {
+; X86-BASELINE-LABEL: oneusei64_d:
+; X86-BASELINE: # %bb.0:
+; X86-BASELINE-NEXT: pushl %ebx
+; X86-BASELINE-NEXT: pushl %edi
+; X86-BASELINE-NEXT: pushl %esi
+; X86-BASELINE-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BASELINE-NEXT: movl {{[0-9]+}}(%esp), %edx
+; X86-BASELINE-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-BASELINE-NEXT: movl %edx, %edi
+; X86-BASELINE-NEXT: shll %cl, %edi
+; X86-BASELINE-NEXT: shldl %cl, %edx, %eax
+; X86-BASELINE-NEXT: testb $32, %cl
+; X86-BASELINE-NEXT: movl %edi, %esi
+; X86-BASELINE-NEXT: jne .LBB21_2
+; X86-BASELINE-NEXT: # %bb.1:
+; X86-BASELINE-NEXT: movl %eax, %esi
+; X86-BASELINE-NEXT: .LBB21_2:
+; X86-BASELINE-NEXT: movl %esi, %eax
+; X86-BASELINE-NEXT: shrl %cl, %eax
+; X86-BASELINE-NEXT: xorl %ebx, %ebx
+; X86-BASELINE-NEXT: testb $32, %cl
+; X86-BASELINE-NEXT: movl $0, %edx
+; X86-BASELINE-NEXT: jne .LBB21_4
+; X86-BASELINE-NEXT: # %bb.3:
+; X86-BASELINE-NEXT: movl %edi, %ebx
+; X86-BASELINE-NEXT: movl %eax, %edx
+; X86-BASELINE-NEXT: .LBB21_4:
+; X86-BASELINE-NEXT: movl %ebx, %edi
+; X86-BASELINE-NEXT: shrdl %cl, %esi, %edi
+; X86-BASELINE-NEXT: testb $32, %cl
+; X86-BASELINE-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-BASELINE-NEXT: movl %ebx, (%ecx)
+; X86-BASELINE-NEXT: movl %esi, 4(%ecx)
+; X86-BASELINE-NEXT: jne .LBB21_6
+; X86-BASELINE-NEXT: # %bb.5:
+; X86-BASELINE-NEXT: movl %edi, %eax
+; X86-BASELINE-NEXT: .LBB21_6:
+; X86-BASELINE-NEXT: popl %esi
+; X86-BASELINE-NEXT: popl %edi
+; X86-BASELINE-NEXT: popl %ebx
+; X86-BASELINE-NEXT: retl
+;
+; X86-BMI1-LABEL: oneusei64_d:
+; X86-BMI1: # %bb.0:
+; X86-BMI1-NEXT: pushl %ebp
+; X86-BMI1-NEXT: pushl %ebx
+; X86-BMI1-NEXT: pushl %edi
+; X86-BMI1-NEXT: pushl %esi
+; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BMI1-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-BMI1-NEXT: movl {{[0-9]+}}(%esp), %esi
+; X86-BMI1-NEXT: movl %eax, %edi
+; X86-BMI1-NEXT: shll %cl, %edi
+; X86-BMI1-NEXT: shldl %cl, %eax, %esi
+; X86-BMI1-NEXT: testb $32, %cl
+; X86-BMI1-NEXT: cmovnel %edi, %esi
+; X86-BMI1-NEXT: movl %esi, %ebx
+; X86-BMI1-NEXT: shrl %cl, %ebx
+; X86-BMI1-NEXT: xorl %edx, %edx
+; X86-BMI1-NEXT: testb $32, %cl
+; X86-BMI1-NEXT: cmovnel %edx, %edi
+; X86-BMI1-NEXT: cmovel %ebx, %edx
+; X86-BMI1-NEXT: movl {{[0-9]+}}(%esp), %ebp
+; X86-BMI1-NEXT: movl %edi, (%ebp)
+; X86-BMI1-NEXT: movl %edi, %eax
+; X86-BMI1-NEXT: shrdl %cl, %esi, %eax
+; X86-BMI1-NEXT: testb $32, %cl
+; X86-BMI1-NEXT: movl %esi, 4(%ebp)
+; X86-BMI1-NEXT: cmovnel %ebx, %eax
+; X86-BMI1-NEXT: popl %esi
+; X86-BMI1-NEXT: popl %edi
+; X86-BMI1-NEXT: popl %ebx
+; X86-BMI1-NEXT: popl %ebp
+; X86-BMI1-NEXT: retl
+;
+; X86-BMI2-LABEL: oneusei64_d:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: pushl %ebx
+; X86-BMI2-NEXT: pushl %edi
+; X86-BMI2-NEXT: pushl %esi
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %esi
+; X86-BMI2-NEXT: shldl %cl, %eax, %esi
+; X86-BMI2-NEXT: shlxl %ecx, %eax, %eax
+; X86-BMI2-NEXT: xorl %edx, %edx
+; X86-BMI2-NEXT: testb $32, %cl
+; X86-BMI2-NEXT: cmovnel %eax, %esi
+; X86-BMI2-NEXT: cmovnel %edx, %eax
+; X86-BMI2-NEXT: shrxl %ecx, %esi, %edi
+; X86-BMI2-NEXT: cmovel %edi, %edx
+; X86-BMI2-NEXT: movl {{[0-9]+}}(%esp), %ebx
+; X86-BMI2-NEXT: movl %eax, (%ebx)
+; X86-BMI2-NEXT: shrdl %cl, %esi, %eax
+; X86-BMI2-NEXT: testb $32, %cl
+; X86-BMI2-NEXT: movl %esi, 4(%ebx)
+; X86-BMI2-NEXT: cmovnel %edi, %eax
+; X86-BMI2-NEXT: popl %esi
+; X86-BMI2-NEXT: popl %edi
+; X86-BMI2-NEXT: popl %ebx
+; X86-BMI2-NEXT: retl
+;
+; X64-NOBMI2-LABEL: oneusei64_d:
+; X64-NOBMI2: # %bb.0:
+; X64-NOBMI2-NEXT: movq %rsi, %rcx
+; X64-NOBMI2-NEXT: movq %rdi, %rax
+; X64-NOBMI2-NEXT: shlq %cl, %rax
+; X64-NOBMI2-NEXT: movq %rax, (%rdx)
+; X64-NOBMI2-NEXT: # kill: def $cl killed $cl killed $rcx
+; X64-NOBMI2-NEXT: shrq %cl, %rax
+; X64-NOBMI2-NEXT: retq
+;
+; X64-BMI2-LABEL: oneusei64_d:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: shlxq %rsi, %rdi, %rax
+; X64-BMI2-NEXT: movq %rax, (%rdx)
+; X64-BMI2-NEXT: shrxq %rsi, %rax, %rax
+; X64-BMI2-NEXT: retq
+ %sh1 = shl i64 %val, %numhighbits
+ store i64 %sh1, i64* %escape
+ %masked = lshr i64 %sh1, %numhighbits
+ ret i64 %masked
+}
More information about the llvm-commits
mailing list