1338 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl -mattr=+avx512vl | FileCheck %s --check-prefix=CHECK --check-prefix=KNL3; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=skx -mattr=+avx512vl | FileCheck %s --check-prefix=CHECK --check-prefix=SKX4 5; 256-bit6 7define <8 x i32> @vpandd256(<8 x i32> %a, <8 x i32> %b) nounwind uwtable readnone ssp {8; CHECK-LABEL: vpandd256:9; CHECK: ## %bb.0: ## %entry10; CHECK-NEXT: vpaddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %ymm0, %ymm011; CHECK-NEXT: vpand %ymm1, %ymm0, %ymm012; CHECK-NEXT: retq13entry:14 ; Force the execution domain with an add.15 %a2 = add <8 x i32> %a, <i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2>16 %x = and <8 x i32> %a2, %b17 ret <8 x i32> %x18}19 20define <8 x i32> @vpandnd256(<8 x i32> %a, <8 x i32> %b) nounwind uwtable readnone ssp {21; CHECK-LABEL: vpandnd256:22; CHECK: ## %bb.0: ## %entry23; CHECK-NEXT: vpaddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %ymm0, %ymm124; CHECK-NEXT: vpandn %ymm1, %ymm0, %ymm025; CHECK-NEXT: retq26entry:27 ; Force the execution domain with an add.28 %a2 = add <8 x i32> %a, <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>29 %b2 = xor <8 x i32> %a, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>30 %x = and <8 x i32> %a2, %b231 ret <8 x i32> %x32}33 34define <8 x i32> @vpord256(<8 x i32> %a, <8 x i32> %b) nounwind uwtable readnone ssp {35; CHECK-LABEL: vpord256:36; CHECK: ## %bb.0: ## %entry37; CHECK-NEXT: vpaddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %ymm0, %ymm038; CHECK-NEXT: vpor %ymm1, %ymm0, %ymm039; CHECK-NEXT: retq40entry:41 ; Force the execution domain with an add.42 %a2 = add <8 x i32> %a, <i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4>43 %x = or <8 x i32> %a2, %b44 ret <8 x i32> %x45}46 47define <8 x i32> @vpxord256(<8 x i32> %a, <8 x i32> %b) nounwind uwtable readnone ssp {48; CHECK-LABEL: vpxord256:49; CHECK: ## %bb.0: ## %entry50; CHECK-NEXT: vpaddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %ymm0, %ymm051; CHECK-NEXT: vpxor %ymm1, %ymm0, %ymm052; CHECK-NEXT: retq53entry:54 ; Force the execution domain with an add.55 %a2 = add <8 x i32> %a, <i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5>56 %x = xor <8 x i32> %a2, %b57 ret <8 x i32> %x58}59 60define <4 x i64> @vpandq256(<4 x i64> %a, <4 x i64> %b) nounwind uwtable readnone ssp {61; CHECK-LABEL: vpandq256:62; CHECK: ## %bb.0: ## %entry63; CHECK-NEXT: vpaddq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %ymm0, %ymm064; CHECK-NEXT: vpand %ymm1, %ymm0, %ymm065; CHECK-NEXT: retq66entry:67 ; Force the execution domain with an add.68 %a2 = add <4 x i64> %a, <i64 6, i64 6, i64 6, i64 6>69 %x = and <4 x i64> %a2, %b70 ret <4 x i64> %x71}72 73define <4 x i64> @vpandnq256(<4 x i64> %a, <4 x i64> %b) nounwind uwtable readnone ssp {74; CHECK-LABEL: vpandnq256:75; CHECK: ## %bb.0: ## %entry76; CHECK-NEXT: vpaddq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %ymm0, %ymm077; CHECK-NEXT: vpandn %ymm0, %ymm1, %ymm078; CHECK-NEXT: retq79entry:80 ; Force the execution domain with an add.81 %a2 = add <4 x i64> %a, <i64 7, i64 7, i64 7, i64 7>82 %b2 = xor <4 x i64> %b, <i64 -1, i64 -1, i64 -1, i64 -1>83 %x = and <4 x i64> %a2, %b284 ret <4 x i64> %x85}86 87define <4 x i64> @vporq256(<4 x i64> %a, <4 x i64> %b) nounwind uwtable readnone ssp {88; CHECK-LABEL: vporq256:89; CHECK: ## %bb.0: ## %entry90; CHECK-NEXT: vpaddq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %ymm0, %ymm091; CHECK-NEXT: vpor %ymm1, %ymm0, %ymm092; CHECK-NEXT: retq93entry:94 ; Force the execution domain with an add.95 %a2 = add <4 x i64> %a, <i64 21, i64 21, i64 21, i64 21>96 %x = or <4 x i64> %a2, %b97 ret <4 x i64> %x98}99 100define <4 x i64> @vpxorq256(<4 x i64> %a, <4 x i64> %b) nounwind uwtable readnone ssp {101; CHECK-LABEL: vpxorq256:102; CHECK: ## %bb.0: ## %entry103; CHECK-NEXT: vpaddq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %ymm0, %ymm0104; CHECK-NEXT: vpxor %ymm1, %ymm0, %ymm0105; CHECK-NEXT: retq106entry:107 ; Force the execution domain with an add.108 %a2 = add <4 x i64> %a, <i64 22, i64 22, i64 22, i64 22>109 %x = xor <4 x i64> %a2, %b110 ret <4 x i64> %x111}112 113; 128-bit114 115define <4 x i32> @vpandd128(<4 x i32> %a, <4 x i32> %b) nounwind uwtable readnone ssp {116; CHECK-LABEL: vpandd128:117; CHECK: ## %bb.0: ## %entry118; CHECK-NEXT: vpaddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm0119; CHECK-NEXT: vpand %xmm1, %xmm0, %xmm0120; CHECK-NEXT: retq121entry:122 ; Force the execution domain with an add.123 %a2 = add <4 x i32> %a, <i32 8, i32 8, i32 8, i32 8>124 %x = and <4 x i32> %a2, %b125 ret <4 x i32> %x126}127 128define <4 x i32> @vpandnd128(<4 x i32> %a, <4 x i32> %b) nounwind uwtable readnone ssp {129; CHECK-LABEL: vpandnd128:130; CHECK: ## %bb.0: ## %entry131; CHECK-NEXT: vpaddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm0132; CHECK-NEXT: vpandn %xmm0, %xmm1, %xmm0133; CHECK-NEXT: retq134entry:135 ; Force the execution domain with an add.136 %a2 = add <4 x i32> %a, <i32 9, i32 9, i32 9, i32 9>137 %b2 = xor <4 x i32> %b, <i32 -1, i32 -1, i32 -1, i32 -1>138 %x = and <4 x i32> %a2, %b2139 ret <4 x i32> %x140}141 142define <4 x i32> @vpord128(<4 x i32> %a, <4 x i32> %b) nounwind uwtable readnone ssp {143; CHECK-LABEL: vpord128:144; CHECK: ## %bb.0: ## %entry145; CHECK-NEXT: vpaddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm0146; CHECK-NEXT: vpor %xmm1, %xmm0, %xmm0147; CHECK-NEXT: retq148entry:149 ; Force the execution domain with an add.150 %a2 = add <4 x i32> %a, <i32 10, i32 10, i32 10, i32 10>151 %x = or <4 x i32> %a2, %b152 ret <4 x i32> %x153}154 155define <4 x i32> @vpxord128(<4 x i32> %a, <4 x i32> %b) nounwind uwtable readnone ssp {156; CHECK-LABEL: vpxord128:157; CHECK: ## %bb.0: ## %entry158; CHECK-NEXT: vpaddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm0159; CHECK-NEXT: vpxor %xmm1, %xmm0, %xmm0160; CHECK-NEXT: retq161entry:162 ; Force the execution domain with an add.163 %a2 = add <4 x i32> %a, <i32 11, i32 11, i32 11, i32 11>164 %x = xor <4 x i32> %a2, %b165 ret <4 x i32> %x166}167 168define <2 x i64> @vpandq128(<2 x i64> %a, <2 x i64> %b) nounwind uwtable readnone ssp {169; CHECK-LABEL: vpandq128:170; CHECK: ## %bb.0: ## %entry171; CHECK-NEXT: vpaddq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to2}, %xmm0, %xmm0172; CHECK-NEXT: vpand %xmm1, %xmm0, %xmm0173; CHECK-NEXT: retq174entry:175 ; Force the execution domain with an add.176 %a2 = add <2 x i64> %a, <i64 12, i64 12>177 %x = and <2 x i64> %a2, %b178 ret <2 x i64> %x179}180 181define <2 x i64> @vpandnq128(<2 x i64> %a, <2 x i64> %b) nounwind uwtable readnone ssp {182; CHECK-LABEL: vpandnq128:183; CHECK: ## %bb.0: ## %entry184; CHECK-NEXT: vpaddq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to2}, %xmm0, %xmm0185; CHECK-NEXT: vpandn %xmm0, %xmm1, %xmm0186; CHECK-NEXT: retq187entry:188 ; Force the execution domain with an add.189 %a2 = add <2 x i64> %a, <i64 13, i64 13>190 %b2 = xor <2 x i64> %b, <i64 -1, i64 -1>191 %x = and <2 x i64> %a2, %b2192 ret <2 x i64> %x193}194 195define <2 x i64> @vporq128(<2 x i64> %a, <2 x i64> %b) nounwind uwtable readnone ssp {196; CHECK-LABEL: vporq128:197; CHECK: ## %bb.0: ## %entry198; CHECK-NEXT: vpaddq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to2}, %xmm0, %xmm0199; CHECK-NEXT: vpor %xmm1, %xmm0, %xmm0200; CHECK-NEXT: retq201entry:202 ; Force the execution domain with an add.203 %a2 = add <2 x i64> %a, <i64 14, i64 14>204 %x = or <2 x i64> %a2, %b205 ret <2 x i64> %x206}207 208define <2 x i64> @vpxorq128(<2 x i64> %a, <2 x i64> %b) nounwind uwtable readnone ssp {209; CHECK-LABEL: vpxorq128:210; CHECK: ## %bb.0: ## %entry211; CHECK-NEXT: vpaddq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to2}, %xmm0, %xmm0212; CHECK-NEXT: vpxor %xmm1, %xmm0, %xmm0213; CHECK-NEXT: retq214entry:215 ; Force the execution domain with an add.216 %a2 = add <2 x i64> %a, <i64 15, i64 15>217 %x = xor <2 x i64> %a2, %b218 ret <2 x i64> %x219}220 221 222define <4 x double> @test_mm256_mask_andnot_pd(<4 x double> %__W, i8 zeroext %__U, <4 x double> %__A, <4 x double> %__B) {223; KNL-LABEL: test_mm256_mask_andnot_pd:224; KNL: ## %bb.0: ## %entry225; KNL-NEXT: kmovw %edi, %k1226; KNL-NEXT: vpandnq %ymm2, %ymm1, %ymm0 {%k1}227; KNL-NEXT: retq228;229; SKX-LABEL: test_mm256_mask_andnot_pd:230; SKX: ## %bb.0: ## %entry231; SKX-NEXT: kmovd %edi, %k1232; SKX-NEXT: vandnpd %ymm2, %ymm1, %ymm0 {%k1}233; SKX-NEXT: retq234entry:235 %0 = bitcast <4 x double> %__A to <4 x i64>236 %neg.i.i = xor <4 x i64> %0, <i64 -1, i64 -1, i64 -1, i64 -1>237 %1 = bitcast <4 x double> %__B to <4 x i64>238 %and.i.i = and <4 x i64> %1, %neg.i.i239 %2 = bitcast <4 x i64> %and.i.i to <4 x double>240 %3 = bitcast i8 %__U to <8 x i1>241 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>242 %4 = select <4 x i1> %extract.i, <4 x double> %2, <4 x double> %__W243 ret <4 x double> %4244}245 246define <4 x double> @test_mm256_maskz_andnot_pd(i8 zeroext %__U, <4 x double> %__A, <4 x double> %__B) {247; KNL-LABEL: test_mm256_maskz_andnot_pd:248; KNL: ## %bb.0: ## %entry249; KNL-NEXT: kmovw %edi, %k1250; KNL-NEXT: vpandnq %ymm1, %ymm0, %ymm0 {%k1} {z}251; KNL-NEXT: retq252;253; SKX-LABEL: test_mm256_maskz_andnot_pd:254; SKX: ## %bb.0: ## %entry255; SKX-NEXT: kmovd %edi, %k1256; SKX-NEXT: vandnpd %ymm1, %ymm0, %ymm0 {%k1} {z}257; SKX-NEXT: retq258entry:259 %0 = bitcast <4 x double> %__A to <4 x i64>260 %neg.i.i = xor <4 x i64> %0, <i64 -1, i64 -1, i64 -1, i64 -1>261 %1 = bitcast <4 x double> %__B to <4 x i64>262 %and.i.i = and <4 x i64> %1, %neg.i.i263 %2 = bitcast <4 x i64> %and.i.i to <4 x double>264 %3 = bitcast i8 %__U to <8 x i1>265 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>266 %4 = select <4 x i1> %extract.i, <4 x double> %2, <4 x double> zeroinitializer267 ret <4 x double> %4268}269 270define <2 x double> @test_mm_mask_andnot_pd(<2 x double> %__W, i8 zeroext %__U, <2 x double> %__A, <2 x double> %__B) {271; KNL-LABEL: test_mm_mask_andnot_pd:272; KNL: ## %bb.0: ## %entry273; KNL-NEXT: kmovw %edi, %k1274; KNL-NEXT: vpandnq %xmm2, %xmm1, %xmm0 {%k1}275; KNL-NEXT: retq276;277; SKX-LABEL: test_mm_mask_andnot_pd:278; SKX: ## %bb.0: ## %entry279; SKX-NEXT: kmovd %edi, %k1280; SKX-NEXT: vandnpd %xmm2, %xmm1, %xmm0 {%k1}281; SKX-NEXT: retq282entry:283 %0 = bitcast <2 x double> %__A to <2 x i64>284 %neg.i.i = xor <2 x i64> %0, <i64 -1, i64 -1>285 %1 = bitcast <2 x double> %__B to <2 x i64>286 %and.i.i = and <2 x i64> %1, %neg.i.i287 %2 = bitcast <2 x i64> %and.i.i to <2 x double>288 %3 = bitcast i8 %__U to <8 x i1>289 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <2 x i32> <i32 0, i32 1>290 %4 = select <2 x i1> %extract.i, <2 x double> %2, <2 x double> %__W291 ret <2 x double> %4292}293 294define <2 x double> @test_mm_maskz_andnot_pd(i8 zeroext %__U, <2 x double> %__A, <2 x double> %__B) {295; KNL-LABEL: test_mm_maskz_andnot_pd:296; KNL: ## %bb.0: ## %entry297; KNL-NEXT: kmovw %edi, %k1298; KNL-NEXT: vpandnq %xmm1, %xmm0, %xmm0 {%k1} {z}299; KNL-NEXT: retq300;301; SKX-LABEL: test_mm_maskz_andnot_pd:302; SKX: ## %bb.0: ## %entry303; SKX-NEXT: kmovd %edi, %k1304; SKX-NEXT: vandnpd %xmm1, %xmm0, %xmm0 {%k1} {z}305; SKX-NEXT: retq306entry:307 %0 = bitcast <2 x double> %__A to <2 x i64>308 %neg.i.i = xor <2 x i64> %0, <i64 -1, i64 -1>309 %1 = bitcast <2 x double> %__B to <2 x i64>310 %and.i.i = and <2 x i64> %1, %neg.i.i311 %2 = bitcast <2 x i64> %and.i.i to <2 x double>312 %3 = bitcast i8 %__U to <8 x i1>313 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <2 x i32> <i32 0, i32 1>314 %4 = select <2 x i1> %extract.i, <2 x double> %2, <2 x double> zeroinitializer315 ret <2 x double> %4316}317 318define <8 x float> @test_mm256_mask_andnot_ps(<8 x float> %__W, i8 zeroext %__U, <8 x float> %__A, <8 x float> %__B) {319; KNL-LABEL: test_mm256_mask_andnot_ps:320; KNL: ## %bb.0: ## %entry321; KNL-NEXT: kmovw %edi, %k1322; KNL-NEXT: vpandnd %ymm2, %ymm1, %ymm0 {%k1}323; KNL-NEXT: retq324;325; SKX-LABEL: test_mm256_mask_andnot_ps:326; SKX: ## %bb.0: ## %entry327; SKX-NEXT: kmovd %edi, %k1328; SKX-NEXT: vandnps %ymm2, %ymm1, %ymm0 {%k1}329; SKX-NEXT: retq330entry:331 %0 = bitcast <8 x float> %__A to <8 x i32>332 %neg.i.i = xor <8 x i32> %0, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>333 %1 = bitcast <8 x float> %__B to <8 x i32>334 %and.i.i = and <8 x i32> %1, %neg.i.i335 %2 = bitcast <8 x i32> %and.i.i to <8 x float>336 %3 = bitcast i8 %__U to <8 x i1>337 %4 = select <8 x i1> %3, <8 x float> %2, <8 x float> %__W338 ret <8 x float> %4339}340 341define <8 x float> @test_mm256_maskz_andnot_ps(i8 zeroext %__U, <8 x float> %__A, <8 x float> %__B) {342; KNL-LABEL: test_mm256_maskz_andnot_ps:343; KNL: ## %bb.0: ## %entry344; KNL-NEXT: kmovw %edi, %k1345; KNL-NEXT: vpandnd %ymm1, %ymm0, %ymm0 {%k1} {z}346; KNL-NEXT: retq347;348; SKX-LABEL: test_mm256_maskz_andnot_ps:349; SKX: ## %bb.0: ## %entry350; SKX-NEXT: kmovd %edi, %k1351; SKX-NEXT: vandnps %ymm1, %ymm0, %ymm0 {%k1} {z}352; SKX-NEXT: retq353entry:354 %0 = bitcast <8 x float> %__A to <8 x i32>355 %neg.i.i = xor <8 x i32> %0, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>356 %1 = bitcast <8 x float> %__B to <8 x i32>357 %and.i.i = and <8 x i32> %1, %neg.i.i358 %2 = bitcast <8 x i32> %and.i.i to <8 x float>359 %3 = bitcast i8 %__U to <8 x i1>360 %4 = select <8 x i1> %3, <8 x float> %2, <8 x float> zeroinitializer361 ret <8 x float> %4362}363 364define <4 x float> @test_mm_mask_andnot_ps(<4 x float> %__W, i8 zeroext %__U, <4 x float> %__A, <4 x float> %__B) {365; KNL-LABEL: test_mm_mask_andnot_ps:366; KNL: ## %bb.0: ## %entry367; KNL-NEXT: kmovw %edi, %k1368; KNL-NEXT: vpandnd %xmm2, %xmm1, %xmm0 {%k1}369; KNL-NEXT: retq370;371; SKX-LABEL: test_mm_mask_andnot_ps:372; SKX: ## %bb.0: ## %entry373; SKX-NEXT: kmovd %edi, %k1374; SKX-NEXT: vandnps %xmm2, %xmm1, %xmm0 {%k1}375; SKX-NEXT: retq376entry:377 %0 = bitcast <4 x float> %__A to <4 x i32>378 %neg.i.i = xor <4 x i32> %0, <i32 -1, i32 -1, i32 -1, i32 -1>379 %1 = bitcast <4 x float> %__B to <4 x i32>380 %and.i.i = and <4 x i32> %1, %neg.i.i381 %2 = bitcast <4 x i32> %and.i.i to <4 x float>382 %3 = bitcast i8 %__U to <8 x i1>383 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>384 %4 = select <4 x i1> %extract.i, <4 x float> %2, <4 x float> %__W385 ret <4 x float> %4386}387 388define <4 x float> @test_mm_maskz_andnot_ps(i8 zeroext %__U, <4 x float> %__A, <4 x float> %__B) {389; KNL-LABEL: test_mm_maskz_andnot_ps:390; KNL: ## %bb.0: ## %entry391; KNL-NEXT: kmovw %edi, %k1392; KNL-NEXT: vpandnd %xmm1, %xmm0, %xmm0 {%k1} {z}393; KNL-NEXT: retq394;395; SKX-LABEL: test_mm_maskz_andnot_ps:396; SKX: ## %bb.0: ## %entry397; SKX-NEXT: kmovd %edi, %k1398; SKX-NEXT: vandnps %xmm1, %xmm0, %xmm0 {%k1} {z}399; SKX-NEXT: retq400entry:401 %0 = bitcast <4 x float> %__A to <4 x i32>402 %neg.i.i = xor <4 x i32> %0, <i32 -1, i32 -1, i32 -1, i32 -1>403 %1 = bitcast <4 x float> %__B to <4 x i32>404 %and.i.i = and <4 x i32> %1, %neg.i.i405 %2 = bitcast <4 x i32> %and.i.i to <4 x float>406 %3 = bitcast i8 %__U to <8 x i1>407 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>408 %4 = select <4 x i1> %extract.i, <4 x float> %2, <4 x float> zeroinitializer409 ret <4 x float> %4410}411 412define <4 x double> @test_mm256_mask_and_pd(<4 x double> %__W, i8 zeroext %__U, <4 x double> %__A, <4 x double> %__B) {413; KNL-LABEL: test_mm256_mask_and_pd:414; KNL: ## %bb.0: ## %entry415; KNL-NEXT: kmovw %edi, %k1416; KNL-NEXT: vpandq %ymm1, %ymm2, %ymm0 {%k1}417; KNL-NEXT: retq418;419; SKX-LABEL: test_mm256_mask_and_pd:420; SKX: ## %bb.0: ## %entry421; SKX-NEXT: kmovd %edi, %k1422; SKX-NEXT: vandpd %ymm1, %ymm2, %ymm0 {%k1}423; SKX-NEXT: retq424entry:425 %0 = bitcast <4 x double> %__A to <4 x i64>426 %1 = bitcast <4 x double> %__B to <4 x i64>427 %and.i.i = and <4 x i64> %1, %0428 %2 = bitcast <4 x i64> %and.i.i to <4 x double>429 %3 = bitcast i8 %__U to <8 x i1>430 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>431 %4 = select <4 x i1> %extract.i, <4 x double> %2, <4 x double> %__W432 ret <4 x double> %4433}434 435define <4 x double> @test_mm256_maskz_and_pd(i8 zeroext %__U, <4 x double> %__A, <4 x double> %__B) {436; KNL-LABEL: test_mm256_maskz_and_pd:437; KNL: ## %bb.0: ## %entry438; KNL-NEXT: kmovw %edi, %k1439; KNL-NEXT: vpandq %ymm0, %ymm1, %ymm0 {%k1} {z}440; KNL-NEXT: retq441;442; SKX-LABEL: test_mm256_maskz_and_pd:443; SKX: ## %bb.0: ## %entry444; SKX-NEXT: kmovd %edi, %k1445; SKX-NEXT: vandpd %ymm0, %ymm1, %ymm0 {%k1} {z}446; SKX-NEXT: retq447entry:448 %0 = bitcast <4 x double> %__A to <4 x i64>449 %1 = bitcast <4 x double> %__B to <4 x i64>450 %and.i.i = and <4 x i64> %1, %0451 %2 = bitcast <4 x i64> %and.i.i to <4 x double>452 %3 = bitcast i8 %__U to <8 x i1>453 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>454 %4 = select <4 x i1> %extract.i, <4 x double> %2, <4 x double> zeroinitializer455 ret <4 x double> %4456}457 458define <2 x double> @test_mm_mask_and_pd(<2 x double> %__W, i8 zeroext %__U, <2 x double> %__A, <2 x double> %__B) {459; KNL-LABEL: test_mm_mask_and_pd:460; KNL: ## %bb.0: ## %entry461; KNL-NEXT: kmovw %edi, %k1462; KNL-NEXT: vpandq %xmm1, %xmm2, %xmm0 {%k1}463; KNL-NEXT: retq464;465; SKX-LABEL: test_mm_mask_and_pd:466; SKX: ## %bb.0: ## %entry467; SKX-NEXT: kmovd %edi, %k1468; SKX-NEXT: vandpd %xmm1, %xmm2, %xmm0 {%k1}469; SKX-NEXT: retq470entry:471 %0 = bitcast <2 x double> %__A to <2 x i64>472 %1 = bitcast <2 x double> %__B to <2 x i64>473 %and.i.i = and <2 x i64> %1, %0474 %2 = bitcast <2 x i64> %and.i.i to <2 x double>475 %3 = bitcast i8 %__U to <8 x i1>476 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <2 x i32> <i32 0, i32 1>477 %4 = select <2 x i1> %extract.i, <2 x double> %2, <2 x double> %__W478 ret <2 x double> %4479}480 481define <2 x double> @test_mm_maskz_and_pd(i8 zeroext %__U, <2 x double> %__A, <2 x double> %__B) {482; KNL-LABEL: test_mm_maskz_and_pd:483; KNL: ## %bb.0: ## %entry484; KNL-NEXT: kmovw %edi, %k1485; KNL-NEXT: vpandq %xmm0, %xmm1, %xmm0 {%k1} {z}486; KNL-NEXT: retq487;488; SKX-LABEL: test_mm_maskz_and_pd:489; SKX: ## %bb.0: ## %entry490; SKX-NEXT: kmovd %edi, %k1491; SKX-NEXT: vandpd %xmm0, %xmm1, %xmm0 {%k1} {z}492; SKX-NEXT: retq493entry:494 %0 = bitcast <2 x double> %__A to <2 x i64>495 %1 = bitcast <2 x double> %__B to <2 x i64>496 %and.i.i = and <2 x i64> %1, %0497 %2 = bitcast <2 x i64> %and.i.i to <2 x double>498 %3 = bitcast i8 %__U to <8 x i1>499 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <2 x i32> <i32 0, i32 1>500 %4 = select <2 x i1> %extract.i, <2 x double> %2, <2 x double> zeroinitializer501 ret <2 x double> %4502}503 504define <8 x float> @test_mm256_mask_and_ps(<8 x float> %__W, i8 zeroext %__U, <8 x float> %__A, <8 x float> %__B) {505; KNL-LABEL: test_mm256_mask_and_ps:506; KNL: ## %bb.0: ## %entry507; KNL-NEXT: kmovw %edi, %k1508; KNL-NEXT: vpandd %ymm1, %ymm2, %ymm0 {%k1}509; KNL-NEXT: retq510;511; SKX-LABEL: test_mm256_mask_and_ps:512; SKX: ## %bb.0: ## %entry513; SKX-NEXT: kmovd %edi, %k1514; SKX-NEXT: vandps %ymm1, %ymm2, %ymm0 {%k1}515; SKX-NEXT: retq516entry:517 %0 = bitcast <8 x float> %__A to <8 x i32>518 %1 = bitcast <8 x float> %__B to <8 x i32>519 %and.i.i = and <8 x i32> %1, %0520 %2 = bitcast <8 x i32> %and.i.i to <8 x float>521 %3 = bitcast i8 %__U to <8 x i1>522 %4 = select <8 x i1> %3, <8 x float> %2, <8 x float> %__W523 ret <8 x float> %4524}525 526define <8 x float> @test_mm256_maskz_and_ps(i8 zeroext %__U, <8 x float> %__A, <8 x float> %__B) {527; KNL-LABEL: test_mm256_maskz_and_ps:528; KNL: ## %bb.0: ## %entry529; KNL-NEXT: kmovw %edi, %k1530; KNL-NEXT: vpandd %ymm0, %ymm1, %ymm0 {%k1} {z}531; KNL-NEXT: retq532;533; SKX-LABEL: test_mm256_maskz_and_ps:534; SKX: ## %bb.0: ## %entry535; SKX-NEXT: kmovd %edi, %k1536; SKX-NEXT: vandps %ymm0, %ymm1, %ymm0 {%k1} {z}537; SKX-NEXT: retq538entry:539 %0 = bitcast <8 x float> %__A to <8 x i32>540 %1 = bitcast <8 x float> %__B to <8 x i32>541 %and.i.i = and <8 x i32> %1, %0542 %2 = bitcast <8 x i32> %and.i.i to <8 x float>543 %3 = bitcast i8 %__U to <8 x i1>544 %4 = select <8 x i1> %3, <8 x float> %2, <8 x float> zeroinitializer545 ret <8 x float> %4546}547 548define <4 x float> @test_mm_mask_and_ps(<4 x float> %__W, i8 zeroext %__U, <4 x float> %__A, <4 x float> %__B) {549; KNL-LABEL: test_mm_mask_and_ps:550; KNL: ## %bb.0: ## %entry551; KNL-NEXT: kmovw %edi, %k1552; KNL-NEXT: vpandd %xmm1, %xmm2, %xmm0 {%k1}553; KNL-NEXT: retq554;555; SKX-LABEL: test_mm_mask_and_ps:556; SKX: ## %bb.0: ## %entry557; SKX-NEXT: kmovd %edi, %k1558; SKX-NEXT: vandps %xmm1, %xmm2, %xmm0 {%k1}559; SKX-NEXT: retq560entry:561 %0 = bitcast <4 x float> %__A to <4 x i32>562 %1 = bitcast <4 x float> %__B to <4 x i32>563 %and.i.i = and <4 x i32> %1, %0564 %2 = bitcast <4 x i32> %and.i.i to <4 x float>565 %3 = bitcast i8 %__U to <8 x i1>566 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>567 %4 = select <4 x i1> %extract.i, <4 x float> %2, <4 x float> %__W568 ret <4 x float> %4569}570 571define <4 x float> @test_mm_maskz_and_ps(i8 zeroext %__U, <4 x float> %__A, <4 x float> %__B) {572; KNL-LABEL: test_mm_maskz_and_ps:573; KNL: ## %bb.0: ## %entry574; KNL-NEXT: kmovw %edi, %k1575; KNL-NEXT: vpandd %xmm0, %xmm1, %xmm0 {%k1} {z}576; KNL-NEXT: retq577;578; SKX-LABEL: test_mm_maskz_and_ps:579; SKX: ## %bb.0: ## %entry580; SKX-NEXT: kmovd %edi, %k1581; SKX-NEXT: vandps %xmm0, %xmm1, %xmm0 {%k1} {z}582; SKX-NEXT: retq583entry:584 %0 = bitcast <4 x float> %__A to <4 x i32>585 %1 = bitcast <4 x float> %__B to <4 x i32>586 %and.i.i = and <4 x i32> %1, %0587 %2 = bitcast <4 x i32> %and.i.i to <4 x float>588 %3 = bitcast i8 %__U to <8 x i1>589 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>590 %4 = select <4 x i1> %extract.i, <4 x float> %2, <4 x float> zeroinitializer591 ret <4 x float> %4592}593 594define <4 x double> @test_mm256_mask_xor_pd(<4 x double> %__W, i8 zeroext %__U, <4 x double> %__A, <4 x double> %__B) {595; KNL-LABEL: test_mm256_mask_xor_pd:596; KNL: ## %bb.0: ## %entry597; KNL-NEXT: kmovw %edi, %k1598; KNL-NEXT: vpxorq %ymm2, %ymm1, %ymm0 {%k1}599; KNL-NEXT: retq600;601; SKX-LABEL: test_mm256_mask_xor_pd:602; SKX: ## %bb.0: ## %entry603; SKX-NEXT: kmovd %edi, %k1604; SKX-NEXT: vxorpd %ymm2, %ymm1, %ymm0 {%k1}605; SKX-NEXT: retq606entry:607 %0 = bitcast <4 x double> %__A to <4 x i64>608 %1 = bitcast <4 x double> %__B to <4 x i64>609 %xor.i.i = xor <4 x i64> %0, %1610 %2 = bitcast <4 x i64> %xor.i.i to <4 x double>611 %3 = bitcast i8 %__U to <8 x i1>612 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>613 %4 = select <4 x i1> %extract.i, <4 x double> %2, <4 x double> %__W614 ret <4 x double> %4615}616 617define <4 x double> @test_mm256_maskz_xor_pd(i8 zeroext %__U, <4 x double> %__A, <4 x double> %__B) {618; KNL-LABEL: test_mm256_maskz_xor_pd:619; KNL: ## %bb.0: ## %entry620; KNL-NEXT: kmovw %edi, %k1621; KNL-NEXT: vpxorq %ymm1, %ymm0, %ymm0 {%k1} {z}622; KNL-NEXT: retq623;624; SKX-LABEL: test_mm256_maskz_xor_pd:625; SKX: ## %bb.0: ## %entry626; SKX-NEXT: kmovd %edi, %k1627; SKX-NEXT: vxorpd %ymm1, %ymm0, %ymm0 {%k1} {z}628; SKX-NEXT: retq629entry:630 %0 = bitcast <4 x double> %__A to <4 x i64>631 %1 = bitcast <4 x double> %__B to <4 x i64>632 %xor.i.i = xor <4 x i64> %0, %1633 %2 = bitcast <4 x i64> %xor.i.i to <4 x double>634 %3 = bitcast i8 %__U to <8 x i1>635 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>636 %4 = select <4 x i1> %extract.i, <4 x double> %2, <4 x double> zeroinitializer637 ret <4 x double> %4638}639 640define <2 x double> @test_mm_mask_xor_pd(<2 x double> %__W, i8 zeroext %__U, <2 x double> %__A, <2 x double> %__B) {641; KNL-LABEL: test_mm_mask_xor_pd:642; KNL: ## %bb.0: ## %entry643; KNL-NEXT: kmovw %edi, %k1644; KNL-NEXT: vpxorq %xmm2, %xmm1, %xmm0 {%k1}645; KNL-NEXT: retq646;647; SKX-LABEL: test_mm_mask_xor_pd:648; SKX: ## %bb.0: ## %entry649; SKX-NEXT: kmovd %edi, %k1650; SKX-NEXT: vxorpd %xmm2, %xmm1, %xmm0 {%k1}651; SKX-NEXT: retq652entry:653 %0 = bitcast <2 x double> %__A to <2 x i64>654 %1 = bitcast <2 x double> %__B to <2 x i64>655 %xor.i.i = xor <2 x i64> %0, %1656 %2 = bitcast <2 x i64> %xor.i.i to <2 x double>657 %3 = bitcast i8 %__U to <8 x i1>658 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <2 x i32> <i32 0, i32 1>659 %4 = select <2 x i1> %extract.i, <2 x double> %2, <2 x double> %__W660 ret <2 x double> %4661}662 663define <2 x double> @test_mm_maskz_xor_pd(i8 zeroext %__U, <2 x double> %__A, <2 x double> %__B) {664; KNL-LABEL: test_mm_maskz_xor_pd:665; KNL: ## %bb.0: ## %entry666; KNL-NEXT: kmovw %edi, %k1667; KNL-NEXT: vpxorq %xmm1, %xmm0, %xmm0 {%k1} {z}668; KNL-NEXT: retq669;670; SKX-LABEL: test_mm_maskz_xor_pd:671; SKX: ## %bb.0: ## %entry672; SKX-NEXT: kmovd %edi, %k1673; SKX-NEXT: vxorpd %xmm1, %xmm0, %xmm0 {%k1} {z}674; SKX-NEXT: retq675entry:676 %0 = bitcast <2 x double> %__A to <2 x i64>677 %1 = bitcast <2 x double> %__B to <2 x i64>678 %xor.i.i = xor <2 x i64> %0, %1679 %2 = bitcast <2 x i64> %xor.i.i to <2 x double>680 %3 = bitcast i8 %__U to <8 x i1>681 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <2 x i32> <i32 0, i32 1>682 %4 = select <2 x i1> %extract.i, <2 x double> %2, <2 x double> zeroinitializer683 ret <2 x double> %4684}685 686define <8 x float> @test_mm256_mask_xor_ps(<8 x float> %__W, i8 zeroext %__U, <8 x float> %__A, <8 x float> %__B) {687; KNL-LABEL: test_mm256_mask_xor_ps:688; KNL: ## %bb.0: ## %entry689; KNL-NEXT: kmovw %edi, %k1690; KNL-NEXT: vpxord %ymm2, %ymm1, %ymm0 {%k1}691; KNL-NEXT: retq692;693; SKX-LABEL: test_mm256_mask_xor_ps:694; SKX: ## %bb.0: ## %entry695; SKX-NEXT: kmovd %edi, %k1696; SKX-NEXT: vxorps %ymm2, %ymm1, %ymm0 {%k1}697; SKX-NEXT: retq698entry:699 %0 = bitcast <8 x float> %__A to <8 x i32>700 %1 = bitcast <8 x float> %__B to <8 x i32>701 %xor.i.i = xor <8 x i32> %0, %1702 %2 = bitcast <8 x i32> %xor.i.i to <8 x float>703 %3 = bitcast i8 %__U to <8 x i1>704 %4 = select <8 x i1> %3, <8 x float> %2, <8 x float> %__W705 ret <8 x float> %4706}707 708define <8 x float> @test_mm256_maskz_xor_ps(i8 zeroext %__U, <8 x float> %__A, <8 x float> %__B) {709; KNL-LABEL: test_mm256_maskz_xor_ps:710; KNL: ## %bb.0: ## %entry711; KNL-NEXT: kmovw %edi, %k1712; KNL-NEXT: vpxord %ymm1, %ymm0, %ymm0 {%k1} {z}713; KNL-NEXT: retq714;715; SKX-LABEL: test_mm256_maskz_xor_ps:716; SKX: ## %bb.0: ## %entry717; SKX-NEXT: kmovd %edi, %k1718; SKX-NEXT: vxorps %ymm1, %ymm0, %ymm0 {%k1} {z}719; SKX-NEXT: retq720entry:721 %0 = bitcast <8 x float> %__A to <8 x i32>722 %1 = bitcast <8 x float> %__B to <8 x i32>723 %xor.i.i = xor <8 x i32> %0, %1724 %2 = bitcast <8 x i32> %xor.i.i to <8 x float>725 %3 = bitcast i8 %__U to <8 x i1>726 %4 = select <8 x i1> %3, <8 x float> %2, <8 x float> zeroinitializer727 ret <8 x float> %4728}729 730define <4 x float> @test_mm_mask_xor_ps(<4 x float> %__W, i8 zeroext %__U, <4 x float> %__A, <4 x float> %__B) {731; KNL-LABEL: test_mm_mask_xor_ps:732; KNL: ## %bb.0: ## %entry733; KNL-NEXT: kmovw %edi, %k1734; KNL-NEXT: vpxord %xmm2, %xmm1, %xmm0 {%k1}735; KNL-NEXT: retq736;737; SKX-LABEL: test_mm_mask_xor_ps:738; SKX: ## %bb.0: ## %entry739; SKX-NEXT: kmovd %edi, %k1740; SKX-NEXT: vxorps %xmm2, %xmm1, %xmm0 {%k1}741; SKX-NEXT: retq742entry:743 %0 = bitcast <4 x float> %__A to <4 x i32>744 %1 = bitcast <4 x float> %__B to <4 x i32>745 %xor.i.i = xor <4 x i32> %0, %1746 %2 = bitcast <4 x i32> %xor.i.i to <4 x float>747 %3 = bitcast i8 %__U to <8 x i1>748 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>749 %4 = select <4 x i1> %extract.i, <4 x float> %2, <4 x float> %__W750 ret <4 x float> %4751}752 753define <4 x float> @test_mm_maskz_xor_ps(i8 zeroext %__U, <4 x float> %__A, <4 x float> %__B) {754; KNL-LABEL: test_mm_maskz_xor_ps:755; KNL: ## %bb.0: ## %entry756; KNL-NEXT: kmovw %edi, %k1757; KNL-NEXT: vpxord %xmm1, %xmm0, %xmm0 {%k1} {z}758; KNL-NEXT: retq759;760; SKX-LABEL: test_mm_maskz_xor_ps:761; SKX: ## %bb.0: ## %entry762; SKX-NEXT: kmovd %edi, %k1763; SKX-NEXT: vxorps %xmm1, %xmm0, %xmm0 {%k1} {z}764; SKX-NEXT: retq765entry:766 %0 = bitcast <4 x float> %__A to <4 x i32>767 %1 = bitcast <4 x float> %__B to <4 x i32>768 %xor.i.i = xor <4 x i32> %0, %1769 %2 = bitcast <4 x i32> %xor.i.i to <4 x float>770 %3 = bitcast i8 %__U to <8 x i1>771 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>772 %4 = select <4 x i1> %extract.i, <4 x float> %2, <4 x float> zeroinitializer773 ret <4 x float> %4774}775 776define <4 x double> @test_mm256_mask_or_pd(<4 x double> %__W, i8 zeroext %__U, <4 x double> %__A, <4 x double> %__B) {777; KNL-LABEL: test_mm256_mask_or_pd:778; KNL: ## %bb.0: ## %entry779; KNL-NEXT: kmovw %edi, %k1780; KNL-NEXT: vporq %ymm1, %ymm2, %ymm0 {%k1}781; KNL-NEXT: retq782;783; SKX-LABEL: test_mm256_mask_or_pd:784; SKX: ## %bb.0: ## %entry785; SKX-NEXT: kmovd %edi, %k1786; SKX-NEXT: vorpd %ymm1, %ymm2, %ymm0 {%k1}787; SKX-NEXT: retq788entry:789 %0 = bitcast <4 x double> %__A to <4 x i64>790 %1 = bitcast <4 x double> %__B to <4 x i64>791 %or.i.i = or <4 x i64> %1, %0792 %2 = bitcast <4 x i64> %or.i.i to <4 x double>793 %3 = bitcast i8 %__U to <8 x i1>794 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>795 %4 = select <4 x i1> %extract.i, <4 x double> %2, <4 x double> %__W796 ret <4 x double> %4797}798 799define <4 x double> @test_mm256_maskz_or_pd(i8 zeroext %__U, <4 x double> %__A, <4 x double> %__B) {800; KNL-LABEL: test_mm256_maskz_or_pd:801; KNL: ## %bb.0: ## %entry802; KNL-NEXT: kmovw %edi, %k1803; KNL-NEXT: vporq %ymm0, %ymm1, %ymm0 {%k1} {z}804; KNL-NEXT: retq805;806; SKX-LABEL: test_mm256_maskz_or_pd:807; SKX: ## %bb.0: ## %entry808; SKX-NEXT: kmovd %edi, %k1809; SKX-NEXT: vorpd %ymm0, %ymm1, %ymm0 {%k1} {z}810; SKX-NEXT: retq811entry:812 %0 = bitcast <4 x double> %__A to <4 x i64>813 %1 = bitcast <4 x double> %__B to <4 x i64>814 %or.i.i = or <4 x i64> %1, %0815 %2 = bitcast <4 x i64> %or.i.i to <4 x double>816 %3 = bitcast i8 %__U to <8 x i1>817 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>818 %4 = select <4 x i1> %extract.i, <4 x double> %2, <4 x double> zeroinitializer819 ret <4 x double> %4820}821 822define <2 x double> @test_mm_mask_or_pd(<2 x double> %__W, i8 zeroext %__U, <2 x double> %__A, <2 x double> %__B) {823; KNL-LABEL: test_mm_mask_or_pd:824; KNL: ## %bb.0: ## %entry825; KNL-NEXT: kmovw %edi, %k1826; KNL-NEXT: vporq %xmm1, %xmm2, %xmm0 {%k1}827; KNL-NEXT: retq828;829; SKX-LABEL: test_mm_mask_or_pd:830; SKX: ## %bb.0: ## %entry831; SKX-NEXT: kmovd %edi, %k1832; SKX-NEXT: vorpd %xmm1, %xmm2, %xmm0 {%k1}833; SKX-NEXT: retq834entry:835 %0 = bitcast <2 x double> %__A to <2 x i64>836 %1 = bitcast <2 x double> %__B to <2 x i64>837 %or.i.i = or <2 x i64> %1, %0838 %2 = bitcast <2 x i64> %or.i.i to <2 x double>839 %3 = bitcast i8 %__U to <8 x i1>840 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <2 x i32> <i32 0, i32 1>841 %4 = select <2 x i1> %extract.i, <2 x double> %2, <2 x double> %__W842 ret <2 x double> %4843}844 845define <2 x double> @test_mm_maskz_or_pd(i8 zeroext %__U, <2 x double> %__A, <2 x double> %__B) {846; KNL-LABEL: test_mm_maskz_or_pd:847; KNL: ## %bb.0: ## %entry848; KNL-NEXT: kmovw %edi, %k1849; KNL-NEXT: vporq %xmm0, %xmm1, %xmm0 {%k1} {z}850; KNL-NEXT: retq851;852; SKX-LABEL: test_mm_maskz_or_pd:853; SKX: ## %bb.0: ## %entry854; SKX-NEXT: kmovd %edi, %k1855; SKX-NEXT: vorpd %xmm0, %xmm1, %xmm0 {%k1} {z}856; SKX-NEXT: retq857entry:858 %0 = bitcast <2 x double> %__A to <2 x i64>859 %1 = bitcast <2 x double> %__B to <2 x i64>860 %or.i.i = or <2 x i64> %1, %0861 %2 = bitcast <2 x i64> %or.i.i to <2 x double>862 %3 = bitcast i8 %__U to <8 x i1>863 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <2 x i32> <i32 0, i32 1>864 %4 = select <2 x i1> %extract.i, <2 x double> %2, <2 x double> zeroinitializer865 ret <2 x double> %4866}867 868define <8 x float> @test_mm256_mask_or_ps(<8 x float> %__W, i8 zeroext %__U, <8 x float> %__A, <8 x float> %__B) {869; KNL-LABEL: test_mm256_mask_or_ps:870; KNL: ## %bb.0: ## %entry871; KNL-NEXT: kmovw %edi, %k1872; KNL-NEXT: vpord %ymm1, %ymm2, %ymm0 {%k1}873; KNL-NEXT: retq874;875; SKX-LABEL: test_mm256_mask_or_ps:876; SKX: ## %bb.0: ## %entry877; SKX-NEXT: kmovd %edi, %k1878; SKX-NEXT: vorps %ymm1, %ymm2, %ymm0 {%k1}879; SKX-NEXT: retq880entry:881 %0 = bitcast <8 x float> %__A to <8 x i32>882 %1 = bitcast <8 x float> %__B to <8 x i32>883 %or.i.i = or <8 x i32> %1, %0884 %2 = bitcast <8 x i32> %or.i.i to <8 x float>885 %3 = bitcast i8 %__U to <8 x i1>886 %4 = select <8 x i1> %3, <8 x float> %2, <8 x float> %__W887 ret <8 x float> %4888}889 890define <8 x float> @test_mm256_maskz_or_ps(i8 zeroext %__U, <8 x float> %__A, <8 x float> %__B) {891; KNL-LABEL: test_mm256_maskz_or_ps:892; KNL: ## %bb.0: ## %entry893; KNL-NEXT: kmovw %edi, %k1894; KNL-NEXT: vpord %ymm0, %ymm1, %ymm0 {%k1} {z}895; KNL-NEXT: retq896;897; SKX-LABEL: test_mm256_maskz_or_ps:898; SKX: ## %bb.0: ## %entry899; SKX-NEXT: kmovd %edi, %k1900; SKX-NEXT: vorps %ymm0, %ymm1, %ymm0 {%k1} {z}901; SKX-NEXT: retq902entry:903 %0 = bitcast <8 x float> %__A to <8 x i32>904 %1 = bitcast <8 x float> %__B to <8 x i32>905 %or.i.i = or <8 x i32> %1, %0906 %2 = bitcast <8 x i32> %or.i.i to <8 x float>907 %3 = bitcast i8 %__U to <8 x i1>908 %4 = select <8 x i1> %3, <8 x float> %2, <8 x float> zeroinitializer909 ret <8 x float> %4910}911 912define <4 x float> @test_mm_mask_or_ps(<4 x float> %__W, i8 zeroext %__U, <4 x float> %__A, <4 x float> %__B) {913; KNL-LABEL: test_mm_mask_or_ps:914; KNL: ## %bb.0: ## %entry915; KNL-NEXT: kmovw %edi, %k1916; KNL-NEXT: vpord %xmm1, %xmm2, %xmm0 {%k1}917; KNL-NEXT: retq918;919; SKX-LABEL: test_mm_mask_or_ps:920; SKX: ## %bb.0: ## %entry921; SKX-NEXT: kmovd %edi, %k1922; SKX-NEXT: vorps %xmm1, %xmm2, %xmm0 {%k1}923; SKX-NEXT: retq924entry:925 %0 = bitcast <4 x float> %__A to <4 x i32>926 %1 = bitcast <4 x float> %__B to <4 x i32>927 %or.i.i = or <4 x i32> %1, %0928 %2 = bitcast <4 x i32> %or.i.i to <4 x float>929 %3 = bitcast i8 %__U to <8 x i1>930 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>931 %4 = select <4 x i1> %extract.i, <4 x float> %2, <4 x float> %__W932 ret <4 x float> %4933}934 935define <4 x float> @test_mm_maskz_or_ps(i8 zeroext %__U, <4 x float> %__A, <4 x float> %__B) {936; KNL-LABEL: test_mm_maskz_or_ps:937; KNL: ## %bb.0: ## %entry938; KNL-NEXT: kmovw %edi, %k1939; KNL-NEXT: vpord %xmm0, %xmm1, %xmm0 {%k1} {z}940; KNL-NEXT: retq941;942; SKX-LABEL: test_mm_maskz_or_ps:943; SKX: ## %bb.0: ## %entry944; SKX-NEXT: kmovd %edi, %k1945; SKX-NEXT: vorps %xmm0, %xmm1, %xmm0 {%k1} {z}946; SKX-NEXT: retq947entry:948 %0 = bitcast <4 x float> %__A to <4 x i32>949 %1 = bitcast <4 x float> %__B to <4 x i32>950 %or.i.i = or <4 x i32> %1, %0951 %2 = bitcast <4 x i32> %or.i.i to <4 x float>952 %3 = bitcast i8 %__U to <8 x i1>953 %extract.i = shufflevector <8 x i1> %3, <8 x i1> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>954 %4 = select <4 x i1> %extract.i, <4 x float> %2, <4 x float> zeroinitializer955 ret <4 x float> %4956}957 958define <4 x i32> @ternlog_and_andn(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {959; CHECK-LABEL: ternlog_and_andn:960; CHECK: ## %bb.0:961; CHECK-NEXT: vpternlogd {{.*#+}} xmm0 = xmm2 & xmm1 & ~xmm0962; CHECK-NEXT: retq963 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>964 %b = and <4 x i32> %y, %a965 %c = and <4 x i32> %b, %z966 ret <4 x i32> %c967}968 969define <4 x i32> @ternlog_or_andn(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {970; CHECK-LABEL: ternlog_or_andn:971; CHECK: ## %bb.0:972; CHECK-NEXT: vpternlogd {{.*#+}} xmm0 = (xmm1 & ~xmm0) | xmm2973; CHECK-NEXT: retq974 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>975 %b = and <4 x i32> %y, %a976 %c = or <4 x i32> %b, %z977 ret <4 x i32> %c978}979 980define <4 x i32> @ternlog_and_orn(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {981; CHECK-LABEL: ternlog_and_orn:982; CHECK: ## %bb.0:983; CHECK-NEXT: vpternlogd {{.*#+}} xmm0 = xmm0 & (xmm1 | ~xmm2)984; CHECK-NEXT: retq985 %a = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>986 %b = or <4 x i32> %a, %y987 %c = and <4 x i32> %b, %x988 ret <4 x i32> %c989}990 991define <4 x i32> @ternlog_and_orn_2(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {992; CHECK-LABEL: ternlog_and_orn_2:993; CHECK: ## %bb.0:994; CHECK-NEXT: vpternlogd {{.*#+}} xmm0 = xmm0 & (xmm1 | ~xmm2)995; CHECK-NEXT: retq996 %a = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>997 %b = or <4 x i32> %y, %a998 %c = and <4 x i32> %b, %x999 ret <4 x i32> %c1000}1001 1002; FIXME: This should be a single vpternlog, but we accidentally match the xor -11003; as the second binary op instead of the and.1004define <4 x i32> @ternlog_orn_and(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {1005; CHECK-LABEL: ternlog_orn_and:1006; CHECK: ## %bb.0:1007; CHECK-NEXT: vpcmpeqd %xmm3, %xmm3, %xmm31008; CHECK-NEXT: vpand %xmm2, %xmm1, %xmm11009; CHECK-NEXT: vpternlogd {{.*#+}} xmm0 = xmm1 | (xmm0 ^ xmm3)1010; CHECK-NEXT: retq1011 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>1012 %b = and <4 x i32> %y, %z1013 %c = or <4 x i32> %b, %a1014 ret <4 x i32> %c1015}1016 1017define <4 x i32> @ternlog_orn_and_2(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {1018; CHECK-LABEL: ternlog_orn_and_2:1019; CHECK: ## %bb.0:1020; CHECK-NEXT: vpternlogd {{.*#+}} xmm0 = (xmm1 & xmm2) | ~xmm01021; CHECK-NEXT: retq1022 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>1023 %b = and <4 x i32> %y, %z1024 %c = or <4 x i32> %a, %b1025 ret <4 x i32> %c1026}1027 1028define <4 x i32> @ternlog_xor_andn(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {1029; CHECK-LABEL: ternlog_xor_andn:1030; CHECK: ## %bb.0:1031; CHECK-NEXT: vpternlogd {{.*#+}} xmm0 = xmm2 ^ (xmm1 & ~xmm0)1032; CHECK-NEXT: retq1033 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>1034 %b = and <4 x i32> %y, %a1035 %c = xor <4 x i32> %b, %z1036 ret <4 x i32> %c1037}1038 1039define <4 x i32> @ternlog_or_and_mask(<4 x i32> %x, <4 x i32> %y) {1040; CHECK-LABEL: ternlog_or_and_mask:1041; CHECK: ## %bb.0:1042; CHECK-NEXT: vpternlogd {{.*#+}} xmm0 = (xmm0 & m32bcst) | xmm11043; CHECK-NEXT: retq1044 %a = and <4 x i32> %x, <i32 255, i32 255, i32 255, i32 255>1045 %b = or <4 x i32> %a, %y1046 ret <4 x i32> %b1047}1048 1049define <8 x i32> @ternlog_or_and_mask_ymm(<8 x i32> %x, <8 x i32> %y) {1050; CHECK-LABEL: ternlog_or_and_mask_ymm:1051; CHECK: ## %bb.0:1052; CHECK-NEXT: vpternlogd {{.*#+}} ymm0 = (ymm0 & m32bcst) | ymm11053; CHECK-NEXT: retq1054 %a = and <8 x i32> %x, <i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216>1055 %b = or <8 x i32> %a, %y1056 ret <8 x i32> %b1057}1058 1059define <2 x i64> @ternlog_xor_and_mask(<2 x i64> %x, <2 x i64> %y) {1060; CHECK-LABEL: ternlog_xor_and_mask:1061; CHECK: ## %bb.0:1062; CHECK-NEXT: vpternlogq {{.*#+}} xmm0 = xmm1 ^ (xmm0 & m64bcst)1063; CHECK-NEXT: retq1064 %a = and <2 x i64> %x, <i64 1099511627775, i64 1099511627775>1065 %b = xor <2 x i64> %a, %y1066 ret <2 x i64> %b1067}1068 1069define <4 x i64> @ternlog_xor_and_mask_ymm(<4 x i64> %x, <4 x i64> %y) {1070; CHECK-LABEL: ternlog_xor_and_mask_ymm:1071; CHECK: ## %bb.0:1072; CHECK-NEXT: vpternlogq {{.*#+}} ymm0 = ymm1 ^ (ymm0 & m64bcst)1073; CHECK-NEXT: retq1074 %a = and <4 x i64> %x, <i64 72057594037927935, i64 72057594037927935, i64 72057594037927935, i64 72057594037927935>1075 %b = xor <4 x i64> %a, %y1076 ret <4 x i64> %b1077}1078 1079define <4 x i32> @ternlog_maskz_or_and_mask(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z, <4 x i32> %mask) {1080; CHECK-LABEL: ternlog_maskz_or_and_mask:1081; CHECK: ## %bb.0:1082; CHECK-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm21083; CHECK-NEXT: vpsrad $31, %xmm3, %xmm01084; CHECK-NEXT: vpternlogd {{.*#+}} xmm0 = xmm0 & (xmm2 | xmm1)1085; CHECK-NEXT: retq1086 %m = icmp slt <4 x i32> %mask, zeroinitializer1087 %a = and <4 x i32> %x, <i32 255, i32 255, i32 255, i32 255>1088 %b = or <4 x i32> %a, %y1089 %c = select <4 x i1> %m, <4 x i32> %b, <4 x i32> zeroinitializer1090 ret <4 x i32> %c1091}1092 1093define <8 x i32> @ternlog_maskz_or_and_mask_ymm(<8 x i32> %x, <8 x i32> %y, <8 x i32> %mask) {1094; CHECK-LABEL: ternlog_maskz_or_and_mask_ymm:1095; CHECK: ## %bb.0:1096; CHECK-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %ymm0, %ymm31097; CHECK-NEXT: vpsrad $31, %ymm2, %ymm01098; CHECK-NEXT: vpternlogd {{.*#+}} ymm0 = ymm0 & (ymm3 | ymm1)1099; CHECK-NEXT: retq1100 %m = icmp slt <8 x i32> %mask, zeroinitializer1101 %a = and <8 x i32> %x, <i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216>1102 %b = or <8 x i32> %a, %y1103 %c = select <8 x i1> %m, <8 x i32> %b, <8 x i32> zeroinitializer1104 ret <8 x i32> %c1105}1106 1107define <2 x i64> @ternlog_maskz_xor_and_mask(<2 x i64> %x, <2 x i64> %y, <2 x i64> %mask) {1108; CHECK-LABEL: ternlog_maskz_xor_and_mask:1109; CHECK: ## %bb.0:1110; CHECK-NEXT: vpandq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to2}, %xmm0, %xmm31111; CHECK-NEXT: vpsraq $63, %xmm2, %xmm01112; CHECK-NEXT: vpternlogq {{.*#+}} xmm0 = xmm0 & (xmm3 ^ xmm1)1113; CHECK-NEXT: retq1114 %m = icmp slt <2 x i64> %mask, zeroinitializer1115 %a = and <2 x i64> %x, <i64 1099511627775, i64 1099511627775>1116 %b = xor <2 x i64> %a, %y1117 %c = select <2 x i1> %m, <2 x i64> %b, <2 x i64> zeroinitializer1118 ret <2 x i64> %c1119}1120 1121define <4 x i64> @ternlog_maskz_xor_and_mask_ymm(<4 x i64> %x, <4 x i64> %y, <4 x i64> %mask) {1122; CHECK-LABEL: ternlog_maskz_xor_and_mask_ymm:1123; CHECK: ## %bb.0:1124; CHECK-NEXT: vpandq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %ymm0, %ymm31125; CHECK-NEXT: vpsraq $63, %ymm2, %ymm01126; CHECK-NEXT: vpternlogq {{.*#+}} ymm0 = ymm0 & (ymm3 ^ ymm1)1127; CHECK-NEXT: retq1128 %m = icmp slt <4 x i64> %mask, zeroinitializer1129 %a = and <4 x i64> %x, <i64 72057594037927935, i64 72057594037927935, i64 72057594037927935, i64 72057594037927935>1130 %b = xor <4 x i64> %a, %y1131 %c = select <4 x i1> %m, <4 x i64> %b, <4 x i64> zeroinitializer1132 ret <4 x i64> %c1133}1134 1135define <4 x i32> @ternlog_maskx_or_and_mask(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z, <4 x i32> %mask) {1136; KNL-LABEL: ternlog_maskx_or_and_mask:1137; KNL: ## %bb.0:1138; KNL-NEXT: vpxor %xmm2, %xmm2, %xmm21139; KNL-NEXT: vpcmpgtd %xmm3, %xmm2, %k11140; KNL-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm21141; KNL-NEXT: vpord %xmm1, %xmm2, %xmm0 {%k1}1142; KNL-NEXT: retq1143;1144; SKX-LABEL: ternlog_maskx_or_and_mask:1145; SKX: ## %bb.0:1146; SKX-NEXT: vpmovd2m %xmm3, %k11147; SKX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm21148; SKX-NEXT: vorps %xmm1, %xmm2, %xmm0 {%k1}1149; SKX-NEXT: retq1150 %m = icmp slt <4 x i32> %mask, zeroinitializer1151 %a = and <4 x i32> %x, <i32 255, i32 255, i32 255, i32 255>1152 %b = or <4 x i32> %a, %y1153 %c = select <4 x i1> %m, <4 x i32> %b, <4 x i32> %x1154 ret <4 x i32> %c1155}1156 1157define <8 x i32> @ternlog_maskx_or_and_mask_ymm(<8 x i32> %x, <8 x i32> %y, <8 x i32> %mask) {1158; KNL-LABEL: ternlog_maskx_or_and_mask_ymm:1159; KNL: ## %bb.0:1160; KNL-NEXT: vpxor %xmm3, %xmm3, %xmm31161; KNL-NEXT: vpcmpgtd %ymm2, %ymm3, %k11162; KNL-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %ymm0, %ymm21163; KNL-NEXT: vpord %ymm1, %ymm2, %ymm0 {%k1}1164; KNL-NEXT: retq1165;1166; SKX-LABEL: ternlog_maskx_or_and_mask_ymm:1167; SKX: ## %bb.0:1168; SKX-NEXT: vpmovd2m %ymm2, %k11169; SKX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %ymm0, %ymm21170; SKX-NEXT: vorps %ymm1, %ymm2, %ymm0 {%k1}1171; SKX-NEXT: retq1172 %m = icmp slt <8 x i32> %mask, zeroinitializer1173 %a = and <8 x i32> %x, <i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216>1174 %b = or <8 x i32> %a, %y1175 %c = select <8 x i1> %m, <8 x i32> %b, <8 x i32> %x1176 ret <8 x i32> %c1177}1178 1179define <2 x i64> @ternlog_maskx_xor_and_mask(<2 x i64> %x, <2 x i64> %y, <2 x i64> %mask) {1180; KNL-LABEL: ternlog_maskx_xor_and_mask:1181; KNL: ## %bb.0:1182; KNL-NEXT: vpxor %xmm3, %xmm3, %xmm31183; KNL-NEXT: vpcmpgtq %xmm2, %xmm3, %k11184; KNL-NEXT: vpandq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to2}, %xmm0, %xmm21185; KNL-NEXT: vpxorq %xmm1, %xmm2, %xmm0 {%k1}1186; KNL-NEXT: retq1187;1188; SKX-LABEL: ternlog_maskx_xor_and_mask:1189; SKX: ## %bb.0:1190; SKX-NEXT: vpmovq2m %xmm2, %k11191; SKX-NEXT: vandpd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to2}, %xmm0, %xmm21192; SKX-NEXT: vxorpd %xmm1, %xmm2, %xmm0 {%k1}1193; SKX-NEXT: retq1194 %m = icmp slt <2 x i64> %mask, zeroinitializer1195 %a = and <2 x i64> %x, <i64 1099511627775, i64 1099511627775>1196 %b = xor <2 x i64> %a, %y1197 %c = select <2 x i1> %m, <2 x i64> %b, <2 x i64> %x1198 ret <2 x i64> %c1199}1200 1201define <4 x i64> @ternlog_maskx_xor_and_mask_ymm(<4 x i64> %x, <4 x i64> %y, <4 x i64> %mask) {1202; KNL-LABEL: ternlog_maskx_xor_and_mask_ymm:1203; KNL: ## %bb.0:1204; KNL-NEXT: vpxor %xmm3, %xmm3, %xmm31205; KNL-NEXT: vpcmpgtq %ymm2, %ymm3, %k11206; KNL-NEXT: vpandq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %ymm0, %ymm21207; KNL-NEXT: vpxorq %ymm1, %ymm2, %ymm0 {%k1}1208; KNL-NEXT: retq1209;1210; SKX-LABEL: ternlog_maskx_xor_and_mask_ymm:1211; SKX: ## %bb.0:1212; SKX-NEXT: vpmovq2m %ymm2, %k11213; SKX-NEXT: vandpd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %ymm0, %ymm21214; SKX-NEXT: vxorpd %ymm1, %ymm2, %ymm0 {%k1}1215; SKX-NEXT: retq1216 %m = icmp slt <4 x i64> %mask, zeroinitializer1217 %a = and <4 x i64> %x, <i64 72057594037927935, i64 72057594037927935, i64 72057594037927935, i64 72057594037927935>1218 %b = xor <4 x i64> %a, %y1219 %c = select <4 x i1> %m, <4 x i64> %b, <4 x i64> %x1220 ret <4 x i64> %c1221}1222 1223define <4 x i32> @ternlog_masky_or_and_mask(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z, <4 x i32> %mask) {1224; KNL-LABEL: ternlog_masky_or_and_mask:1225; KNL: ## %bb.0:1226; KNL-NEXT: vpxor %xmm2, %xmm2, %xmm21227; KNL-NEXT: vpcmpgtd %xmm3, %xmm2, %k11228; KNL-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm01229; KNL-NEXT: vpord %xmm1, %xmm0, %xmm1 {%k1}1230; KNL-NEXT: vmovdqa %xmm1, %xmm01231; KNL-NEXT: retq1232;1233; SKX-LABEL: ternlog_masky_or_and_mask:1234; SKX: ## %bb.0:1235; SKX-NEXT: vpmovd2m %xmm3, %k11236; SKX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm01237; SKX-NEXT: vorps %xmm1, %xmm0, %xmm1 {%k1}1238; SKX-NEXT: vmovaps %xmm1, %xmm01239; SKX-NEXT: retq1240 %m = icmp slt <4 x i32> %mask, zeroinitializer1241 %a = and <4 x i32> %x, <i32 255, i32 255, i32 255, i32 255>1242 %b = or <4 x i32> %a, %y1243 %c = select <4 x i1> %m, <4 x i32> %b, <4 x i32> %y1244 ret <4 x i32> %c1245}1246 1247define <8 x i32> @ternlog_masky_or_and_mask_ymm(<8 x i32> %x, <8 x i32> %y, <8 x i32> %mask) {1248; KNL-LABEL: ternlog_masky_or_and_mask_ymm:1249; KNL: ## %bb.0:1250; KNL-NEXT: vpxor %xmm3, %xmm3, %xmm31251; KNL-NEXT: vpcmpgtd %ymm2, %ymm3, %k11252; KNL-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %ymm0, %ymm21253; KNL-NEXT: vpord %ymm1, %ymm2, %ymm0 {%k1}1254; KNL-NEXT: retq1255;1256; SKX-LABEL: ternlog_masky_or_and_mask_ymm:1257; SKX: ## %bb.0:1258; SKX-NEXT: vpmovd2m %ymm2, %k11259; SKX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %ymm0, %ymm21260; SKX-NEXT: vorps %ymm1, %ymm2, %ymm0 {%k1}1261; SKX-NEXT: retq1262 %m = icmp slt <8 x i32> %mask, zeroinitializer1263 %a = and <8 x i32> %x, <i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216, i32 -16777216>1264 %b = or <8 x i32> %a, %y1265 %c = select <8 x i1> %m, <8 x i32> %b, <8 x i32> %x1266 ret <8 x i32> %c1267}1268 1269define <2 x i64> @ternlog_masky_xor_and_mask(<2 x i64> %x, <2 x i64> %y, <2 x i64> %mask) {1270; KNL-LABEL: ternlog_masky_xor_and_mask:1271; KNL: ## %bb.0:1272; KNL-NEXT: vpxor %xmm3, %xmm3, %xmm31273; KNL-NEXT: vpcmpgtq %xmm2, %xmm3, %k11274; KNL-NEXT: vpandq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to2}, %xmm0, %xmm01275; KNL-NEXT: vpxorq %xmm1, %xmm0, %xmm1 {%k1}1276; KNL-NEXT: vmovdqa %xmm1, %xmm01277; KNL-NEXT: retq1278;1279; SKX-LABEL: ternlog_masky_xor_and_mask:1280; SKX: ## %bb.0:1281; SKX-NEXT: vpmovq2m %xmm2, %k11282; SKX-NEXT: vandpd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to2}, %xmm0, %xmm01283; SKX-NEXT: vxorpd %xmm1, %xmm0, %xmm1 {%k1}1284; SKX-NEXT: vmovapd %xmm1, %xmm01285; SKX-NEXT: retq1286 %m = icmp slt <2 x i64> %mask, zeroinitializer1287 %a = and <2 x i64> %x, <i64 1099511627775, i64 1099511627775>1288 %b = xor <2 x i64> %a, %y1289 %c = select <2 x i1> %m, <2 x i64> %b, <2 x i64> %y1290 ret <2 x i64> %c1291}1292 1293define <4 x i64> @ternlog_masky_xor_and_mask_ymm(<4 x i64> %x, <4 x i64> %y, <4 x i64> %mask) {1294; KNL-LABEL: ternlog_masky_xor_and_mask_ymm:1295; KNL: ## %bb.0:1296; KNL-NEXT: vpxor %xmm3, %xmm3, %xmm31297; KNL-NEXT: vpcmpgtq %ymm2, %ymm3, %k11298; KNL-NEXT: vpandq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %ymm0, %ymm01299; KNL-NEXT: vpxorq %ymm1, %ymm0, %ymm1 {%k1}1300; KNL-NEXT: vmovdqa %ymm1, %ymm01301; KNL-NEXT: retq1302;1303; SKX-LABEL: ternlog_masky_xor_and_mask_ymm:1304; SKX: ## %bb.0:1305; SKX-NEXT: vpmovq2m %ymm2, %k11306; SKX-NEXT: vandpd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %ymm0, %ymm01307; SKX-NEXT: vxorpd %ymm1, %ymm0, %ymm1 {%k1}1308; SKX-NEXT: vmovapd %ymm1, %ymm01309; SKX-NEXT: retq1310 %m = icmp slt <4 x i64> %mask, zeroinitializer1311 %a = and <4 x i64> %x, <i64 72057594037927935, i64 72057594037927935, i64 72057594037927935, i64 72057594037927935>1312 %b = xor <4 x i64> %a, %y1313 %c = select <4 x i1> %m, <4 x i64> %b, <4 x i64> %y1314 ret <4 x i64> %c1315}1316 1317define <4 x i32> @ternlog_andn_or(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {1318; CHECK-LABEL: ternlog_andn_or:1319; CHECK: ## %bb.0:1320; CHECK-NEXT: vpternlogd {{.*#+}} xmm0 = ~xmm0 & (xmm1 | xmm2)1321; CHECK-NEXT: retq1322 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>1323 %b = or <4 x i32> %y, %z1324 %c = and <4 x i32> %a, %b1325 ret <4 x i32> %c1326}1327 1328define <4 x i32> @ternlog_andn_or_2(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {1329; CHECK-LABEL: ternlog_andn_or_2:1330; CHECK: ## %bb.0:1331; CHECK-NEXT: vpternlogd {{.*#+}} xmm0 = xmm0 & ~(xmm1 | xmm2)1332; CHECK-NEXT: retq1333 %a = or <4 x i32> %y, %z1334 %b = xor <4 x i32> %a, <i32 -1, i32 -1, i32 -1, i32 -1>1335 %c = and <4 x i32> %x, %b1336 ret <4 x i32> %c1337}1338