1311 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse2 -disable-peephole | FileCheck %s --check-prefix=SSE3; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+avx2 -disable-peephole | FileCheck %s --check-prefix=AVX4; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+avx512vl,+avx512dq -disable-peephole | FileCheck %s --check-prefix=AVX5125 6;7; Float Comparisons8; Only equal/not-equal/ordered/unordered can be safely commuted9;10 11define <4 x i32> @commute_cmpps_eq(ptr %a0, <4 x float> %a1) {12; SSE-LABEL: commute_cmpps_eq:13; SSE: # %bb.0:14; SSE-NEXT: cmpeqps (%rdi), %xmm015; SSE-NEXT: retq16;17; AVX-LABEL: commute_cmpps_eq:18; AVX: # %bb.0:19; AVX-NEXT: vcmpeqps (%rdi), %xmm0, %xmm020; AVX-NEXT: retq21;22; AVX512-LABEL: commute_cmpps_eq:23; AVX512: # %bb.0:24; AVX512-NEXT: vcmpeqps (%rdi), %xmm0, %xmm025; AVX512-NEXT: retq26 %1 = load <4 x float>, ptr %a027 %2 = fcmp oeq <4 x float> %1, %a128 %3 = sext <4 x i1> %2 to <4 x i32>29 ret <4 x i32> %330}31 32define <4 x i32> @commute_cmpps_ne(ptr %a0, <4 x float> %a1) {33; SSE-LABEL: commute_cmpps_ne:34; SSE: # %bb.0:35; SSE-NEXT: cmpneqps (%rdi), %xmm036; SSE-NEXT: retq37;38; AVX-LABEL: commute_cmpps_ne:39; AVX: # %bb.0:40; AVX-NEXT: vcmpneqps (%rdi), %xmm0, %xmm041; AVX-NEXT: retq42;43; AVX512-LABEL: commute_cmpps_ne:44; AVX512: # %bb.0:45; AVX512-NEXT: vcmpneqps (%rdi), %xmm0, %xmm046; AVX512-NEXT: retq47 %1 = load <4 x float>, ptr %a048 %2 = fcmp une <4 x float> %1, %a149 %3 = sext <4 x i1> %2 to <4 x i32>50 ret <4 x i32> %351}52 53define <4 x i32> @commute_cmpps_ord(ptr %a0, <4 x float> %a1) {54; SSE-LABEL: commute_cmpps_ord:55; SSE: # %bb.0:56; SSE-NEXT: cmpordps (%rdi), %xmm057; SSE-NEXT: retq58;59; AVX-LABEL: commute_cmpps_ord:60; AVX: # %bb.0:61; AVX-NEXT: vcmpordps (%rdi), %xmm0, %xmm062; AVX-NEXT: retq63;64; AVX512-LABEL: commute_cmpps_ord:65; AVX512: # %bb.0:66; AVX512-NEXT: vcmpordps (%rdi), %xmm0, %xmm067; AVX512-NEXT: retq68 %1 = load <4 x float>, ptr %a069 %2 = fcmp ord <4 x float> %1, %a170 %3 = sext <4 x i1> %2 to <4 x i32>71 ret <4 x i32> %372}73 74define <4 x i32> @commute_cmpps_uno(ptr %a0, <4 x float> %a1) {75; SSE-LABEL: commute_cmpps_uno:76; SSE: # %bb.0:77; SSE-NEXT: cmpunordps (%rdi), %xmm078; SSE-NEXT: retq79;80; AVX-LABEL: commute_cmpps_uno:81; AVX: # %bb.0:82; AVX-NEXT: vcmpunordps (%rdi), %xmm0, %xmm083; AVX-NEXT: retq84;85; AVX512-LABEL: commute_cmpps_uno:86; AVX512: # %bb.0:87; AVX512-NEXT: vcmpunordps (%rdi), %xmm0, %xmm088; AVX512-NEXT: retq89 %1 = load <4 x float>, ptr %a090 %2 = fcmp uno <4 x float> %1, %a191 %3 = sext <4 x i1> %2 to <4 x i32>92 ret <4 x i32> %393}94 95define <4 x i32> @commute_cmpps_ueq(ptr %a0, <4 x float> %a1) {96; SSE-LABEL: commute_cmpps_ueq:97; SSE: # %bb.0:98; SSE-NEXT: movaps (%rdi), %xmm199; SSE-NEXT: movaps %xmm1, %xmm2100; SSE-NEXT: cmpeqps %xmm0, %xmm2101; SSE-NEXT: cmpunordps %xmm1, %xmm0102; SSE-NEXT: orps %xmm2, %xmm0103; SSE-NEXT: retq104;105; AVX-LABEL: commute_cmpps_ueq:106; AVX: # %bb.0:107; AVX-NEXT: vcmpeq_uqps (%rdi), %xmm0, %xmm0108; AVX-NEXT: retq109;110; AVX512-LABEL: commute_cmpps_ueq:111; AVX512: # %bb.0:112; AVX512-NEXT: vcmpeq_uqps (%rdi), %xmm0, %xmm0113; AVX512-NEXT: retq114 %1 = load <4 x float>, ptr %a0115 %2 = fcmp ueq <4 x float> %1, %a1116 %3 = sext <4 x i1> %2 to <4 x i32>117 ret <4 x i32> %3118}119 120define <4 x i32> @commute_cmpps_one(ptr %a0, <4 x float> %a1) {121; SSE-LABEL: commute_cmpps_one:122; SSE: # %bb.0:123; SSE-NEXT: movaps (%rdi), %xmm1124; SSE-NEXT: movaps %xmm1, %xmm2125; SSE-NEXT: cmpneqps %xmm0, %xmm2126; SSE-NEXT: cmpordps %xmm1, %xmm0127; SSE-NEXT: andps %xmm2, %xmm0128; SSE-NEXT: retq129;130; AVX-LABEL: commute_cmpps_one:131; AVX: # %bb.0:132; AVX-NEXT: vcmpneq_oqps (%rdi), %xmm0, %xmm0133; AVX-NEXT: retq134;135; AVX512-LABEL: commute_cmpps_one:136; AVX512: # %bb.0:137; AVX512-NEXT: vcmpneq_oqps (%rdi), %xmm0, %xmm0138; AVX512-NEXT: retq139 %1 = load <4 x float>, ptr %a0140 %2 = fcmp one <4 x float> %1, %a1141 %3 = sext <4 x i1> %2 to <4 x i32>142 ret <4 x i32> %3143}144 145define <4 x i32> @commute_cmpps_lt(ptr %a0, <4 x float> %a1) {146; SSE-LABEL: commute_cmpps_lt:147; SSE: # %bb.0:148; SSE-NEXT: movaps (%rdi), %xmm1149; SSE-NEXT: cmpltps %xmm0, %xmm1150; SSE-NEXT: movaps %xmm1, %xmm0151; SSE-NEXT: retq152;153; AVX-LABEL: commute_cmpps_lt:154; AVX: # %bb.0:155; AVX-NEXT: vmovaps (%rdi), %xmm1156; AVX-NEXT: vcmpltps %xmm0, %xmm1, %xmm0157; AVX-NEXT: retq158;159; AVX512-LABEL: commute_cmpps_lt:160; AVX512: # %bb.0:161; AVX512-NEXT: vmovaps (%rdi), %xmm1162; AVX512-NEXT: vcmpltps %xmm0, %xmm1, %xmm0163; AVX512-NEXT: retq164 %1 = load <4 x float>, ptr %a0165 %2 = fcmp olt <4 x float> %1, %a1166 %3 = sext <4 x i1> %2 to <4 x i32>167 ret <4 x i32> %3168}169 170define <4 x i32> @commute_cmpps_le(ptr %a0, <4 x float> %a1) {171; SSE-LABEL: commute_cmpps_le:172; SSE: # %bb.0:173; SSE-NEXT: movaps (%rdi), %xmm1174; SSE-NEXT: cmpleps %xmm0, %xmm1175; SSE-NEXT: movaps %xmm1, %xmm0176; SSE-NEXT: retq177;178; AVX-LABEL: commute_cmpps_le:179; AVX: # %bb.0:180; AVX-NEXT: vmovaps (%rdi), %xmm1181; AVX-NEXT: vcmpleps %xmm0, %xmm1, %xmm0182; AVX-NEXT: retq183;184; AVX512-LABEL: commute_cmpps_le:185; AVX512: # %bb.0:186; AVX512-NEXT: vmovaps (%rdi), %xmm1187; AVX512-NEXT: vcmpleps %xmm0, %xmm1, %xmm0188; AVX512-NEXT: retq189 %1 = load <4 x float>, ptr %a0190 %2 = fcmp ole <4 x float> %1, %a1191 %3 = sext <4 x i1> %2 to <4 x i32>192 ret <4 x i32> %3193}194 195define <8 x i32> @commute_cmpps_eq_ymm(ptr %a0, <8 x float> %a1) {196; SSE-LABEL: commute_cmpps_eq_ymm:197; SSE: # %bb.0:198; SSE-NEXT: cmpeqps (%rdi), %xmm0199; SSE-NEXT: cmpeqps 16(%rdi), %xmm1200; SSE-NEXT: retq201;202; AVX-LABEL: commute_cmpps_eq_ymm:203; AVX: # %bb.0:204; AVX-NEXT: vcmpeqps (%rdi), %ymm0, %ymm0205; AVX-NEXT: retq206;207; AVX512-LABEL: commute_cmpps_eq_ymm:208; AVX512: # %bb.0:209; AVX512-NEXT: vcmpeqps (%rdi), %ymm0, %ymm0210; AVX512-NEXT: retq211 %1 = load <8 x float>, ptr %a0212 %2 = fcmp oeq <8 x float> %1, %a1213 %3 = sext <8 x i1> %2 to <8 x i32>214 ret <8 x i32> %3215}216 217define <8 x i32> @commute_cmpps_ne_ymm(ptr %a0, <8 x float> %a1) {218; SSE-LABEL: commute_cmpps_ne_ymm:219; SSE: # %bb.0:220; SSE-NEXT: cmpneqps (%rdi), %xmm0221; SSE-NEXT: cmpneqps 16(%rdi), %xmm1222; SSE-NEXT: retq223;224; AVX-LABEL: commute_cmpps_ne_ymm:225; AVX: # %bb.0:226; AVX-NEXT: vcmpneqps (%rdi), %ymm0, %ymm0227; AVX-NEXT: retq228;229; AVX512-LABEL: commute_cmpps_ne_ymm:230; AVX512: # %bb.0:231; AVX512-NEXT: vcmpneqps (%rdi), %ymm0, %ymm0232; AVX512-NEXT: retq233 %1 = load <8 x float>, ptr %a0234 %2 = fcmp une <8 x float> %1, %a1235 %3 = sext <8 x i1> %2 to <8 x i32>236 ret <8 x i32> %3237}238 239define <8 x i32> @commute_cmpps_ord_ymm(ptr %a0, <8 x float> %a1) {240; SSE-LABEL: commute_cmpps_ord_ymm:241; SSE: # %bb.0:242; SSE-NEXT: cmpordps (%rdi), %xmm0243; SSE-NEXT: cmpordps 16(%rdi), %xmm1244; SSE-NEXT: retq245;246; AVX-LABEL: commute_cmpps_ord_ymm:247; AVX: # %bb.0:248; AVX-NEXT: vcmpordps (%rdi), %ymm0, %ymm0249; AVX-NEXT: retq250;251; AVX512-LABEL: commute_cmpps_ord_ymm:252; AVX512: # %bb.0:253; AVX512-NEXT: vcmpordps (%rdi), %ymm0, %ymm0254; AVX512-NEXT: retq255 %1 = load <8 x float>, ptr %a0256 %2 = fcmp ord <8 x float> %1, %a1257 %3 = sext <8 x i1> %2 to <8 x i32>258 ret <8 x i32> %3259}260 261define <8 x i32> @commute_cmpps_uno_ymm(ptr %a0, <8 x float> %a1) {262; SSE-LABEL: commute_cmpps_uno_ymm:263; SSE: # %bb.0:264; SSE-NEXT: cmpunordps (%rdi), %xmm0265; SSE-NEXT: cmpunordps 16(%rdi), %xmm1266; SSE-NEXT: retq267;268; AVX-LABEL: commute_cmpps_uno_ymm:269; AVX: # %bb.0:270; AVX-NEXT: vcmpunordps (%rdi), %ymm0, %ymm0271; AVX-NEXT: retq272;273; AVX512-LABEL: commute_cmpps_uno_ymm:274; AVX512: # %bb.0:275; AVX512-NEXT: vcmpunordps (%rdi), %ymm0, %ymm0276; AVX512-NEXT: retq277 %1 = load <8 x float>, ptr %a0278 %2 = fcmp uno <8 x float> %1, %a1279 %3 = sext <8 x i1> %2 to <8 x i32>280 ret <8 x i32> %3281}282 283define <8 x i32> @commute_cmpps_ueq_ymm(ptr %a0, <8 x float> %a1) {284; SSE-LABEL: commute_cmpps_ueq_ymm:285; SSE: # %bb.0:286; SSE-NEXT: movaps (%rdi), %xmm2287; SSE-NEXT: movaps 16(%rdi), %xmm3288; SSE-NEXT: movaps %xmm2, %xmm4289; SSE-NEXT: cmpeqps %xmm0, %xmm4290; SSE-NEXT: cmpunordps %xmm2, %xmm0291; SSE-NEXT: orps %xmm4, %xmm0292; SSE-NEXT: movaps %xmm3, %xmm2293; SSE-NEXT: cmpeqps %xmm1, %xmm2294; SSE-NEXT: cmpunordps %xmm3, %xmm1295; SSE-NEXT: orps %xmm2, %xmm1296; SSE-NEXT: retq297;298; AVX-LABEL: commute_cmpps_ueq_ymm:299; AVX: # %bb.0:300; AVX-NEXT: vcmpeq_uqps (%rdi), %ymm0, %ymm0301; AVX-NEXT: retq302;303; AVX512-LABEL: commute_cmpps_ueq_ymm:304; AVX512: # %bb.0:305; AVX512-NEXT: vcmpeq_uqps (%rdi), %ymm0, %ymm0306; AVX512-NEXT: retq307 %1 = load <8 x float>, ptr %a0308 %2 = fcmp ueq <8 x float> %1, %a1309 %3 = sext <8 x i1> %2 to <8 x i32>310 ret <8 x i32> %3311}312 313define <8 x i32> @commute_cmpps_one_ymm(ptr %a0, <8 x float> %a1) {314; SSE-LABEL: commute_cmpps_one_ymm:315; SSE: # %bb.0:316; SSE-NEXT: movaps (%rdi), %xmm2317; SSE-NEXT: movaps 16(%rdi), %xmm3318; SSE-NEXT: movaps %xmm2, %xmm4319; SSE-NEXT: cmpneqps %xmm0, %xmm4320; SSE-NEXT: cmpordps %xmm2, %xmm0321; SSE-NEXT: andps %xmm4, %xmm0322; SSE-NEXT: movaps %xmm3, %xmm2323; SSE-NEXT: cmpneqps %xmm1, %xmm2324; SSE-NEXT: cmpordps %xmm3, %xmm1325; SSE-NEXT: andps %xmm2, %xmm1326; SSE-NEXT: retq327;328; AVX-LABEL: commute_cmpps_one_ymm:329; AVX: # %bb.0:330; AVX-NEXT: vcmpneq_oqps (%rdi), %ymm0, %ymm0331; AVX-NEXT: retq332;333; AVX512-LABEL: commute_cmpps_one_ymm:334; AVX512: # %bb.0:335; AVX512-NEXT: vcmpneq_oqps (%rdi), %ymm0, %ymm0336; AVX512-NEXT: retq337 %1 = load <8 x float>, ptr %a0338 %2 = fcmp one <8 x float> %1, %a1339 %3 = sext <8 x i1> %2 to <8 x i32>340 ret <8 x i32> %3341}342 343define <8 x i32> @commute_cmpps_lt_ymm(ptr %a0, <8 x float> %a1) {344; SSE-LABEL: commute_cmpps_lt_ymm:345; SSE: # %bb.0:346; SSE-NEXT: movaps (%rdi), %xmm2347; SSE-NEXT: movaps 16(%rdi), %xmm3348; SSE-NEXT: cmpltps %xmm0, %xmm2349; SSE-NEXT: cmpltps %xmm1, %xmm3350; SSE-NEXT: movaps %xmm2, %xmm0351; SSE-NEXT: movaps %xmm3, %xmm1352; SSE-NEXT: retq353;354; AVX-LABEL: commute_cmpps_lt_ymm:355; AVX: # %bb.0:356; AVX-NEXT: vmovaps (%rdi), %ymm1357; AVX-NEXT: vcmpltps %ymm0, %ymm1, %ymm0358; AVX-NEXT: retq359;360; AVX512-LABEL: commute_cmpps_lt_ymm:361; AVX512: # %bb.0:362; AVX512-NEXT: vmovaps (%rdi), %ymm1363; AVX512-NEXT: vcmpltps %ymm0, %ymm1, %ymm0364; AVX512-NEXT: retq365 %1 = load <8 x float>, ptr %a0366 %2 = fcmp olt <8 x float> %1, %a1367 %3 = sext <8 x i1> %2 to <8 x i32>368 ret <8 x i32> %3369}370 371define <8 x i32> @commute_cmpps_le_ymm(ptr %a0, <8 x float> %a1) {372; SSE-LABEL: commute_cmpps_le_ymm:373; SSE: # %bb.0:374; SSE-NEXT: movaps (%rdi), %xmm2375; SSE-NEXT: movaps 16(%rdi), %xmm3376; SSE-NEXT: cmpleps %xmm0, %xmm2377; SSE-NEXT: cmpleps %xmm1, %xmm3378; SSE-NEXT: movaps %xmm2, %xmm0379; SSE-NEXT: movaps %xmm3, %xmm1380; SSE-NEXT: retq381;382; AVX-LABEL: commute_cmpps_le_ymm:383; AVX: # %bb.0:384; AVX-NEXT: vmovaps (%rdi), %ymm1385; AVX-NEXT: vcmpleps %ymm0, %ymm1, %ymm0386; AVX-NEXT: retq387;388; AVX512-LABEL: commute_cmpps_le_ymm:389; AVX512: # %bb.0:390; AVX512-NEXT: vmovaps (%rdi), %ymm1391; AVX512-NEXT: vcmpleps %ymm0, %ymm1, %ymm0392; AVX512-NEXT: retq393 %1 = load <8 x float>, ptr %a0394 %2 = fcmp ole <8 x float> %1, %a1395 %3 = sext <8 x i1> %2 to <8 x i32>396 ret <8 x i32> %3397}398 399;400; Double Comparisons401; Only equal/not-equal/ordered/unordered can be safely commuted402;403 404define <2 x i64> @commute_cmppd_eq(ptr %a0, <2 x double> %a1) {405; SSE-LABEL: commute_cmppd_eq:406; SSE: # %bb.0:407; SSE-NEXT: cmpeqpd (%rdi), %xmm0408; SSE-NEXT: retq409;410; AVX-LABEL: commute_cmppd_eq:411; AVX: # %bb.0:412; AVX-NEXT: vcmpeqpd (%rdi), %xmm0, %xmm0413; AVX-NEXT: retq414;415; AVX512-LABEL: commute_cmppd_eq:416; AVX512: # %bb.0:417; AVX512-NEXT: vcmpeqpd (%rdi), %xmm0, %xmm0418; AVX512-NEXT: retq419 %1 = load <2 x double>, ptr %a0420 %2 = fcmp oeq <2 x double> %1, %a1421 %3 = sext <2 x i1> %2 to <2 x i64>422 ret <2 x i64> %3423}424 425define <2 x i64> @commute_cmppd_ne(ptr %a0, <2 x double> %a1) {426; SSE-LABEL: commute_cmppd_ne:427; SSE: # %bb.0:428; SSE-NEXT: cmpneqpd (%rdi), %xmm0429; SSE-NEXT: retq430;431; AVX-LABEL: commute_cmppd_ne:432; AVX: # %bb.0:433; AVX-NEXT: vcmpneqpd (%rdi), %xmm0, %xmm0434; AVX-NEXT: retq435;436; AVX512-LABEL: commute_cmppd_ne:437; AVX512: # %bb.0:438; AVX512-NEXT: vcmpneqpd (%rdi), %xmm0, %xmm0439; AVX512-NEXT: retq440 %1 = load <2 x double>, ptr %a0441 %2 = fcmp une <2 x double> %1, %a1442 %3 = sext <2 x i1> %2 to <2 x i64>443 ret <2 x i64> %3444}445 446define <2 x i64> @commute_cmppd_ord(ptr %a0, <2 x double> %a1) {447; SSE-LABEL: commute_cmppd_ord:448; SSE: # %bb.0:449; SSE-NEXT: cmpordpd (%rdi), %xmm0450; SSE-NEXT: retq451;452; AVX-LABEL: commute_cmppd_ord:453; AVX: # %bb.0:454; AVX-NEXT: vcmpordpd (%rdi), %xmm0, %xmm0455; AVX-NEXT: retq456;457; AVX512-LABEL: commute_cmppd_ord:458; AVX512: # %bb.0:459; AVX512-NEXT: vcmpordpd (%rdi), %xmm0, %xmm0460; AVX512-NEXT: retq461 %1 = load <2 x double>, ptr %a0462 %2 = fcmp ord <2 x double> %1, %a1463 %3 = sext <2 x i1> %2 to <2 x i64>464 ret <2 x i64> %3465}466 467define <2 x i64> @commute_cmppd_ueq(ptr %a0, <2 x double> %a1) {468; SSE-LABEL: commute_cmppd_ueq:469; SSE: # %bb.0:470; SSE-NEXT: movapd (%rdi), %xmm1471; SSE-NEXT: movapd %xmm1, %xmm2472; SSE-NEXT: cmpeqpd %xmm0, %xmm2473; SSE-NEXT: cmpunordpd %xmm1, %xmm0474; SSE-NEXT: orpd %xmm2, %xmm0475; SSE-NEXT: retq476;477; AVX-LABEL: commute_cmppd_ueq:478; AVX: # %bb.0:479; AVX-NEXT: vcmpeq_uqpd (%rdi), %xmm0, %xmm0480; AVX-NEXT: retq481;482; AVX512-LABEL: commute_cmppd_ueq:483; AVX512: # %bb.0:484; AVX512-NEXT: vcmpeq_uqpd (%rdi), %xmm0, %xmm0485; AVX512-NEXT: retq486 %1 = load <2 x double>, ptr %a0487 %2 = fcmp ueq <2 x double> %1, %a1488 %3 = sext <2 x i1> %2 to <2 x i64>489 ret <2 x i64> %3490}491 492define <2 x i64> @commute_cmppd_one(ptr %a0, <2 x double> %a1) {493; SSE-LABEL: commute_cmppd_one:494; SSE: # %bb.0:495; SSE-NEXT: movapd (%rdi), %xmm1496; SSE-NEXT: movapd %xmm1, %xmm2497; SSE-NEXT: cmpneqpd %xmm0, %xmm2498; SSE-NEXT: cmpordpd %xmm1, %xmm0499; SSE-NEXT: andpd %xmm2, %xmm0500; SSE-NEXT: retq501;502; AVX-LABEL: commute_cmppd_one:503; AVX: # %bb.0:504; AVX-NEXT: vcmpneq_oqpd (%rdi), %xmm0, %xmm0505; AVX-NEXT: retq506;507; AVX512-LABEL: commute_cmppd_one:508; AVX512: # %bb.0:509; AVX512-NEXT: vcmpneq_oqpd (%rdi), %xmm0, %xmm0510; AVX512-NEXT: retq511 %1 = load <2 x double>, ptr %a0512 %2 = fcmp one <2 x double> %1, %a1513 %3 = sext <2 x i1> %2 to <2 x i64>514 ret <2 x i64> %3515}516 517define <2 x i64> @commute_cmppd_uno(ptr %a0, <2 x double> %a1) {518; SSE-LABEL: commute_cmppd_uno:519; SSE: # %bb.0:520; SSE-NEXT: cmpunordpd (%rdi), %xmm0521; SSE-NEXT: retq522;523; AVX-LABEL: commute_cmppd_uno:524; AVX: # %bb.0:525; AVX-NEXT: vcmpunordpd (%rdi), %xmm0, %xmm0526; AVX-NEXT: retq527;528; AVX512-LABEL: commute_cmppd_uno:529; AVX512: # %bb.0:530; AVX512-NEXT: vcmpunordpd (%rdi), %xmm0, %xmm0531; AVX512-NEXT: retq532 %1 = load <2 x double>, ptr %a0533 %2 = fcmp uno <2 x double> %1, %a1534 %3 = sext <2 x i1> %2 to <2 x i64>535 ret <2 x i64> %3536}537 538define <2 x i64> @commute_cmppd_lt(ptr %a0, <2 x double> %a1) {539; SSE-LABEL: commute_cmppd_lt:540; SSE: # %bb.0:541; SSE-NEXT: movapd (%rdi), %xmm1542; SSE-NEXT: cmpltpd %xmm0, %xmm1543; SSE-NEXT: movapd %xmm1, %xmm0544; SSE-NEXT: retq545;546; AVX-LABEL: commute_cmppd_lt:547; AVX: # %bb.0:548; AVX-NEXT: vmovapd (%rdi), %xmm1549; AVX-NEXT: vcmpltpd %xmm0, %xmm1, %xmm0550; AVX-NEXT: retq551;552; AVX512-LABEL: commute_cmppd_lt:553; AVX512: # %bb.0:554; AVX512-NEXT: vmovapd (%rdi), %xmm1555; AVX512-NEXT: vcmpltpd %xmm0, %xmm1, %xmm0556; AVX512-NEXT: retq557 %1 = load <2 x double>, ptr %a0558 %2 = fcmp olt <2 x double> %1, %a1559 %3 = sext <2 x i1> %2 to <2 x i64>560 ret <2 x i64> %3561}562 563define <2 x i64> @commute_cmppd_le(ptr %a0, <2 x double> %a1) {564; SSE-LABEL: commute_cmppd_le:565; SSE: # %bb.0:566; SSE-NEXT: movapd (%rdi), %xmm1567; SSE-NEXT: cmplepd %xmm0, %xmm1568; SSE-NEXT: movapd %xmm1, %xmm0569; SSE-NEXT: retq570;571; AVX-LABEL: commute_cmppd_le:572; AVX: # %bb.0:573; AVX-NEXT: vmovapd (%rdi), %xmm1574; AVX-NEXT: vcmplepd %xmm0, %xmm1, %xmm0575; AVX-NEXT: retq576;577; AVX512-LABEL: commute_cmppd_le:578; AVX512: # %bb.0:579; AVX512-NEXT: vmovapd (%rdi), %xmm1580; AVX512-NEXT: vcmplepd %xmm0, %xmm1, %xmm0581; AVX512-NEXT: retq582 %1 = load <2 x double>, ptr %a0583 %2 = fcmp ole <2 x double> %1, %a1584 %3 = sext <2 x i1> %2 to <2 x i64>585 ret <2 x i64> %3586}587 588define <4 x i64> @commute_cmppd_eq_ymmm(ptr %a0, <4 x double> %a1) {589; SSE-LABEL: commute_cmppd_eq_ymmm:590; SSE: # %bb.0:591; SSE-NEXT: cmpeqpd (%rdi), %xmm0592; SSE-NEXT: cmpeqpd 16(%rdi), %xmm1593; SSE-NEXT: retq594;595; AVX-LABEL: commute_cmppd_eq_ymmm:596; AVX: # %bb.0:597; AVX-NEXT: vcmpeqpd (%rdi), %ymm0, %ymm0598; AVX-NEXT: retq599;600; AVX512-LABEL: commute_cmppd_eq_ymmm:601; AVX512: # %bb.0:602; AVX512-NEXT: vcmpeqpd (%rdi), %ymm0, %ymm0603; AVX512-NEXT: retq604 %1 = load <4 x double>, ptr %a0605 %2 = fcmp oeq <4 x double> %1, %a1606 %3 = sext <4 x i1> %2 to <4 x i64>607 ret <4 x i64> %3608}609 610define <4 x i64> @commute_cmppd_ne_ymmm(ptr %a0, <4 x double> %a1) {611; SSE-LABEL: commute_cmppd_ne_ymmm:612; SSE: # %bb.0:613; SSE-NEXT: cmpneqpd (%rdi), %xmm0614; SSE-NEXT: cmpneqpd 16(%rdi), %xmm1615; SSE-NEXT: retq616;617; AVX-LABEL: commute_cmppd_ne_ymmm:618; AVX: # %bb.0:619; AVX-NEXT: vcmpneqpd (%rdi), %ymm0, %ymm0620; AVX-NEXT: retq621;622; AVX512-LABEL: commute_cmppd_ne_ymmm:623; AVX512: # %bb.0:624; AVX512-NEXT: vcmpneqpd (%rdi), %ymm0, %ymm0625; AVX512-NEXT: retq626 %1 = load <4 x double>, ptr %a0627 %2 = fcmp une <4 x double> %1, %a1628 %3 = sext <4 x i1> %2 to <4 x i64>629 ret <4 x i64> %3630}631 632define <4 x i64> @commute_cmppd_ord_ymmm(ptr %a0, <4 x double> %a1) {633; SSE-LABEL: commute_cmppd_ord_ymmm:634; SSE: # %bb.0:635; SSE-NEXT: cmpordpd (%rdi), %xmm0636; SSE-NEXT: cmpordpd 16(%rdi), %xmm1637; SSE-NEXT: retq638;639; AVX-LABEL: commute_cmppd_ord_ymmm:640; AVX: # %bb.0:641; AVX-NEXT: vcmpordpd (%rdi), %ymm0, %ymm0642; AVX-NEXT: retq643;644; AVX512-LABEL: commute_cmppd_ord_ymmm:645; AVX512: # %bb.0:646; AVX512-NEXT: vcmpordpd (%rdi), %ymm0, %ymm0647; AVX512-NEXT: retq648 %1 = load <4 x double>, ptr %a0649 %2 = fcmp ord <4 x double> %1, %a1650 %3 = sext <4 x i1> %2 to <4 x i64>651 ret <4 x i64> %3652}653 654define <4 x i64> @commute_cmppd_uno_ymmm(ptr %a0, <4 x double> %a1) {655; SSE-LABEL: commute_cmppd_uno_ymmm:656; SSE: # %bb.0:657; SSE-NEXT: cmpunordpd (%rdi), %xmm0658; SSE-NEXT: cmpunordpd 16(%rdi), %xmm1659; SSE-NEXT: retq660;661; AVX-LABEL: commute_cmppd_uno_ymmm:662; AVX: # %bb.0:663; AVX-NEXT: vcmpunordpd (%rdi), %ymm0, %ymm0664; AVX-NEXT: retq665;666; AVX512-LABEL: commute_cmppd_uno_ymmm:667; AVX512: # %bb.0:668; AVX512-NEXT: vcmpunordpd (%rdi), %ymm0, %ymm0669; AVX512-NEXT: retq670 %1 = load <4 x double>, ptr %a0671 %2 = fcmp uno <4 x double> %1, %a1672 %3 = sext <4 x i1> %2 to <4 x i64>673 ret <4 x i64> %3674}675 676define <4 x i64> @commute_cmppd_ueq_ymmm(ptr %a0, <4 x double> %a1) {677; SSE-LABEL: commute_cmppd_ueq_ymmm:678; SSE: # %bb.0:679; SSE-NEXT: movapd (%rdi), %xmm2680; SSE-NEXT: movapd 16(%rdi), %xmm3681; SSE-NEXT: movapd %xmm2, %xmm4682; SSE-NEXT: cmpeqpd %xmm0, %xmm4683; SSE-NEXT: cmpunordpd %xmm2, %xmm0684; SSE-NEXT: orpd %xmm4, %xmm0685; SSE-NEXT: movapd %xmm3, %xmm2686; SSE-NEXT: cmpeqpd %xmm1, %xmm2687; SSE-NEXT: cmpunordpd %xmm3, %xmm1688; SSE-NEXT: orpd %xmm2, %xmm1689; SSE-NEXT: retq690;691; AVX-LABEL: commute_cmppd_ueq_ymmm:692; AVX: # %bb.0:693; AVX-NEXT: vcmpeq_uqpd (%rdi), %ymm0, %ymm0694; AVX-NEXT: retq695;696; AVX512-LABEL: commute_cmppd_ueq_ymmm:697; AVX512: # %bb.0:698; AVX512-NEXT: vcmpeq_uqpd (%rdi), %ymm0, %ymm0699; AVX512-NEXT: retq700 %1 = load <4 x double>, ptr %a0701 %2 = fcmp ueq <4 x double> %1, %a1702 %3 = sext <4 x i1> %2 to <4 x i64>703 ret <4 x i64> %3704}705 706define <4 x i64> @commute_cmppd_one_ymmm(ptr %a0, <4 x double> %a1) {707; SSE-LABEL: commute_cmppd_one_ymmm:708; SSE: # %bb.0:709; SSE-NEXT: movapd (%rdi), %xmm2710; SSE-NEXT: movapd 16(%rdi), %xmm3711; SSE-NEXT: movapd %xmm2, %xmm4712; SSE-NEXT: cmpneqpd %xmm0, %xmm4713; SSE-NEXT: cmpordpd %xmm2, %xmm0714; SSE-NEXT: andpd %xmm4, %xmm0715; SSE-NEXT: movapd %xmm3, %xmm2716; SSE-NEXT: cmpneqpd %xmm1, %xmm2717; SSE-NEXT: cmpordpd %xmm3, %xmm1718; SSE-NEXT: andpd %xmm2, %xmm1719; SSE-NEXT: retq720;721; AVX-LABEL: commute_cmppd_one_ymmm:722; AVX: # %bb.0:723; AVX-NEXT: vcmpneq_oqpd (%rdi), %ymm0, %ymm0724; AVX-NEXT: retq725;726; AVX512-LABEL: commute_cmppd_one_ymmm:727; AVX512: # %bb.0:728; AVX512-NEXT: vcmpneq_oqpd (%rdi), %ymm0, %ymm0729; AVX512-NEXT: retq730 %1 = load <4 x double>, ptr %a0731 %2 = fcmp one <4 x double> %1, %a1732 %3 = sext <4 x i1> %2 to <4 x i64>733 ret <4 x i64> %3734}735 736define <4 x i64> @commute_cmppd_lt_ymmm(ptr %a0, <4 x double> %a1) {737; SSE-LABEL: commute_cmppd_lt_ymmm:738; SSE: # %bb.0:739; SSE-NEXT: movapd (%rdi), %xmm2740; SSE-NEXT: movapd 16(%rdi), %xmm3741; SSE-NEXT: cmpltpd %xmm0, %xmm2742; SSE-NEXT: cmpltpd %xmm1, %xmm3743; SSE-NEXT: movapd %xmm2, %xmm0744; SSE-NEXT: movapd %xmm3, %xmm1745; SSE-NEXT: retq746;747; AVX-LABEL: commute_cmppd_lt_ymmm:748; AVX: # %bb.0:749; AVX-NEXT: vmovapd (%rdi), %ymm1750; AVX-NEXT: vcmpltpd %ymm0, %ymm1, %ymm0751; AVX-NEXT: retq752;753; AVX512-LABEL: commute_cmppd_lt_ymmm:754; AVX512: # %bb.0:755; AVX512-NEXT: vmovapd (%rdi), %ymm1756; AVX512-NEXT: vcmpltpd %ymm0, %ymm1, %ymm0757; AVX512-NEXT: retq758 %1 = load <4 x double>, ptr %a0759 %2 = fcmp olt <4 x double> %1, %a1760 %3 = sext <4 x i1> %2 to <4 x i64>761 ret <4 x i64> %3762}763 764define <4 x i64> @commute_cmppd_le_ymmm(ptr %a0, <4 x double> %a1) {765; SSE-LABEL: commute_cmppd_le_ymmm:766; SSE: # %bb.0:767; SSE-NEXT: movapd (%rdi), %xmm2768; SSE-NEXT: movapd 16(%rdi), %xmm3769; SSE-NEXT: cmplepd %xmm0, %xmm2770; SSE-NEXT: cmplepd %xmm1, %xmm3771; SSE-NEXT: movapd %xmm2, %xmm0772; SSE-NEXT: movapd %xmm3, %xmm1773; SSE-NEXT: retq774;775; AVX-LABEL: commute_cmppd_le_ymmm:776; AVX: # %bb.0:777; AVX-NEXT: vmovapd (%rdi), %ymm1778; AVX-NEXT: vcmplepd %ymm0, %ymm1, %ymm0779; AVX-NEXT: retq780;781; AVX512-LABEL: commute_cmppd_le_ymmm:782; AVX512: # %bb.0:783; AVX512-NEXT: vmovapd (%rdi), %ymm1784; AVX512-NEXT: vcmplepd %ymm0, %ymm1, %ymm0785; AVX512-NEXT: retq786 %1 = load <4 x double>, ptr %a0787 %2 = fcmp ole <4 x double> %1, %a1788 %3 = sext <4 x i1> %2 to <4 x i64>789 ret <4 x i64> %3790}791 792define <16 x i32> @commute_cmpps_eq_zmm(ptr %a0, <16 x float> %a1) {793; SSE-LABEL: commute_cmpps_eq_zmm:794; SSE: # %bb.0:795; SSE-NEXT: cmpeqps (%rdi), %xmm0796; SSE-NEXT: cmpeqps 16(%rdi), %xmm1797; SSE-NEXT: cmpeqps 32(%rdi), %xmm2798; SSE-NEXT: cmpeqps 48(%rdi), %xmm3799; SSE-NEXT: retq800;801; AVX-LABEL: commute_cmpps_eq_zmm:802; AVX: # %bb.0:803; AVX-NEXT: vcmpeqps (%rdi), %ymm0, %ymm0804; AVX-NEXT: vcmpeqps 32(%rdi), %ymm1, %ymm1805; AVX-NEXT: retq806;807; AVX512-LABEL: commute_cmpps_eq_zmm:808; AVX512: # %bb.0:809; AVX512-NEXT: vcmpeqps (%rdi), %zmm0, %k0810; AVX512-NEXT: vpmovm2d %k0, %zmm0811; AVX512-NEXT: retq812 %1 = load <16 x float>, ptr %a0813 %2 = fcmp oeq <16 x float> %1, %a1814 %3 = sext <16 x i1> %2 to <16 x i32>815 ret <16 x i32> %3816}817 818define <16 x i32> @commute_cmpps_ne_zmm(ptr %a0, <16 x float> %a1) {819; SSE-LABEL: commute_cmpps_ne_zmm:820; SSE: # %bb.0:821; SSE-NEXT: cmpneqps (%rdi), %xmm0822; SSE-NEXT: cmpneqps 16(%rdi), %xmm1823; SSE-NEXT: cmpneqps 32(%rdi), %xmm2824; SSE-NEXT: cmpneqps 48(%rdi), %xmm3825; SSE-NEXT: retq826;827; AVX-LABEL: commute_cmpps_ne_zmm:828; AVX: # %bb.0:829; AVX-NEXT: vcmpneqps (%rdi), %ymm0, %ymm0830; AVX-NEXT: vcmpneqps 32(%rdi), %ymm1, %ymm1831; AVX-NEXT: retq832;833; AVX512-LABEL: commute_cmpps_ne_zmm:834; AVX512: # %bb.0:835; AVX512-NEXT: vcmpneqps (%rdi), %zmm0, %k0836; AVX512-NEXT: vpmovm2d %k0, %zmm0837; AVX512-NEXT: retq838 %1 = load <16 x float>, ptr %a0839 %2 = fcmp une <16 x float> %1, %a1840 %3 = sext <16 x i1> %2 to <16 x i32>841 ret <16 x i32> %3842}843 844define <16 x i32> @commute_cmpps_ord_zmm(ptr %a0, <16 x float> %a1) {845; SSE-LABEL: commute_cmpps_ord_zmm:846; SSE: # %bb.0:847; SSE-NEXT: cmpordps (%rdi), %xmm0848; SSE-NEXT: cmpordps 16(%rdi), %xmm1849; SSE-NEXT: cmpordps 32(%rdi), %xmm2850; SSE-NEXT: cmpordps 48(%rdi), %xmm3851; SSE-NEXT: retq852;853; AVX-LABEL: commute_cmpps_ord_zmm:854; AVX: # %bb.0:855; AVX-NEXT: vcmpordps (%rdi), %ymm0, %ymm0856; AVX-NEXT: vcmpordps 32(%rdi), %ymm1, %ymm1857; AVX-NEXT: retq858;859; AVX512-LABEL: commute_cmpps_ord_zmm:860; AVX512: # %bb.0:861; AVX512-NEXT: vcmpordps (%rdi), %zmm0, %k0862; AVX512-NEXT: vpmovm2d %k0, %zmm0863; AVX512-NEXT: retq864 %1 = load <16 x float>, ptr %a0865 %2 = fcmp ord <16 x float> %1, %a1866 %3 = sext <16 x i1> %2 to <16 x i32>867 ret <16 x i32> %3868}869 870define <16 x i32> @commute_cmpps_uno_zmm(ptr %a0, <16 x float> %a1) {871; SSE-LABEL: commute_cmpps_uno_zmm:872; SSE: # %bb.0:873; SSE-NEXT: cmpunordps (%rdi), %xmm0874; SSE-NEXT: cmpunordps 16(%rdi), %xmm1875; SSE-NEXT: cmpunordps 32(%rdi), %xmm2876; SSE-NEXT: cmpunordps 48(%rdi), %xmm3877; SSE-NEXT: retq878;879; AVX-LABEL: commute_cmpps_uno_zmm:880; AVX: # %bb.0:881; AVX-NEXT: vcmpunordps (%rdi), %ymm0, %ymm0882; AVX-NEXT: vcmpunordps 32(%rdi), %ymm1, %ymm1883; AVX-NEXT: retq884;885; AVX512-LABEL: commute_cmpps_uno_zmm:886; AVX512: # %bb.0:887; AVX512-NEXT: vcmpunordps (%rdi), %zmm0, %k0888; AVX512-NEXT: vpmovm2d %k0, %zmm0889; AVX512-NEXT: retq890 %1 = load <16 x float>, ptr %a0891 %2 = fcmp uno <16 x float> %1, %a1892 %3 = sext <16 x i1> %2 to <16 x i32>893 ret <16 x i32> %3894}895 896define <16 x i32> @commute_cmpps_ueq_zmm(ptr %a0, <16 x float> %a1) {897; SSE-LABEL: commute_cmpps_ueq_zmm:898; SSE: # %bb.0:899; SSE-NEXT: movaps (%rdi), %xmm4900; SSE-NEXT: movaps 16(%rdi), %xmm5901; SSE-NEXT: movaps 32(%rdi), %xmm6902; SSE-NEXT: movaps 48(%rdi), %xmm7903; SSE-NEXT: movaps %xmm4, %xmm8904; SSE-NEXT: cmpeqps %xmm0, %xmm8905; SSE-NEXT: cmpunordps %xmm4, %xmm0906; SSE-NEXT: orps %xmm8, %xmm0907; SSE-NEXT: movaps %xmm5, %xmm4908; SSE-NEXT: cmpeqps %xmm1, %xmm4909; SSE-NEXT: cmpunordps %xmm5, %xmm1910; SSE-NEXT: orps %xmm4, %xmm1911; SSE-NEXT: movaps %xmm6, %xmm4912; SSE-NEXT: cmpeqps %xmm2, %xmm4913; SSE-NEXT: cmpunordps %xmm6, %xmm2914; SSE-NEXT: orps %xmm4, %xmm2915; SSE-NEXT: movaps %xmm7, %xmm4916; SSE-NEXT: cmpeqps %xmm3, %xmm4917; SSE-NEXT: cmpunordps %xmm7, %xmm3918; SSE-NEXT: orps %xmm4, %xmm3919; SSE-NEXT: retq920;921; AVX-LABEL: commute_cmpps_ueq_zmm:922; AVX: # %bb.0:923; AVX-NEXT: vcmpeq_uqps (%rdi), %ymm0, %ymm0924; AVX-NEXT: vcmpeq_uqps 32(%rdi), %ymm1, %ymm1925; AVX-NEXT: retq926;927; AVX512-LABEL: commute_cmpps_ueq_zmm:928; AVX512: # %bb.0:929; AVX512-NEXT: vcmpeq_uqps (%rdi), %zmm0, %k0930; AVX512-NEXT: vpmovm2d %k0, %zmm0931; AVX512-NEXT: retq932 %1 = load <16 x float>, ptr %a0933 %2 = fcmp ueq <16 x float> %1, %a1934 %3 = sext <16 x i1> %2 to <16 x i32>935 ret <16 x i32> %3936}937 938define <16 x i32> @commute_cmpps_one_zmm(ptr %a0, <16 x float> %a1) {939; SSE-LABEL: commute_cmpps_one_zmm:940; SSE: # %bb.0:941; SSE-NEXT: movaps (%rdi), %xmm4942; SSE-NEXT: movaps 16(%rdi), %xmm5943; SSE-NEXT: movaps 32(%rdi), %xmm6944; SSE-NEXT: movaps 48(%rdi), %xmm7945; SSE-NEXT: movaps %xmm4, %xmm8946; SSE-NEXT: cmpneqps %xmm0, %xmm8947; SSE-NEXT: cmpordps %xmm4, %xmm0948; SSE-NEXT: andps %xmm8, %xmm0949; SSE-NEXT: movaps %xmm5, %xmm4950; SSE-NEXT: cmpneqps %xmm1, %xmm4951; SSE-NEXT: cmpordps %xmm5, %xmm1952; SSE-NEXT: andps %xmm4, %xmm1953; SSE-NEXT: movaps %xmm6, %xmm4954; SSE-NEXT: cmpneqps %xmm2, %xmm4955; SSE-NEXT: cmpordps %xmm6, %xmm2956; SSE-NEXT: andps %xmm4, %xmm2957; SSE-NEXT: movaps %xmm7, %xmm4958; SSE-NEXT: cmpneqps %xmm3, %xmm4959; SSE-NEXT: cmpordps %xmm7, %xmm3960; SSE-NEXT: andps %xmm4, %xmm3961; SSE-NEXT: retq962;963; AVX-LABEL: commute_cmpps_one_zmm:964; AVX: # %bb.0:965; AVX-NEXT: vcmpneq_oqps (%rdi), %ymm0, %ymm0966; AVX-NEXT: vcmpneq_oqps 32(%rdi), %ymm1, %ymm1967; AVX-NEXT: retq968;969; AVX512-LABEL: commute_cmpps_one_zmm:970; AVX512: # %bb.0:971; AVX512-NEXT: vcmpneq_oqps (%rdi), %zmm0, %k0972; AVX512-NEXT: vpmovm2d %k0, %zmm0973; AVX512-NEXT: retq974 %1 = load <16 x float>, ptr %a0975 %2 = fcmp one <16 x float> %1, %a1976 %3 = sext <16 x i1> %2 to <16 x i32>977 ret <16 x i32> %3978}979 980define <16 x i32> @commute_cmpps_lt_zmm(ptr %a0, <16 x float> %a1) {981; SSE-LABEL: commute_cmpps_lt_zmm:982; SSE: # %bb.0:983; SSE-NEXT: movaps (%rdi), %xmm4984; SSE-NEXT: movaps 16(%rdi), %xmm5985; SSE-NEXT: movaps 32(%rdi), %xmm6986; SSE-NEXT: movaps 48(%rdi), %xmm7987; SSE-NEXT: cmpltps %xmm0, %xmm4988; SSE-NEXT: cmpltps %xmm1, %xmm5989; SSE-NEXT: cmpltps %xmm2, %xmm6990; SSE-NEXT: cmpltps %xmm3, %xmm7991; SSE-NEXT: movaps %xmm4, %xmm0992; SSE-NEXT: movaps %xmm5, %xmm1993; SSE-NEXT: movaps %xmm6, %xmm2994; SSE-NEXT: movaps %xmm7, %xmm3995; SSE-NEXT: retq996;997; AVX-LABEL: commute_cmpps_lt_zmm:998; AVX: # %bb.0:999; AVX-NEXT: vmovaps (%rdi), %ymm21000; AVX-NEXT: vmovaps 32(%rdi), %ymm31001; AVX-NEXT: vcmpltps %ymm0, %ymm2, %ymm01002; AVX-NEXT: vcmpltps %ymm1, %ymm3, %ymm11003; AVX-NEXT: retq1004;1005; AVX512-LABEL: commute_cmpps_lt_zmm:1006; AVX512: # %bb.0:1007; AVX512-NEXT: vcmpgtps (%rdi), %zmm0, %k01008; AVX512-NEXT: vpmovm2d %k0, %zmm01009; AVX512-NEXT: retq1010 %1 = load <16 x float>, ptr %a01011 %2 = fcmp olt <16 x float> %1, %a11012 %3 = sext <16 x i1> %2 to <16 x i32>1013 ret <16 x i32> %31014}1015 1016define <16 x i32> @commute_cmpps_le_zmm(ptr %a0, <16 x float> %a1) {1017; SSE-LABEL: commute_cmpps_le_zmm:1018; SSE: # %bb.0:1019; SSE-NEXT: movaps (%rdi), %xmm41020; SSE-NEXT: movaps 16(%rdi), %xmm51021; SSE-NEXT: movaps 32(%rdi), %xmm61022; SSE-NEXT: movaps 48(%rdi), %xmm71023; SSE-NEXT: cmpleps %xmm0, %xmm41024; SSE-NEXT: cmpleps %xmm1, %xmm51025; SSE-NEXT: cmpleps %xmm2, %xmm61026; SSE-NEXT: cmpleps %xmm3, %xmm71027; SSE-NEXT: movaps %xmm4, %xmm01028; SSE-NEXT: movaps %xmm5, %xmm11029; SSE-NEXT: movaps %xmm6, %xmm21030; SSE-NEXT: movaps %xmm7, %xmm31031; SSE-NEXT: retq1032;1033; AVX-LABEL: commute_cmpps_le_zmm:1034; AVX: # %bb.0:1035; AVX-NEXT: vmovaps (%rdi), %ymm21036; AVX-NEXT: vmovaps 32(%rdi), %ymm31037; AVX-NEXT: vcmpleps %ymm0, %ymm2, %ymm01038; AVX-NEXT: vcmpleps %ymm1, %ymm3, %ymm11039; AVX-NEXT: retq1040;1041; AVX512-LABEL: commute_cmpps_le_zmm:1042; AVX512: # %bb.0:1043; AVX512-NEXT: vcmpgeps (%rdi), %zmm0, %k01044; AVX512-NEXT: vpmovm2d %k0, %zmm01045; AVX512-NEXT: retq1046 %1 = load <16 x float>, ptr %a01047 %2 = fcmp ole <16 x float> %1, %a11048 %3 = sext <16 x i1> %2 to <16 x i32>1049 ret <16 x i32> %31050}1051 1052define <8 x i64> @commute_cmppd_eq_zmmm(ptr %a0, <8 x double> %a1) {1053; SSE-LABEL: commute_cmppd_eq_zmmm:1054; SSE: # %bb.0:1055; SSE-NEXT: cmpeqpd (%rdi), %xmm01056; SSE-NEXT: cmpeqpd 16(%rdi), %xmm11057; SSE-NEXT: cmpeqpd 32(%rdi), %xmm21058; SSE-NEXT: cmpeqpd 48(%rdi), %xmm31059; SSE-NEXT: retq1060;1061; AVX-LABEL: commute_cmppd_eq_zmmm:1062; AVX: # %bb.0:1063; AVX-NEXT: vcmpeqpd (%rdi), %ymm0, %ymm01064; AVX-NEXT: vcmpeqpd 32(%rdi), %ymm1, %ymm11065; AVX-NEXT: retq1066;1067; AVX512-LABEL: commute_cmppd_eq_zmmm:1068; AVX512: # %bb.0:1069; AVX512-NEXT: vcmpeqpd (%rdi), %zmm0, %k01070; AVX512-NEXT: vpmovm2q %k0, %zmm01071; AVX512-NEXT: retq1072 %1 = load <8 x double>, ptr %a01073 %2 = fcmp oeq <8 x double> %1, %a11074 %3 = sext <8 x i1> %2 to <8 x i64>1075 ret <8 x i64> %31076}1077 1078define <8 x i64> @commute_cmppd_ne_zmmm(ptr %a0, <8 x double> %a1) {1079; SSE-LABEL: commute_cmppd_ne_zmmm:1080; SSE: # %bb.0:1081; SSE-NEXT: cmpneqpd (%rdi), %xmm01082; SSE-NEXT: cmpneqpd 16(%rdi), %xmm11083; SSE-NEXT: cmpneqpd 32(%rdi), %xmm21084; SSE-NEXT: cmpneqpd 48(%rdi), %xmm31085; SSE-NEXT: retq1086;1087; AVX-LABEL: commute_cmppd_ne_zmmm:1088; AVX: # %bb.0:1089; AVX-NEXT: vcmpneqpd (%rdi), %ymm0, %ymm01090; AVX-NEXT: vcmpneqpd 32(%rdi), %ymm1, %ymm11091; AVX-NEXT: retq1092;1093; AVX512-LABEL: commute_cmppd_ne_zmmm:1094; AVX512: # %bb.0:1095; AVX512-NEXT: vcmpneqpd (%rdi), %zmm0, %k01096; AVX512-NEXT: vpmovm2q %k0, %zmm01097; AVX512-NEXT: retq1098 %1 = load <8 x double>, ptr %a01099 %2 = fcmp une <8 x double> %1, %a11100 %3 = sext <8 x i1> %2 to <8 x i64>1101 ret <8 x i64> %31102}1103 1104define <8 x i64> @commute_cmppd_ord_zmmm(ptr %a0, <8 x double> %a1) {1105; SSE-LABEL: commute_cmppd_ord_zmmm:1106; SSE: # %bb.0:1107; SSE-NEXT: cmpordpd (%rdi), %xmm01108; SSE-NEXT: cmpordpd 16(%rdi), %xmm11109; SSE-NEXT: cmpordpd 32(%rdi), %xmm21110; SSE-NEXT: cmpordpd 48(%rdi), %xmm31111; SSE-NEXT: retq1112;1113; AVX-LABEL: commute_cmppd_ord_zmmm:1114; AVX: # %bb.0:1115; AVX-NEXT: vcmpordpd (%rdi), %ymm0, %ymm01116; AVX-NEXT: vcmpordpd 32(%rdi), %ymm1, %ymm11117; AVX-NEXT: retq1118;1119; AVX512-LABEL: commute_cmppd_ord_zmmm:1120; AVX512: # %bb.0:1121; AVX512-NEXT: vcmpordpd (%rdi), %zmm0, %k01122; AVX512-NEXT: vpmovm2q %k0, %zmm01123; AVX512-NEXT: retq1124 %1 = load <8 x double>, ptr %a01125 %2 = fcmp ord <8 x double> %1, %a11126 %3 = sext <8 x i1> %2 to <8 x i64>1127 ret <8 x i64> %31128}1129 1130define <8 x i64> @commute_cmppd_uno_zmmm(ptr %a0, <8 x double> %a1) {1131; SSE-LABEL: commute_cmppd_uno_zmmm:1132; SSE: # %bb.0:1133; SSE-NEXT: cmpunordpd (%rdi), %xmm01134; SSE-NEXT: cmpunordpd 16(%rdi), %xmm11135; SSE-NEXT: cmpunordpd 32(%rdi), %xmm21136; SSE-NEXT: cmpunordpd 48(%rdi), %xmm31137; SSE-NEXT: retq1138;1139; AVX-LABEL: commute_cmppd_uno_zmmm:1140; AVX: # %bb.0:1141; AVX-NEXT: vcmpunordpd (%rdi), %ymm0, %ymm01142; AVX-NEXT: vcmpunordpd 32(%rdi), %ymm1, %ymm11143; AVX-NEXT: retq1144;1145; AVX512-LABEL: commute_cmppd_uno_zmmm:1146; AVX512: # %bb.0:1147; AVX512-NEXT: vcmpunordpd (%rdi), %zmm0, %k01148; AVX512-NEXT: vpmovm2q %k0, %zmm01149; AVX512-NEXT: retq1150 %1 = load <8 x double>, ptr %a01151 %2 = fcmp uno <8 x double> %1, %a11152 %3 = sext <8 x i1> %2 to <8 x i64>1153 ret <8 x i64> %31154}1155 1156define <8 x i64> @commute_cmppd_ueq_zmmm(ptr %a0, <8 x double> %a1) {1157; SSE-LABEL: commute_cmppd_ueq_zmmm:1158; SSE: # %bb.0:1159; SSE-NEXT: movapd (%rdi), %xmm41160; SSE-NEXT: movapd 16(%rdi), %xmm51161; SSE-NEXT: movapd 32(%rdi), %xmm61162; SSE-NEXT: movapd 48(%rdi), %xmm71163; SSE-NEXT: movapd %xmm4, %xmm81164; SSE-NEXT: cmpeqpd %xmm0, %xmm81165; SSE-NEXT: cmpunordpd %xmm4, %xmm01166; SSE-NEXT: orpd %xmm8, %xmm01167; SSE-NEXT: movapd %xmm5, %xmm41168; SSE-NEXT: cmpeqpd %xmm1, %xmm41169; SSE-NEXT: cmpunordpd %xmm5, %xmm11170; SSE-NEXT: orpd %xmm4, %xmm11171; SSE-NEXT: movapd %xmm6, %xmm41172; SSE-NEXT: cmpeqpd %xmm2, %xmm41173; SSE-NEXT: cmpunordpd %xmm6, %xmm21174; SSE-NEXT: orpd %xmm4, %xmm21175; SSE-NEXT: movapd %xmm7, %xmm41176; SSE-NEXT: cmpeqpd %xmm3, %xmm41177; SSE-NEXT: cmpunordpd %xmm7, %xmm31178; SSE-NEXT: orpd %xmm4, %xmm31179; SSE-NEXT: retq1180;1181; AVX-LABEL: commute_cmppd_ueq_zmmm:1182; AVX: # %bb.0:1183; AVX-NEXT: vcmpeq_uqpd (%rdi), %ymm0, %ymm01184; AVX-NEXT: vcmpeq_uqpd 32(%rdi), %ymm1, %ymm11185; AVX-NEXT: retq1186;1187; AVX512-LABEL: commute_cmppd_ueq_zmmm:1188; AVX512: # %bb.0:1189; AVX512-NEXT: vcmpeq_uqpd (%rdi), %zmm0, %k01190; AVX512-NEXT: vpmovm2q %k0, %zmm01191; AVX512-NEXT: retq1192 %1 = load <8 x double>, ptr %a01193 %2 = fcmp ueq <8 x double> %1, %a11194 %3 = sext <8 x i1> %2 to <8 x i64>1195 ret <8 x i64> %31196}1197 1198define <8 x i64> @commute_cmppd_one_zmmm(ptr %a0, <8 x double> %a1) {1199; SSE-LABEL: commute_cmppd_one_zmmm:1200; SSE: # %bb.0:1201; SSE-NEXT: movapd (%rdi), %xmm41202; SSE-NEXT: movapd 16(%rdi), %xmm51203; SSE-NEXT: movapd 32(%rdi), %xmm61204; SSE-NEXT: movapd 48(%rdi), %xmm71205; SSE-NEXT: movapd %xmm4, %xmm81206; SSE-NEXT: cmpneqpd %xmm0, %xmm81207; SSE-NEXT: cmpordpd %xmm4, %xmm01208; SSE-NEXT: andpd %xmm8, %xmm01209; SSE-NEXT: movapd %xmm5, %xmm41210; SSE-NEXT: cmpneqpd %xmm1, %xmm41211; SSE-NEXT: cmpordpd %xmm5, %xmm11212; SSE-NEXT: andpd %xmm4, %xmm11213; SSE-NEXT: movapd %xmm6, %xmm41214; SSE-NEXT: cmpneqpd %xmm2, %xmm41215; SSE-NEXT: cmpordpd %xmm6, %xmm21216; SSE-NEXT: andpd %xmm4, %xmm21217; SSE-NEXT: movapd %xmm7, %xmm41218; SSE-NEXT: cmpneqpd %xmm3, %xmm41219; SSE-NEXT: cmpordpd %xmm7, %xmm31220; SSE-NEXT: andpd %xmm4, %xmm31221; SSE-NEXT: retq1222;1223; AVX-LABEL: commute_cmppd_one_zmmm:1224; AVX: # %bb.0:1225; AVX-NEXT: vcmpneq_oqpd (%rdi), %ymm0, %ymm01226; AVX-NEXT: vcmpneq_oqpd 32(%rdi), %ymm1, %ymm11227; AVX-NEXT: retq1228;1229; AVX512-LABEL: commute_cmppd_one_zmmm:1230; AVX512: # %bb.0:1231; AVX512-NEXT: vcmpneq_oqpd (%rdi), %zmm0, %k01232; AVX512-NEXT: vpmovm2q %k0, %zmm01233; AVX512-NEXT: retq1234 %1 = load <8 x double>, ptr %a01235 %2 = fcmp one <8 x double> %1, %a11236 %3 = sext <8 x i1> %2 to <8 x i64>1237 ret <8 x i64> %31238}1239 1240define <8 x i64> @commute_cmppd_lt_zmmm(ptr %a0, <8 x double> %a1) {1241; SSE-LABEL: commute_cmppd_lt_zmmm:1242; SSE: # %bb.0:1243; SSE-NEXT: movapd (%rdi), %xmm41244; SSE-NEXT: movapd 16(%rdi), %xmm51245; SSE-NEXT: movapd 32(%rdi), %xmm61246; SSE-NEXT: movapd 48(%rdi), %xmm71247; SSE-NEXT: cmpltpd %xmm0, %xmm41248; SSE-NEXT: cmpltpd %xmm1, %xmm51249; SSE-NEXT: cmpltpd %xmm2, %xmm61250; SSE-NEXT: cmpltpd %xmm3, %xmm71251; SSE-NEXT: movapd %xmm4, %xmm01252; SSE-NEXT: movapd %xmm5, %xmm11253; SSE-NEXT: movapd %xmm6, %xmm21254; SSE-NEXT: movapd %xmm7, %xmm31255; SSE-NEXT: retq1256;1257; AVX-LABEL: commute_cmppd_lt_zmmm:1258; AVX: # %bb.0:1259; AVX-NEXT: vmovapd (%rdi), %ymm21260; AVX-NEXT: vmovapd 32(%rdi), %ymm31261; AVX-NEXT: vcmpltpd %ymm0, %ymm2, %ymm01262; AVX-NEXT: vcmpltpd %ymm1, %ymm3, %ymm11263; AVX-NEXT: retq1264;1265; AVX512-LABEL: commute_cmppd_lt_zmmm:1266; AVX512: # %bb.0:1267; AVX512-NEXT: vcmpgtpd (%rdi), %zmm0, %k01268; AVX512-NEXT: vpmovm2q %k0, %zmm01269; AVX512-NEXT: retq1270 %1 = load <8 x double>, ptr %a01271 %2 = fcmp olt <8 x double> %1, %a11272 %3 = sext <8 x i1> %2 to <8 x i64>1273 ret <8 x i64> %31274}1275 1276define <8 x i64> @commute_cmppd_le_zmmm(ptr %a0, <8 x double> %a1) {1277; SSE-LABEL: commute_cmppd_le_zmmm:1278; SSE: # %bb.0:1279; SSE-NEXT: movapd (%rdi), %xmm41280; SSE-NEXT: movapd 16(%rdi), %xmm51281; SSE-NEXT: movapd 32(%rdi), %xmm61282; SSE-NEXT: movapd 48(%rdi), %xmm71283; SSE-NEXT: cmplepd %xmm0, %xmm41284; SSE-NEXT: cmplepd %xmm1, %xmm51285; SSE-NEXT: cmplepd %xmm2, %xmm61286; SSE-NEXT: cmplepd %xmm3, %xmm71287; SSE-NEXT: movapd %xmm4, %xmm01288; SSE-NEXT: movapd %xmm5, %xmm11289; SSE-NEXT: movapd %xmm6, %xmm21290; SSE-NEXT: movapd %xmm7, %xmm31291; SSE-NEXT: retq1292;1293; AVX-LABEL: commute_cmppd_le_zmmm:1294; AVX: # %bb.0:1295; AVX-NEXT: vmovapd (%rdi), %ymm21296; AVX-NEXT: vmovapd 32(%rdi), %ymm31297; AVX-NEXT: vcmplepd %ymm0, %ymm2, %ymm01298; AVX-NEXT: vcmplepd %ymm1, %ymm3, %ymm11299; AVX-NEXT: retq1300;1301; AVX512-LABEL: commute_cmppd_le_zmmm:1302; AVX512: # %bb.0:1303; AVX512-NEXT: vcmpgepd (%rdi), %zmm0, %k01304; AVX512-NEXT: vpmovm2q %k0, %zmm01305; AVX512-NEXT: retq1306 %1 = load <8 x double>, ptr %a01307 %2 = fcmp ole <8 x double> %1, %a11308 %3 = sext <8 x i1> %2 to <8 x i64>1309 ret <8 x i64> %31310}1311