1*9880d681SAndroid Build Coastguard Worker; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+ssse3,+sse4a | FileCheck %s --check-prefix=ALL --check-prefix=BTVER1 3*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx,+sse4a | FileCheck %s --check-prefix=ALL --check-prefix=BTVER2 4*9880d681SAndroid Build Coastguard Worker 5*9880d681SAndroid Build Coastguard Worker; 6*9880d681SAndroid Build Coastguard Worker; EXTRQI 7*9880d681SAndroid Build Coastguard Worker; 8*9880d681SAndroid Build Coastguard Worker 9*9880d681SAndroid Build Coastguard Worker; A length of zero is equivalent to a bit length of 64. 10*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @extrqi_len0_idx0(<2 x i64> %a) { 11*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: extrqi_len0_idx0: 12*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 13*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: extrq {{.*#+}} xmm0 = xmm0[0,1,2,3,4,5,6,7,u,u,u,u,u,u,u,u] 14*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 15*9880d681SAndroid Build Coastguard Worker %1 = tail call <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64> %a, i8 0, i8 0) 16*9880d681SAndroid Build Coastguard Worker ret <2 x i64> %1 17*9880d681SAndroid Build Coastguard Worker} 18*9880d681SAndroid Build Coastguard Worker 19*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @extrqi_len8_idx16(<2 x i64> %a) { 20*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: extrqi_len8_idx16: 21*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 22*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: extrq {{.*#+}} xmm0 = xmm0[2],zero,zero,zero,zero,zero,zero,zero,xmm0[u,u,u,u,u,u,u,u] 23*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 24*9880d681SAndroid Build Coastguard Worker %1 = tail call <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64> %a, i8 8, i8 16) 25*9880d681SAndroid Build Coastguard Worker ret <2 x i64> %1 26*9880d681SAndroid Build Coastguard Worker} 27*9880d681SAndroid Build Coastguard Worker 28*9880d681SAndroid Build Coastguard Worker; If the length + index exceeds the bottom 64 bits the result is undefined. 29*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @extrqi_len32_idx48(<2 x i64> %a) { 30*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: extrqi_len32_idx48: 31*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 32*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: extrq {{.*#+}} xmm0 = xmm0[u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u] 33*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 34*9880d681SAndroid Build Coastguard Worker %1 = tail call <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64> %a, i8 32, i8 48) 35*9880d681SAndroid Build Coastguard Worker ret <2 x i64> %1 36*9880d681SAndroid Build Coastguard Worker} 37*9880d681SAndroid Build Coastguard Worker 38*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @shuf_0zzzuuuuuuuuuuuu(<16 x i8> %a0) { 39*9880d681SAndroid Build Coastguard Worker; BTVER1-LABEL: shuf_0zzzuuuuuuuuuuuu: 40*9880d681SAndroid Build Coastguard Worker; BTVER1: # BB#0: 41*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: extrq {{.*#+}} xmm0 = xmm0[0],zero,zero,zero,zero,zero,zero,zero,xmm0[u,u,u,u,u,u,u,u] 42*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: retq 43*9880d681SAndroid Build Coastguard Worker; 44*9880d681SAndroid Build Coastguard Worker; BTVER2-LABEL: shuf_0zzzuuuuuuuuuuuu: 45*9880d681SAndroid Build Coastguard Worker; BTVER2: # BB#0: 46*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: vpmovzxbq {{.*#+}} xmm0 = xmm0[0],zero,zero,zero,zero,zero,zero,zero,xmm0[1],zero,zero,zero,zero,zero,zero,zero 47*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: retq 48*9880d681SAndroid Build Coastguard Worker %s = shufflevector <16 x i8> %a0, <16 x i8> zeroinitializer, <16 x i32> <i32 0, i32 16, i32 16, i32 16, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef> 49*9880d681SAndroid Build Coastguard Worker ret <16 x i8> %s 50*9880d681SAndroid Build Coastguard Worker} 51*9880d681SAndroid Build Coastguard Worker 52*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @shuf_0zzzzzzz1zzzzzzz(<16 x i8> %a0) { 53*9880d681SAndroid Build Coastguard Worker; BTVER1-LABEL: shuf_0zzzzzzz1zzzzzzz: 54*9880d681SAndroid Build Coastguard Worker; BTVER1: # BB#0: 55*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: movaps %xmm0, %xmm1 56*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: extrq {{.*#+}} xmm1 = xmm1[1],zero,zero,zero,zero,zero,zero,zero,xmm1[u,u,u,u,u,u,u,u] 57*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: extrq {{.*#+}} xmm0 = xmm0[0],zero,zero,zero,zero,zero,zero,zero,xmm0[u,u,u,u,u,u,u,u] 58*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0] 59*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: retq 60*9880d681SAndroid Build Coastguard Worker; 61*9880d681SAndroid Build Coastguard Worker; BTVER2-LABEL: shuf_0zzzzzzz1zzzzzzz: 62*9880d681SAndroid Build Coastguard Worker; BTVER2: # BB#0: 63*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: vpmovzxbq {{.*#+}} xmm0 = xmm0[0],zero,zero,zero,zero,zero,zero,zero,xmm0[1],zero,zero,zero,zero,zero,zero,zero 64*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: retq 65*9880d681SAndroid Build Coastguard Worker %s = shufflevector <16 x i8> %a0, <16 x i8> zeroinitializer, <16 x i32> <i32 0, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 1, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16> 66*9880d681SAndroid Build Coastguard Worker ret <16 x i8> %s 67*9880d681SAndroid Build Coastguard Worker} 68*9880d681SAndroid Build Coastguard Worker 69*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @shuf_2zzzzzzz3zzzzzzz(<16 x i8> %a0) { 70*9880d681SAndroid Build Coastguard Worker; BTVER1-LABEL: shuf_2zzzzzzz3zzzzzzz: 71*9880d681SAndroid Build Coastguard Worker; BTVER1: # BB#0: 72*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: movaps %xmm0, %xmm1 73*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: extrq {{.*#+}} xmm1 = xmm1[3],zero,zero,zero,zero,zero,zero,zero,xmm1[u,u,u,u,u,u,u,u] 74*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: extrq {{.*#+}} xmm0 = xmm0[2],zero,zero,zero,zero,zero,zero,zero,xmm0[u,u,u,u,u,u,u,u] 75*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0] 76*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: retq 77*9880d681SAndroid Build Coastguard Worker; 78*9880d681SAndroid Build Coastguard Worker; BTVER2-LABEL: shuf_2zzzzzzz3zzzzzzz: 79*9880d681SAndroid Build Coastguard Worker; BTVER2: # BB#0: 80*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: vpsrld $16, %xmm0, %xmm0 81*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: vpmovzxbq {{.*#+}} xmm0 = xmm0[0],zero,zero,zero,zero,zero,zero,zero,xmm0[1],zero,zero,zero,zero,zero,zero,zero 82*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: retq 83*9880d681SAndroid Build Coastguard Worker %s = shufflevector <16 x i8> %a0, <16 x i8> zeroinitializer, <16 x i32> <i32 2, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 3, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16> 84*9880d681SAndroid Build Coastguard Worker ret <16 x i8> %s 85*9880d681SAndroid Build Coastguard Worker} 86*9880d681SAndroid Build Coastguard Worker 87*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @shuf_01zzuuuuuuuuuuuu(<16 x i8> %a0) { 88*9880d681SAndroid Build Coastguard Worker; BTVER1-LABEL: shuf_01zzuuuuuuuuuuuu: 89*9880d681SAndroid Build Coastguard Worker; BTVER1: # BB#0: 90*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: extrq {{.*#+}} xmm0 = xmm0[0,1],zero,zero,zero,zero,zero,zero,xmm0[u,u,u,u,u,u,u,u] 91*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: retq 92*9880d681SAndroid Build Coastguard Worker; 93*9880d681SAndroid Build Coastguard Worker; BTVER2-LABEL: shuf_01zzuuuuuuuuuuuu: 94*9880d681SAndroid Build Coastguard Worker; BTVER2: # BB#0: 95*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: vpmovzxwq {{.*#+}} xmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero 96*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: retq 97*9880d681SAndroid Build Coastguard Worker %s = shufflevector <16 x i8> %a0, <16 x i8> zeroinitializer, <16 x i32> <i32 0, i32 1, i32 16, i32 16, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef> 98*9880d681SAndroid Build Coastguard Worker ret <16 x i8> %s 99*9880d681SAndroid Build Coastguard Worker} 100*9880d681SAndroid Build Coastguard Worker 101*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @shuf_01zzzzzz23zzzzzz(<16 x i8> %a0) { 102*9880d681SAndroid Build Coastguard Worker; BTVER1-LABEL: shuf_01zzzzzz23zzzzzz: 103*9880d681SAndroid Build Coastguard Worker; BTVER1: # BB#0: 104*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: movaps %xmm0, %xmm1 105*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: extrq {{.*#+}} xmm1 = xmm1[2,3],zero,zero,zero,zero,zero,zero,xmm1[u,u,u,u,u,u,u,u] 106*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: extrq {{.*#+}} xmm0 = xmm0[0,1],zero,zero,zero,zero,zero,zero,xmm0[u,u,u,u,u,u,u,u] 107*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0] 108*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: retq 109*9880d681SAndroid Build Coastguard Worker; 110*9880d681SAndroid Build Coastguard Worker; BTVER2-LABEL: shuf_01zzzzzz23zzzzzz: 111*9880d681SAndroid Build Coastguard Worker; BTVER2: # BB#0: 112*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: vpmovzxwq {{.*#+}} xmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero 113*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: retq 114*9880d681SAndroid Build Coastguard Worker %s = shufflevector <16 x i8> %a0, <16 x i8> zeroinitializer, <16 x i32> <i32 0, i32 1, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 2, i32 3, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16> 115*9880d681SAndroid Build Coastguard Worker ret <16 x i8> %s 116*9880d681SAndroid Build Coastguard Worker} 117*9880d681SAndroid Build Coastguard Worker 118*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @shuf_1zzzuuuuuuuuuuuu(<16 x i8> %a0) { 119*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: shuf_1zzzuuuuuuuuuuuu: 120*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 121*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: extrq {{.*#+}} xmm0 = xmm0[1],zero,zero,zero,zero,zero,zero,zero,xmm0[u,u,u,u,u,u,u,u] 122*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 123*9880d681SAndroid Build Coastguard Worker %s = shufflevector <16 x i8> %a0, <16 x i8> zeroinitializer, <16 x i32> <i32 1, i32 16, i32 16, i32 16, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef> 124*9880d681SAndroid Build Coastguard Worker ret <16 x i8> %s 125*9880d681SAndroid Build Coastguard Worker} 126*9880d681SAndroid Build Coastguard Worker 127*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @shuf_1zzzuuuu(<8 x i16> %a0) { 128*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: shuf_1zzzuuuu: 129*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 130*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: extrq {{.*#+}} xmm0 = xmm0[2,3],zero,zero,zero,zero,zero,zero,xmm0[u,u,u,u,u,u,u,u] 131*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 132*9880d681SAndroid Build Coastguard Worker %s = shufflevector <8 x i16> %a0, <8 x i16> zeroinitializer, <8 x i32> <i32 1, i32 8, i32 8, i32 8, i32 undef, i32 undef, i32 undef, i32 undef> 133*9880d681SAndroid Build Coastguard Worker ret <8 x i16> %s 134*9880d681SAndroid Build Coastguard Worker} 135*9880d681SAndroid Build Coastguard Worker 136*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @shuf_12zzuuuu(<8 x i16> %a0) { 137*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: shuf_12zzuuuu: 138*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 139*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: extrq {{.*#+}} xmm0 = xmm0[2,3,4,5],zero,zero,zero,zero,xmm0[u,u,u,u,u,u,u,u] 140*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 141*9880d681SAndroid Build Coastguard Worker %s = shufflevector <8 x i16> %a0, <8 x i16> zeroinitializer, <8 x i32> <i32 1, i32 2, i32 8, i32 8, i32 undef, i32 undef, i32 undef, i32 undef> 142*9880d681SAndroid Build Coastguard Worker ret <8 x i16> %s 143*9880d681SAndroid Build Coastguard Worker} 144*9880d681SAndroid Build Coastguard Worker 145*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @shuf_012zuuuu(<8 x i16> %a0) { 146*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: shuf_012zuuuu: 147*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 148*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: extrq {{.*#+}} xmm0 = xmm0[0,1,2,3,4,5],zero,zero,xmm0[u,u,u,u,u,u,u,u] 149*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 150*9880d681SAndroid Build Coastguard Worker %s = shufflevector <8 x i16> %a0, <8 x i16> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 8, i32 undef, i32 undef, i32 undef, i32 undef> 151*9880d681SAndroid Build Coastguard Worker ret <8 x i16> %s 152*9880d681SAndroid Build Coastguard Worker} 153*9880d681SAndroid Build Coastguard Worker 154*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @shuf_0zzz1zzz(<8 x i16> %a0) { 155*9880d681SAndroid Build Coastguard Worker; BTVER1-LABEL: shuf_0zzz1zzz: 156*9880d681SAndroid Build Coastguard Worker; BTVER1: # BB#0: 157*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: movaps %xmm0, %xmm1 158*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: extrq {{.*#+}} xmm1 = xmm1[2,3],zero,zero,zero,zero,zero,zero,xmm1[u,u,u,u,u,u,u,u] 159*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: extrq {{.*#+}} xmm0 = xmm0[0,1],zero,zero,zero,zero,zero,zero,xmm0[u,u,u,u,u,u,u,u] 160*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0] 161*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: retq 162*9880d681SAndroid Build Coastguard Worker; 163*9880d681SAndroid Build Coastguard Worker; BTVER2-LABEL: shuf_0zzz1zzz: 164*9880d681SAndroid Build Coastguard Worker; BTVER2: # BB#0: 165*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: vpmovzxwq {{.*#+}} xmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero 166*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: retq 167*9880d681SAndroid Build Coastguard Worker %s = shufflevector <8 x i16> %a0, <8 x i16> zeroinitializer, <8 x i32> <i32 0, i32 8, i32 8, i32 8, i32 1, i32 8, i32 8, i32 8> 168*9880d681SAndroid Build Coastguard Worker ret <8 x i16> %s 169*9880d681SAndroid Build Coastguard Worker} 170*9880d681SAndroid Build Coastguard Worker 171*9880d681SAndroid Build Coastguard Workerdefine <4 x i32> @shuf_0z1z(<4 x i32> %a0) { 172*9880d681SAndroid Build Coastguard Worker; BTVER1-LABEL: shuf_0z1z: 173*9880d681SAndroid Build Coastguard Worker; BTVER1: # BB#0: 174*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: pxor %xmm1, %xmm1 175*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1] 176*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: retq 177*9880d681SAndroid Build Coastguard Worker; 178*9880d681SAndroid Build Coastguard Worker; BTVER2-LABEL: shuf_0z1z: 179*9880d681SAndroid Build Coastguard Worker; BTVER2: # BB#0: 180*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: vpmovzxdq {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero 181*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: retq 182*9880d681SAndroid Build Coastguard Worker %s = shufflevector <4 x i32> %a0, <4 x i32> zeroinitializer, <4 x i32> <i32 0, i32 4, i32 1, i32 4> 183*9880d681SAndroid Build Coastguard Worker ret <4 x i32> %s 184*9880d681SAndroid Build Coastguard Worker} 185*9880d681SAndroid Build Coastguard Worker 186*9880d681SAndroid Build Coastguard Worker; 187*9880d681SAndroid Build Coastguard Worker; INSERTQI 188*9880d681SAndroid Build Coastguard Worker; 189*9880d681SAndroid Build Coastguard Worker 190*9880d681SAndroid Build Coastguard Worker; A length of zero is equivalent to a bit length of 64. 191*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @insertqi_len0_idx0(<2 x i64> %a, <2 x i64> %b) { 192*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: insertqi_len0_idx0: 193*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 194*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: insertq {{.*#+}} xmm0 = xmm1[0,1,2,3,4,5,6,7],xmm0[u,u,u,u,u,u,u,u] 195*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 196*9880d681SAndroid Build Coastguard Worker %1 = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> %a, <2 x i64> %b, i8 0, i8 0) 197*9880d681SAndroid Build Coastguard Worker ret <2 x i64> %1 198*9880d681SAndroid Build Coastguard Worker} 199*9880d681SAndroid Build Coastguard Worker 200*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @insertqi_len8_idx16(<2 x i64> %a, <2 x i64> %b) { 201*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: insertqi_len8_idx16: 202*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 203*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: insertq {{.*#+}} xmm0 = xmm0[0,1],xmm1[0],xmm0[3,4,5,6,7,u,u,u,u,u,u,u,u] 204*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 205*9880d681SAndroid Build Coastguard Worker %1 = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> %a, <2 x i64> %b, i8 8, i8 16) 206*9880d681SAndroid Build Coastguard Worker ret <2 x i64> %1 207*9880d681SAndroid Build Coastguard Worker} 208*9880d681SAndroid Build Coastguard Worker 209*9880d681SAndroid Build Coastguard Worker; If the length + index exceeds the bottom 64 bits the result is undefined 210*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @insertqi_len32_idx48(<2 x i64> %a, <2 x i64> %b) { 211*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: insertqi_len32_idx48: 212*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 213*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: insertq {{.*#+}} xmm0 = xmm0[u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u] 214*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 215*9880d681SAndroid Build Coastguard Worker %1 = tail call <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64> %a, <2 x i64> %b, i8 32, i8 48) 216*9880d681SAndroid Build Coastguard Worker ret <2 x i64> %1 217*9880d681SAndroid Build Coastguard Worker} 218*9880d681SAndroid Build Coastguard Worker 219*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @shuf_0_0_2_3_uuuu_uuuu_uuuu(<16 x i8> %a0, <16 x i8> %a1) { 220*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: shuf_0_0_2_3_uuuu_uuuu_uuuu: 221*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 222*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: insertq {{.*#+}} xmm0 = xmm0[0,0,2,3,4,5,6,7,u,u,u,u,u,u,u,u] 223*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 224*9880d681SAndroid Build Coastguard Worker %s = shufflevector <16 x i8> %a0, <16 x i8> %a1, <16 x i32> <i32 0, i32 0, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef> 225*9880d681SAndroid Build Coastguard Worker ret <16 x i8> %s 226*9880d681SAndroid Build Coastguard Worker} 227*9880d681SAndroid Build Coastguard Worker 228*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @shuf_0_16_2_3_uuuu_uuuu_uuuu(<16 x i8> %a0, <16 x i8> %a1) { 229*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: shuf_0_16_2_3_uuuu_uuuu_uuuu: 230*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 231*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: insertq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[2,3,4,5,6,7,u,u,u,u,u,u,u,u] 232*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 233*9880d681SAndroid Build Coastguard Worker %s = shufflevector <16 x i8> %a0, <16 x i8> %a1, <16 x i32> <i32 0, i32 16, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef> 234*9880d681SAndroid Build Coastguard Worker ret <16 x i8> %s 235*9880d681SAndroid Build Coastguard Worker} 236*9880d681SAndroid Build Coastguard Worker 237*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @shuf_16_1_2_3_uuuu_uuuu_uuuu(<16 x i8> %a0, <16 x i8> %a1) { 238*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: shuf_16_1_2_3_uuuu_uuuu_uuuu: 239*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 240*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: insertq {{.*#+}} xmm0 = xmm1[0],xmm0[1,2,3,4,5,6,7,u,u,u,u,u,u,u,u] 241*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 242*9880d681SAndroid Build Coastguard Worker %s = shufflevector <16 x i8> %a0, <16 x i8> %a1, <16 x i32> <i32 16, i32 1, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef> 243*9880d681SAndroid Build Coastguard Worker ret <16 x i8> %s 244*9880d681SAndroid Build Coastguard Worker} 245*9880d681SAndroid Build Coastguard Worker 246*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @shuf_0823uuuu(<8 x i16> %a0, <8 x i16> %a1) { 247*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: shuf_0823uuuu: 248*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 249*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: insertq {{.*#+}} xmm0 = xmm0[0,1],xmm1[0,1],xmm0[4,5,6,7,u,u,u,u,u,u,u,u] 250*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 251*9880d681SAndroid Build Coastguard Worker %s = shufflevector <8 x i16> %a0, <8 x i16> %a1, <8 x i32> <i32 0, i32 8, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef> 252*9880d681SAndroid Build Coastguard Worker ret <8 x i16> %s 253*9880d681SAndroid Build Coastguard Worker} 254*9880d681SAndroid Build Coastguard Worker 255*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @shuf_0183uuuu(<8 x i16> %a0, <8 x i16> %a1) { 256*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: shuf_0183uuuu: 257*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 258*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: insertq {{.*#+}} xmm0 = xmm0[0,1,2,3],xmm1[0,1],xmm0[6,7,u,u,u,u,u,u,u,u] 259*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 260*9880d681SAndroid Build Coastguard Worker %s = shufflevector <8 x i16> %a0, <8 x i16> %a1, <8 x i32> <i32 0, i32 1, i32 8, i32 3, i32 undef, i32 undef, i32 undef, i32 undef> 261*9880d681SAndroid Build Coastguard Worker ret <8 x i16> %s 262*9880d681SAndroid Build Coastguard Worker} 263*9880d681SAndroid Build Coastguard Worker 264*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @shuf_0128uuuu(<8 x i16> %a0, <8 x i16> %a1) { 265*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: shuf_0128uuuu: 266*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 267*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: insertq {{.*#+}} xmm0 = xmm0[0,1,2,3,4,5],xmm1[0,1],xmm0[u,u,u,u,u,u,u,u] 268*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 269*9880d681SAndroid Build Coastguard Worker %s = shufflevector <8 x i16> %a0, <8 x i16> %a1, <8 x i32> <i32 0, i32 1, i32 2, i32 8, i32 undef, i32 undef, i32 undef, i32 undef> 270*9880d681SAndroid Build Coastguard Worker ret <8 x i16> %s 271*9880d681SAndroid Build Coastguard Worker} 272*9880d681SAndroid Build Coastguard Worker 273*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @shuf_0893uuuu(<8 x i16> %a0, <8 x i16> %a1) { 274*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: shuf_0893uuuu: 275*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 276*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: insertq {{.*#+}} xmm0 = xmm0[0,1],xmm1[0,1,2,3],xmm0[6,7,u,u,u,u,u,u,u,u] 277*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 278*9880d681SAndroid Build Coastguard Worker %s = shufflevector <8 x i16> %a0, <8 x i16> %a1, <8 x i32> <i32 0, i32 8, i32 9, i32 3, i32 undef, i32 undef, i32 undef, i32 undef> 279*9880d681SAndroid Build Coastguard Worker ret <8 x i16> %s 280*9880d681SAndroid Build Coastguard Worker} 281*9880d681SAndroid Build Coastguard Worker 282*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @shuf_089Auuuu(<8 x i16> %a0, <8 x i16> %a1) { 283*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: shuf_089Auuuu: 284*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 285*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: insertq {{.*#+}} xmm0 = xmm0[0,1],xmm1[0,1,2,3,4,5],xmm0[u,u,u,u,u,u,u,u] 286*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 287*9880d681SAndroid Build Coastguard Worker %s = shufflevector <8 x i16> %a0, <8 x i16> %a1, <8 x i32> <i32 0, i32 8, i32 9, i32 10, i32 undef, i32 undef, i32 undef, i32 undef> 288*9880d681SAndroid Build Coastguard Worker ret <8 x i16> %s 289*9880d681SAndroid Build Coastguard Worker} 290*9880d681SAndroid Build Coastguard Worker 291*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @shuf_089uuuuu(<8 x i16> %a0, <8 x i16> %a1) { 292*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: shuf_089uuuuu: 293*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 294*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: insertq {{.*#+}} xmm0 = xmm0[0,1],xmm1[0,1,2,3],xmm0[6,7,u,u,u,u,u,u,u,u] 295*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 296*9880d681SAndroid Build Coastguard Worker %s = shufflevector <8 x i16> %a0, <8 x i16> %a1, <8 x i32> <i32 0, i32 8, i32 9, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef> 297*9880d681SAndroid Build Coastguard Worker ret <8 x i16> %s 298*9880d681SAndroid Build Coastguard Worker} 299*9880d681SAndroid Build Coastguard Worker 300*9880d681SAndroid Build Coastguard Worker; 301*9880d681SAndroid Build Coastguard Worker; Special Cases 302*9880d681SAndroid Build Coastguard Worker; 303*9880d681SAndroid Build Coastguard Worker 304*9880d681SAndroid Build Coastguard Worker; Out of range. 305*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @shuffle_8_18_uuuuuuuuuuuuuu(<16 x i8> %a, <16 x i8> %b) { 306*9880d681SAndroid Build Coastguard Worker; BTVER1-LABEL: shuffle_8_18_uuuuuuuuuuuuuu: 307*9880d681SAndroid Build Coastguard Worker; BTVER1: # BB#0: 308*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: psrld $16, %xmm1 309*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,0,1] 310*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7] 311*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: retq 312*9880d681SAndroid Build Coastguard Worker; 313*9880d681SAndroid Build Coastguard Worker; BTVER2-LABEL: shuffle_8_18_uuuuuuuuuuuuuu: 314*9880d681SAndroid Build Coastguard Worker; BTVER2: # BB#0: 315*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: vpsrld $16, %xmm1, %xmm1 316*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1] 317*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7] 318*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: retq 319*9880d681SAndroid Build Coastguard Worker %1 = shufflevector <16 x i8> %a, <16 x i8> %b, <16 x i32> <i32 8, i32 18, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef> 320*9880d681SAndroid Build Coastguard Worker ret <16 x i8> %1 321*9880d681SAndroid Build Coastguard Worker} 322*9880d681SAndroid Build Coastguard Worker 323*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @shuffle_uu_0_5_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu(<16 x i8> %v) { 324*9880d681SAndroid Build Coastguard Worker; BTVER1-LABEL: shuffle_uu_0_5_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu: 325*9880d681SAndroid Build Coastguard Worker; BTVER1: # BB#0: 326*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: pshufb {{.*#+}} xmm0 = xmm0[0,0,5,5,4,4,5,5,4,4,5,5,6,6,7,7] 327*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: retq 328*9880d681SAndroid Build Coastguard Worker; 329*9880d681SAndroid Build Coastguard Worker; BTVER2-LABEL: shuffle_uu_0_5_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu: 330*9880d681SAndroid Build Coastguard Worker; BTVER2: # BB#0: 331*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,0,5,5,4,4,5,5,4,4,5,5,6,6,7,7] 332*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: retq 333*9880d681SAndroid Build Coastguard Worker %1 = shufflevector <16 x i8> %v, <16 x i8> zeroinitializer, <16 x i32> <i32 undef, i32 0, i32 5, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef> 334*9880d681SAndroid Build Coastguard Worker ret <16 x i8> %1 335*9880d681SAndroid Build Coastguard Worker} 336*9880d681SAndroid Build Coastguard Worker 337*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @shuffle_uu_16_4_16_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu(<16 x i8> %v) { 338*9880d681SAndroid Build Coastguard Worker; BTVER1-LABEL: shuffle_uu_16_4_16_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu: 339*9880d681SAndroid Build Coastguard Worker; BTVER1: # BB#0: 340*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: pshufb {{.*#+}} xmm0 = xmm0[u],zero,xmm0[4],zero,xmm0[u,u,u,u,u,u,u,u,u,u,u,u] 341*9880d681SAndroid Build Coastguard Worker; BTVER1-NEXT: retq 342*9880d681SAndroid Build Coastguard Worker; 343*9880d681SAndroid Build Coastguard Worker; BTVER2-LABEL: shuffle_uu_16_4_16_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu: 344*9880d681SAndroid Build Coastguard Worker; BTVER2: # BB#0: 345*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[u],zero,xmm0[4],zero,xmm0[u,u,u,u,u,u,u,u,u,u,u,u] 346*9880d681SAndroid Build Coastguard Worker; BTVER2-NEXT: retq 347*9880d681SAndroid Build Coastguard Worker %1 = shufflevector <16 x i8> %v, <16 x i8> zeroinitializer, <16 x i32> <i32 undef, i32 16, i32 4, i32 16, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef> 348*9880d681SAndroid Build Coastguard Worker ret <16 x i8> %1 349*9880d681SAndroid Build Coastguard Worker} 350*9880d681SAndroid Build Coastguard Worker 351*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @shuffle_uu_uu_4_16_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu(<16 x i8> %v) { 352*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: shuffle_uu_uu_4_16_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu: 353*9880d681SAndroid Build Coastguard Worker; ALL: # BB#0: 354*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: extrq {{.*#+}} xmm0 = xmm0[2,3,4],zero,zero,zero,zero,zero,xmm0[u,u,u,u,u,u,u,u] 355*9880d681SAndroid Build Coastguard Worker; ALL-NEXT: retq 356*9880d681SAndroid Build Coastguard Worker %1 = shufflevector <16 x i8> %v, <16 x i8> zeroinitializer, <16 x i32> <i32 undef, i32 undef, i32 4, i32 16, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef> 357*9880d681SAndroid Build Coastguard Worker ret <16 x i8> %1 358*9880d681SAndroid Build Coastguard Worker} 359*9880d681SAndroid Build Coastguard Worker 360*9880d681SAndroid Build Coastguard Workerdeclare <2 x i64> @llvm.x86.sse4a.extrqi(<2 x i64>, i8, i8) nounwind 361*9880d681SAndroid Build Coastguard Workerdeclare <2 x i64> @llvm.x86.sse4a.insertqi(<2 x i64>, <2 x i64>, i8, i8) nounwind 362