1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2 < %s | FileCheck %s --check-prefix=CHECK-SSE2 3; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+sse4.1 < %s | FileCheck %s --check-prefix=CHECK-SSE41 4; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+avx < %s | FileCheck %s --check-prefix=CHECK-AVX1 5; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+avx2 < %s | FileCheck %s --check-prefix=CHECK-AVX2 6; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512vl < %s | FileCheck %s --check-prefix=CHECK-AVX512VL 7 8define <4 x i1> @t32_3(<4 x i32> %X) nounwind { 9; CHECK-SSE2-LABEL: t32_3: 10; CHECK-SSE2: # %bb.0: 11; CHECK-SSE2-NEXT: psubd {{.*}}(%rip), %xmm0 12; CHECK-SSE2-NEXT: movdqa {{.*#+}} xmm1 = [2863311531,2863311531,2863311531,2863311531] 13; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,1,3,3] 14; CHECK-SSE2-NEXT: pmuludq %xmm1, %xmm0 15; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm0[0,2,2,3] 16; CHECK-SSE2-NEXT: pmuludq %xmm1, %xmm2 17; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm2[0,2,2,3] 18; CHECK-SSE2-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1] 19; CHECK-SSE2-NEXT: pxor {{.*}}(%rip), %xmm3 20; CHECK-SSE2-NEXT: pcmpgtd {{.*}}(%rip), %xmm3 21; CHECK-SSE2-NEXT: pcmpeqd %xmm0, %xmm0 22; CHECK-SSE2-NEXT: pxor %xmm3, %xmm0 23; CHECK-SSE2-NEXT: retq 24; 25; CHECK-SSE41-LABEL: t32_3: 26; CHECK-SSE41: # %bb.0: 27; CHECK-SSE41-NEXT: psubd {{.*}}(%rip), %xmm0 28; CHECK-SSE41-NEXT: pmulld {{.*}}(%rip), %xmm0 29; CHECK-SSE41-NEXT: movdqa {{.*#+}} xmm1 = [1431655765,1431655764,1431655764,1431655764] 30; CHECK-SSE41-NEXT: pminud %xmm0, %xmm1 31; CHECK-SSE41-NEXT: pcmpeqd %xmm1, %xmm0 32; CHECK-SSE41-NEXT: retq 33; 34; CHECK-AVX1-LABEL: t32_3: 35; CHECK-AVX1: # %bb.0: 36; CHECK-AVX1-NEXT: vpsubd {{.*}}(%rip), %xmm0, %xmm0 37; CHECK-AVX1-NEXT: vpmulld {{.*}}(%rip), %xmm0, %xmm0 38; CHECK-AVX1-NEXT: vpminud {{.*}}(%rip), %xmm0, %xmm1 39; CHECK-AVX1-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0 40; CHECK-AVX1-NEXT: retq 41; 42; CHECK-AVX2-LABEL: t32_3: 43; CHECK-AVX2: # %bb.0: 44; CHECK-AVX2-NEXT: vpsubd {{.*}}(%rip), %xmm0, %xmm0 45; CHECK-AVX2-NEXT: vpbroadcastd {{.*#+}} xmm1 = [2863311531,2863311531,2863311531,2863311531] 46; CHECK-AVX2-NEXT: vpmulld %xmm1, %xmm0, %xmm0 47; CHECK-AVX2-NEXT: vpminud {{.*}}(%rip), %xmm0, %xmm1 48; CHECK-AVX2-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0 49; CHECK-AVX2-NEXT: retq 50; 51; CHECK-AVX512VL-LABEL: t32_3: 52; CHECK-AVX512VL: # %bb.0: 53; CHECK-AVX512VL-NEXT: vpsubd {{.*}}(%rip), %xmm0, %xmm0 54; CHECK-AVX512VL-NEXT: vpmulld {{.*}}(%rip){1to4}, %xmm0, %xmm0 55; CHECK-AVX512VL-NEXT: vpminud {{.*}}(%rip), %xmm0, %xmm1 56; CHECK-AVX512VL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0 57; CHECK-AVX512VL-NEXT: retq 58 %urem = urem <4 x i32> %X, <i32 3, i32 3, i32 3, i32 3> 59 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 1, i32 2, i32 2> 60 ret <4 x i1> %cmp 61} 62 63define <4 x i1> @t32_5(<4 x i32> %X) nounwind { 64; CHECK-SSE2-LABEL: t32_5: 65; CHECK-SSE2: # %bb.0: 66; CHECK-SSE2-NEXT: psubd {{.*}}(%rip), %xmm0 67; CHECK-SSE2-NEXT: movdqa {{.*#+}} xmm1 = [3435973837,3435973837,3435973837,3435973837] 68; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,1,3,3] 69; CHECK-SSE2-NEXT: pmuludq %xmm1, %xmm0 70; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm0[0,2,2,3] 71; CHECK-SSE2-NEXT: pmuludq %xmm1, %xmm2 72; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm2[0,2,2,3] 73; CHECK-SSE2-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1] 74; CHECK-SSE2-NEXT: pxor {{.*}}(%rip), %xmm3 75; CHECK-SSE2-NEXT: pcmpgtd {{.*}}(%rip), %xmm3 76; CHECK-SSE2-NEXT: pcmpeqd %xmm0, %xmm0 77; CHECK-SSE2-NEXT: pxor %xmm3, %xmm0 78; CHECK-SSE2-NEXT: retq 79; 80; CHECK-SSE41-LABEL: t32_5: 81; CHECK-SSE41: # %bb.0: 82; CHECK-SSE41-NEXT: psubd {{.*}}(%rip), %xmm0 83; CHECK-SSE41-NEXT: pmulld {{.*}}(%rip), %xmm0 84; CHECK-SSE41-NEXT: movdqa {{.*#+}} xmm1 = [858993458,858993458,858993458,858993458] 85; CHECK-SSE41-NEXT: pminud %xmm0, %xmm1 86; CHECK-SSE41-NEXT: pcmpeqd %xmm1, %xmm0 87; CHECK-SSE41-NEXT: retq 88; 89; CHECK-AVX1-LABEL: t32_5: 90; CHECK-AVX1: # %bb.0: 91; CHECK-AVX1-NEXT: vpsubd {{.*}}(%rip), %xmm0, %xmm0 92; CHECK-AVX1-NEXT: vpmulld {{.*}}(%rip), %xmm0, %xmm0 93; CHECK-AVX1-NEXT: vpminud {{.*}}(%rip), %xmm0, %xmm1 94; CHECK-AVX1-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0 95; CHECK-AVX1-NEXT: retq 96; 97; CHECK-AVX2-LABEL: t32_5: 98; CHECK-AVX2: # %bb.0: 99; CHECK-AVX2-NEXT: vpsubd {{.*}}(%rip), %xmm0, %xmm0 100; CHECK-AVX2-NEXT: vpbroadcastd {{.*#+}} xmm1 = [3435973837,3435973837,3435973837,3435973837] 101; CHECK-AVX2-NEXT: vpmulld %xmm1, %xmm0, %xmm0 102; CHECK-AVX2-NEXT: vpbroadcastd {{.*#+}} xmm1 = [858993458,858993458,858993458,858993458] 103; CHECK-AVX2-NEXT: vpminud %xmm1, %xmm0, %xmm1 104; CHECK-AVX2-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0 105; CHECK-AVX2-NEXT: retq 106; 107; CHECK-AVX512VL-LABEL: t32_5: 108; CHECK-AVX512VL: # %bb.0: 109; CHECK-AVX512VL-NEXT: vpsubd {{.*}}(%rip), %xmm0, %xmm0 110; CHECK-AVX512VL-NEXT: vpmulld {{.*}}(%rip){1to4}, %xmm0, %xmm0 111; CHECK-AVX512VL-NEXT: vpminud {{.*}}(%rip){1to4}, %xmm0, %xmm1 112; CHECK-AVX512VL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0 113; CHECK-AVX512VL-NEXT: retq 114 %urem = urem <4 x i32> %X, <i32 5, i32 5, i32 5, i32 5> 115 %cmp = icmp eq <4 x i32> %urem, <i32 1, i32 2, i32 3, i32 4> 116 ret <4 x i1> %cmp 117} 118 119define <4 x i1> @t32_6_part0(<4 x i32> %X) nounwind { 120; CHECK-SSE2-LABEL: t32_6_part0: 121; CHECK-SSE2: # %bb.0: 122; CHECK-SSE2-NEXT: movdqa {{.*#+}} xmm1 = [2863311531,2863311531,2863311531,2863311531] 123; CHECK-SSE2-NEXT: movdqa %xmm0, %xmm2 124; CHECK-SSE2-NEXT: pmuludq %xmm1, %xmm2 125; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,3,2,3] 126; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm0[1,1,3,3] 127; CHECK-SSE2-NEXT: pmuludq %xmm1, %xmm3 128; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm3[1,3,2,3] 129; CHECK-SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1] 130; CHECK-SSE2-NEXT: psrld $2, %xmm2 131; CHECK-SSE2-NEXT: movdqa {{.*#+}} xmm1 = [6,6,6,6] 132; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm2[1,1,3,3] 133; CHECK-SSE2-NEXT: pmuludq %xmm1, %xmm2 134; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[0,2,2,3] 135; CHECK-SSE2-NEXT: pmuludq %xmm1, %xmm3 136; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm3[0,2,2,3] 137; CHECK-SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1] 138; CHECK-SSE2-NEXT: psubd %xmm2, %xmm0 139; CHECK-SSE2-NEXT: pcmpeqd {{.*}}(%rip), %xmm0 140; CHECK-SSE2-NEXT: retq 141; 142; CHECK-SSE41-LABEL: t32_6_part0: 143; CHECK-SSE41: # %bb.0: 144; CHECK-SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,3,3] 145; CHECK-SSE41-NEXT: movdqa {{.*#+}} xmm2 = [2863311531,2863311531,2863311531,2863311531] 146; CHECK-SSE41-NEXT: pmuludq %xmm2, %xmm1 147; CHECK-SSE41-NEXT: pmuludq %xmm0, %xmm2 148; CHECK-SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,1,3,3] 149; CHECK-SSE41-NEXT: pblendw {{.*#+}} xmm2 = xmm2[0,1],xmm1[2,3],xmm2[4,5],xmm1[6,7] 150; CHECK-SSE41-NEXT: psrld $2, %xmm2 151; CHECK-SSE41-NEXT: pmulld {{.*}}(%rip), %xmm2 152; CHECK-SSE41-NEXT: psubd %xmm2, %xmm0 153; CHECK-SSE41-NEXT: pcmpeqd {{.*}}(%rip), %xmm0 154; CHECK-SSE41-NEXT: retq 155; 156; CHECK-AVX1-LABEL: t32_6_part0: 157; CHECK-AVX1: # %bb.0: 158; CHECK-AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,3,3] 159; CHECK-AVX1-NEXT: vmovdqa {{.*#+}} xmm2 = [2863311531,2863311531,2863311531,2863311531] 160; CHECK-AVX1-NEXT: vpmuludq %xmm2, %xmm1, %xmm1 161; CHECK-AVX1-NEXT: vpmuludq %xmm2, %xmm0, %xmm2 162; CHECK-AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm2[1,1,3,3] 163; CHECK-AVX1-NEXT: vpblendw {{.*#+}} xmm1 = xmm2[0,1],xmm1[2,3],xmm2[4,5],xmm1[6,7] 164; CHECK-AVX1-NEXT: vpsrld $2, %xmm1, %xmm1 165; CHECK-AVX1-NEXT: vpmulld {{.*}}(%rip), %xmm1, %xmm1 166; CHECK-AVX1-NEXT: vpsubd %xmm1, %xmm0, %xmm0 167; CHECK-AVX1-NEXT: vpcmpeqd {{.*}}(%rip), %xmm0, %xmm0 168; CHECK-AVX1-NEXT: retq 169; 170; CHECK-AVX2-LABEL: t32_6_part0: 171; CHECK-AVX2: # %bb.0: 172; CHECK-AVX2-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,3,3] 173; CHECK-AVX2-NEXT: vpbroadcastd {{.*#+}} xmm2 = [2863311531,2863311531,2863311531,2863311531] 174; CHECK-AVX2-NEXT: vpmuludq %xmm2, %xmm1, %xmm1 175; CHECK-AVX2-NEXT: vpmuludq %xmm2, %xmm0, %xmm2 176; CHECK-AVX2-NEXT: vpshufd {{.*#+}} xmm2 = xmm2[1,1,3,3] 177; CHECK-AVX2-NEXT: vpblendd {{.*#+}} xmm1 = xmm2[0],xmm1[1],xmm2[2],xmm1[3] 178; CHECK-AVX2-NEXT: vpsrld $2, %xmm1, %xmm1 179; CHECK-AVX2-NEXT: vpbroadcastd {{.*#+}} xmm2 = [6,6,6,6] 180; CHECK-AVX2-NEXT: vpmulld %xmm2, %xmm1, %xmm1 181; CHECK-AVX2-NEXT: vpsubd %xmm1, %xmm0, %xmm0 182; CHECK-AVX2-NEXT: vpcmpeqd {{.*}}(%rip), %xmm0, %xmm0 183; CHECK-AVX2-NEXT: retq 184; 185; CHECK-AVX512VL-LABEL: t32_6_part0: 186; CHECK-AVX512VL: # %bb.0: 187; CHECK-AVX512VL-NEXT: vpsubd {{.*}}(%rip), %xmm0, %xmm0 188; CHECK-AVX512VL-NEXT: vpmulld {{.*}}(%rip){1to4}, %xmm0, %xmm0 189; CHECK-AVX512VL-NEXT: vprord $1, %xmm0, %xmm0 190; CHECK-AVX512VL-NEXT: vpminud {{.*}}(%rip){1to4}, %xmm0, %xmm1 191; CHECK-AVX512VL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0 192; CHECK-AVX512VL-NEXT: retq 193 %urem = urem <4 x i32> %X, <i32 6, i32 6, i32 6, i32 6> 194 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 1, i32 2, i32 3> 195 ret <4 x i1> %cmp 196} 197 198define <4 x i1> @t32_6_part1(<4 x i32> %X) nounwind { 199; CHECK-SSE2-LABEL: t32_6_part1: 200; CHECK-SSE2: # %bb.0: 201; CHECK-SSE2-NEXT: movdqa {{.*#+}} xmm1 = [2863311531,2863311531,2863311531,2863311531] 202; CHECK-SSE2-NEXT: movdqa %xmm0, %xmm2 203; CHECK-SSE2-NEXT: pmuludq %xmm1, %xmm2 204; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,3,2,3] 205; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm0[1,1,3,3] 206; CHECK-SSE2-NEXT: pmuludq %xmm1, %xmm3 207; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm3[1,3,2,3] 208; CHECK-SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1] 209; CHECK-SSE2-NEXT: psrld $2, %xmm2 210; CHECK-SSE2-NEXT: movdqa {{.*#+}} xmm1 = [6,6,6,6] 211; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm2[1,1,3,3] 212; CHECK-SSE2-NEXT: pmuludq %xmm1, %xmm2 213; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[0,2,2,3] 214; CHECK-SSE2-NEXT: pmuludq %xmm1, %xmm3 215; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm3[0,2,2,3] 216; CHECK-SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1] 217; CHECK-SSE2-NEXT: psubd %xmm2, %xmm0 218; CHECK-SSE2-NEXT: pcmpeqd {{.*}}(%rip), %xmm0 219; CHECK-SSE2-NEXT: retq 220; 221; CHECK-SSE41-LABEL: t32_6_part1: 222; CHECK-SSE41: # %bb.0: 223; CHECK-SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,3,3] 224; CHECK-SSE41-NEXT: movdqa {{.*#+}} xmm2 = [2863311531,2863311531,2863311531,2863311531] 225; CHECK-SSE41-NEXT: pmuludq %xmm2, %xmm1 226; CHECK-SSE41-NEXT: pmuludq %xmm0, %xmm2 227; CHECK-SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,1,3,3] 228; CHECK-SSE41-NEXT: pblendw {{.*#+}} xmm2 = xmm2[0,1],xmm1[2,3],xmm2[4,5],xmm1[6,7] 229; CHECK-SSE41-NEXT: psrld $2, %xmm2 230; CHECK-SSE41-NEXT: pmulld {{.*}}(%rip), %xmm2 231; CHECK-SSE41-NEXT: psubd %xmm2, %xmm0 232; CHECK-SSE41-NEXT: pcmpeqd {{.*}}(%rip), %xmm0 233; CHECK-SSE41-NEXT: retq 234; 235; CHECK-AVX1-LABEL: t32_6_part1: 236; CHECK-AVX1: # %bb.0: 237; CHECK-AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,3,3] 238; CHECK-AVX1-NEXT: vmovdqa {{.*#+}} xmm2 = [2863311531,2863311531,2863311531,2863311531] 239; CHECK-AVX1-NEXT: vpmuludq %xmm2, %xmm1, %xmm1 240; CHECK-AVX1-NEXT: vpmuludq %xmm2, %xmm0, %xmm2 241; CHECK-AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm2[1,1,3,3] 242; CHECK-AVX1-NEXT: vpblendw {{.*#+}} xmm1 = xmm2[0,1],xmm1[2,3],xmm2[4,5],xmm1[6,7] 243; CHECK-AVX1-NEXT: vpsrld $2, %xmm1, %xmm1 244; CHECK-AVX1-NEXT: vpmulld {{.*}}(%rip), %xmm1, %xmm1 245; CHECK-AVX1-NEXT: vpsubd %xmm1, %xmm0, %xmm0 246; CHECK-AVX1-NEXT: vpcmpeqd {{.*}}(%rip), %xmm0, %xmm0 247; CHECK-AVX1-NEXT: retq 248; 249; CHECK-AVX2-LABEL: t32_6_part1: 250; CHECK-AVX2: # %bb.0: 251; CHECK-AVX2-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,3,3] 252; CHECK-AVX2-NEXT: vpbroadcastd {{.*#+}} xmm2 = [2863311531,2863311531,2863311531,2863311531] 253; CHECK-AVX2-NEXT: vpmuludq %xmm2, %xmm1, %xmm1 254; CHECK-AVX2-NEXT: vpmuludq %xmm2, %xmm0, %xmm2 255; CHECK-AVX2-NEXT: vpshufd {{.*#+}} xmm2 = xmm2[1,1,3,3] 256; CHECK-AVX2-NEXT: vpblendd {{.*#+}} xmm1 = xmm2[0],xmm1[1],xmm2[2],xmm1[3] 257; CHECK-AVX2-NEXT: vpsrld $2, %xmm1, %xmm1 258; CHECK-AVX2-NEXT: vpbroadcastd {{.*#+}} xmm2 = [6,6,6,6] 259; CHECK-AVX2-NEXT: vpmulld %xmm2, %xmm1, %xmm1 260; CHECK-AVX2-NEXT: vpsubd %xmm1, %xmm0, %xmm0 261; CHECK-AVX2-NEXT: vpcmpeqd {{.*}}(%rip), %xmm0, %xmm0 262; CHECK-AVX2-NEXT: retq 263; 264; CHECK-AVX512VL-LABEL: t32_6_part1: 265; CHECK-AVX512VL: # %bb.0: 266; CHECK-AVX512VL-NEXT: vpsubd {{.*}}(%rip), %xmm0, %xmm0 267; CHECK-AVX512VL-NEXT: vpmulld {{.*}}(%rip){1to4}, %xmm0, %xmm0 268; CHECK-AVX512VL-NEXT: vprord $1, %xmm0, %xmm0 269; CHECK-AVX512VL-NEXT: vpminud {{.*}}(%rip), %xmm0, %xmm1 270; CHECK-AVX512VL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0 271; CHECK-AVX512VL-NEXT: retq 272 %urem = urem <4 x i32> %X, <i32 6, i32 6, i32 6, i32 6> 273 %cmp = icmp eq <4 x i32> %urem, <i32 4, i32 5, i32 0, i32 0> 274 ret <4 x i1> %cmp 275} 276 277define <4 x i1> @t32_tautological(<4 x i32> %X) nounwind { 278; CHECK-SSE2-LABEL: t32_tautological: 279; CHECK-SSE2: # %bb.0: 280; CHECK-SSE2-NEXT: movdqa {{.*#+}} xmm1 = [0,0,2147483648,2863311531] 281; CHECK-SSE2-NEXT: movdqa %xmm0, %xmm2 282; CHECK-SSE2-NEXT: pmuludq %xmm1, %xmm2 283; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3] 284; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm0[1,1,3,3] 285; CHECK-SSE2-NEXT: pmuludq %xmm1, %xmm3 286; CHECK-SSE2-NEXT: psrld $1, %xmm3 287; CHECK-SSE2-NEXT: punpckhdq {{.*#+}} xmm2 = xmm2[2],xmm3[2],xmm2[3],xmm3[3] 288; CHECK-SSE2-NEXT: movsd {{.*#+}} xmm2 = xmm0[0],xmm2[1] 289; CHECK-SSE2-NEXT: movdqa {{.*#+}} xmm1 = [1,1,2,3] 290; CHECK-SSE2-NEXT: movapd %xmm2, %xmm3 291; CHECK-SSE2-NEXT: pmuludq %xmm1, %xmm3 292; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm3[0,2,2,3] 293; CHECK-SSE2-NEXT: shufps {{.*#+}} xmm2 = xmm2[1,1,3,3] 294; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3] 295; CHECK-SSE2-NEXT: pmuludq %xmm2, %xmm1 296; CHECK-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3] 297; CHECK-SSE2-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1] 298; CHECK-SSE2-NEXT: psubd %xmm3, %xmm0 299; CHECK-SSE2-NEXT: pcmpeqd {{.*}}(%rip), %xmm0 300; CHECK-SSE2-NEXT: retq 301; 302; CHECK-SSE41-LABEL: t32_tautological: 303; CHECK-SSE41: # %bb.0: 304; CHECK-SSE41-NEXT: movdqa {{.*#+}} xmm1 = [0,0,2147483648,2863311531] 305; CHECK-SSE41-NEXT: movdqa %xmm0, %xmm2 306; CHECK-SSE41-NEXT: pmuludq %xmm1, %xmm2 307; CHECK-SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3] 308; CHECK-SSE41-NEXT: pshufd {{.*#+}} xmm3 = xmm0[1,1,3,3] 309; CHECK-SSE41-NEXT: pmuludq %xmm1, %xmm3 310; CHECK-SSE41-NEXT: psrld $1, %xmm3 311; CHECK-SSE41-NEXT: punpckhdq {{.*#+}} xmm2 = xmm2[2],xmm3[2],xmm2[3],xmm3[3] 312; CHECK-SSE41-NEXT: pblendw {{.*#+}} xmm2 = xmm0[0,1,2,3],xmm2[4,5,6,7] 313; CHECK-SSE41-NEXT: pmulld {{.*}}(%rip), %xmm2 314; CHECK-SSE41-NEXT: psubd %xmm2, %xmm0 315; CHECK-SSE41-NEXT: pcmpeqd {{.*}}(%rip), %xmm0 316; CHECK-SSE41-NEXT: retq 317; 318; CHECK-AVX1-LABEL: t32_tautological: 319; CHECK-AVX1: # %bb.0: 320; CHECK-AVX1-NEXT: vmovdqa {{.*#+}} xmm1 = [0,0,2147483648,2863311531] 321; CHECK-AVX1-NEXT: vpmuludq %xmm1, %xmm0, %xmm2 322; CHECK-AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[1,1,3,3] 323; CHECK-AVX1-NEXT: vpshufd {{.*#+}} xmm3 = xmm0[1,1,3,3] 324; CHECK-AVX1-NEXT: vpmuludq %xmm1, %xmm3, %xmm1 325; CHECK-AVX1-NEXT: vpsrld $1, %xmm1, %xmm1 326; CHECK-AVX1-NEXT: vpunpckhdq {{.*#+}} xmm1 = xmm2[2],xmm1[2],xmm2[3],xmm1[3] 327; CHECK-AVX1-NEXT: vpblendw {{.*#+}} xmm1 = xmm0[0,1,2,3],xmm1[4,5,6,7] 328; CHECK-AVX1-NEXT: vpmulld {{.*}}(%rip), %xmm1, %xmm1 329; CHECK-AVX1-NEXT: vpsubd %xmm1, %xmm0, %xmm0 330; CHECK-AVX1-NEXT: vpcmpeqd {{.*}}(%rip), %xmm0, %xmm0 331; CHECK-AVX1-NEXT: retq 332; 333; CHECK-AVX2-LABEL: t32_tautological: 334; CHECK-AVX2: # %bb.0: 335; CHECK-AVX2-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,3,3] 336; CHECK-AVX2-NEXT: vpbroadcastd {{.*#+}} xmm2 = [2863311531,2863311531,2863311531,2863311531] 337; CHECK-AVX2-NEXT: vpmuludq %xmm2, %xmm1, %xmm1 338; CHECK-AVX2-NEXT: vpmuludq {{.*}}(%rip), %xmm0, %xmm2 339; CHECK-AVX2-NEXT: vpunpckhdq {{.*#+}} xmm1 = xmm2[2],xmm1[2],xmm2[3],xmm1[3] 340; CHECK-AVX2-NEXT: vpsrlvd {{.*}}(%rip), %xmm1, %xmm1 341; CHECK-AVX2-NEXT: vpblendd {{.*#+}} xmm1 = xmm0[0,1],xmm1[2,3] 342; CHECK-AVX2-NEXT: vpmulld {{.*}}(%rip), %xmm1, %xmm1 343; CHECK-AVX2-NEXT: vpsubd %xmm1, %xmm0, %xmm0 344; CHECK-AVX2-NEXT: vpcmpeqd {{.*}}(%rip), %xmm0, %xmm0 345; CHECK-AVX2-NEXT: retq 346; 347; CHECK-AVX512VL-LABEL: t32_tautological: 348; CHECK-AVX512VL: # %bb.0: 349; CHECK-AVX512VL-NEXT: vpsubd {{.*}}(%rip), %xmm0, %xmm0 350; CHECK-AVX512VL-NEXT: vpmulld {{.*}}(%rip){1to4}, %xmm0, %xmm0 351; CHECK-AVX512VL-NEXT: vpminud {{.*}}(%rip), %xmm0, %xmm1 352; CHECK-AVX512VL-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0 353; CHECK-AVX512VL-NEXT: vpxor %xmm1, %xmm1, %xmm1 354; CHECK-AVX512VL-NEXT: vpblendd {{.*#+}} xmm0 = xmm0[0],xmm1[1,2],xmm0[3] 355; CHECK-AVX512VL-NEXT: retq 356 %urem = urem <4 x i32> %X, <i32 1, i32 1, i32 2, i32 3> 357 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 1, i32 2, i32 2> 358 ret <4 x i1> %cmp 359} 360