[llvm] r362606 - [NFC][Codegen][X86] Add AVX2 runline for '(X & (C l>> Y)) ==/!= 0' tests
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 5 07:08:11 PDT 2019
Author: lebedevri
Date: Wed Jun 5 07:08:11 2019
New Revision: 362606
URL: http://llvm.org/viewvc/llvm-project?rev=362606&view=rev
Log:
[NFC][Codegen][X86] Add AVX2 runline for '(X & (C l>> Y)) ==/!= 0' tests
Modified:
llvm/trunk/test/CodeGen/X86/hoist-and-by-const-from-lshr-in-eqcmp-zero.ll
llvm/trunk/test/CodeGen/X86/hoist-and-by-const-from-shl-in-eqcmp-zero.ll
Modified: llvm/trunk/test/CodeGen/X86/hoist-and-by-const-from-lshr-in-eqcmp-zero.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/hoist-and-by-const-from-lshr-in-eqcmp-zero.ll?rev=362606&r1=362605&r2=362606&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/hoist-and-by-const-from-lshr-in-eqcmp-zero.ll (original)
+++ llvm/trunk/test/CodeGen/X86/hoist-and-by-const-from-lshr-in-eqcmp-zero.ll Wed Jun 5 07:08:11 2019
@@ -1,10 +1,12 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+sse,sse2 < %s | FileCheck %s --check-prefixes=CHECK,X86,X86-NOBMI
-; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+sse,sse2,+bmi < %s | FileCheck %s --check-prefixes=CHECK,X86,X86-BMI,X86-BMI1
-; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+sse,sse2,+bmi,+bmi2 < %s | FileCheck %s --check-prefixes=CHECK,X86,X86-BMI,X86-BMI12
-; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+sse,sse2 < %s | FileCheck %s --check-prefixes=CHECK,X64,X64-NOBMI
-; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+sse,sse2,+bmi < %s | FileCheck %s --check-prefixes=CHECK,X64,X64-BMI,X64-BMI1
-; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+sse,sse2,+bmi,+bmi2 < %s | FileCheck %s --check-prefixes=CHECK,X64,X64-BMI,X64-BMI12
+; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+sse,sse2 < %s | FileCheck %s --check-prefixes=CHECK,X86,V0123,X86-V0123,SSE2,X86-SSE2,BMI1,X86-BMI1,V0,X86-V0
+; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+sse,sse2,+bmi < %s | FileCheck %s --check-prefixes=CHECK,X86,V0123,X86-V0123,SSE2,X86-SSE2,BMI1,X86-BMI1,V1,X86-V1
+; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+sse,sse2,+bmi,+bmi2 < %s | FileCheck %s --check-prefixes=CHECK,X86,V0123,X86-V0123,SSE2,X86-SSE2,BMI2,X86-BMI2,V2,X86-V2
+; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+sse,sse2,+bmi,+bmi2,+avx2 < %s | FileCheck %s --check-prefixes=CHECK,X86,V0123,X86-V0123,BMI2,X86-BMI2,AVX2,X86-AVX2
+; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+sse,sse2 < %s | FileCheck %s --check-prefixes=CHECK,X64,V0123,X64-V0123,SSE2,X64-SSE2,BMI1,X64-BMI1,V0,X64-V0
+; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+sse,sse2,+bmi < %s | FileCheck %s --check-prefixes=CHECK,X64,V0123,X64-V0123,SSE2,X64-SSE2,BMI1,X64-BMI1,V1,X64-V1
+; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+sse,sse2,+bmi,+bmi2 < %s | FileCheck %s --check-prefixes=CHECK,X64,V0123,X64-V0123,SSE2,X64-SSE2,BMI2,X64-BMI2,V2,X64-V2
+; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+sse,sse2,+bmi,+bmi2,+avx2 < %s | FileCheck %s --check-prefixes=CHECK,X64,V0123,X64-V0123,BMI2,X64-BMI2,AVX2,X64-AVX2
; We are looking for the following pattern here:
; (X & (C l>> Y)) ==/!= 0
@@ -95,15 +97,6 @@ define i1 @scalar_i8_bitsinmiddle_eq(i8
; i16 scalar
define i1 @scalar_i16_signbit_eq(i16 %x, i16 %y) nounwind {
-; X86-NOBMI-LABEL: scalar_i16_signbit_eq:
-; X86-NOBMI: # %bb.0:
-; X86-NOBMI-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NOBMI-NEXT: movl $32768, %eax # imm = 0x8000
-; X86-NOBMI-NEXT: shrl %cl, %eax
-; X86-NOBMI-NEXT: testw %ax, {{[0-9]+}}(%esp)
-; X86-NOBMI-NEXT: sete %al
-; X86-NOBMI-NEXT: retl
-;
; X86-BMI1-LABEL: scalar_i16_signbit_eq:
; X86-BMI1: # %bb.0:
; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
@@ -113,24 +106,14 @@ define i1 @scalar_i16_signbit_eq(i16 %x,
; X86-BMI1-NEXT: sete %al
; X86-BMI1-NEXT: retl
;
-; X86-BMI12-LABEL: scalar_i16_signbit_eq:
-; X86-BMI12: # %bb.0:
-; X86-BMI12-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI12-NEXT: movl $32768, %ecx # imm = 0x8000
-; X86-BMI12-NEXT: shrxl %eax, %ecx, %eax
-; X86-BMI12-NEXT: testw %ax, {{[0-9]+}}(%esp)
-; X86-BMI12-NEXT: sete %al
-; X86-BMI12-NEXT: retl
-;
-; X64-NOBMI-LABEL: scalar_i16_signbit_eq:
-; X64-NOBMI: # %bb.0:
-; X64-NOBMI-NEXT: movl %esi, %ecx
-; X64-NOBMI-NEXT: movl $32768, %eax # imm = 0x8000
-; X64-NOBMI-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-NOBMI-NEXT: shrl %cl, %eax
-; X64-NOBMI-NEXT: testw %di, %ax
-; X64-NOBMI-NEXT: sete %al
-; X64-NOBMI-NEXT: retq
+; X86-BMI2-LABEL: scalar_i16_signbit_eq:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-BMI2-NEXT: movl $32768, %ecx # imm = 0x8000
+; X86-BMI2-NEXT: shrxl %eax, %ecx, %eax
+; X86-BMI2-NEXT: testw %ax, {{[0-9]+}}(%esp)
+; X86-BMI2-NEXT: sete %al
+; X86-BMI2-NEXT: retl
;
; X64-BMI1-LABEL: scalar_i16_signbit_eq:
; X64-BMI1: # %bb.0:
@@ -142,13 +125,13 @@ define i1 @scalar_i16_signbit_eq(i16 %x,
; X64-BMI1-NEXT: sete %al
; X64-BMI1-NEXT: retq
;
-; X64-BMI12-LABEL: scalar_i16_signbit_eq:
-; X64-BMI12: # %bb.0:
-; X64-BMI12-NEXT: movl $32768, %eax # imm = 0x8000
-; X64-BMI12-NEXT: shrxl %esi, %eax, %eax
-; X64-BMI12-NEXT: testw %di, %ax
-; X64-BMI12-NEXT: sete %al
-; X64-BMI12-NEXT: retq
+; X64-BMI2-LABEL: scalar_i16_signbit_eq:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: movl $32768, %eax # imm = 0x8000
+; X64-BMI2-NEXT: shrxl %esi, %eax, %eax
+; X64-BMI2-NEXT: testw %di, %ax
+; X64-BMI2-NEXT: sete %al
+; X64-BMI2-NEXT: retq
%t0 = lshr i16 32768, %y
%t1 = and i16 %t0, %x
%res = icmp eq i16 %t1, 0
@@ -156,15 +139,6 @@ define i1 @scalar_i16_signbit_eq(i16 %x,
}
define i1 @scalar_i16_lowestbit_eq(i16 %x, i16 %y) nounwind {
-; X86-NOBMI-LABEL: scalar_i16_lowestbit_eq:
-; X86-NOBMI: # %bb.0:
-; X86-NOBMI-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NOBMI-NEXT: movl $1, %eax
-; X86-NOBMI-NEXT: shrl %cl, %eax
-; X86-NOBMI-NEXT: testw %ax, {{[0-9]+}}(%esp)
-; X86-NOBMI-NEXT: sete %al
-; X86-NOBMI-NEXT: retl
-;
; X86-BMI1-LABEL: scalar_i16_lowestbit_eq:
; X86-BMI1: # %bb.0:
; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
@@ -174,24 +148,14 @@ define i1 @scalar_i16_lowestbit_eq(i16 %
; X86-BMI1-NEXT: sete %al
; X86-BMI1-NEXT: retl
;
-; X86-BMI12-LABEL: scalar_i16_lowestbit_eq:
-; X86-BMI12: # %bb.0:
-; X86-BMI12-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI12-NEXT: movl $1, %ecx
-; X86-BMI12-NEXT: shrxl %eax, %ecx, %eax
-; X86-BMI12-NEXT: testw %ax, {{[0-9]+}}(%esp)
-; X86-BMI12-NEXT: sete %al
-; X86-BMI12-NEXT: retl
-;
-; X64-NOBMI-LABEL: scalar_i16_lowestbit_eq:
-; X64-NOBMI: # %bb.0:
-; X64-NOBMI-NEXT: movl %esi, %ecx
-; X64-NOBMI-NEXT: movl $1, %eax
-; X64-NOBMI-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-NOBMI-NEXT: shrl %cl, %eax
-; X64-NOBMI-NEXT: testw %di, %ax
-; X64-NOBMI-NEXT: sete %al
-; X64-NOBMI-NEXT: retq
+; X86-BMI2-LABEL: scalar_i16_lowestbit_eq:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-BMI2-NEXT: movl $1, %ecx
+; X86-BMI2-NEXT: shrxl %eax, %ecx, %eax
+; X86-BMI2-NEXT: testw %ax, {{[0-9]+}}(%esp)
+; X86-BMI2-NEXT: sete %al
+; X86-BMI2-NEXT: retl
;
; X64-BMI1-LABEL: scalar_i16_lowestbit_eq:
; X64-BMI1: # %bb.0:
@@ -203,13 +167,13 @@ define i1 @scalar_i16_lowestbit_eq(i16 %
; X64-BMI1-NEXT: sete %al
; X64-BMI1-NEXT: retq
;
-; X64-BMI12-LABEL: scalar_i16_lowestbit_eq:
-; X64-BMI12: # %bb.0:
-; X64-BMI12-NEXT: movl $1, %eax
-; X64-BMI12-NEXT: shrxl %esi, %eax, %eax
-; X64-BMI12-NEXT: testw %di, %ax
-; X64-BMI12-NEXT: sete %al
-; X64-BMI12-NEXT: retq
+; X64-BMI2-LABEL: scalar_i16_lowestbit_eq:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: movl $1, %eax
+; X64-BMI2-NEXT: shrxl %esi, %eax, %eax
+; X64-BMI2-NEXT: testw %di, %ax
+; X64-BMI2-NEXT: sete %al
+; X64-BMI2-NEXT: retq
%t0 = lshr i16 1, %y
%t1 = and i16 %t0, %x
%res = icmp eq i16 %t1, 0
@@ -217,15 +181,6 @@ define i1 @scalar_i16_lowestbit_eq(i16 %
}
define i1 @scalar_i16_bitsinmiddle_eq(i16 %x, i16 %y) nounwind {
-; X86-NOBMI-LABEL: scalar_i16_bitsinmiddle_eq:
-; X86-NOBMI: # %bb.0:
-; X86-NOBMI-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NOBMI-NEXT: movl $4080, %eax # imm = 0xFF0
-; X86-NOBMI-NEXT: shrl %cl, %eax
-; X86-NOBMI-NEXT: testw %ax, {{[0-9]+}}(%esp)
-; X86-NOBMI-NEXT: sete %al
-; X86-NOBMI-NEXT: retl
-;
; X86-BMI1-LABEL: scalar_i16_bitsinmiddle_eq:
; X86-BMI1: # %bb.0:
; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
@@ -235,24 +190,14 @@ define i1 @scalar_i16_bitsinmiddle_eq(i1
; X86-BMI1-NEXT: sete %al
; X86-BMI1-NEXT: retl
;
-; X86-BMI12-LABEL: scalar_i16_bitsinmiddle_eq:
-; X86-BMI12: # %bb.0:
-; X86-BMI12-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI12-NEXT: movl $4080, %ecx # imm = 0xFF0
-; X86-BMI12-NEXT: shrxl %eax, %ecx, %eax
-; X86-BMI12-NEXT: testw %ax, {{[0-9]+}}(%esp)
-; X86-BMI12-NEXT: sete %al
-; X86-BMI12-NEXT: retl
-;
-; X64-NOBMI-LABEL: scalar_i16_bitsinmiddle_eq:
-; X64-NOBMI: # %bb.0:
-; X64-NOBMI-NEXT: movl %esi, %ecx
-; X64-NOBMI-NEXT: movl $4080, %eax # imm = 0xFF0
-; X64-NOBMI-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-NOBMI-NEXT: shrl %cl, %eax
-; X64-NOBMI-NEXT: testw %di, %ax
-; X64-NOBMI-NEXT: sete %al
-; X64-NOBMI-NEXT: retq
+; X86-BMI2-LABEL: scalar_i16_bitsinmiddle_eq:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-BMI2-NEXT: movl $4080, %ecx # imm = 0xFF0
+; X86-BMI2-NEXT: shrxl %eax, %ecx, %eax
+; X86-BMI2-NEXT: testw %ax, {{[0-9]+}}(%esp)
+; X86-BMI2-NEXT: sete %al
+; X86-BMI2-NEXT: retl
;
; X64-BMI1-LABEL: scalar_i16_bitsinmiddle_eq:
; X64-BMI1: # %bb.0:
@@ -264,13 +209,13 @@ define i1 @scalar_i16_bitsinmiddle_eq(i1
; X64-BMI1-NEXT: sete %al
; X64-BMI1-NEXT: retq
;
-; X64-BMI12-LABEL: scalar_i16_bitsinmiddle_eq:
-; X64-BMI12: # %bb.0:
-; X64-BMI12-NEXT: movl $4080, %eax # imm = 0xFF0
-; X64-BMI12-NEXT: shrxl %esi, %eax, %eax
-; X64-BMI12-NEXT: testw %di, %ax
-; X64-BMI12-NEXT: sete %al
-; X64-BMI12-NEXT: retq
+; X64-BMI2-LABEL: scalar_i16_bitsinmiddle_eq:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: movl $4080, %eax # imm = 0xFF0
+; X64-BMI2-NEXT: shrxl %esi, %eax, %eax
+; X64-BMI2-NEXT: testw %di, %ax
+; X64-BMI2-NEXT: sete %al
+; X64-BMI2-NEXT: retq
%t0 = lshr i16 4080, %y
%t1 = and i16 %t0, %x
%res = icmp eq i16 %t1, 0
@@ -280,15 +225,6 @@ define i1 @scalar_i16_bitsinmiddle_eq(i1
; i32 scalar
define i1 @scalar_i32_signbit_eq(i32 %x, i32 %y) nounwind {
-; X86-NOBMI-LABEL: scalar_i32_signbit_eq:
-; X86-NOBMI: # %bb.0:
-; X86-NOBMI-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NOBMI-NEXT: movl $-2147483648, %eax # imm = 0x80000000
-; X86-NOBMI-NEXT: shrl %cl, %eax
-; X86-NOBMI-NEXT: testl %eax, {{[0-9]+}}(%esp)
-; X86-NOBMI-NEXT: sete %al
-; X86-NOBMI-NEXT: retl
-;
; X86-BMI1-LABEL: scalar_i32_signbit_eq:
; X86-BMI1: # %bb.0:
; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
@@ -298,24 +234,14 @@ define i1 @scalar_i32_signbit_eq(i32 %x,
; X86-BMI1-NEXT: sete %al
; X86-BMI1-NEXT: retl
;
-; X86-BMI12-LABEL: scalar_i32_signbit_eq:
-; X86-BMI12: # %bb.0:
-; X86-BMI12-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI12-NEXT: movl $-2147483648, %ecx # imm = 0x80000000
-; X86-BMI12-NEXT: shrxl %eax, %ecx, %eax
-; X86-BMI12-NEXT: testl %eax, {{[0-9]+}}(%esp)
-; X86-BMI12-NEXT: sete %al
-; X86-BMI12-NEXT: retl
-;
-; X64-NOBMI-LABEL: scalar_i32_signbit_eq:
-; X64-NOBMI: # %bb.0:
-; X64-NOBMI-NEXT: movl %esi, %ecx
-; X64-NOBMI-NEXT: movl $-2147483648, %eax # imm = 0x80000000
-; X64-NOBMI-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-NOBMI-NEXT: shrl %cl, %eax
-; X64-NOBMI-NEXT: testl %edi, %eax
-; X64-NOBMI-NEXT: sete %al
-; X64-NOBMI-NEXT: retq
+; X86-BMI2-LABEL: scalar_i32_signbit_eq:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-BMI2-NEXT: movl $-2147483648, %ecx # imm = 0x80000000
+; X86-BMI2-NEXT: shrxl %eax, %ecx, %eax
+; X86-BMI2-NEXT: testl %eax, {{[0-9]+}}(%esp)
+; X86-BMI2-NEXT: sete %al
+; X86-BMI2-NEXT: retl
;
; X64-BMI1-LABEL: scalar_i32_signbit_eq:
; X64-BMI1: # %bb.0:
@@ -327,13 +253,13 @@ define i1 @scalar_i32_signbit_eq(i32 %x,
; X64-BMI1-NEXT: sete %al
; X64-BMI1-NEXT: retq
;
-; X64-BMI12-LABEL: scalar_i32_signbit_eq:
-; X64-BMI12: # %bb.0:
-; X64-BMI12-NEXT: movl $-2147483648, %eax # imm = 0x80000000
-; X64-BMI12-NEXT: shrxl %esi, %eax, %eax
-; X64-BMI12-NEXT: testl %edi, %eax
-; X64-BMI12-NEXT: sete %al
-; X64-BMI12-NEXT: retq
+; X64-BMI2-LABEL: scalar_i32_signbit_eq:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: movl $-2147483648, %eax # imm = 0x80000000
+; X64-BMI2-NEXT: shrxl %esi, %eax, %eax
+; X64-BMI2-NEXT: testl %edi, %eax
+; X64-BMI2-NEXT: sete %al
+; X64-BMI2-NEXT: retq
%t0 = lshr i32 2147483648, %y
%t1 = and i32 %t0, %x
%res = icmp eq i32 %t1, 0
@@ -341,15 +267,6 @@ define i1 @scalar_i32_signbit_eq(i32 %x,
}
define i1 @scalar_i32_lowestbit_eq(i32 %x, i32 %y) nounwind {
-; X86-NOBMI-LABEL: scalar_i32_lowestbit_eq:
-; X86-NOBMI: # %bb.0:
-; X86-NOBMI-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NOBMI-NEXT: movl $1, %eax
-; X86-NOBMI-NEXT: shrl %cl, %eax
-; X86-NOBMI-NEXT: testl %eax, {{[0-9]+}}(%esp)
-; X86-NOBMI-NEXT: sete %al
-; X86-NOBMI-NEXT: retl
-;
; X86-BMI1-LABEL: scalar_i32_lowestbit_eq:
; X86-BMI1: # %bb.0:
; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
@@ -359,24 +276,14 @@ define i1 @scalar_i32_lowestbit_eq(i32 %
; X86-BMI1-NEXT: sete %al
; X86-BMI1-NEXT: retl
;
-; X86-BMI12-LABEL: scalar_i32_lowestbit_eq:
-; X86-BMI12: # %bb.0:
-; X86-BMI12-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI12-NEXT: movl $1, %ecx
-; X86-BMI12-NEXT: shrxl %eax, %ecx, %eax
-; X86-BMI12-NEXT: testl %eax, {{[0-9]+}}(%esp)
-; X86-BMI12-NEXT: sete %al
-; X86-BMI12-NEXT: retl
-;
-; X64-NOBMI-LABEL: scalar_i32_lowestbit_eq:
-; X64-NOBMI: # %bb.0:
-; X64-NOBMI-NEXT: movl %esi, %ecx
-; X64-NOBMI-NEXT: movl $1, %eax
-; X64-NOBMI-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-NOBMI-NEXT: shrl %cl, %eax
-; X64-NOBMI-NEXT: testl %edi, %eax
-; X64-NOBMI-NEXT: sete %al
-; X64-NOBMI-NEXT: retq
+; X86-BMI2-LABEL: scalar_i32_lowestbit_eq:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-BMI2-NEXT: movl $1, %ecx
+; X86-BMI2-NEXT: shrxl %eax, %ecx, %eax
+; X86-BMI2-NEXT: testl %eax, {{[0-9]+}}(%esp)
+; X86-BMI2-NEXT: sete %al
+; X86-BMI2-NEXT: retl
;
; X64-BMI1-LABEL: scalar_i32_lowestbit_eq:
; X64-BMI1: # %bb.0:
@@ -388,13 +295,13 @@ define i1 @scalar_i32_lowestbit_eq(i32 %
; X64-BMI1-NEXT: sete %al
; X64-BMI1-NEXT: retq
;
-; X64-BMI12-LABEL: scalar_i32_lowestbit_eq:
-; X64-BMI12: # %bb.0:
-; X64-BMI12-NEXT: movl $1, %eax
-; X64-BMI12-NEXT: shrxl %esi, %eax, %eax
-; X64-BMI12-NEXT: testl %edi, %eax
-; X64-BMI12-NEXT: sete %al
-; X64-BMI12-NEXT: retq
+; X64-BMI2-LABEL: scalar_i32_lowestbit_eq:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: movl $1, %eax
+; X64-BMI2-NEXT: shrxl %esi, %eax, %eax
+; X64-BMI2-NEXT: testl %edi, %eax
+; X64-BMI2-NEXT: sete %al
+; X64-BMI2-NEXT: retq
%t0 = lshr i32 1, %y
%t1 = and i32 %t0, %x
%res = icmp eq i32 %t1, 0
@@ -402,15 +309,6 @@ define i1 @scalar_i32_lowestbit_eq(i32 %
}
define i1 @scalar_i32_bitsinmiddle_eq(i32 %x, i32 %y) nounwind {
-; X86-NOBMI-LABEL: scalar_i32_bitsinmiddle_eq:
-; X86-NOBMI: # %bb.0:
-; X86-NOBMI-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NOBMI-NEXT: movl $16776960, %eax # imm = 0xFFFF00
-; X86-NOBMI-NEXT: shrl %cl, %eax
-; X86-NOBMI-NEXT: testl %eax, {{[0-9]+}}(%esp)
-; X86-NOBMI-NEXT: sete %al
-; X86-NOBMI-NEXT: retl
-;
; X86-BMI1-LABEL: scalar_i32_bitsinmiddle_eq:
; X86-BMI1: # %bb.0:
; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
@@ -420,24 +318,14 @@ define i1 @scalar_i32_bitsinmiddle_eq(i3
; X86-BMI1-NEXT: sete %al
; X86-BMI1-NEXT: retl
;
-; X86-BMI12-LABEL: scalar_i32_bitsinmiddle_eq:
-; X86-BMI12: # %bb.0:
-; X86-BMI12-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI12-NEXT: movl $16776960, %ecx # imm = 0xFFFF00
-; X86-BMI12-NEXT: shrxl %eax, %ecx, %eax
-; X86-BMI12-NEXT: testl %eax, {{[0-9]+}}(%esp)
-; X86-BMI12-NEXT: sete %al
-; X86-BMI12-NEXT: retl
-;
-; X64-NOBMI-LABEL: scalar_i32_bitsinmiddle_eq:
-; X64-NOBMI: # %bb.0:
-; X64-NOBMI-NEXT: movl %esi, %ecx
-; X64-NOBMI-NEXT: movl $16776960, %eax # imm = 0xFFFF00
-; X64-NOBMI-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-NOBMI-NEXT: shrl %cl, %eax
-; X64-NOBMI-NEXT: testl %edi, %eax
-; X64-NOBMI-NEXT: sete %al
-; X64-NOBMI-NEXT: retq
+; X86-BMI2-LABEL: scalar_i32_bitsinmiddle_eq:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-BMI2-NEXT: movl $16776960, %ecx # imm = 0xFFFF00
+; X86-BMI2-NEXT: shrxl %eax, %ecx, %eax
+; X86-BMI2-NEXT: testl %eax, {{[0-9]+}}(%esp)
+; X86-BMI2-NEXT: sete %al
+; X86-BMI2-NEXT: retl
;
; X64-BMI1-LABEL: scalar_i32_bitsinmiddle_eq:
; X64-BMI1: # %bb.0:
@@ -449,13 +337,13 @@ define i1 @scalar_i32_bitsinmiddle_eq(i3
; X64-BMI1-NEXT: sete %al
; X64-BMI1-NEXT: retq
;
-; X64-BMI12-LABEL: scalar_i32_bitsinmiddle_eq:
-; X64-BMI12: # %bb.0:
-; X64-BMI12-NEXT: movl $16776960, %eax # imm = 0xFFFF00
-; X64-BMI12-NEXT: shrxl %esi, %eax, %eax
-; X64-BMI12-NEXT: testl %edi, %eax
-; X64-BMI12-NEXT: sete %al
-; X64-BMI12-NEXT: retq
+; X64-BMI2-LABEL: scalar_i32_bitsinmiddle_eq:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: movl $16776960, %eax # imm = 0xFFFF00
+; X64-BMI2-NEXT: shrxl %esi, %eax, %eax
+; X64-BMI2-NEXT: testl %edi, %eax
+; X64-BMI2-NEXT: sete %al
+; X64-BMI2-NEXT: retq
%t0 = lshr i32 16776960, %y
%t1 = and i32 %t0, %x
%res = icmp eq i32 %t1, 0
@@ -465,25 +353,6 @@ define i1 @scalar_i32_bitsinmiddle_eq(i3
; i64 scalar
define i1 @scalar_i64_signbit_eq(i64 %x, i64 %y) nounwind {
-; X86-NOBMI-LABEL: scalar_i64_signbit_eq:
-; X86-NOBMI: # %bb.0:
-; X86-NOBMI-NEXT: pushl %esi
-; X86-NOBMI-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NOBMI-NEXT: movl $-2147483648, %eax # imm = 0x80000000
-; X86-NOBMI-NEXT: xorl %edx, %edx
-; X86-NOBMI-NEXT: xorl %esi, %esi
-; X86-NOBMI-NEXT: shrdl %cl, %eax, %esi
-; X86-NOBMI-NEXT: shrl %cl, %eax
-; X86-NOBMI-NEXT: testb $32, %cl
-; X86-NOBMI-NEXT: cmovnel %eax, %esi
-; X86-NOBMI-NEXT: cmovnel %edx, %eax
-; X86-NOBMI-NEXT: andl {{[0-9]+}}(%esp), %esi
-; X86-NOBMI-NEXT: andl {{[0-9]+}}(%esp), %eax
-; X86-NOBMI-NEXT: orl %esi, %eax
-; X86-NOBMI-NEXT: sete %al
-; X86-NOBMI-NEXT: popl %esi
-; X86-NOBMI-NEXT: retl
-;
; X86-BMI1-LABEL: scalar_i64_signbit_eq:
; X86-BMI1: # %bb.0:
; X86-BMI1-NEXT: pushl %esi
@@ -503,34 +372,24 @@ define i1 @scalar_i64_signbit_eq(i64 %x,
; X86-BMI1-NEXT: popl %esi
; X86-BMI1-NEXT: retl
;
-; X86-BMI12-LABEL: scalar_i64_signbit_eq:
-; X86-BMI12: # %bb.0:
-; X86-BMI12-NEXT: pushl %esi
-; X86-BMI12-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-BMI12-NEXT: movl $-2147483648, %eax # imm = 0x80000000
-; X86-BMI12-NEXT: xorl %edx, %edx
-; X86-BMI12-NEXT: xorl %esi, %esi
-; X86-BMI12-NEXT: shrdl %cl, %eax, %esi
-; X86-BMI12-NEXT: shrxl %ecx, %eax, %eax
-; X86-BMI12-NEXT: testb $32, %cl
-; X86-BMI12-NEXT: cmovnel %eax, %esi
-; X86-BMI12-NEXT: cmovnel %edx, %eax
-; X86-BMI12-NEXT: andl {{[0-9]+}}(%esp), %esi
-; X86-BMI12-NEXT: andl {{[0-9]+}}(%esp), %eax
-; X86-BMI12-NEXT: orl %esi, %eax
-; X86-BMI12-NEXT: sete %al
-; X86-BMI12-NEXT: popl %esi
-; X86-BMI12-NEXT: retl
-;
-; X64-NOBMI-LABEL: scalar_i64_signbit_eq:
-; X64-NOBMI: # %bb.0:
-; X64-NOBMI-NEXT: movq %rsi, %rcx
-; X64-NOBMI-NEXT: movabsq $-9223372036854775808, %rax # imm = 0x8000000000000000
-; X64-NOBMI-NEXT: # kill: def $cl killed $cl killed $rcx
-; X64-NOBMI-NEXT: shrq %cl, %rax
-; X64-NOBMI-NEXT: testq %rdi, %rax
-; X64-NOBMI-NEXT: sete %al
-; X64-NOBMI-NEXT: retq
+; X86-BMI2-LABEL: scalar_i64_signbit_eq:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: pushl %esi
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BMI2-NEXT: movl $-2147483648, %eax # imm = 0x80000000
+; X86-BMI2-NEXT: xorl %edx, %edx
+; X86-BMI2-NEXT: xorl %esi, %esi
+; X86-BMI2-NEXT: shrdl %cl, %eax, %esi
+; X86-BMI2-NEXT: shrxl %ecx, %eax, %eax
+; X86-BMI2-NEXT: testb $32, %cl
+; X86-BMI2-NEXT: cmovnel %eax, %esi
+; X86-BMI2-NEXT: cmovnel %edx, %eax
+; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %esi
+; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %eax
+; X86-BMI2-NEXT: orl %esi, %eax
+; X86-BMI2-NEXT: sete %al
+; X86-BMI2-NEXT: popl %esi
+; X86-BMI2-NEXT: retl
;
; X64-BMI1-LABEL: scalar_i64_signbit_eq:
; X64-BMI1: # %bb.0:
@@ -542,13 +401,13 @@ define i1 @scalar_i64_signbit_eq(i64 %x,
; X64-BMI1-NEXT: sete %al
; X64-BMI1-NEXT: retq
;
-; X64-BMI12-LABEL: scalar_i64_signbit_eq:
-; X64-BMI12: # %bb.0:
-; X64-BMI12-NEXT: movabsq $-9223372036854775808, %rax # imm = 0x8000000000000000
-; X64-BMI12-NEXT: shrxq %rsi, %rax, %rax
-; X64-BMI12-NEXT: testq %rdi, %rax
-; X64-BMI12-NEXT: sete %al
-; X64-BMI12-NEXT: retq
+; X64-BMI2-LABEL: scalar_i64_signbit_eq:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: movabsq $-9223372036854775808, %rax # imm = 0x8000000000000000
+; X64-BMI2-NEXT: shrxq %rsi, %rax, %rax
+; X64-BMI2-NEXT: testq %rdi, %rax
+; X64-BMI2-NEXT: sete %al
+; X64-BMI2-NEXT: retq
%t0 = lshr i64 9223372036854775808, %y
%t1 = and i64 %t0, %x
%res = icmp eq i64 %t1, 0
@@ -569,16 +428,6 @@ define i1 @scalar_i64_lowestbit_eq(i64 %
; X86-NEXT: sete %al
; X86-NEXT: retl
;
-; X64-NOBMI-LABEL: scalar_i64_lowestbit_eq:
-; X64-NOBMI: # %bb.0:
-; X64-NOBMI-NEXT: movq %rsi, %rcx
-; X64-NOBMI-NEXT: movl $1, %eax
-; X64-NOBMI-NEXT: # kill: def $cl killed $cl killed $rcx
-; X64-NOBMI-NEXT: shrq %cl, %rax
-; X64-NOBMI-NEXT: testq %rdi, %rax
-; X64-NOBMI-NEXT: sete %al
-; X64-NOBMI-NEXT: retq
-;
; X64-BMI1-LABEL: scalar_i64_lowestbit_eq:
; X64-BMI1: # %bb.0:
; X64-BMI1-NEXT: movq %rsi, %rcx
@@ -589,13 +438,13 @@ define i1 @scalar_i64_lowestbit_eq(i64 %
; X64-BMI1-NEXT: sete %al
; X64-BMI1-NEXT: retq
;
-; X64-BMI12-LABEL: scalar_i64_lowestbit_eq:
-; X64-BMI12: # %bb.0:
-; X64-BMI12-NEXT: movl $1, %eax
-; X64-BMI12-NEXT: shrxq %rsi, %rax, %rax
-; X64-BMI12-NEXT: testq %rdi, %rax
-; X64-BMI12-NEXT: sete %al
-; X64-BMI12-NEXT: retq
+; X64-BMI2-LABEL: scalar_i64_lowestbit_eq:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: movl $1, %eax
+; X64-BMI2-NEXT: shrxq %rsi, %rax, %rax
+; X64-BMI2-NEXT: testq %rdi, %rax
+; X64-BMI2-NEXT: sete %al
+; X64-BMI2-NEXT: retq
%t0 = lshr i64 1, %y
%t1 = and i64 %t0, %x
%res = icmp eq i64 %t1, 0
@@ -603,25 +452,6 @@ define i1 @scalar_i64_lowestbit_eq(i64 %
}
define i1 @scalar_i64_bitsinmiddle_eq(i64 %x, i64 %y) nounwind {
-; X86-NOBMI-LABEL: scalar_i64_bitsinmiddle_eq:
-; X86-NOBMI: # %bb.0:
-; X86-NOBMI-NEXT: pushl %esi
-; X86-NOBMI-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NOBMI-NEXT: movl $65535, %eax # imm = 0xFFFF
-; X86-NOBMI-NEXT: movl $-65536, %edx # imm = 0xFFFF0000
-; X86-NOBMI-NEXT: shrdl %cl, %eax, %edx
-; X86-NOBMI-NEXT: shrl %cl, %eax
-; X86-NOBMI-NEXT: xorl %esi, %esi
-; X86-NOBMI-NEXT: testb $32, %cl
-; X86-NOBMI-NEXT: cmovnel %eax, %edx
-; X86-NOBMI-NEXT: cmovel %eax, %esi
-; X86-NOBMI-NEXT: andl {{[0-9]+}}(%esp), %edx
-; X86-NOBMI-NEXT: andl {{[0-9]+}}(%esp), %esi
-; X86-NOBMI-NEXT: orl %edx, %esi
-; X86-NOBMI-NEXT: sete %al
-; X86-NOBMI-NEXT: popl %esi
-; X86-NOBMI-NEXT: retl
-;
; X86-BMI1-LABEL: scalar_i64_bitsinmiddle_eq:
; X86-BMI1: # %bb.0:
; X86-BMI1-NEXT: pushl %esi
@@ -641,34 +471,24 @@ define i1 @scalar_i64_bitsinmiddle_eq(i6
; X86-BMI1-NEXT: popl %esi
; X86-BMI1-NEXT: retl
;
-; X86-BMI12-LABEL: scalar_i64_bitsinmiddle_eq:
-; X86-BMI12: # %bb.0:
-; X86-BMI12-NEXT: pushl %esi
-; X86-BMI12-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-BMI12-NEXT: movl $65535, %eax # imm = 0xFFFF
-; X86-BMI12-NEXT: movl $-65536, %edx # imm = 0xFFFF0000
-; X86-BMI12-NEXT: shrdl %cl, %eax, %edx
-; X86-BMI12-NEXT: shrxl %ecx, %eax, %eax
-; X86-BMI12-NEXT: xorl %esi, %esi
-; X86-BMI12-NEXT: testb $32, %cl
-; X86-BMI12-NEXT: cmovnel %eax, %edx
-; X86-BMI12-NEXT: cmovel %eax, %esi
-; X86-BMI12-NEXT: andl {{[0-9]+}}(%esp), %edx
-; X86-BMI12-NEXT: andl {{[0-9]+}}(%esp), %esi
-; X86-BMI12-NEXT: orl %edx, %esi
-; X86-BMI12-NEXT: sete %al
-; X86-BMI12-NEXT: popl %esi
-; X86-BMI12-NEXT: retl
-;
-; X64-NOBMI-LABEL: scalar_i64_bitsinmiddle_eq:
-; X64-NOBMI: # %bb.0:
-; X64-NOBMI-NEXT: movq %rsi, %rcx
-; X64-NOBMI-NEXT: movabsq $281474976645120, %rax # imm = 0xFFFFFFFF0000
-; X64-NOBMI-NEXT: # kill: def $cl killed $cl killed $rcx
-; X64-NOBMI-NEXT: shrq %cl, %rax
-; X64-NOBMI-NEXT: testq %rdi, %rax
-; X64-NOBMI-NEXT: sete %al
-; X64-NOBMI-NEXT: retq
+; X86-BMI2-LABEL: scalar_i64_bitsinmiddle_eq:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: pushl %esi
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BMI2-NEXT: movl $65535, %eax # imm = 0xFFFF
+; X86-BMI2-NEXT: movl $-65536, %edx # imm = 0xFFFF0000
+; X86-BMI2-NEXT: shrdl %cl, %eax, %edx
+; X86-BMI2-NEXT: shrxl %ecx, %eax, %eax
+; X86-BMI2-NEXT: xorl %esi, %esi
+; X86-BMI2-NEXT: testb $32, %cl
+; X86-BMI2-NEXT: cmovnel %eax, %edx
+; X86-BMI2-NEXT: cmovel %eax, %esi
+; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %edx
+; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %esi
+; X86-BMI2-NEXT: orl %edx, %esi
+; X86-BMI2-NEXT: sete %al
+; X86-BMI2-NEXT: popl %esi
+; X86-BMI2-NEXT: retl
;
; X64-BMI1-LABEL: scalar_i64_bitsinmiddle_eq:
; X64-BMI1: # %bb.0:
@@ -680,13 +500,13 @@ define i1 @scalar_i64_bitsinmiddle_eq(i6
; X64-BMI1-NEXT: sete %al
; X64-BMI1-NEXT: retq
;
-; X64-BMI12-LABEL: scalar_i64_bitsinmiddle_eq:
-; X64-BMI12: # %bb.0:
-; X64-BMI12-NEXT: movabsq $281474976645120, %rax # imm = 0xFFFFFFFF0000
-; X64-BMI12-NEXT: shrxq %rsi, %rax, %rax
-; X64-BMI12-NEXT: testq %rdi, %rax
-; X64-BMI12-NEXT: sete %al
-; X64-BMI12-NEXT: retq
+; X64-BMI2-LABEL: scalar_i64_bitsinmiddle_eq:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: movabsq $281474976645120, %rax # imm = 0xFFFFFFFF0000
+; X64-BMI2-NEXT: shrxq %rsi, %rax, %rax
+; X64-BMI2-NEXT: testq %rdi, %rax
+; X64-BMI2-NEXT: sete %al
+; X64-BMI2-NEXT: retq
%t0 = lshr i64 281474976645120, %y
%t1 = and i64 %t0, %x
%res = icmp eq i64 %t1, 0
@@ -698,28 +518,37 @@ define i1 @scalar_i64_bitsinmiddle_eq(i6
;------------------------------------------------------------------------------;
define <4 x i1> @vec_4xi32_splat_eq(<4 x i32> %x, <4 x i32> %y) nounwind {
-; CHECK-LABEL: vec_4xi32_splat_eq:
-; CHECK: # %bb.0:
-; CHECK-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
-; CHECK-NEXT: movdqa {{.*#+}} xmm3 = [1,1,1,1]
-; CHECK-NEXT: movdqa %xmm3, %xmm4
-; CHECK-NEXT: psrld %xmm2, %xmm4
-; CHECK-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[0,1,1,1,4,5,6,7]
-; CHECK-NEXT: movdqa %xmm3, %xmm5
-; CHECK-NEXT: psrld %xmm2, %xmm5
-; CHECK-NEXT: punpcklqdq {{.*#+}} xmm5 = xmm5[0],xmm4[0]
-; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
-; CHECK-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
-; CHECK-NEXT: movdqa %xmm3, %xmm4
-; CHECK-NEXT: psrld %xmm2, %xmm4
-; CHECK-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[0,1,1,1,4,5,6,7]
-; CHECK-NEXT: psrld %xmm1, %xmm3
-; CHECK-NEXT: punpckhqdq {{.*#+}} xmm3 = xmm3[1],xmm4[1]
-; CHECK-NEXT: shufps {{.*#+}} xmm5 = xmm5[0,3],xmm3[0,3]
-; CHECK-NEXT: andps %xmm5, %xmm0
-; CHECK-NEXT: pxor %xmm1, %xmm1
-; CHECK-NEXT: pcmpeqd %xmm1, %xmm0
-; CHECK-NEXT: ret{{[l|q]}}
+; SSE2-LABEL: vec_4xi32_splat_eq:
+; SSE2: # %bb.0:
+; SSE2-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
+; SSE2-NEXT: movdqa {{.*#+}} xmm3 = [1,1,1,1]
+; SSE2-NEXT: movdqa %xmm3, %xmm4
+; SSE2-NEXT: psrld %xmm2, %xmm4
+; SSE2-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[0,1,1,1,4,5,6,7]
+; SSE2-NEXT: movdqa %xmm3, %xmm5
+; SSE2-NEXT: psrld %xmm2, %xmm5
+; SSE2-NEXT: punpcklqdq {{.*#+}} xmm5 = xmm5[0],xmm4[0]
+; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
+; SSE2-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
+; SSE2-NEXT: movdqa %xmm3, %xmm4
+; SSE2-NEXT: psrld %xmm2, %xmm4
+; SSE2-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[0,1,1,1,4,5,6,7]
+; SSE2-NEXT: psrld %xmm1, %xmm3
+; SSE2-NEXT: punpckhqdq {{.*#+}} xmm3 = xmm3[1],xmm4[1]
+; SSE2-NEXT: shufps {{.*#+}} xmm5 = xmm5[0,3],xmm3[0,3]
+; SSE2-NEXT: andps %xmm5, %xmm0
+; SSE2-NEXT: pxor %xmm1, %xmm1
+; SSE2-NEXT: pcmpeqd %xmm1, %xmm0
+; SSE2-NEXT: ret{{[l|q]}}
+;
+; AVX2-LABEL: vec_4xi32_splat_eq:
+; AVX2: # %bb.0:
+; AVX2-NEXT: vpbroadcastd {{.*#+}} xmm2 = [1,1,1,1]
+; AVX2-NEXT: vpsrlvd %xmm1, %xmm2, %xmm1
+; AVX2-NEXT: vpand %xmm0, %xmm1, %xmm0
+; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; AVX2-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
+; AVX2-NEXT: ret{{[l|q]}}
%t0 = lshr <4 x i32> <i32 1, i32 1, i32 1, i32 1>, %y
%t1 = and <4 x i32> %t0, %x
%res = icmp eq <4 x i32> %t1, <i32 0, i32 0, i32 0, i32 0>
@@ -727,28 +556,37 @@ define <4 x i1> @vec_4xi32_splat_eq(<4 x
}
define <4 x i1> @vec_4xi32_nonsplat_eq(<4 x i32> %x, <4 x i32> %y) nounwind {
-; CHECK-LABEL: vec_4xi32_nonsplat_eq:
-; CHECK: # %bb.0:
-; CHECK-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
-; CHECK-NEXT: movdqa {{.*#+}} xmm3 = [0,1,16776960,2147483648]
-; CHECK-NEXT: movdqa %xmm3, %xmm4
-; CHECK-NEXT: psrld %xmm2, %xmm4
-; CHECK-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[0,1,1,1,4,5,6,7]
-; CHECK-NEXT: movdqa %xmm3, %xmm5
-; CHECK-NEXT: psrld %xmm2, %xmm5
-; CHECK-NEXT: punpcklqdq {{.*#+}} xmm5 = xmm5[0],xmm4[0]
-; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
-; CHECK-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
-; CHECK-NEXT: movdqa %xmm3, %xmm4
-; CHECK-NEXT: psrld %xmm2, %xmm4
-; CHECK-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[0,1,1,1,4,5,6,7]
-; CHECK-NEXT: psrld %xmm1, %xmm3
-; CHECK-NEXT: punpckhqdq {{.*#+}} xmm3 = xmm3[1],xmm4[1]
-; CHECK-NEXT: shufps {{.*#+}} xmm5 = xmm5[0,3],xmm3[0,3]
-; CHECK-NEXT: andps %xmm5, %xmm0
-; CHECK-NEXT: pxor %xmm1, %xmm1
-; CHECK-NEXT: pcmpeqd %xmm1, %xmm0
-; CHECK-NEXT: ret{{[l|q]}}
+; SSE2-LABEL: vec_4xi32_nonsplat_eq:
+; SSE2: # %bb.0:
+; SSE2-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
+; SSE2-NEXT: movdqa {{.*#+}} xmm3 = [0,1,16776960,2147483648]
+; SSE2-NEXT: movdqa %xmm3, %xmm4
+; SSE2-NEXT: psrld %xmm2, %xmm4
+; SSE2-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[0,1,1,1,4,5,6,7]
+; SSE2-NEXT: movdqa %xmm3, %xmm5
+; SSE2-NEXT: psrld %xmm2, %xmm5
+; SSE2-NEXT: punpcklqdq {{.*#+}} xmm5 = xmm5[0],xmm4[0]
+; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
+; SSE2-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
+; SSE2-NEXT: movdqa %xmm3, %xmm4
+; SSE2-NEXT: psrld %xmm2, %xmm4
+; SSE2-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[0,1,1,1,4,5,6,7]
+; SSE2-NEXT: psrld %xmm1, %xmm3
+; SSE2-NEXT: punpckhqdq {{.*#+}} xmm3 = xmm3[1],xmm4[1]
+; SSE2-NEXT: shufps {{.*#+}} xmm5 = xmm5[0,3],xmm3[0,3]
+; SSE2-NEXT: andps %xmm5, %xmm0
+; SSE2-NEXT: pxor %xmm1, %xmm1
+; SSE2-NEXT: pcmpeqd %xmm1, %xmm0
+; SSE2-NEXT: ret{{[l|q]}}
+;
+; AVX2-LABEL: vec_4xi32_nonsplat_eq:
+; AVX2: # %bb.0:
+; AVX2-NEXT: vmovdqa {{.*#+}} xmm2 = [0,1,16776960,2147483648]
+; AVX2-NEXT: vpsrlvd %xmm1, %xmm2, %xmm1
+; AVX2-NEXT: vpand %xmm0, %xmm1, %xmm0
+; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; AVX2-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
+; AVX2-NEXT: ret{{[l|q]}}
%t0 = lshr <4 x i32> <i32 0, i32 1, i32 16776960, i32 2147483648>, %y
%t1 = and <4 x i32> %t0, %x
%res = icmp eq <4 x i32> %t1, <i32 0, i32 0, i32 0, i32 0>
@@ -756,84 +594,111 @@ define <4 x i1> @vec_4xi32_nonsplat_eq(<
}
define <4 x i1> @vec_4xi32_nonsplat_undef0_eq(<4 x i32> %x, <4 x i32> %y) nounwind {
-; CHECK-LABEL: vec_4xi32_nonsplat_undef0_eq:
-; CHECK: # %bb.0:
-; CHECK-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
-; CHECK-NEXT: movdqa {{.*#+}} xmm3 = <1,1,u,1>
-; CHECK-NEXT: movdqa %xmm3, %xmm4
-; CHECK-NEXT: psrld %xmm2, %xmm4
-; CHECK-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[0,1,1,1,4,5,6,7]
-; CHECK-NEXT: movdqa %xmm3, %xmm5
-; CHECK-NEXT: psrld %xmm2, %xmm5
-; CHECK-NEXT: punpcklqdq {{.*#+}} xmm5 = xmm5[0],xmm4[0]
-; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
-; CHECK-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
-; CHECK-NEXT: movdqa %xmm3, %xmm4
-; CHECK-NEXT: psrld %xmm2, %xmm4
-; CHECK-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[0,1,1,1,4,5,6,7]
-; CHECK-NEXT: psrld %xmm1, %xmm3
-; CHECK-NEXT: punpckhqdq {{.*#+}} xmm3 = xmm3[1],xmm4[1]
-; CHECK-NEXT: shufps {{.*#+}} xmm5 = xmm5[0,3],xmm3[0,3]
-; CHECK-NEXT: andps %xmm5, %xmm0
-; CHECK-NEXT: pxor %xmm1, %xmm1
-; CHECK-NEXT: pcmpeqd %xmm1, %xmm0
-; CHECK-NEXT: ret{{[l|q]}}
+; SSE2-LABEL: vec_4xi32_nonsplat_undef0_eq:
+; SSE2: # %bb.0:
+; SSE2-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
+; SSE2-NEXT: movdqa {{.*#+}} xmm3 = <1,1,u,1>
+; SSE2-NEXT: movdqa %xmm3, %xmm4
+; SSE2-NEXT: psrld %xmm2, %xmm4
+; SSE2-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[0,1,1,1,4,5,6,7]
+; SSE2-NEXT: movdqa %xmm3, %xmm5
+; SSE2-NEXT: psrld %xmm2, %xmm5
+; SSE2-NEXT: punpcklqdq {{.*#+}} xmm5 = xmm5[0],xmm4[0]
+; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
+; SSE2-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
+; SSE2-NEXT: movdqa %xmm3, %xmm4
+; SSE2-NEXT: psrld %xmm2, %xmm4
+; SSE2-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[0,1,1,1,4,5,6,7]
+; SSE2-NEXT: psrld %xmm1, %xmm3
+; SSE2-NEXT: punpckhqdq {{.*#+}} xmm3 = xmm3[1],xmm4[1]
+; SSE2-NEXT: shufps {{.*#+}} xmm5 = xmm5[0,3],xmm3[0,3]
+; SSE2-NEXT: andps %xmm5, %xmm0
+; SSE2-NEXT: pxor %xmm1, %xmm1
+; SSE2-NEXT: pcmpeqd %xmm1, %xmm0
+; SSE2-NEXT: ret{{[l|q]}}
+;
+; AVX2-LABEL: vec_4xi32_nonsplat_undef0_eq:
+; AVX2: # %bb.0:
+; AVX2-NEXT: vpbroadcastd {{.*#+}} xmm2 = [1,1,1,1]
+; AVX2-NEXT: vpsrlvd %xmm1, %xmm2, %xmm1
+; AVX2-NEXT: vpand %xmm0, %xmm1, %xmm0
+; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; AVX2-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
+; AVX2-NEXT: ret{{[l|q]}}
%t0 = lshr <4 x i32> <i32 1, i32 1, i32 undef, i32 1>, %y
%t1 = and <4 x i32> %t0, %x
%res = icmp eq <4 x i32> %t1, <i32 0, i32 0, i32 0, i32 0>
ret <4 x i1> %res
}
define <4 x i1> @vec_4xi32_nonsplat_undef1_eq(<4 x i32> %x, <4 x i32> %y) nounwind {
-; CHECK-LABEL: vec_4xi32_nonsplat_undef1_eq:
-; CHECK: # %bb.0:
-; CHECK-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
-; CHECK-NEXT: movdqa {{.*#+}} xmm3 = [1,1,1,1]
-; CHECK-NEXT: movdqa %xmm3, %xmm4
-; CHECK-NEXT: psrld %xmm2, %xmm4
-; CHECK-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[0,1,1,1,4,5,6,7]
-; CHECK-NEXT: movdqa %xmm3, %xmm5
-; CHECK-NEXT: psrld %xmm2, %xmm5
-; CHECK-NEXT: punpcklqdq {{.*#+}} xmm5 = xmm5[0],xmm4[0]
-; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
-; CHECK-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
-; CHECK-NEXT: movdqa %xmm3, %xmm4
-; CHECK-NEXT: psrld %xmm2, %xmm4
-; CHECK-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[0,1,1,1,4,5,6,7]
-; CHECK-NEXT: psrld %xmm1, %xmm3
-; CHECK-NEXT: punpckhqdq {{.*#+}} xmm3 = xmm3[1],xmm4[1]
-; CHECK-NEXT: shufps {{.*#+}} xmm5 = xmm5[0,3],xmm3[0,3]
-; CHECK-NEXT: andps %xmm5, %xmm0
-; CHECK-NEXT: pxor %xmm1, %xmm1
-; CHECK-NEXT: pcmpeqd %xmm1, %xmm0
-; CHECK-NEXT: ret{{[l|q]}}
+; SSE2-LABEL: vec_4xi32_nonsplat_undef1_eq:
+; SSE2: # %bb.0:
+; SSE2-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
+; SSE2-NEXT: movdqa {{.*#+}} xmm3 = [1,1,1,1]
+; SSE2-NEXT: movdqa %xmm3, %xmm4
+; SSE2-NEXT: psrld %xmm2, %xmm4
+; SSE2-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[0,1,1,1,4,5,6,7]
+; SSE2-NEXT: movdqa %xmm3, %xmm5
+; SSE2-NEXT: psrld %xmm2, %xmm5
+; SSE2-NEXT: punpcklqdq {{.*#+}} xmm5 = xmm5[0],xmm4[0]
+; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
+; SSE2-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
+; SSE2-NEXT: movdqa %xmm3, %xmm4
+; SSE2-NEXT: psrld %xmm2, %xmm4
+; SSE2-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[0,1,1,1,4,5,6,7]
+; SSE2-NEXT: psrld %xmm1, %xmm3
+; SSE2-NEXT: punpckhqdq {{.*#+}} xmm3 = xmm3[1],xmm4[1]
+; SSE2-NEXT: shufps {{.*#+}} xmm5 = xmm5[0,3],xmm3[0,3]
+; SSE2-NEXT: andps %xmm5, %xmm0
+; SSE2-NEXT: pxor %xmm1, %xmm1
+; SSE2-NEXT: pcmpeqd %xmm1, %xmm0
+; SSE2-NEXT: ret{{[l|q]}}
+;
+; AVX2-LABEL: vec_4xi32_nonsplat_undef1_eq:
+; AVX2: # %bb.0:
+; AVX2-NEXT: vpbroadcastd {{.*#+}} xmm2 = [1,1,1,1]
+; AVX2-NEXT: vpsrlvd %xmm1, %xmm2, %xmm1
+; AVX2-NEXT: vpand %xmm0, %xmm1, %xmm0
+; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; AVX2-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
+; AVX2-NEXT: ret{{[l|q]}}
%t0 = lshr <4 x i32> <i32 1, i32 1, i32 1, i32 1>, %y
%t1 = and <4 x i32> %t0, %x
%res = icmp eq <4 x i32> %t1, <i32 0, i32 0, i32 undef, i32 0>
ret <4 x i1> %res
}
define <4 x i1> @vec_4xi32_nonsplat_undef2_eq(<4 x i32> %x, <4 x i32> %y) nounwind {
-; CHECK-LABEL: vec_4xi32_nonsplat_undef2_eq:
-; CHECK: # %bb.0:
-; CHECK-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
-; CHECK-NEXT: movdqa {{.*#+}} xmm3 = <1,1,u,1>
-; CHECK-NEXT: movdqa %xmm3, %xmm4
-; CHECK-NEXT: psrld %xmm2, %xmm4
-; CHECK-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[0,1,1,1,4,5,6,7]
-; CHECK-NEXT: movdqa %xmm3, %xmm5
-; CHECK-NEXT: psrld %xmm2, %xmm5
-; CHECK-NEXT: punpcklqdq {{.*#+}} xmm5 = xmm5[0],xmm4[0]
-; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
-; CHECK-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
-; CHECK-NEXT: movdqa %xmm3, %xmm4
-; CHECK-NEXT: psrld %xmm2, %xmm4
-; CHECK-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[0,1,1,1,4,5,6,7]
-; CHECK-NEXT: psrld %xmm1, %xmm3
-; CHECK-NEXT: punpckhqdq {{.*#+}} xmm3 = xmm3[1],xmm4[1]
-; CHECK-NEXT: shufps {{.*#+}} xmm5 = xmm5[0,3],xmm3[0,3]
-; CHECK-NEXT: andps %xmm5, %xmm0
-; CHECK-NEXT: pxor %xmm1, %xmm1
-; CHECK-NEXT: pcmpeqd %xmm1, %xmm0
-; CHECK-NEXT: ret{{[l|q]}}
+; SSE2-LABEL: vec_4xi32_nonsplat_undef2_eq:
+; SSE2: # %bb.0:
+; SSE2-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
+; SSE2-NEXT: movdqa {{.*#+}} xmm3 = <1,1,u,1>
+; SSE2-NEXT: movdqa %xmm3, %xmm4
+; SSE2-NEXT: psrld %xmm2, %xmm4
+; SSE2-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[0,1,1,1,4,5,6,7]
+; SSE2-NEXT: movdqa %xmm3, %xmm5
+; SSE2-NEXT: psrld %xmm2, %xmm5
+; SSE2-NEXT: punpcklqdq {{.*#+}} xmm5 = xmm5[0],xmm4[0]
+; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
+; SSE2-NEXT: pshuflw {{.*#+}} xmm2 = xmm1[2,3,3,3,4,5,6,7]
+; SSE2-NEXT: movdqa %xmm3, %xmm4
+; SSE2-NEXT: psrld %xmm2, %xmm4
+; SSE2-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[0,1,1,1,4,5,6,7]
+; SSE2-NEXT: psrld %xmm1, %xmm3
+; SSE2-NEXT: punpckhqdq {{.*#+}} xmm3 = xmm3[1],xmm4[1]
+; SSE2-NEXT: shufps {{.*#+}} xmm5 = xmm5[0,3],xmm3[0,3]
+; SSE2-NEXT: andps %xmm5, %xmm0
+; SSE2-NEXT: pxor %xmm1, %xmm1
+; SSE2-NEXT: pcmpeqd %xmm1, %xmm0
+; SSE2-NEXT: ret{{[l|q]}}
+;
+; AVX2-LABEL: vec_4xi32_nonsplat_undef2_eq:
+; AVX2: # %bb.0:
+; AVX2-NEXT: vpbroadcastd {{.*#+}} xmm2 = [1,1,1,1]
+; AVX2-NEXT: vpsrlvd %xmm1, %xmm2, %xmm1
+; AVX2-NEXT: vpand %xmm0, %xmm1, %xmm0
+; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; AVX2-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
+; AVX2-NEXT: ret{{[l|q]}}
%t0 = lshr <4 x i32> <i32 1, i32 1, i32 undef, i32 1>, %y
%t1 = and <4 x i32> %t0, %x
%res = icmp eq <4 x i32> %t1, <i32 0, i32 0, i32 undef, i32 0>
@@ -894,15 +759,6 @@ define i1 @scalar_i32_x_is_const_eq(i32
ret i1 %res
}
define i1 @scalar_i32_x_is_const2_eq(i32 %y) nounwind {
-; X86-NOBMI-LABEL: scalar_i32_x_is_const2_eq:
-; X86-NOBMI: # %bb.0:
-; X86-NOBMI-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NOBMI-NEXT: movl $1, %eax
-; X86-NOBMI-NEXT: shrl %cl, %eax
-; X86-NOBMI-NEXT: testl $-1437226411, %eax # imm = 0xAA55AA55
-; X86-NOBMI-NEXT: sete %al
-; X86-NOBMI-NEXT: retl
-;
; X86-BMI1-LABEL: scalar_i32_x_is_const2_eq:
; X86-BMI1: # %bb.0:
; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
@@ -912,24 +768,14 @@ define i1 @scalar_i32_x_is_const2_eq(i32
; X86-BMI1-NEXT: sete %al
; X86-BMI1-NEXT: retl
;
-; X86-BMI12-LABEL: scalar_i32_x_is_const2_eq:
-; X86-BMI12: # %bb.0:
-; X86-BMI12-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI12-NEXT: movl $1, %ecx
-; X86-BMI12-NEXT: shrxl %eax, %ecx, %eax
-; X86-BMI12-NEXT: testl $-1437226411, %eax # imm = 0xAA55AA55
-; X86-BMI12-NEXT: sete %al
-; X86-BMI12-NEXT: retl
-;
-; X64-NOBMI-LABEL: scalar_i32_x_is_const2_eq:
-; X64-NOBMI: # %bb.0:
-; X64-NOBMI-NEXT: movl %edi, %ecx
-; X64-NOBMI-NEXT: movl $1, %eax
-; X64-NOBMI-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-NOBMI-NEXT: shrl %cl, %eax
-; X64-NOBMI-NEXT: testl $-1437226411, %eax # imm = 0xAA55AA55
-; X64-NOBMI-NEXT: sete %al
-; X64-NOBMI-NEXT: retq
+; X86-BMI2-LABEL: scalar_i32_x_is_const2_eq:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-BMI2-NEXT: movl $1, %ecx
+; X86-BMI2-NEXT: shrxl %eax, %ecx, %eax
+; X86-BMI2-NEXT: testl $-1437226411, %eax # imm = 0xAA55AA55
+; X86-BMI2-NEXT: sete %al
+; X86-BMI2-NEXT: retl
;
; X64-BMI1-LABEL: scalar_i32_x_is_const2_eq:
; X64-BMI1: # %bb.0:
@@ -941,13 +787,13 @@ define i1 @scalar_i32_x_is_const2_eq(i32
; X64-BMI1-NEXT: sete %al
; X64-BMI1-NEXT: retq
;
-; X64-BMI12-LABEL: scalar_i32_x_is_const2_eq:
-; X64-BMI12: # %bb.0:
-; X64-BMI12-NEXT: movl $1, %eax
-; X64-BMI12-NEXT: shrxl %edi, %eax, %eax
-; X64-BMI12-NEXT: testl $-1437226411, %eax # imm = 0xAA55AA55
-; X64-BMI12-NEXT: sete %al
-; X64-BMI12-NEXT: retq
+; X64-BMI2-LABEL: scalar_i32_x_is_const2_eq:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: movl $1, %eax
+; X64-BMI2-NEXT: shrxl %edi, %eax, %eax
+; X64-BMI2-NEXT: testl $-1437226411, %eax # imm = 0xAA55AA55
+; X64-BMI2-NEXT: sete %al
+; X64-BMI2-NEXT: retq
%t0 = lshr i32 1, %y
%t1 = and i32 %t0, 2857740885
%res = icmp eq i32 %t1, 0
Modified: llvm/trunk/test/CodeGen/X86/hoist-and-by-const-from-shl-in-eqcmp-zero.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/hoist-and-by-const-from-shl-in-eqcmp-zero.ll?rev=362606&r1=362605&r2=362606&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/hoist-and-by-const-from-shl-in-eqcmp-zero.ll (original)
+++ llvm/trunk/test/CodeGen/X86/hoist-and-by-const-from-shl-in-eqcmp-zero.ll Wed Jun 5 07:08:11 2019
@@ -1,10 +1,12 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+sse,sse2 < %s | FileCheck %s --check-prefixes=CHECK,X86,X86-NOBMI
-; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+sse,sse2,+bmi < %s | FileCheck %s --check-prefixes=CHECK,X86,X86-BMI,X86-BMI1
-; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+sse,sse2,+bmi,+bmi2 < %s | FileCheck %s --check-prefixes=CHECK,X86,X86-BMI,X86-BMI12
-; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+sse,sse2 < %s | FileCheck %s --check-prefixes=CHECK,X64,X64-NOBMI
-; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+sse,sse2,+bmi < %s | FileCheck %s --check-prefixes=CHECK,X64,X64-BMI,X64-BMI1
-; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+sse,sse2,+bmi,+bmi2 < %s | FileCheck %s --check-prefixes=CHECK,X64,X64-BMI,X64-BMI12
+; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+sse,sse2 < %s | FileCheck %s --check-prefixes=CHECK,X86,V0123,X86-V0123,SSE2,X86-SSE2,BMI1,X86-BMI1,V0,X86-V0
+; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+sse,sse2,+bmi < %s | FileCheck %s --check-prefixes=CHECK,X86,V0123,X86-V0123,SSE2,X86-SSE2,BMI1,X86-BMI1,V1,X86-V1
+; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+sse,sse2,+bmi,+bmi2 < %s | FileCheck %s --check-prefixes=CHECK,X86,V0123,X86-V0123,SSE2,X86-SSE2,BMI2,X86-BMI2,V2,X86-V2
+; RUN: llc -mtriple=i686-unknown-linux-gnu -mattr=+sse,sse2,+bmi,+bmi2,+avx2 < %s | FileCheck %s --check-prefixes=CHECK,X86,V0123,X86-V0123,BMI2,X86-BMI2,AVX2,X86-AVX2
+; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+sse,sse2 < %s | FileCheck %s --check-prefixes=CHECK,X64,V0123,X64-V0123,SSE2,X64-SSE2,BMI1,X64-BMI1,V0,X64-V0
+; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+sse,sse2,+bmi < %s | FileCheck %s --check-prefixes=CHECK,X64,V0123,X64-V0123,SSE2,X64-SSE2,BMI1,X64-BMI1,V1,X64-V1
+; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+sse,sse2,+bmi,+bmi2 < %s | FileCheck %s --check-prefixes=CHECK,X64,V0123,X64-V0123,SSE2,X64-SSE2,BMI2,X64-BMI2,V2,X64-V2
+; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+sse,sse2,+bmi,+bmi2,+avx2 < %s | FileCheck %s --check-prefixes=CHECK,X64,V0123,X64-V0123,BMI2,X64-BMI2,AVX2,X64-AVX2
; We are looking for the following pattern here:
; (X & (C << Y)) ==/!= 0
@@ -90,15 +92,6 @@ define i1 @scalar_i8_bitsinmiddle_eq(i8
; i16 scalar
define i1 @scalar_i16_signbit_eq(i16 %x, i16 %y) nounwind {
-; X86-NOBMI-LABEL: scalar_i16_signbit_eq:
-; X86-NOBMI: # %bb.0:
-; X86-NOBMI-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NOBMI-NEXT: movl $-32768, %eax # imm = 0x8000
-; X86-NOBMI-NEXT: shll %cl, %eax
-; X86-NOBMI-NEXT: testw %ax, {{[0-9]+}}(%esp)
-; X86-NOBMI-NEXT: sete %al
-; X86-NOBMI-NEXT: retl
-;
; X86-BMI1-LABEL: scalar_i16_signbit_eq:
; X86-BMI1: # %bb.0:
; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
@@ -108,24 +101,14 @@ define i1 @scalar_i16_signbit_eq(i16 %x,
; X86-BMI1-NEXT: sete %al
; X86-BMI1-NEXT: retl
;
-; X86-BMI12-LABEL: scalar_i16_signbit_eq:
-; X86-BMI12: # %bb.0:
-; X86-BMI12-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI12-NEXT: movl $-32768, %ecx # imm = 0x8000
-; X86-BMI12-NEXT: shlxl %eax, %ecx, %eax
-; X86-BMI12-NEXT: testw %ax, {{[0-9]+}}(%esp)
-; X86-BMI12-NEXT: sete %al
-; X86-BMI12-NEXT: retl
-;
-; X64-NOBMI-LABEL: scalar_i16_signbit_eq:
-; X64-NOBMI: # %bb.0:
-; X64-NOBMI-NEXT: movl %esi, %ecx
-; X64-NOBMI-NEXT: movl $-32768, %eax # imm = 0x8000
-; X64-NOBMI-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-NOBMI-NEXT: shll %cl, %eax
-; X64-NOBMI-NEXT: testw %di, %ax
-; X64-NOBMI-NEXT: sete %al
-; X64-NOBMI-NEXT: retq
+; X86-BMI2-LABEL: scalar_i16_signbit_eq:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-BMI2-NEXT: movl $-32768, %ecx # imm = 0x8000
+; X86-BMI2-NEXT: shlxl %eax, %ecx, %eax
+; X86-BMI2-NEXT: testw %ax, {{[0-9]+}}(%esp)
+; X86-BMI2-NEXT: sete %al
+; X86-BMI2-NEXT: retl
;
; X64-BMI1-LABEL: scalar_i16_signbit_eq:
; X64-BMI1: # %bb.0:
@@ -137,13 +120,13 @@ define i1 @scalar_i16_signbit_eq(i16 %x,
; X64-BMI1-NEXT: sete %al
; X64-BMI1-NEXT: retq
;
-; X64-BMI12-LABEL: scalar_i16_signbit_eq:
-; X64-BMI12: # %bb.0:
-; X64-BMI12-NEXT: movl $-32768, %eax # imm = 0x8000
-; X64-BMI12-NEXT: shlxl %esi, %eax, %eax
-; X64-BMI12-NEXT: testw %di, %ax
-; X64-BMI12-NEXT: sete %al
-; X64-BMI12-NEXT: retq
+; X64-BMI2-LABEL: scalar_i16_signbit_eq:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: movl $-32768, %eax # imm = 0x8000
+; X64-BMI2-NEXT: shlxl %esi, %eax, %eax
+; X64-BMI2-NEXT: testw %di, %ax
+; X64-BMI2-NEXT: sete %al
+; X64-BMI2-NEXT: retq
%t0 = shl i16 32768, %y
%t1 = and i16 %t0, %x
%res = icmp eq i16 %t1, 0
@@ -171,15 +154,6 @@ define i1 @scalar_i16_lowestbit_eq(i16 %
}
define i1 @scalar_i16_bitsinmiddle_eq(i16 %x, i16 %y) nounwind {
-; X86-NOBMI-LABEL: scalar_i16_bitsinmiddle_eq:
-; X86-NOBMI: # %bb.0:
-; X86-NOBMI-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NOBMI-NEXT: movl $4080, %eax # imm = 0xFF0
-; X86-NOBMI-NEXT: shll %cl, %eax
-; X86-NOBMI-NEXT: testw %ax, {{[0-9]+}}(%esp)
-; X86-NOBMI-NEXT: sete %al
-; X86-NOBMI-NEXT: retl
-;
; X86-BMI1-LABEL: scalar_i16_bitsinmiddle_eq:
; X86-BMI1: # %bb.0:
; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
@@ -189,24 +163,14 @@ define i1 @scalar_i16_bitsinmiddle_eq(i1
; X86-BMI1-NEXT: sete %al
; X86-BMI1-NEXT: retl
;
-; X86-BMI12-LABEL: scalar_i16_bitsinmiddle_eq:
-; X86-BMI12: # %bb.0:
-; X86-BMI12-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI12-NEXT: movl $4080, %ecx # imm = 0xFF0
-; X86-BMI12-NEXT: shlxl %eax, %ecx, %eax
-; X86-BMI12-NEXT: testw %ax, {{[0-9]+}}(%esp)
-; X86-BMI12-NEXT: sete %al
-; X86-BMI12-NEXT: retl
-;
-; X64-NOBMI-LABEL: scalar_i16_bitsinmiddle_eq:
-; X64-NOBMI: # %bb.0:
-; X64-NOBMI-NEXT: movl %esi, %ecx
-; X64-NOBMI-NEXT: movl $4080, %eax # imm = 0xFF0
-; X64-NOBMI-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-NOBMI-NEXT: shll %cl, %eax
-; X64-NOBMI-NEXT: testw %di, %ax
-; X64-NOBMI-NEXT: sete %al
-; X64-NOBMI-NEXT: retq
+; X86-BMI2-LABEL: scalar_i16_bitsinmiddle_eq:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-BMI2-NEXT: movl $4080, %ecx # imm = 0xFF0
+; X86-BMI2-NEXT: shlxl %eax, %ecx, %eax
+; X86-BMI2-NEXT: testw %ax, {{[0-9]+}}(%esp)
+; X86-BMI2-NEXT: sete %al
+; X86-BMI2-NEXT: retl
;
; X64-BMI1-LABEL: scalar_i16_bitsinmiddle_eq:
; X64-BMI1: # %bb.0:
@@ -218,13 +182,13 @@ define i1 @scalar_i16_bitsinmiddle_eq(i1
; X64-BMI1-NEXT: sete %al
; X64-BMI1-NEXT: retq
;
-; X64-BMI12-LABEL: scalar_i16_bitsinmiddle_eq:
-; X64-BMI12: # %bb.0:
-; X64-BMI12-NEXT: movl $4080, %eax # imm = 0xFF0
-; X64-BMI12-NEXT: shlxl %esi, %eax, %eax
-; X64-BMI12-NEXT: testw %di, %ax
-; X64-BMI12-NEXT: sete %al
-; X64-BMI12-NEXT: retq
+; X64-BMI2-LABEL: scalar_i16_bitsinmiddle_eq:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: movl $4080, %eax # imm = 0xFF0
+; X64-BMI2-NEXT: shlxl %esi, %eax, %eax
+; X64-BMI2-NEXT: testw %di, %ax
+; X64-BMI2-NEXT: sete %al
+; X64-BMI2-NEXT: retq
%t0 = shl i16 4080, %y
%t1 = and i16 %t0, %x
%res = icmp eq i16 %t1, 0
@@ -234,15 +198,6 @@ define i1 @scalar_i16_bitsinmiddle_eq(i1
; i32 scalar
define i1 @scalar_i32_signbit_eq(i32 %x, i32 %y) nounwind {
-; X86-NOBMI-LABEL: scalar_i32_signbit_eq:
-; X86-NOBMI: # %bb.0:
-; X86-NOBMI-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NOBMI-NEXT: movl $-2147483648, %eax # imm = 0x80000000
-; X86-NOBMI-NEXT: shll %cl, %eax
-; X86-NOBMI-NEXT: testl %eax, {{[0-9]+}}(%esp)
-; X86-NOBMI-NEXT: sete %al
-; X86-NOBMI-NEXT: retl
-;
; X86-BMI1-LABEL: scalar_i32_signbit_eq:
; X86-BMI1: # %bb.0:
; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
@@ -252,24 +207,14 @@ define i1 @scalar_i32_signbit_eq(i32 %x,
; X86-BMI1-NEXT: sete %al
; X86-BMI1-NEXT: retl
;
-; X86-BMI12-LABEL: scalar_i32_signbit_eq:
-; X86-BMI12: # %bb.0:
-; X86-BMI12-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI12-NEXT: movl $-2147483648, %ecx # imm = 0x80000000
-; X86-BMI12-NEXT: shlxl %eax, %ecx, %eax
-; X86-BMI12-NEXT: testl %eax, {{[0-9]+}}(%esp)
-; X86-BMI12-NEXT: sete %al
-; X86-BMI12-NEXT: retl
-;
-; X64-NOBMI-LABEL: scalar_i32_signbit_eq:
-; X64-NOBMI: # %bb.0:
-; X64-NOBMI-NEXT: movl %esi, %ecx
-; X64-NOBMI-NEXT: movl $-2147483648, %eax # imm = 0x80000000
-; X64-NOBMI-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-NOBMI-NEXT: shll %cl, %eax
-; X64-NOBMI-NEXT: testl %edi, %eax
-; X64-NOBMI-NEXT: sete %al
-; X64-NOBMI-NEXT: retq
+; X86-BMI2-LABEL: scalar_i32_signbit_eq:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-BMI2-NEXT: movl $-2147483648, %ecx # imm = 0x80000000
+; X86-BMI2-NEXT: shlxl %eax, %ecx, %eax
+; X86-BMI2-NEXT: testl %eax, {{[0-9]+}}(%esp)
+; X86-BMI2-NEXT: sete %al
+; X86-BMI2-NEXT: retl
;
; X64-BMI1-LABEL: scalar_i32_signbit_eq:
; X64-BMI1: # %bb.0:
@@ -281,13 +226,13 @@ define i1 @scalar_i32_signbit_eq(i32 %x,
; X64-BMI1-NEXT: sete %al
; X64-BMI1-NEXT: retq
;
-; X64-BMI12-LABEL: scalar_i32_signbit_eq:
-; X64-BMI12: # %bb.0:
-; X64-BMI12-NEXT: movl $-2147483648, %eax # imm = 0x80000000
-; X64-BMI12-NEXT: shlxl %esi, %eax, %eax
-; X64-BMI12-NEXT: testl %edi, %eax
-; X64-BMI12-NEXT: sete %al
-; X64-BMI12-NEXT: retq
+; X64-BMI2-LABEL: scalar_i32_signbit_eq:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: movl $-2147483648, %eax # imm = 0x80000000
+; X64-BMI2-NEXT: shlxl %esi, %eax, %eax
+; X64-BMI2-NEXT: testl %edi, %eax
+; X64-BMI2-NEXT: sete %al
+; X64-BMI2-NEXT: retq
%t0 = shl i32 2147483648, %y
%t1 = and i32 %t0, %x
%res = icmp eq i32 %t1, 0
@@ -315,15 +260,6 @@ define i1 @scalar_i32_lowestbit_eq(i32 %
}
define i1 @scalar_i32_bitsinmiddle_eq(i32 %x, i32 %y) nounwind {
-; X86-NOBMI-LABEL: scalar_i32_bitsinmiddle_eq:
-; X86-NOBMI: # %bb.0:
-; X86-NOBMI-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NOBMI-NEXT: movl $16776960, %eax # imm = 0xFFFF00
-; X86-NOBMI-NEXT: shll %cl, %eax
-; X86-NOBMI-NEXT: testl %eax, {{[0-9]+}}(%esp)
-; X86-NOBMI-NEXT: sete %al
-; X86-NOBMI-NEXT: retl
-;
; X86-BMI1-LABEL: scalar_i32_bitsinmiddle_eq:
; X86-BMI1: # %bb.0:
; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
@@ -333,24 +269,14 @@ define i1 @scalar_i32_bitsinmiddle_eq(i3
; X86-BMI1-NEXT: sete %al
; X86-BMI1-NEXT: retl
;
-; X86-BMI12-LABEL: scalar_i32_bitsinmiddle_eq:
-; X86-BMI12: # %bb.0:
-; X86-BMI12-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI12-NEXT: movl $16776960, %ecx # imm = 0xFFFF00
-; X86-BMI12-NEXT: shlxl %eax, %ecx, %eax
-; X86-BMI12-NEXT: testl %eax, {{[0-9]+}}(%esp)
-; X86-BMI12-NEXT: sete %al
-; X86-BMI12-NEXT: retl
-;
-; X64-NOBMI-LABEL: scalar_i32_bitsinmiddle_eq:
-; X64-NOBMI: # %bb.0:
-; X64-NOBMI-NEXT: movl %esi, %ecx
-; X64-NOBMI-NEXT: movl $16776960, %eax # imm = 0xFFFF00
-; X64-NOBMI-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-NOBMI-NEXT: shll %cl, %eax
-; X64-NOBMI-NEXT: testl %edi, %eax
-; X64-NOBMI-NEXT: sete %al
-; X64-NOBMI-NEXT: retq
+; X86-BMI2-LABEL: scalar_i32_bitsinmiddle_eq:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-BMI2-NEXT: movl $16776960, %ecx # imm = 0xFFFF00
+; X86-BMI2-NEXT: shlxl %eax, %ecx, %eax
+; X86-BMI2-NEXT: testl %eax, {{[0-9]+}}(%esp)
+; X86-BMI2-NEXT: sete %al
+; X86-BMI2-NEXT: retl
;
; X64-BMI1-LABEL: scalar_i32_bitsinmiddle_eq:
; X64-BMI1: # %bb.0:
@@ -362,13 +288,13 @@ define i1 @scalar_i32_bitsinmiddle_eq(i3
; X64-BMI1-NEXT: sete %al
; X64-BMI1-NEXT: retq
;
-; X64-BMI12-LABEL: scalar_i32_bitsinmiddle_eq:
-; X64-BMI12: # %bb.0:
-; X64-BMI12-NEXT: movl $16776960, %eax # imm = 0xFFFF00
-; X64-BMI12-NEXT: shlxl %esi, %eax, %eax
-; X64-BMI12-NEXT: testl %edi, %eax
-; X64-BMI12-NEXT: sete %al
-; X64-BMI12-NEXT: retq
+; X64-BMI2-LABEL: scalar_i32_bitsinmiddle_eq:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: movl $16776960, %eax # imm = 0xFFFF00
+; X64-BMI2-NEXT: shlxl %esi, %eax, %eax
+; X64-BMI2-NEXT: testl %edi, %eax
+; X64-BMI2-NEXT: sete %al
+; X64-BMI2-NEXT: retq
%t0 = shl i32 16776960, %y
%t1 = and i32 %t0, %x
%res = icmp eq i32 %t1, 0
@@ -391,16 +317,6 @@ define i1 @scalar_i64_signbit_eq(i64 %x,
; X86-NEXT: sete %al
; X86-NEXT: retl
;
-; X64-NOBMI-LABEL: scalar_i64_signbit_eq:
-; X64-NOBMI: # %bb.0:
-; X64-NOBMI-NEXT: movq %rsi, %rcx
-; X64-NOBMI-NEXT: movabsq $-9223372036854775808, %rax # imm = 0x8000000000000000
-; X64-NOBMI-NEXT: # kill: def $cl killed $cl killed $rcx
-; X64-NOBMI-NEXT: shlq %cl, %rax
-; X64-NOBMI-NEXT: testq %rdi, %rax
-; X64-NOBMI-NEXT: sete %al
-; X64-NOBMI-NEXT: retq
-;
; X64-BMI1-LABEL: scalar_i64_signbit_eq:
; X64-BMI1: # %bb.0:
; X64-BMI1-NEXT: movq %rsi, %rcx
@@ -411,13 +327,13 @@ define i1 @scalar_i64_signbit_eq(i64 %x,
; X64-BMI1-NEXT: sete %al
; X64-BMI1-NEXT: retq
;
-; X64-BMI12-LABEL: scalar_i64_signbit_eq:
-; X64-BMI12: # %bb.0:
-; X64-BMI12-NEXT: movabsq $-9223372036854775808, %rax # imm = 0x8000000000000000
-; X64-BMI12-NEXT: shlxq %rsi, %rax, %rax
-; X64-BMI12-NEXT: testq %rdi, %rax
-; X64-BMI12-NEXT: sete %al
-; X64-BMI12-NEXT: retq
+; X64-BMI2-LABEL: scalar_i64_signbit_eq:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: movabsq $-9223372036854775808, %rax # imm = 0x8000000000000000
+; X64-BMI2-NEXT: shlxq %rsi, %rax, %rax
+; X64-BMI2-NEXT: testq %rdi, %rax
+; X64-BMI2-NEXT: sete %al
+; X64-BMI2-NEXT: retq
%t0 = shl i64 9223372036854775808, %y
%t1 = and i64 %t0, %x
%res = icmp eq i64 %t1, 0
@@ -425,25 +341,6 @@ define i1 @scalar_i64_signbit_eq(i64 %x,
}
define i1 @scalar_i64_lowestbit_eq(i64 %x, i64 %y) nounwind {
-; X86-NOBMI-LABEL: scalar_i64_lowestbit_eq:
-; X86-NOBMI: # %bb.0:
-; X86-NOBMI-NEXT: pushl %esi
-; X86-NOBMI-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NOBMI-NEXT: movl $1, %eax
-; X86-NOBMI-NEXT: xorl %edx, %edx
-; X86-NOBMI-NEXT: xorl %esi, %esi
-; X86-NOBMI-NEXT: shldl %cl, %eax, %esi
-; X86-NOBMI-NEXT: shll %cl, %eax
-; X86-NOBMI-NEXT: testb $32, %cl
-; X86-NOBMI-NEXT: cmovnel %eax, %esi
-; X86-NOBMI-NEXT: cmovnel %edx, %eax
-; X86-NOBMI-NEXT: andl {{[0-9]+}}(%esp), %esi
-; X86-NOBMI-NEXT: andl {{[0-9]+}}(%esp), %eax
-; X86-NOBMI-NEXT: orl %esi, %eax
-; X86-NOBMI-NEXT: sete %al
-; X86-NOBMI-NEXT: popl %esi
-; X86-NOBMI-NEXT: retl
-;
; X86-BMI1-LABEL: scalar_i64_lowestbit_eq:
; X86-BMI1: # %bb.0:
; X86-BMI1-NEXT: pushl %esi
@@ -463,24 +360,24 @@ define i1 @scalar_i64_lowestbit_eq(i64 %
; X86-BMI1-NEXT: popl %esi
; X86-BMI1-NEXT: retl
;
-; X86-BMI12-LABEL: scalar_i64_lowestbit_eq:
-; X86-BMI12: # %bb.0:
-; X86-BMI12-NEXT: pushl %esi
-; X86-BMI12-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-BMI12-NEXT: movl $1, %eax
-; X86-BMI12-NEXT: xorl %edx, %edx
-; X86-BMI12-NEXT: xorl %esi, %esi
-; X86-BMI12-NEXT: shldl %cl, %eax, %esi
-; X86-BMI12-NEXT: shlxl %ecx, %eax, %eax
-; X86-BMI12-NEXT: testb $32, %cl
-; X86-BMI12-NEXT: cmovnel %eax, %esi
-; X86-BMI12-NEXT: cmovnel %edx, %eax
-; X86-BMI12-NEXT: andl {{[0-9]+}}(%esp), %esi
-; X86-BMI12-NEXT: andl {{[0-9]+}}(%esp), %eax
-; X86-BMI12-NEXT: orl %esi, %eax
-; X86-BMI12-NEXT: sete %al
-; X86-BMI12-NEXT: popl %esi
-; X86-BMI12-NEXT: retl
+; X86-BMI2-LABEL: scalar_i64_lowestbit_eq:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: pushl %esi
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BMI2-NEXT: movl $1, %eax
+; X86-BMI2-NEXT: xorl %edx, %edx
+; X86-BMI2-NEXT: xorl %esi, %esi
+; X86-BMI2-NEXT: shldl %cl, %eax, %esi
+; X86-BMI2-NEXT: shlxl %ecx, %eax, %eax
+; X86-BMI2-NEXT: testb $32, %cl
+; X86-BMI2-NEXT: cmovnel %eax, %esi
+; X86-BMI2-NEXT: cmovnel %edx, %eax
+; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %esi
+; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %eax
+; X86-BMI2-NEXT: orl %esi, %eax
+; X86-BMI2-NEXT: sete %al
+; X86-BMI2-NEXT: popl %esi
+; X86-BMI2-NEXT: retl
;
; X64-LABEL: scalar_i64_lowestbit_eq:
; X64: # %bb.0:
@@ -494,25 +391,6 @@ define i1 @scalar_i64_lowestbit_eq(i64 %
}
define i1 @scalar_i64_bitsinmiddle_eq(i64 %x, i64 %y) nounwind {
-; X86-NOBMI-LABEL: scalar_i64_bitsinmiddle_eq:
-; X86-NOBMI: # %bb.0:
-; X86-NOBMI-NEXT: pushl %esi
-; X86-NOBMI-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NOBMI-NEXT: movl $-65536, %eax # imm = 0xFFFF0000
-; X86-NOBMI-NEXT: movl $65535, %edx # imm = 0xFFFF
-; X86-NOBMI-NEXT: shldl %cl, %eax, %edx
-; X86-NOBMI-NEXT: shll %cl, %eax
-; X86-NOBMI-NEXT: xorl %esi, %esi
-; X86-NOBMI-NEXT: testb $32, %cl
-; X86-NOBMI-NEXT: cmovnel %eax, %edx
-; X86-NOBMI-NEXT: cmovel %eax, %esi
-; X86-NOBMI-NEXT: andl {{[0-9]+}}(%esp), %edx
-; X86-NOBMI-NEXT: andl {{[0-9]+}}(%esp), %esi
-; X86-NOBMI-NEXT: orl %edx, %esi
-; X86-NOBMI-NEXT: sete %al
-; X86-NOBMI-NEXT: popl %esi
-; X86-NOBMI-NEXT: retl
-;
; X86-BMI1-LABEL: scalar_i64_bitsinmiddle_eq:
; X86-BMI1: # %bb.0:
; X86-BMI1-NEXT: pushl %esi
@@ -532,34 +410,24 @@ define i1 @scalar_i64_bitsinmiddle_eq(i6
; X86-BMI1-NEXT: popl %esi
; X86-BMI1-NEXT: retl
;
-; X86-BMI12-LABEL: scalar_i64_bitsinmiddle_eq:
-; X86-BMI12: # %bb.0:
-; X86-BMI12-NEXT: pushl %esi
-; X86-BMI12-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-BMI12-NEXT: movl $-65536, %eax # imm = 0xFFFF0000
-; X86-BMI12-NEXT: movl $65535, %edx # imm = 0xFFFF
-; X86-BMI12-NEXT: shldl %cl, %eax, %edx
-; X86-BMI12-NEXT: shlxl %ecx, %eax, %eax
-; X86-BMI12-NEXT: xorl %esi, %esi
-; X86-BMI12-NEXT: testb $32, %cl
-; X86-BMI12-NEXT: cmovnel %eax, %edx
-; X86-BMI12-NEXT: cmovel %eax, %esi
-; X86-BMI12-NEXT: andl {{[0-9]+}}(%esp), %edx
-; X86-BMI12-NEXT: andl {{[0-9]+}}(%esp), %esi
-; X86-BMI12-NEXT: orl %edx, %esi
-; X86-BMI12-NEXT: sete %al
-; X86-BMI12-NEXT: popl %esi
-; X86-BMI12-NEXT: retl
-;
-; X64-NOBMI-LABEL: scalar_i64_bitsinmiddle_eq:
-; X64-NOBMI: # %bb.0:
-; X64-NOBMI-NEXT: movq %rsi, %rcx
-; X64-NOBMI-NEXT: movabsq $281474976645120, %rax # imm = 0xFFFFFFFF0000
-; X64-NOBMI-NEXT: # kill: def $cl killed $cl killed $rcx
-; X64-NOBMI-NEXT: shlq %cl, %rax
-; X64-NOBMI-NEXT: testq %rdi, %rax
-; X64-NOBMI-NEXT: sete %al
-; X64-NOBMI-NEXT: retq
+; X86-BMI2-LABEL: scalar_i64_bitsinmiddle_eq:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: pushl %esi
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BMI2-NEXT: movl $-65536, %eax # imm = 0xFFFF0000
+; X86-BMI2-NEXT: movl $65535, %edx # imm = 0xFFFF
+; X86-BMI2-NEXT: shldl %cl, %eax, %edx
+; X86-BMI2-NEXT: shlxl %ecx, %eax, %eax
+; X86-BMI2-NEXT: xorl %esi, %esi
+; X86-BMI2-NEXT: testb $32, %cl
+; X86-BMI2-NEXT: cmovnel %eax, %edx
+; X86-BMI2-NEXT: cmovel %eax, %esi
+; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %edx
+; X86-BMI2-NEXT: andl {{[0-9]+}}(%esp), %esi
+; X86-BMI2-NEXT: orl %edx, %esi
+; X86-BMI2-NEXT: sete %al
+; X86-BMI2-NEXT: popl %esi
+; X86-BMI2-NEXT: retl
;
; X64-BMI1-LABEL: scalar_i64_bitsinmiddle_eq:
; X64-BMI1: # %bb.0:
@@ -571,13 +439,13 @@ define i1 @scalar_i64_bitsinmiddle_eq(i6
; X64-BMI1-NEXT: sete %al
; X64-BMI1-NEXT: retq
;
-; X64-BMI12-LABEL: scalar_i64_bitsinmiddle_eq:
-; X64-BMI12: # %bb.0:
-; X64-BMI12-NEXT: movabsq $281474976645120, %rax # imm = 0xFFFFFFFF0000
-; X64-BMI12-NEXT: shlxq %rsi, %rax, %rax
-; X64-BMI12-NEXT: testq %rdi, %rax
-; X64-BMI12-NEXT: sete %al
-; X64-BMI12-NEXT: retq
+; X64-BMI2-LABEL: scalar_i64_bitsinmiddle_eq:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: movabsq $281474976645120, %rax # imm = 0xFFFFFFFF0000
+; X64-BMI2-NEXT: shlxq %rsi, %rax, %rax
+; X64-BMI2-NEXT: testq %rdi, %rax
+; X64-BMI2-NEXT: sete %al
+; X64-BMI2-NEXT: retq
%t0 = shl i64 281474976645120, %y
%t1 = and i64 %t0, %x
%res = icmp eq i64 %t1, 0
@@ -589,39 +457,48 @@ define i1 @scalar_i64_bitsinmiddle_eq(i6
;------------------------------------------------------------------------------;
define <4 x i1> @vec_4xi32_splat_eq(<4 x i32> %x, <4 x i32> %y) nounwind {
-; X86-LABEL: vec_4xi32_splat_eq:
-; X86: # %bb.0:
-; X86-NEXT: pslld $23, %xmm1
-; X86-NEXT: paddd {{\.LCPI.*}}, %xmm1
-; X86-NEXT: cvttps2dq %xmm1, %xmm1
-; X86-NEXT: movdqa {{.*#+}} xmm2 = [1,1,1,1]
-; X86-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,1,3,3]
-; X86-NEXT: pmuludq %xmm2, %xmm3
-; X86-NEXT: pmuludq %xmm1, %xmm2
-; X86-NEXT: pshufd {{.*#+}} xmm1 = xmm2[0,2,2,3]
-; X86-NEXT: pshufd {{.*#+}} xmm2 = xmm3[0,2,2,3]
-; X86-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
-; X86-NEXT: pand %xmm1, %xmm0
-; X86-NEXT: pxor %xmm1, %xmm1
-; X86-NEXT: pcmpeqd %xmm1, %xmm0
-; X86-NEXT: retl
-;
-; X64-LABEL: vec_4xi32_splat_eq:
-; X64: # %bb.0:
-; X64-NEXT: pslld $23, %xmm1
-; X64-NEXT: paddd {{.*}}(%rip), %xmm1
-; X64-NEXT: cvttps2dq %xmm1, %xmm1
-; X64-NEXT: movdqa {{.*#+}} xmm2 = [1,1,1,1]
-; X64-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,1,3,3]
-; X64-NEXT: pmuludq %xmm2, %xmm3
-; X64-NEXT: pmuludq %xmm1, %xmm2
-; X64-NEXT: pshufd {{.*#+}} xmm1 = xmm2[0,2,2,3]
-; X64-NEXT: pshufd {{.*#+}} xmm2 = xmm3[0,2,2,3]
-; X64-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
-; X64-NEXT: pand %xmm1, %xmm0
-; X64-NEXT: pxor %xmm1, %xmm1
-; X64-NEXT: pcmpeqd %xmm1, %xmm0
-; X64-NEXT: retq
+; X86-SSE2-LABEL: vec_4xi32_splat_eq:
+; X86-SSE2: # %bb.0:
+; X86-SSE2-NEXT: pslld $23, %xmm1
+; X86-SSE2-NEXT: paddd {{\.LCPI.*}}, %xmm1
+; X86-SSE2-NEXT: cvttps2dq %xmm1, %xmm1
+; X86-SSE2-NEXT: movdqa {{.*#+}} xmm2 = [1,1,1,1]
+; X86-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,1,3,3]
+; X86-SSE2-NEXT: pmuludq %xmm2, %xmm3
+; X86-SSE2-NEXT: pmuludq %xmm1, %xmm2
+; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm2[0,2,2,3]
+; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm3[0,2,2,3]
+; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
+; X86-SSE2-NEXT: pand %xmm1, %xmm0
+; X86-SSE2-NEXT: pxor %xmm1, %xmm1
+; X86-SSE2-NEXT: pcmpeqd %xmm1, %xmm0
+; X86-SSE2-NEXT: retl
+;
+; AVX2-LABEL: vec_4xi32_splat_eq:
+; AVX2: # %bb.0:
+; AVX2-NEXT: vpbroadcastd {{.*#+}} xmm2 = [1,1,1,1]
+; AVX2-NEXT: vpsllvd %xmm1, %xmm2, %xmm1
+; AVX2-NEXT: vpand %xmm0, %xmm1, %xmm0
+; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; AVX2-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
+; AVX2-NEXT: ret{{[l|q]}}
+;
+; X64-SSE2-LABEL: vec_4xi32_splat_eq:
+; X64-SSE2: # %bb.0:
+; X64-SSE2-NEXT: pslld $23, %xmm1
+; X64-SSE2-NEXT: paddd {{.*}}(%rip), %xmm1
+; X64-SSE2-NEXT: cvttps2dq %xmm1, %xmm1
+; X64-SSE2-NEXT: movdqa {{.*#+}} xmm2 = [1,1,1,1]
+; X64-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,1,3,3]
+; X64-SSE2-NEXT: pmuludq %xmm2, %xmm3
+; X64-SSE2-NEXT: pmuludq %xmm1, %xmm2
+; X64-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm2[0,2,2,3]
+; X64-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm3[0,2,2,3]
+; X64-SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
+; X64-SSE2-NEXT: pand %xmm1, %xmm0
+; X64-SSE2-NEXT: pxor %xmm1, %xmm1
+; X64-SSE2-NEXT: pcmpeqd %xmm1, %xmm0
+; X64-SSE2-NEXT: retq
%t0 = shl <4 x i32> <i32 1, i32 1, i32 1, i32 1>, %y
%t1 = and <4 x i32> %t0, %x
%res = icmp eq <4 x i32> %t1, <i32 0, i32 0, i32 0, i32 0>
@@ -629,41 +506,50 @@ define <4 x i1> @vec_4xi32_splat_eq(<4 x
}
define <4 x i1> @vec_4xi32_nonsplat_eq(<4 x i32> %x, <4 x i32> %y) nounwind {
-; X86-LABEL: vec_4xi32_nonsplat_eq:
-; X86: # %bb.0:
-; X86-NEXT: pslld $23, %xmm1
-; X86-NEXT: paddd {{\.LCPI.*}}, %xmm1
-; X86-NEXT: cvttps2dq %xmm1, %xmm1
-; X86-NEXT: movdqa {{.*#+}} xmm2 = [0,1,16776960,2147483648]
-; X86-NEXT: pshufd {{.*#+}} xmm3 = xmm2[1,1,3,3]
-; X86-NEXT: pmuludq %xmm1, %xmm2
-; X86-NEXT: pshufd {{.*#+}} xmm2 = xmm2[0,2,2,3]
-; X86-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
-; X86-NEXT: pmuludq %xmm3, %xmm1
-; X86-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
-; X86-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
-; X86-NEXT: pand %xmm2, %xmm0
-; X86-NEXT: pxor %xmm1, %xmm1
-; X86-NEXT: pcmpeqd %xmm1, %xmm0
-; X86-NEXT: retl
-;
-; X64-LABEL: vec_4xi32_nonsplat_eq:
-; X64: # %bb.0:
-; X64-NEXT: pslld $23, %xmm1
-; X64-NEXT: paddd {{.*}}(%rip), %xmm1
-; X64-NEXT: cvttps2dq %xmm1, %xmm1
-; X64-NEXT: movdqa {{.*#+}} xmm2 = [0,1,16776960,2147483648]
-; X64-NEXT: pshufd {{.*#+}} xmm3 = xmm2[1,1,3,3]
-; X64-NEXT: pmuludq %xmm1, %xmm2
-; X64-NEXT: pshufd {{.*#+}} xmm2 = xmm2[0,2,2,3]
-; X64-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
-; X64-NEXT: pmuludq %xmm3, %xmm1
-; X64-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
-; X64-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
-; X64-NEXT: pand %xmm2, %xmm0
-; X64-NEXT: pxor %xmm1, %xmm1
-; X64-NEXT: pcmpeqd %xmm1, %xmm0
-; X64-NEXT: retq
+; X86-SSE2-LABEL: vec_4xi32_nonsplat_eq:
+; X86-SSE2: # %bb.0:
+; X86-SSE2-NEXT: pslld $23, %xmm1
+; X86-SSE2-NEXT: paddd {{\.LCPI.*}}, %xmm1
+; X86-SSE2-NEXT: cvttps2dq %xmm1, %xmm1
+; X86-SSE2-NEXT: movdqa {{.*#+}} xmm2 = [0,1,16776960,2147483648]
+; X86-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm2[1,1,3,3]
+; X86-SSE2-NEXT: pmuludq %xmm1, %xmm2
+; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[0,2,2,3]
+; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
+; X86-SSE2-NEXT: pmuludq %xmm3, %xmm1
+; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
+; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
+; X86-SSE2-NEXT: pand %xmm2, %xmm0
+; X86-SSE2-NEXT: pxor %xmm1, %xmm1
+; X86-SSE2-NEXT: pcmpeqd %xmm1, %xmm0
+; X86-SSE2-NEXT: retl
+;
+; AVX2-LABEL: vec_4xi32_nonsplat_eq:
+; AVX2: # %bb.0:
+; AVX2-NEXT: vmovdqa {{.*#+}} xmm2 = [0,1,16776960,2147483648]
+; AVX2-NEXT: vpsllvd %xmm1, %xmm2, %xmm1
+; AVX2-NEXT: vpand %xmm0, %xmm1, %xmm0
+; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; AVX2-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
+; AVX2-NEXT: ret{{[l|q]}}
+;
+; X64-SSE2-LABEL: vec_4xi32_nonsplat_eq:
+; X64-SSE2: # %bb.0:
+; X64-SSE2-NEXT: pslld $23, %xmm1
+; X64-SSE2-NEXT: paddd {{.*}}(%rip), %xmm1
+; X64-SSE2-NEXT: cvttps2dq %xmm1, %xmm1
+; X64-SSE2-NEXT: movdqa {{.*#+}} xmm2 = [0,1,16776960,2147483648]
+; X64-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm2[1,1,3,3]
+; X64-SSE2-NEXT: pmuludq %xmm1, %xmm2
+; X64-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[0,2,2,3]
+; X64-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
+; X64-SSE2-NEXT: pmuludq %xmm3, %xmm1
+; X64-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
+; X64-SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
+; X64-SSE2-NEXT: pand %xmm2, %xmm0
+; X64-SSE2-NEXT: pxor %xmm1, %xmm1
+; X64-SSE2-NEXT: pcmpeqd %xmm1, %xmm0
+; X64-SSE2-NEXT: retq
%t0 = shl <4 x i32> <i32 0, i32 1, i32 16776960, i32 2147483648>, %y
%t1 = and <4 x i32> %t0, %x
%res = icmp eq <4 x i32> %t1, <i32 0, i32 0, i32 0, i32 0>
@@ -671,117 +557,144 @@ define <4 x i1> @vec_4xi32_nonsplat_eq(<
}
define <4 x i1> @vec_4xi32_nonsplat_undef0_eq(<4 x i32> %x, <4 x i32> %y) nounwind {
-; X86-LABEL: vec_4xi32_nonsplat_undef0_eq:
-; X86: # %bb.0:
-; X86-NEXT: pslld $23, %xmm1
-; X86-NEXT: paddd {{\.LCPI.*}}, %xmm1
-; X86-NEXT: cvttps2dq %xmm1, %xmm1
-; X86-NEXT: movdqa {{.*#+}} xmm2 = [1,1,1,1]
-; X86-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,1,3,3]
-; X86-NEXT: pmuludq %xmm2, %xmm3
-; X86-NEXT: pmuludq %xmm1, %xmm2
-; X86-NEXT: pshufd {{.*#+}} xmm1 = xmm2[0,2,2,3]
-; X86-NEXT: pshufd {{.*#+}} xmm2 = xmm3[0,2,2,3]
-; X86-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
-; X86-NEXT: pand %xmm1, %xmm0
-; X86-NEXT: pxor %xmm1, %xmm1
-; X86-NEXT: pcmpeqd %xmm1, %xmm0
-; X86-NEXT: retl
-;
-; X64-LABEL: vec_4xi32_nonsplat_undef0_eq:
-; X64: # %bb.0:
-; X64-NEXT: pslld $23, %xmm1
-; X64-NEXT: paddd {{.*}}(%rip), %xmm1
-; X64-NEXT: cvttps2dq %xmm1, %xmm1
-; X64-NEXT: movdqa {{.*#+}} xmm2 = [1,1,1,1]
-; X64-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,1,3,3]
-; X64-NEXT: pmuludq %xmm2, %xmm3
-; X64-NEXT: pmuludq %xmm1, %xmm2
-; X64-NEXT: pshufd {{.*#+}} xmm1 = xmm2[0,2,2,3]
-; X64-NEXT: pshufd {{.*#+}} xmm2 = xmm3[0,2,2,3]
-; X64-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
-; X64-NEXT: pand %xmm1, %xmm0
-; X64-NEXT: pxor %xmm1, %xmm1
-; X64-NEXT: pcmpeqd %xmm1, %xmm0
-; X64-NEXT: retq
+; X86-SSE2-LABEL: vec_4xi32_nonsplat_undef0_eq:
+; X86-SSE2: # %bb.0:
+; X86-SSE2-NEXT: pslld $23, %xmm1
+; X86-SSE2-NEXT: paddd {{\.LCPI.*}}, %xmm1
+; X86-SSE2-NEXT: cvttps2dq %xmm1, %xmm1
+; X86-SSE2-NEXT: movdqa {{.*#+}} xmm2 = [1,1,1,1]
+; X86-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,1,3,3]
+; X86-SSE2-NEXT: pmuludq %xmm2, %xmm3
+; X86-SSE2-NEXT: pmuludq %xmm1, %xmm2
+; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm2[0,2,2,3]
+; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm3[0,2,2,3]
+; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
+; X86-SSE2-NEXT: pand %xmm1, %xmm0
+; X86-SSE2-NEXT: pxor %xmm1, %xmm1
+; X86-SSE2-NEXT: pcmpeqd %xmm1, %xmm0
+; X86-SSE2-NEXT: retl
+;
+; AVX2-LABEL: vec_4xi32_nonsplat_undef0_eq:
+; AVX2: # %bb.0:
+; AVX2-NEXT: vpbroadcastd {{.*#+}} xmm2 = [1,1,1,1]
+; AVX2-NEXT: vpsllvd %xmm1, %xmm2, %xmm1
+; AVX2-NEXT: vpand %xmm0, %xmm1, %xmm0
+; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; AVX2-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
+; AVX2-NEXT: ret{{[l|q]}}
+;
+; X64-SSE2-LABEL: vec_4xi32_nonsplat_undef0_eq:
+; X64-SSE2: # %bb.0:
+; X64-SSE2-NEXT: pslld $23, %xmm1
+; X64-SSE2-NEXT: paddd {{.*}}(%rip), %xmm1
+; X64-SSE2-NEXT: cvttps2dq %xmm1, %xmm1
+; X64-SSE2-NEXT: movdqa {{.*#+}} xmm2 = [1,1,1,1]
+; X64-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,1,3,3]
+; X64-SSE2-NEXT: pmuludq %xmm2, %xmm3
+; X64-SSE2-NEXT: pmuludq %xmm1, %xmm2
+; X64-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm2[0,2,2,3]
+; X64-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm3[0,2,2,3]
+; X64-SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
+; X64-SSE2-NEXT: pand %xmm1, %xmm0
+; X64-SSE2-NEXT: pxor %xmm1, %xmm1
+; X64-SSE2-NEXT: pcmpeqd %xmm1, %xmm0
+; X64-SSE2-NEXT: retq
%t0 = shl <4 x i32> <i32 1, i32 1, i32 undef, i32 1>, %y
%t1 = and <4 x i32> %t0, %x
%res = icmp eq <4 x i32> %t1, <i32 0, i32 0, i32 0, i32 0>
ret <4 x i1> %res
}
define <4 x i1> @vec_4xi32_nonsplat_undef1_eq(<4 x i32> %x, <4 x i32> %y) nounwind {
-; X86-LABEL: vec_4xi32_nonsplat_undef1_eq:
-; X86: # %bb.0:
-; X86-NEXT: pslld $23, %xmm1
-; X86-NEXT: paddd {{\.LCPI.*}}, %xmm1
-; X86-NEXT: cvttps2dq %xmm1, %xmm1
-; X86-NEXT: movdqa {{.*#+}} xmm2 = [1,1,1,1]
-; X86-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,1,3,3]
-; X86-NEXT: pmuludq %xmm2, %xmm3
-; X86-NEXT: pmuludq %xmm1, %xmm2
-; X86-NEXT: pshufd {{.*#+}} xmm1 = xmm2[0,2,2,3]
-; X86-NEXT: pshufd {{.*#+}} xmm2 = xmm3[0,2,2,3]
-; X86-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
-; X86-NEXT: pand %xmm1, %xmm0
-; X86-NEXT: pxor %xmm1, %xmm1
-; X86-NEXT: pcmpeqd %xmm1, %xmm0
-; X86-NEXT: retl
-;
-; X64-LABEL: vec_4xi32_nonsplat_undef1_eq:
-; X64: # %bb.0:
-; X64-NEXT: pslld $23, %xmm1
-; X64-NEXT: paddd {{.*}}(%rip), %xmm1
-; X64-NEXT: cvttps2dq %xmm1, %xmm1
-; X64-NEXT: movdqa {{.*#+}} xmm2 = [1,1,1,1]
-; X64-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,1,3,3]
-; X64-NEXT: pmuludq %xmm2, %xmm3
-; X64-NEXT: pmuludq %xmm1, %xmm2
-; X64-NEXT: pshufd {{.*#+}} xmm1 = xmm2[0,2,2,3]
-; X64-NEXT: pshufd {{.*#+}} xmm2 = xmm3[0,2,2,3]
-; X64-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
-; X64-NEXT: pand %xmm1, %xmm0
-; X64-NEXT: pxor %xmm1, %xmm1
-; X64-NEXT: pcmpeqd %xmm1, %xmm0
-; X64-NEXT: retq
+; X86-SSE2-LABEL: vec_4xi32_nonsplat_undef1_eq:
+; X86-SSE2: # %bb.0:
+; X86-SSE2-NEXT: pslld $23, %xmm1
+; X86-SSE2-NEXT: paddd {{\.LCPI.*}}, %xmm1
+; X86-SSE2-NEXT: cvttps2dq %xmm1, %xmm1
+; X86-SSE2-NEXT: movdqa {{.*#+}} xmm2 = [1,1,1,1]
+; X86-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,1,3,3]
+; X86-SSE2-NEXT: pmuludq %xmm2, %xmm3
+; X86-SSE2-NEXT: pmuludq %xmm1, %xmm2
+; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm2[0,2,2,3]
+; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm3[0,2,2,3]
+; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
+; X86-SSE2-NEXT: pand %xmm1, %xmm0
+; X86-SSE2-NEXT: pxor %xmm1, %xmm1
+; X86-SSE2-NEXT: pcmpeqd %xmm1, %xmm0
+; X86-SSE2-NEXT: retl
+;
+; AVX2-LABEL: vec_4xi32_nonsplat_undef1_eq:
+; AVX2: # %bb.0:
+; AVX2-NEXT: vpbroadcastd {{.*#+}} xmm2 = [1,1,1,1]
+; AVX2-NEXT: vpsllvd %xmm1, %xmm2, %xmm1
+; AVX2-NEXT: vpand %xmm0, %xmm1, %xmm0
+; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; AVX2-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
+; AVX2-NEXT: ret{{[l|q]}}
+;
+; X64-SSE2-LABEL: vec_4xi32_nonsplat_undef1_eq:
+; X64-SSE2: # %bb.0:
+; X64-SSE2-NEXT: pslld $23, %xmm1
+; X64-SSE2-NEXT: paddd {{.*}}(%rip), %xmm1
+; X64-SSE2-NEXT: cvttps2dq %xmm1, %xmm1
+; X64-SSE2-NEXT: movdqa {{.*#+}} xmm2 = [1,1,1,1]
+; X64-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,1,3,3]
+; X64-SSE2-NEXT: pmuludq %xmm2, %xmm3
+; X64-SSE2-NEXT: pmuludq %xmm1, %xmm2
+; X64-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm2[0,2,2,3]
+; X64-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm3[0,2,2,3]
+; X64-SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
+; X64-SSE2-NEXT: pand %xmm1, %xmm0
+; X64-SSE2-NEXT: pxor %xmm1, %xmm1
+; X64-SSE2-NEXT: pcmpeqd %xmm1, %xmm0
+; X64-SSE2-NEXT: retq
%t0 = shl <4 x i32> <i32 1, i32 1, i32 1, i32 1>, %y
%t1 = and <4 x i32> %t0, %x
%res = icmp eq <4 x i32> %t1, <i32 0, i32 0, i32 undef, i32 0>
ret <4 x i1> %res
}
define <4 x i1> @vec_4xi32_nonsplat_undef2_eq(<4 x i32> %x, <4 x i32> %y) nounwind {
-; X86-LABEL: vec_4xi32_nonsplat_undef2_eq:
-; X86: # %bb.0:
-; X86-NEXT: pslld $23, %xmm1
-; X86-NEXT: paddd {{\.LCPI.*}}, %xmm1
-; X86-NEXT: cvttps2dq %xmm1, %xmm1
-; X86-NEXT: movdqa {{.*#+}} xmm2 = [1,1,1,1]
-; X86-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,1,3,3]
-; X86-NEXT: pmuludq %xmm2, %xmm3
-; X86-NEXT: pmuludq %xmm1, %xmm2
-; X86-NEXT: pshufd {{.*#+}} xmm1 = xmm2[0,2,2,3]
-; X86-NEXT: pshufd {{.*#+}} xmm2 = xmm3[0,2,2,3]
-; X86-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
-; X86-NEXT: pand %xmm1, %xmm0
-; X86-NEXT: pxor %xmm1, %xmm1
-; X86-NEXT: pcmpeqd %xmm1, %xmm0
-; X86-NEXT: retl
-;
-; X64-LABEL: vec_4xi32_nonsplat_undef2_eq:
-; X64: # %bb.0:
-; X64-NEXT: pslld $23, %xmm1
-; X64-NEXT: paddd {{.*}}(%rip), %xmm1
-; X64-NEXT: cvttps2dq %xmm1, %xmm1
-; X64-NEXT: movdqa {{.*#+}} xmm2 = [1,1,1,1]
-; X64-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,1,3,3]
-; X64-NEXT: pmuludq %xmm2, %xmm3
-; X64-NEXT: pmuludq %xmm1, %xmm2
-; X64-NEXT: pshufd {{.*#+}} xmm1 = xmm2[0,2,2,3]
-; X64-NEXT: pshufd {{.*#+}} xmm2 = xmm3[0,2,2,3]
-; X64-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
-; X64-NEXT: pand %xmm1, %xmm0
-; X64-NEXT: pxor %xmm1, %xmm1
-; X64-NEXT: pcmpeqd %xmm1, %xmm0
-; X64-NEXT: retq
+; X86-SSE2-LABEL: vec_4xi32_nonsplat_undef2_eq:
+; X86-SSE2: # %bb.0:
+; X86-SSE2-NEXT: pslld $23, %xmm1
+; X86-SSE2-NEXT: paddd {{\.LCPI.*}}, %xmm1
+; X86-SSE2-NEXT: cvttps2dq %xmm1, %xmm1
+; X86-SSE2-NEXT: movdqa {{.*#+}} xmm2 = [1,1,1,1]
+; X86-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,1,3,3]
+; X86-SSE2-NEXT: pmuludq %xmm2, %xmm3
+; X86-SSE2-NEXT: pmuludq %xmm1, %xmm2
+; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm2[0,2,2,3]
+; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm3[0,2,2,3]
+; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
+; X86-SSE2-NEXT: pand %xmm1, %xmm0
+; X86-SSE2-NEXT: pxor %xmm1, %xmm1
+; X86-SSE2-NEXT: pcmpeqd %xmm1, %xmm0
+; X86-SSE2-NEXT: retl
+;
+; AVX2-LABEL: vec_4xi32_nonsplat_undef2_eq:
+; AVX2: # %bb.0:
+; AVX2-NEXT: vpbroadcastd {{.*#+}} xmm2 = [1,1,1,1]
+; AVX2-NEXT: vpsllvd %xmm1, %xmm2, %xmm1
+; AVX2-NEXT: vpand %xmm0, %xmm1, %xmm0
+; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; AVX2-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
+; AVX2-NEXT: ret{{[l|q]}}
+;
+; X64-SSE2-LABEL: vec_4xi32_nonsplat_undef2_eq:
+; X64-SSE2: # %bb.0:
+; X64-SSE2-NEXT: pslld $23, %xmm1
+; X64-SSE2-NEXT: paddd {{.*}}(%rip), %xmm1
+; X64-SSE2-NEXT: cvttps2dq %xmm1, %xmm1
+; X64-SSE2-NEXT: movdqa {{.*#+}} xmm2 = [1,1,1,1]
+; X64-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,1,3,3]
+; X64-SSE2-NEXT: pmuludq %xmm2, %xmm3
+; X64-SSE2-NEXT: pmuludq %xmm1, %xmm2
+; X64-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm2[0,2,2,3]
+; X64-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm3[0,2,2,3]
+; X64-SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
+; X64-SSE2-NEXT: pand %xmm1, %xmm0
+; X64-SSE2-NEXT: pxor %xmm1, %xmm1
+; X64-SSE2-NEXT: pcmpeqd %xmm1, %xmm0
+; X64-SSE2-NEXT: retq
%t0 = shl <4 x i32> <i32 1, i32 1, i32 undef, i32 1>, %y
%t1 = and <4 x i32> %t0, %x
%res = icmp eq <4 x i32> %t1, <i32 0, i32 0, i32 undef, i32 0>
@@ -822,15 +735,6 @@ define i1 @scalar_i8_signbit_ne(i8 %x, i
;------------------------------------------------------------------------------;
define i1 @scalar_i32_x_is_const_eq(i32 %y) nounwind {
-; X86-NOBMI-LABEL: scalar_i32_x_is_const_eq:
-; X86-NOBMI: # %bb.0:
-; X86-NOBMI-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-NOBMI-NEXT: movl $-1437226411, %eax # imm = 0xAA55AA55
-; X86-NOBMI-NEXT: shll %cl, %eax
-; X86-NOBMI-NEXT: testb $1, %al
-; X86-NOBMI-NEXT: sete %al
-; X86-NOBMI-NEXT: retl
-;
; X86-BMI1-LABEL: scalar_i32_x_is_const_eq:
; X86-BMI1: # %bb.0:
; X86-BMI1-NEXT: movb {{[0-9]+}}(%esp), %cl
@@ -840,24 +744,14 @@ define i1 @scalar_i32_x_is_const_eq(i32
; X86-BMI1-NEXT: sete %al
; X86-BMI1-NEXT: retl
;
-; X86-BMI12-LABEL: scalar_i32_x_is_const_eq:
-; X86-BMI12: # %bb.0:
-; X86-BMI12-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI12-NEXT: movl $-1437226411, %ecx # imm = 0xAA55AA55
-; X86-BMI12-NEXT: shlxl %eax, %ecx, %eax
-; X86-BMI12-NEXT: testb $1, %al
-; X86-BMI12-NEXT: sete %al
-; X86-BMI12-NEXT: retl
-;
-; X64-NOBMI-LABEL: scalar_i32_x_is_const_eq:
-; X64-NOBMI: # %bb.0:
-; X64-NOBMI-NEXT: movl %edi, %ecx
-; X64-NOBMI-NEXT: movl $-1437226411, %eax # imm = 0xAA55AA55
-; X64-NOBMI-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-NOBMI-NEXT: shll %cl, %eax
-; X64-NOBMI-NEXT: testb $1, %al
-; X64-NOBMI-NEXT: sete %al
-; X64-NOBMI-NEXT: retq
+; X86-BMI2-LABEL: scalar_i32_x_is_const_eq:
+; X86-BMI2: # %bb.0:
+; X86-BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-BMI2-NEXT: movl $-1437226411, %ecx # imm = 0xAA55AA55
+; X86-BMI2-NEXT: shlxl %eax, %ecx, %eax
+; X86-BMI2-NEXT: testb $1, %al
+; X86-BMI2-NEXT: sete %al
+; X86-BMI2-NEXT: retl
;
; X64-BMI1-LABEL: scalar_i32_x_is_const_eq:
; X64-BMI1: # %bb.0:
@@ -869,13 +763,13 @@ define i1 @scalar_i32_x_is_const_eq(i32
; X64-BMI1-NEXT: sete %al
; X64-BMI1-NEXT: retq
;
-; X64-BMI12-LABEL: scalar_i32_x_is_const_eq:
-; X64-BMI12: # %bb.0:
-; X64-BMI12-NEXT: movl $-1437226411, %eax # imm = 0xAA55AA55
-; X64-BMI12-NEXT: shlxl %edi, %eax, %eax
-; X64-BMI12-NEXT: testb $1, %al
-; X64-BMI12-NEXT: sete %al
-; X64-BMI12-NEXT: retq
+; X64-BMI2-LABEL: scalar_i32_x_is_const_eq:
+; X64-BMI2: # %bb.0:
+; X64-BMI2-NEXT: movl $-1437226411, %eax # imm = 0xAA55AA55
+; X64-BMI2-NEXT: shlxl %edi, %eax, %eax
+; X64-BMI2-NEXT: testb $1, %al
+; X64-BMI2-NEXT: sete %al
+; X64-BMI2-NEXT: retq
%t0 = shl i32 2857740885, %y
%t1 = and i32 %t0, 1
%res = icmp eq i32 %t1, 0
More information about the llvm-commits
mailing list