brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.2 KiB · 9db2f6b Raw
202 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=SSE23; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=AVX,AVX24; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefixes=AVX,AVX5125; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bw | FileCheck %s --check-prefixes=AVX,AVX5126 7define <4 x i32> @test1(<8 x i32> %v) {8; SSE2-LABEL: test1:9; SSE2:       # %bb.0:10; SSE2-NEXT:    retq11;12; AVX-LABEL: test1:13; AVX:       # %bb.0:14; AVX-NEXT:    # kill: def $xmm0 killed $xmm0 killed $ymm015; AVX-NEXT:    vzeroupper16; AVX-NEXT:    retq17  %x = sext <8 x i32> %v to <8 x i64>18  %s = shufflevector <8 x i64> %x, <8 x i64> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>19  %t = trunc <4 x i64> %s to <4 x i32>20  ret <4 x i32> %t21}22 23define <4 x i32> @test2(<8 x i32> %v) {24; SSE2-LABEL: test2:25; SSE2:       # %bb.0:26; SSE2-NEXT:    movaps %xmm1, %xmm027; SSE2-NEXT:    retq28;29; AVX-LABEL: test2:30; AVX:       # %bb.0:31; AVX-NEXT:    vextractf128 $1, %ymm0, %xmm032; AVX-NEXT:    vzeroupper33; AVX-NEXT:    retq34  %x = sext <8 x i32> %v to <8 x i64>35  %s = shufflevector <8 x i64> %x, <8 x i64> undef, <4 x i32> <i32 4, i32 5, i32 6, i32 7>36  %t = trunc <4 x i64> %s to <4 x i32>37  ret <4 x i32> %t38}39 40define <2 x i32> @test3(<8 x i32> %v) {41; SSE2-LABEL: test3:42; SSE2:       # %bb.0:43; SSE2-NEXT:    movaps %xmm1, %xmm044; SSE2-NEXT:    retq45;46; AVX-LABEL: test3:47; AVX:       # %bb.0:48; AVX-NEXT:    vextractf128 $1, %ymm0, %xmm049; AVX-NEXT:    vzeroupper50; AVX-NEXT:    retq51  %x = sext <8 x i32> %v to <8 x i64>52  %s = shufflevector <8 x i64> %x, <8 x i64> undef, <2 x i32> <i32 4, i32 5>53  %t = trunc <2 x i64> %s to <2 x i32>54  ret <2 x i32> %t55}56 57define <2 x i32> @test4(<8 x i32> %v) {58; SSE2-LABEL: test4:59; SSE2:       # %bb.0:60; SSE2-NEXT:    retq61;62; AVX-LABEL: test4:63; AVX:       # %bb.0:64; AVX-NEXT:    # kill: def $xmm0 killed $xmm0 killed $ymm065; AVX-NEXT:    vzeroupper66; AVX-NEXT:    retq67  %x = sext <8 x i32> %v to <8 x i64>68  %s = shufflevector <8 x i64> %x, <8 x i64> undef, <2 x i32> <i32 0, i32 1>69  %t = trunc <2 x i64> %s to <2 x i32>70  ret <2 x i32> %t71}72 73define <2 x i32> @test5(<8 x i32> %v) {74; SSE2-LABEL: test5:75; SSE2:       # %bb.0:76; SSE2-NEXT:    pshufd {{.*#+}} xmm0 = xmm0[3,3,3,3]77; SSE2-NEXT:    punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]78; SSE2-NEXT:    retq79;80; AVX2-LABEL: test5:81; AVX2:       # %bb.0:82; AVX2-NEXT:    vmovaps {{.*#+}} xmm1 = [3,4,4,4]83; AVX2-NEXT:    vpermps %ymm0, %ymm1, %ymm084; AVX2-NEXT:    # kill: def $xmm0 killed $xmm0 killed $ymm085; AVX2-NEXT:    vzeroupper86; AVX2-NEXT:    retq87;88; AVX512-LABEL: test5:89; AVX512:       # %bb.0:90; AVX512-NEXT:    vpmovsxdq %ymm0, %zmm091; AVX512-NEXT:    vextracti128 $1, %ymm0, %xmm192; AVX512-NEXT:    vpextrq $1, %xmm1, %rax93; AVX512-NEXT:    vextracti32x4 $2, %zmm0, %xmm094; AVX512-NEXT:    vmovq %xmm0, %rcx95; AVX512-NEXT:    vmovd %eax, %xmm096; AVX512-NEXT:    vpinsrd $1, %ecx, %xmm0, %xmm097; AVX512-NEXT:    vzeroupper98; AVX512-NEXT:    retq99  %x = sext <8 x i32> %v to <8 x i64>100  %s = shufflevector <8 x i64> %x, <8 x i64> undef, <2 x i32> <i32 3, i32 4>101  %t = trunc <2 x i64> %s to <2 x i32>102  ret <2 x i32> %t103}104 105define <4 x i32> @test6(<8 x i32> %v) {106; SSE2-LABEL: test6:107; SSE2:       # %bb.0:108; SSE2-NEXT:    retq109;110; AVX-LABEL: test6:111; AVX:       # %bb.0:112; AVX-NEXT:    # kill: def $xmm0 killed $xmm0 killed $ymm0113; AVX-NEXT:    vzeroupper114; AVX-NEXT:    retq115  %x = zext <8 x i32> %v to <8 x i64>116  %s = shufflevector <8 x i64> %x, <8 x i64> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>117  %t = trunc <4 x i64> %s to <4 x i32>118  ret <4 x i32> %t119}120 121define <4 x i32> @test7(<8 x i32> %v) {122; SSE2-LABEL: test7:123; SSE2:       # %bb.0:124; SSE2-NEXT:    movaps %xmm1, %xmm0125; SSE2-NEXT:    retq126;127; AVX-LABEL: test7:128; AVX:       # %bb.0:129; AVX-NEXT:    vextractf128 $1, %ymm0, %xmm0130; AVX-NEXT:    vzeroupper131; AVX-NEXT:    retq132  %x = zext <8 x i32> %v to <8 x i64>133  %s = shufflevector <8 x i64> %x, <8 x i64> undef, <4 x i32> <i32 4, i32 5, i32 6, i32 7>134  %t = trunc <4 x i64> %s to <4 x i32>135  ret <4 x i32> %t136}137 138define <2 x i32> @test8(<8 x i32> %v) {139; SSE2-LABEL: test8:140; SSE2:       # %bb.0:141; SSE2-NEXT:    movaps %xmm1, %xmm0142; SSE2-NEXT:    retq143;144; AVX-LABEL: test8:145; AVX:       # %bb.0:146; AVX-NEXT:    vextractf128 $1, %ymm0, %xmm0147; AVX-NEXT:    vzeroupper148; AVX-NEXT:    retq149  %x = zext <8 x i32> %v to <8 x i64>150  %s = shufflevector <8 x i64> %x, <8 x i64> undef, <2 x i32> <i32 4, i32 5>151  %t = trunc <2 x i64> %s to <2 x i32>152  ret <2 x i32> %t153}154 155define <2 x i32> @test9(<8 x i32> %v) {156; SSE2-LABEL: test9:157; SSE2:       # %bb.0:158; SSE2-NEXT:    retq159;160; AVX-LABEL: test9:161; AVX:       # %bb.0:162; AVX-NEXT:    # kill: def $xmm0 killed $xmm0 killed $ymm0163; AVX-NEXT:    vzeroupper164; AVX-NEXT:    retq165  %x = zext <8 x i32> %v to <8 x i64>166  %s = shufflevector <8 x i64> %x, <8 x i64> undef, <2 x i32> <i32 0, i32 1>167  %t = trunc <2 x i64> %s to <2 x i32>168  ret <2 x i32> %t169}170 171define <2 x i32> @test10(<8 x i32> %v) {172; SSE2-LABEL: test10:173; SSE2:       # %bb.0:174; SSE2-NEXT:    pshufd {{.*#+}} xmm0 = xmm0[3,3,3,3]175; SSE2-NEXT:    punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]176; SSE2-NEXT:    retq177;178; AVX2-LABEL: test10:179; AVX2:       # %bb.0:180; AVX2-NEXT:    vmovaps {{.*#+}} xmm1 = [3,4,4,4]181; AVX2-NEXT:    vpermps %ymm0, %ymm1, %ymm0182; AVX2-NEXT:    # kill: def $xmm0 killed $xmm0 killed $ymm0183; AVX2-NEXT:    vzeroupper184; AVX2-NEXT:    retq185;186; AVX512-LABEL: test10:187; AVX512:       # %bb.0:188; AVX512-NEXT:    vpmovzxdq {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero189; AVX512-NEXT:    vextracti128 $1, %ymm0, %xmm1190; AVX512-NEXT:    vpextrq $1, %xmm1, %rax191; AVX512-NEXT:    vextracti32x4 $2, %zmm0, %xmm0192; AVX512-NEXT:    vmovq %xmm0, %rcx193; AVX512-NEXT:    vmovd %eax, %xmm0194; AVX512-NEXT:    vpinsrd $1, %ecx, %xmm0, %xmm0195; AVX512-NEXT:    vzeroupper196; AVX512-NEXT:    retq197  %x = zext <8 x i32> %v to <8 x i64>198  %s = shufflevector <8 x i64> %x, <8 x i64> undef, <2 x i32> <i32 3, i32 4>199  %t = trunc <2 x i64> %s to <2 x i32>200  ret <2 x i32> %t201}202