brintos

brintos / llvm-project-archived public Read only

0
0
Text · 11.9 KiB · 26b023a Raw
332 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -disable-peephole -mtriple=i686-unknown-unknown -mattr=+avx,+xop | FileCheck %s --check-prefixes=CHECK,X863; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown-unknown -mattr=+avx,+xop | FileCheck %s --check-prefixes=CHECK,X644 5define <16 x i8> @commute_fold_vpcomb(ptr %a0, <16 x i8> %a1) {6; X86-LABEL: commute_fold_vpcomb:7; X86:       # %bb.0:8; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax9; X86-NEXT:    vpcomgtb (%eax), %xmm0, %xmm010; X86-NEXT:    retl11;12; X64-LABEL: commute_fold_vpcomb:13; X64:       # %bb.0:14; X64-NEXT:    vpcomgtb (%rdi), %xmm0, %xmm015; X64-NEXT:    retq16  %1 = load <16 x i8>, ptr %a017  %2 = call <16 x i8> @llvm.x86.xop.vpcomb(<16 x i8> %1, <16 x i8> %a1, i8 0) ; vpcomltb18  ret <16 x i8> %219}20declare <16 x i8> @llvm.x86.xop.vpcomb(<16 x i8>, <16 x i8>, i8) nounwind readnone21 22define <4 x i32> @commute_fold_vpcomd(ptr %a0, <4 x i32> %a1) {23; X86-LABEL: commute_fold_vpcomd:24; X86:       # %bb.0:25; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax26; X86-NEXT:    vpcomged (%eax), %xmm0, %xmm027; X86-NEXT:    retl28;29; X64-LABEL: commute_fold_vpcomd:30; X64:       # %bb.0:31; X64-NEXT:    vpcomged (%rdi), %xmm0, %xmm032; X64-NEXT:    retq33  %1 = load <4 x i32>, ptr %a034  %2 = call <4 x i32> @llvm.x86.xop.vpcomd(<4 x i32> %1, <4 x i32> %a1, i8 1) ; vpcomled35  ret <4 x i32> %236}37declare <4 x i32> @llvm.x86.xop.vpcomd(<4 x i32>, <4 x i32>, i8) nounwind readnone38 39define <2 x i64> @commute_fold_vpcomq(ptr %a0, <2 x i64> %a1) {40; X86-LABEL: commute_fold_vpcomq:41; X86:       # %bb.0:42; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax43; X86-NEXT:    vpcomltq (%eax), %xmm0, %xmm044; X86-NEXT:    retl45;46; X64-LABEL: commute_fold_vpcomq:47; X64:       # %bb.0:48; X64-NEXT:    vpcomltq (%rdi), %xmm0, %xmm049; X64-NEXT:    retq50  %1 = load <2 x i64>, ptr %a051  %2 = call <2 x i64> @llvm.x86.xop.vpcomq(<2 x i64> %1, <2 x i64> %a1, i8 2) ; vpcomgtq52  ret <2 x i64> %253}54declare <2 x i64> @llvm.x86.xop.vpcomq(<2 x i64>, <2 x i64>, i8) nounwind readnone55 56define <16 x i8> @commute_fold_vpcomub(ptr %a0, <16 x i8> %a1) {57; X86-LABEL: commute_fold_vpcomub:58; X86:       # %bb.0:59; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax60; X86-NEXT:    vpcomleub (%eax), %xmm0, %xmm061; X86-NEXT:    retl62;63; X64-LABEL: commute_fold_vpcomub:64; X64:       # %bb.0:65; X64-NEXT:    vpcomleub (%rdi), %xmm0, %xmm066; X64-NEXT:    retq67  %1 = load <16 x i8>, ptr %a068  %2 = call <16 x i8> @llvm.x86.xop.vpcomub(<16 x i8> %1, <16 x i8> %a1, i8 3) ; vpcomgeub69  ret <16 x i8> %270}71declare <16 x i8> @llvm.x86.xop.vpcomub(<16 x i8>, <16 x i8>, i8) nounwind readnone72 73define <4 x i32> @commute_fold_vpcomud(ptr %a0, <4 x i32> %a1) {74; X86-LABEL: commute_fold_vpcomud:75; X86:       # %bb.0:76; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax77; X86-NEXT:    vpcomeqd (%eax), %xmm0, %xmm078; X86-NEXT:    retl79;80; X64-LABEL: commute_fold_vpcomud:81; X64:       # %bb.0:82; X64-NEXT:    vpcomeqd (%rdi), %xmm0, %xmm083; X64-NEXT:    retq84  %1 = load <4 x i32>, ptr %a085  %2 = call <4 x i32> @llvm.x86.xop.vpcomud(<4 x i32> %1, <4 x i32> %a1, i8 4) ; vpcomequd86  ret <4 x i32> %287}88declare <4 x i32> @llvm.x86.xop.vpcomud(<4 x i32>, <4 x i32>, i8) nounwind readnone89 90define <2 x i64> @commute_fold_vpcomuq(ptr %a0, <2 x i64> %a1) {91; X86-LABEL: commute_fold_vpcomuq:92; X86:       # %bb.0:93; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax94; X86-NEXT:    vpcomneqq (%eax), %xmm0, %xmm095; X86-NEXT:    retl96;97; X64-LABEL: commute_fold_vpcomuq:98; X64:       # %bb.0:99; X64-NEXT:    vpcomneqq (%rdi), %xmm0, %xmm0100; X64-NEXT:    retq101  %1 = load <2 x i64>, ptr %a0102  %2 = call <2 x i64> @llvm.x86.xop.vpcomuq(<2 x i64> %1, <2 x i64> %a1, i8 5) ; vpcomnequq103  ret <2 x i64> %2104}105declare <2 x i64> @llvm.x86.xop.vpcomuq(<2 x i64>, <2 x i64>, i8) nounwind readnone106 107define <8 x i16> @commute_fold_vpcomuw(ptr %a0, <8 x i16> %a1) {108; CHECK-LABEL: commute_fold_vpcomuw:109; CHECK:       # %bb.0:110; CHECK-NEXT:    vxorps %xmm0, %xmm0, %xmm0111; CHECK-NEXT:    ret{{[l|q]}}112  %1 = load <8 x i16>, ptr %a0113  %2 = call <8 x i16> @llvm.x86.xop.vpcomuw(<8 x i16> %1, <8 x i16> %a1, i8 6) ; vpcomfalseuw114  ret <8 x i16> %2115}116declare <8 x i16> @llvm.x86.xop.vpcomuw(<8 x i16>, <8 x i16>, i8) nounwind readnone117 118define <8 x i16> @commute_fold_vpcomw(ptr %a0, <8 x i16> %a1) {119; CHECK-LABEL: commute_fold_vpcomw:120; CHECK:       # %bb.0:121; CHECK-NEXT:    vpcmpeqd %xmm0, %xmm0, %xmm0122; CHECK-NEXT:    ret{{[l|q]}}123  %1 = load <8 x i16>, ptr %a0124  %2 = call <8 x i16> @llvm.x86.xop.vpcomw(<8 x i16> %1, <8 x i16> %a1, i8 7) ; vpcomtruew125  ret <8 x i16> %2126}127declare <8 x i16> @llvm.x86.xop.vpcomw(<8 x i16>, <8 x i16>, i8) nounwind readnone128 129define <4 x i32> @commute_fold_vpmacsdd(ptr %a0, <4 x i32> %a1, <4 x i32> %a2) {130; X86-LABEL: commute_fold_vpmacsdd:131; X86:       # %bb.0:132; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax133; X86-NEXT:    vpmacsdd %xmm1, (%eax), %xmm0, %xmm0134; X86-NEXT:    retl135;136; X64-LABEL: commute_fold_vpmacsdd:137; X64:       # %bb.0:138; X64-NEXT:    vpmacsdd %xmm1, (%rdi), %xmm0, %xmm0139; X64-NEXT:    retq140  %1 = load <4 x i32>, ptr %a0141  %2 = call <4 x i32> @llvm.x86.xop.vpmacsdd(<4 x i32> %1, <4 x i32> %a1, <4 x i32> %a2)142  ret <4 x i32> %2143}144declare <4 x i32> @llvm.x86.xop.vpmacsdd(<4 x i32>, <4 x i32>, <4 x i32>) nounwind readnone145 146define <2 x i64> @commute_fold_vpmacsdqh(ptr %a0, <4 x i32> %a1, <2 x i64> %a2) {147; X86-LABEL: commute_fold_vpmacsdqh:148; X86:       # %bb.0:149; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax150; X86-NEXT:    vpmacsdqh %xmm1, (%eax), %xmm0, %xmm0151; X86-NEXT:    retl152;153; X64-LABEL: commute_fold_vpmacsdqh:154; X64:       # %bb.0:155; X64-NEXT:    vpmacsdqh %xmm1, (%rdi), %xmm0, %xmm0156; X64-NEXT:    retq157  %1 = load <4 x i32>, ptr %a0158  %2 = call <2 x i64> @llvm.x86.xop.vpmacsdqh(<4 x i32> %1, <4 x i32> %a1, <2 x i64> %a2)159  ret <2 x i64> %2160}161declare <2 x i64> @llvm.x86.xop.vpmacsdqh(<4 x i32>, <4 x i32>, <2 x i64>) nounwind readnone162 163define <2 x i64> @commute_fold_vpmacsdql(ptr %a0, <4 x i32> %a1, <2 x i64> %a2) {164; X86-LABEL: commute_fold_vpmacsdql:165; X86:       # %bb.0:166; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax167; X86-NEXT:    vpmacsdql %xmm1, (%eax), %xmm0, %xmm0168; X86-NEXT:    retl169;170; X64-LABEL: commute_fold_vpmacsdql:171; X64:       # %bb.0:172; X64-NEXT:    vpmacsdql %xmm1, (%rdi), %xmm0, %xmm0173; X64-NEXT:    retq174  %1 = load <4 x i32>, ptr %a0175  %2 = call <2 x i64> @llvm.x86.xop.vpmacsdql(<4 x i32> %1, <4 x i32> %a1, <2 x i64> %a2)176  ret <2 x i64> %2177}178declare <2 x i64> @llvm.x86.xop.vpmacsdql(<4 x i32>, <4 x i32>, <2 x i64>) nounwind readnone179 180define <4 x i32> @commute_fold_vpmacssdd(ptr %a0, <4 x i32> %a1, <4 x i32> %a2) {181; X86-LABEL: commute_fold_vpmacssdd:182; X86:       # %bb.0:183; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax184; X86-NEXT:    vpmacssdd %xmm1, (%eax), %xmm0, %xmm0185; X86-NEXT:    retl186;187; X64-LABEL: commute_fold_vpmacssdd:188; X64:       # %bb.0:189; X64-NEXT:    vpmacssdd %xmm1, (%rdi), %xmm0, %xmm0190; X64-NEXT:    retq191  %1 = load <4 x i32>, ptr %a0192  %2 = call <4 x i32> @llvm.x86.xop.vpmacssdd(<4 x i32> %1, <4 x i32> %a1, <4 x i32> %a2)193  ret <4 x i32> %2194}195declare <4 x i32> @llvm.x86.xop.vpmacssdd(<4 x i32>, <4 x i32>, <4 x i32>) nounwind readnone196 197define <2 x i64> @commute_fold_vpmacssdqh(ptr %a0, <4 x i32> %a1, <2 x i64> %a2) {198; X86-LABEL: commute_fold_vpmacssdqh:199; X86:       # %bb.0:200; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax201; X86-NEXT:    vpmacssdqh %xmm1, (%eax), %xmm0, %xmm0202; X86-NEXT:    retl203;204; X64-LABEL: commute_fold_vpmacssdqh:205; X64:       # %bb.0:206; X64-NEXT:    vpmacssdqh %xmm1, (%rdi), %xmm0, %xmm0207; X64-NEXT:    retq208  %1 = load <4 x i32>, ptr %a0209  %2 = call <2 x i64> @llvm.x86.xop.vpmacssdqh(<4 x i32> %1, <4 x i32> %a1, <2 x i64> %a2)210  ret <2 x i64> %2211}212declare <2 x i64> @llvm.x86.xop.vpmacssdqh(<4 x i32>, <4 x i32>, <2 x i64>) nounwind readnone213 214define <2 x i64> @commute_fold_vpmacssdql(ptr %a0, <4 x i32> %a1, <2 x i64> %a2) {215; X86-LABEL: commute_fold_vpmacssdql:216; X86:       # %bb.0:217; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax218; X86-NEXT:    vpmacssdql %xmm1, (%eax), %xmm0, %xmm0219; X86-NEXT:    retl220;221; X64-LABEL: commute_fold_vpmacssdql:222; X64:       # %bb.0:223; X64-NEXT:    vpmacssdql %xmm1, (%rdi), %xmm0, %xmm0224; X64-NEXT:    retq225  %1 = load <4 x i32>, ptr %a0226  %2 = call <2 x i64> @llvm.x86.xop.vpmacssdql(<4 x i32> %1, <4 x i32> %a1, <2 x i64> %a2)227  ret <2 x i64> %2228}229declare <2 x i64> @llvm.x86.xop.vpmacssdql(<4 x i32>, <4 x i32>, <2 x i64>) nounwind readnone230 231define <4 x i32> @commute_fold_vpmacsswd(ptr %a0, <8 x i16> %a1, <4 x i32> %a2) {232; X86-LABEL: commute_fold_vpmacsswd:233; X86:       # %bb.0:234; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax235; X86-NEXT:    vpmacsswd %xmm1, (%eax), %xmm0, %xmm0236; X86-NEXT:    retl237;238; X64-LABEL: commute_fold_vpmacsswd:239; X64:       # %bb.0:240; X64-NEXT:    vpmacsswd %xmm1, (%rdi), %xmm0, %xmm0241; X64-NEXT:    retq242  %1 = load <8 x i16>, ptr %a0243  %2 = call <4 x i32> @llvm.x86.xop.vpmacsswd(<8 x i16> %1, <8 x i16> %a1, <4 x i32> %a2)244  ret <4 x i32> %2245}246declare <4 x i32> @llvm.x86.xop.vpmacsswd(<8 x i16>, <8 x i16>, <4 x i32>) nounwind readnone247 248define <8 x i16> @commute_fold_vpmacssww(ptr %a0, <8 x i16> %a1, <8 x i16> %a2) {249; X86-LABEL: commute_fold_vpmacssww:250; X86:       # %bb.0:251; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax252; X86-NEXT:    vpmacssww %xmm1, (%eax), %xmm0, %xmm0253; X86-NEXT:    retl254;255; X64-LABEL: commute_fold_vpmacssww:256; X64:       # %bb.0:257; X64-NEXT:    vpmacssww %xmm1, (%rdi), %xmm0, %xmm0258; X64-NEXT:    retq259  %1 = load <8 x i16>, ptr %a0260  %2 = call <8 x i16> @llvm.x86.xop.vpmacssww(<8 x i16> %1, <8 x i16> %a1, <8 x i16> %a2)261  ret <8 x i16> %2262}263declare <8 x i16> @llvm.x86.xop.vpmacssww(<8 x i16>, <8 x i16>, <8 x i16>) nounwind readnone264 265define <4 x i32> @commute_fold_vpmacswd(ptr %a0, <8 x i16> %a1, <4 x i32> %a2) {266; X86-LABEL: commute_fold_vpmacswd:267; X86:       # %bb.0:268; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax269; X86-NEXT:    vpmacswd %xmm1, (%eax), %xmm0, %xmm0270; X86-NEXT:    retl271;272; X64-LABEL: commute_fold_vpmacswd:273; X64:       # %bb.0:274; X64-NEXT:    vpmacswd %xmm1, (%rdi), %xmm0, %xmm0275; X64-NEXT:    retq276  %1 = load <8 x i16>, ptr %a0277  %2 = call <4 x i32> @llvm.x86.xop.vpmacswd(<8 x i16> %1, <8 x i16> %a1, <4 x i32> %a2)278  ret <4 x i32> %2279}280declare <4 x i32> @llvm.x86.xop.vpmacswd(<8 x i16>, <8 x i16>, <4 x i32>) nounwind readnone281 282define <8 x i16> @commute_fold_vpmacsww(ptr %a0, <8 x i16> %a1, <8 x i16> %a2) {283; X86-LABEL: commute_fold_vpmacsww:284; X86:       # %bb.0:285; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax286; X86-NEXT:    vpmacsww %xmm1, (%eax), %xmm0, %xmm0287; X86-NEXT:    retl288;289; X64-LABEL: commute_fold_vpmacsww:290; X64:       # %bb.0:291; X64-NEXT:    vpmacsww %xmm1, (%rdi), %xmm0, %xmm0292; X64-NEXT:    retq293  %1 = load <8 x i16>, ptr %a0294  %2 = call <8 x i16> @llvm.x86.xop.vpmacsww(<8 x i16> %1, <8 x i16> %a1, <8 x i16> %a2)295  ret <8 x i16> %2296}297declare <8 x i16> @llvm.x86.xop.vpmacsww(<8 x i16>, <8 x i16>, <8 x i16>) nounwind readnone298 299define <4 x i32> @commute_fold_vpmadcsswd(ptr %a0, <8 x i16> %a1, <4 x i32> %a2) {300; X86-LABEL: commute_fold_vpmadcsswd:301; X86:       # %bb.0:302; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax303; X86-NEXT:    vpmadcsswd %xmm1, (%eax), %xmm0, %xmm0304; X86-NEXT:    retl305;306; X64-LABEL: commute_fold_vpmadcsswd:307; X64:       # %bb.0:308; X64-NEXT:    vpmadcsswd %xmm1, (%rdi), %xmm0, %xmm0309; X64-NEXT:    retq310  %1 = load <8 x i16>, ptr %a0311  %2 = call <4 x i32> @llvm.x86.xop.vpmadcsswd(<8 x i16> %1, <8 x i16> %a1, <4 x i32> %a2)312  ret <4 x i32> %2313}314declare <4 x i32> @llvm.x86.xop.vpmadcsswd(<8 x i16>, <8 x i16>, <4 x i32>) nounwind readnone315 316define <4 x i32> @commute_fold_vpmadcswd(ptr %a0, <8 x i16> %a1, <4 x i32> %a2) {317; X86-LABEL: commute_fold_vpmadcswd:318; X86:       # %bb.0:319; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax320; X86-NEXT:    vpmadcswd %xmm1, (%eax), %xmm0, %xmm0321; X86-NEXT:    retl322;323; X64-LABEL: commute_fold_vpmadcswd:324; X64:       # %bb.0:325; X64-NEXT:    vpmadcswd %xmm1, (%rdi), %xmm0, %xmm0326; X64-NEXT:    retq327  %1 = load <8 x i16>, ptr %a0328  %2 = call <4 x i32> @llvm.x86.xop.vpmadcswd(<8 x i16> %1, <8 x i16> %a1, <4 x i32> %a2)329  ret <4 x i32> %2330}331declare <4 x i32> @llvm.x86.xop.vpmadcswd(<8 x i16>, <8 x i16>, <4 x i32>) nounwind readnone332