1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 -mattr=+sse2,-sse4.1 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE2 2*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE41 3*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7-avx -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX 4*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=core-avx2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX2 5*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=bdver2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=XOP -check-prefix=XOPAVX 6*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=bdver4 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=XOP -check-prefix=XOPAVX2 7*9880d681SAndroid Build Coastguard Worker 8*9880d681SAndroid Build Coastguard Worker; Verify the cost of vector logical shift right instructions. 9*9880d681SAndroid Build Coastguard Worker 10*9880d681SAndroid Build Coastguard Worker; 11*9880d681SAndroid Build Coastguard Worker; Variable Shifts 12*9880d681SAndroid Build Coastguard Worker; 13*9880d681SAndroid Build Coastguard Worker 14*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @var_shift_v2i64(<2 x i64> %a, <2 x i64> %b) { 15*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_shift_v2i64': 16*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 4 for instruction: %shift 17*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 4 for instruction: %shift 18*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 4 for instruction: %shift 19*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction: %shift 20*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 2 for instruction: %shift 21*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction: %shift 22*9880d681SAndroid Build Coastguard Worker %shift = lshr <2 x i64> %a, %b 23*9880d681SAndroid Build Coastguard Worker ret <2 x i64> %shift 24*9880d681SAndroid Build Coastguard Worker} 25*9880d681SAndroid Build Coastguard Worker 26*9880d681SAndroid Build Coastguard Workerdefine <4 x i64> @var_shift_v4i64(<4 x i64> %a, <4 x i64> %b) { 27*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_shift_v4i64': 28*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 8 for instruction: %shift 29*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 8 for instruction: %shift 30*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 8 for instruction: %shift 31*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction: %shift 32*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 4 for instruction: %shift 33*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction: %shift 34*9880d681SAndroid Build Coastguard Worker %shift = lshr <4 x i64> %a, %b 35*9880d681SAndroid Build Coastguard Worker ret <4 x i64> %shift 36*9880d681SAndroid Build Coastguard Worker} 37*9880d681SAndroid Build Coastguard Worker 38*9880d681SAndroid Build Coastguard Workerdefine <4 x i32> @var_shift_v4i32(<4 x i32> %a, <4 x i32> %b) { 39*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_shift_v4i32': 40*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 16 for instruction: %shift 41*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 16 for instruction: %shift 42*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 16 for instruction: %shift 43*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction: %shift 44*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 2 for instruction: %shift 45*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction: %shift 46*9880d681SAndroid Build Coastguard Worker %shift = lshr <4 x i32> %a, %b 47*9880d681SAndroid Build Coastguard Worker ret <4 x i32> %shift 48*9880d681SAndroid Build Coastguard Worker} 49*9880d681SAndroid Build Coastguard Worker 50*9880d681SAndroid Build Coastguard Workerdefine <8 x i32> @var_shift_v8i32(<8 x i32> %a, <8 x i32> %b) { 51*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_shift_v8i32': 52*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 32 for instruction: %shift 53*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 32 for instruction: %shift 54*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 32 for instruction: %shift 55*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction: %shift 56*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 4 for instruction: %shift 57*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction: %shift 58*9880d681SAndroid Build Coastguard Worker %shift = lshr <8 x i32> %a, %b 59*9880d681SAndroid Build Coastguard Worker ret <8 x i32> %shift 60*9880d681SAndroid Build Coastguard Worker} 61*9880d681SAndroid Build Coastguard Worker 62*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @var_shift_v8i16(<8 x i16> %a, <8 x i16> %b) { 63*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_shift_v8i16': 64*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 32 for instruction: %shift 65*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 32 for instruction: %shift 66*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 32 for instruction: %shift 67*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 32 for instruction: %shift 68*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction: %shift 69*9880d681SAndroid Build Coastguard Worker %shift = lshr <8 x i16> %a, %b 70*9880d681SAndroid Build Coastguard Worker ret <8 x i16> %shift 71*9880d681SAndroid Build Coastguard Worker} 72*9880d681SAndroid Build Coastguard Worker 73*9880d681SAndroid Build Coastguard Workerdefine <16 x i16> @var_shift_v16i16(<16 x i16> %a, <16 x i16> %b) { 74*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_shift_v16i16': 75*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 64 for instruction: %shift 76*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 64 for instruction: %shift 77*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 64 for instruction: %shift 78*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 10 for instruction: %shift 79*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction: %shift 80*9880d681SAndroid Build Coastguard Worker %shift = lshr <16 x i16> %a, %b 81*9880d681SAndroid Build Coastguard Worker ret <16 x i16> %shift 82*9880d681SAndroid Build Coastguard Worker} 83*9880d681SAndroid Build Coastguard Worker 84*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @var_shift_v16i8(<16 x i8> %a, <16 x i8> %b) { 85*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_shift_v16i8': 86*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 26 for instruction: %shift 87*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 26 for instruction: %shift 88*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 26 for instruction: %shift 89*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 26 for instruction: %shift 90*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction: %shift 91*9880d681SAndroid Build Coastguard Worker %shift = lshr <16 x i8> %a, %b 92*9880d681SAndroid Build Coastguard Worker ret <16 x i8> %shift 93*9880d681SAndroid Build Coastguard Worker} 94*9880d681SAndroid Build Coastguard Worker 95*9880d681SAndroid Build Coastguard Workerdefine <32 x i8> @var_shift_v32i8(<32 x i8> %a, <32 x i8> %b) { 96*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'var_shift_v32i8': 97*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 52 for instruction: %shift 98*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 52 for instruction: %shift 99*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 52 for instruction: %shift 100*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 11 for instruction: %shift 101*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction: %shift 102*9880d681SAndroid Build Coastguard Worker %shift = lshr <32 x i8> %a, %b 103*9880d681SAndroid Build Coastguard Worker ret <32 x i8> %shift 104*9880d681SAndroid Build Coastguard Worker} 105*9880d681SAndroid Build Coastguard Worker 106*9880d681SAndroid Build Coastguard Worker; 107*9880d681SAndroid Build Coastguard Worker; Uniform Variable Shifts 108*9880d681SAndroid Build Coastguard Worker; 109*9880d681SAndroid Build Coastguard Worker 110*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @splatvar_shift_v2i64(<2 x i64> %a, <2 x i64> %b) { 111*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v2i64': 112*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 4 for instruction: %shift 113*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 4 for instruction: %shift 114*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 4 for instruction: %shift 115*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction: %shift 116*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 2 for instruction: %shift 117*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction: %shift 118*9880d681SAndroid Build Coastguard Worker %splat = shufflevector <2 x i64> %b, <2 x i64> undef, <2 x i32> zeroinitializer 119*9880d681SAndroid Build Coastguard Worker %shift = lshr <2 x i64> %a, %splat 120*9880d681SAndroid Build Coastguard Worker ret <2 x i64> %shift 121*9880d681SAndroid Build Coastguard Worker} 122*9880d681SAndroid Build Coastguard Worker 123*9880d681SAndroid Build Coastguard Workerdefine <4 x i64> @splatvar_shift_v4i64(<4 x i64> %a, <4 x i64> %b) { 124*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v4i64': 125*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 8 for instruction: %shift 126*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 8 for instruction: %shift 127*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 8 for instruction: %shift 128*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction: %shift 129*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 4 for instruction: %shift 130*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction: %shift 131*9880d681SAndroid Build Coastguard Worker %splat = shufflevector <4 x i64> %b, <4 x i64> undef, <4 x i32> zeroinitializer 132*9880d681SAndroid Build Coastguard Worker %shift = lshr <4 x i64> %a, %splat 133*9880d681SAndroid Build Coastguard Worker ret <4 x i64> %shift 134*9880d681SAndroid Build Coastguard Worker} 135*9880d681SAndroid Build Coastguard Worker 136*9880d681SAndroid Build Coastguard Workerdefine <4 x i32> @splatvar_shift_v4i32(<4 x i32> %a, <4 x i32> %b) { 137*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v4i32': 138*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 16 for instruction: %shift 139*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 16 for instruction: %shift 140*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 16 for instruction: %shift 141*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction: %shift 142*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 2 for instruction: %shift 143*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction: %shift 144*9880d681SAndroid Build Coastguard Worker %splat = shufflevector <4 x i32> %b, <4 x i32> undef, <4 x i32> zeroinitializer 145*9880d681SAndroid Build Coastguard Worker %shift = lshr <4 x i32> %a, %splat 146*9880d681SAndroid Build Coastguard Worker ret <4 x i32> %shift 147*9880d681SAndroid Build Coastguard Worker} 148*9880d681SAndroid Build Coastguard Worker 149*9880d681SAndroid Build Coastguard Workerdefine <8 x i32> @splatvar_shift_v8i32(<8 x i32> %a, <8 x i32> %b) { 150*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v8i32': 151*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 32 for instruction: %shift 152*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 32 for instruction: %shift 153*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 32 for instruction: %shift 154*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction: %shift 155*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 4 for instruction: %shift 156*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction: %shift 157*9880d681SAndroid Build Coastguard Worker %splat = shufflevector <8 x i32> %b, <8 x i32> undef, <8 x i32> zeroinitializer 158*9880d681SAndroid Build Coastguard Worker %shift = lshr <8 x i32> %a, %splat 159*9880d681SAndroid Build Coastguard Worker ret <8 x i32> %shift 160*9880d681SAndroid Build Coastguard Worker} 161*9880d681SAndroid Build Coastguard Worker 162*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @splatvar_shift_v8i16(<8 x i16> %a, <8 x i16> %b) { 163*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v8i16': 164*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 32 for instruction: %shift 165*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 32 for instruction: %shift 166*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 32 for instruction: %shift 167*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 32 for instruction: %shift 168*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction: %shift 169*9880d681SAndroid Build Coastguard Worker %splat = shufflevector <8 x i16> %b, <8 x i16> undef, <8 x i32> zeroinitializer 170*9880d681SAndroid Build Coastguard Worker %shift = lshr <8 x i16> %a, %splat 171*9880d681SAndroid Build Coastguard Worker ret <8 x i16> %shift 172*9880d681SAndroid Build Coastguard Worker} 173*9880d681SAndroid Build Coastguard Worker 174*9880d681SAndroid Build Coastguard Workerdefine <16 x i16> @splatvar_shift_v16i16(<16 x i16> %a, <16 x i16> %b) { 175*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v16i16': 176*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 64 for instruction: %shift 177*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 64 for instruction: %shift 178*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 64 for instruction: %shift 179*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 10 for instruction: %shift 180*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction: %shift 181*9880d681SAndroid Build Coastguard Worker %splat = shufflevector <16 x i16> %b, <16 x i16> undef, <16 x i32> zeroinitializer 182*9880d681SAndroid Build Coastguard Worker %shift = lshr <16 x i16> %a, %splat 183*9880d681SAndroid Build Coastguard Worker ret <16 x i16> %shift 184*9880d681SAndroid Build Coastguard Worker} 185*9880d681SAndroid Build Coastguard Worker 186*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @splatvar_shift_v16i8(<16 x i8> %a, <16 x i8> %b) { 187*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v16i8': 188*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 26 for instruction: %shift 189*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 26 for instruction: %shift 190*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 26 for instruction: %shift 191*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 26 for instruction: %shift 192*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction: %shift 193*9880d681SAndroid Build Coastguard Worker %splat = shufflevector <16 x i8> %b, <16 x i8> undef, <16 x i32> zeroinitializer 194*9880d681SAndroid Build Coastguard Worker %shift = lshr <16 x i8> %a, %splat 195*9880d681SAndroid Build Coastguard Worker ret <16 x i8> %shift 196*9880d681SAndroid Build Coastguard Worker} 197*9880d681SAndroid Build Coastguard Worker 198*9880d681SAndroid Build Coastguard Workerdefine <32 x i8> @splatvar_shift_v32i8(<32 x i8> %a, <32 x i8> %b) { 199*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v32i8': 200*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 52 for instruction: %shift 201*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 52 for instruction: %shift 202*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 52 for instruction: %shift 203*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 11 for instruction: %shift 204*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction: %shift 205*9880d681SAndroid Build Coastguard Worker %splat = shufflevector <32 x i8> %b, <32 x i8> undef, <32 x i32> zeroinitializer 206*9880d681SAndroid Build Coastguard Worker %shift = lshr <32 x i8> %a, %splat 207*9880d681SAndroid Build Coastguard Worker ret <32 x i8> %shift 208*9880d681SAndroid Build Coastguard Worker} 209*9880d681SAndroid Build Coastguard Worker 210*9880d681SAndroid Build Coastguard Worker; 211*9880d681SAndroid Build Coastguard Worker; Constant Shifts 212*9880d681SAndroid Build Coastguard Worker; 213*9880d681SAndroid Build Coastguard Worker 214*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @constant_shift_v2i64(<2 x i64> %a) { 215*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'constant_shift_v2i64': 216*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 4 for instruction: %shift 217*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 4 for instruction: %shift 218*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 4 for instruction: %shift 219*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction: %shift 220*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 2 for instruction: %shift 221*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction: %shift 222*9880d681SAndroid Build Coastguard Worker %shift = lshr <2 x i64> %a, <i64 1, i64 7> 223*9880d681SAndroid Build Coastguard Worker ret <2 x i64> %shift 224*9880d681SAndroid Build Coastguard Worker} 225*9880d681SAndroid Build Coastguard Worker 226*9880d681SAndroid Build Coastguard Workerdefine <4 x i64> @constant_shift_v4i64(<4 x i64> %a) { 227*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'constant_shift_v4i64': 228*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 8 for instruction: %shift 229*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 8 for instruction: %shift 230*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 8 for instruction: %shift 231*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction: %shift 232*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 4 for instruction: %shift 233*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction: %shift 234*9880d681SAndroid Build Coastguard Worker %shift = lshr <4 x i64> %a, <i64 1, i64 7, i64 15, i64 31> 235*9880d681SAndroid Build Coastguard Worker ret <4 x i64> %shift 236*9880d681SAndroid Build Coastguard Worker} 237*9880d681SAndroid Build Coastguard Worker 238*9880d681SAndroid Build Coastguard Workerdefine <4 x i32> @constant_shift_v4i32(<4 x i32> %a) { 239*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'constant_shift_v4i32': 240*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 16 for instruction: %shift 241*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 16 for instruction: %shift 242*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 16 for instruction: %shift 243*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction: %shift 244*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 2 for instruction: %shift 245*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction: %shift 246*9880d681SAndroid Build Coastguard Worker %shift = lshr <4 x i32> %a, <i32 4, i32 5, i32 6, i32 7> 247*9880d681SAndroid Build Coastguard Worker ret <4 x i32> %shift 248*9880d681SAndroid Build Coastguard Worker} 249*9880d681SAndroid Build Coastguard Worker 250*9880d681SAndroid Build Coastguard Workerdefine <8 x i32> @constant_shift_v8i32(<8 x i32> %a) { 251*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'constant_shift_v8i32': 252*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 32 for instruction: %shift 253*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 32 for instruction: %shift 254*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 32 for instruction: %shift 255*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction: %shift 256*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 4 for instruction: %shift 257*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction: %shift 258*9880d681SAndroid Build Coastguard Worker %shift = lshr <8 x i32> %a, <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3> 259*9880d681SAndroid Build Coastguard Worker ret <8 x i32> %shift 260*9880d681SAndroid Build Coastguard Worker} 261*9880d681SAndroid Build Coastguard Worker 262*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @constant_shift_v8i16(<8 x i16> %a) { 263*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'constant_shift_v8i16': 264*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 32 for instruction: %shift 265*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 32 for instruction: %shift 266*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 32 for instruction: %shift 267*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 32 for instruction: %shift 268*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction: %shift 269*9880d681SAndroid Build Coastguard Worker %shift = lshr <8 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7> 270*9880d681SAndroid Build Coastguard Worker ret <8 x i16> %shift 271*9880d681SAndroid Build Coastguard Worker} 272*9880d681SAndroid Build Coastguard Worker 273*9880d681SAndroid Build Coastguard Workerdefine <16 x i16> @constant_shift_v16i16(<16 x i16> %a) { 274*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'constant_shift_v16i16': 275*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 64 for instruction: %shift 276*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 64 for instruction: %shift 277*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 64 for instruction: %shift 278*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 10 for instruction: %shift 279*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction: %shift 280*9880d681SAndroid Build Coastguard Worker %shift = lshr <16 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7, i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7> 281*9880d681SAndroid Build Coastguard Worker ret <16 x i16> %shift 282*9880d681SAndroid Build Coastguard Worker} 283*9880d681SAndroid Build Coastguard Worker 284*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @constant_shift_v16i8(<16 x i8> %a) { 285*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'constant_shift_v16i8': 286*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 26 for instruction: %shift 287*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 26 for instruction: %shift 288*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 26 for instruction: %shift 289*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 26 for instruction: %shift 290*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction: %shift 291*9880d681SAndroid Build Coastguard Worker %shift = lshr <16 x i8> %a, <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 7, i8 6, i8 5, i8 4, i8 3, i8 2, i8 1, i8 0> 292*9880d681SAndroid Build Coastguard Worker ret <16 x i8> %shift 293*9880d681SAndroid Build Coastguard Worker} 294*9880d681SAndroid Build Coastguard Worker 295*9880d681SAndroid Build Coastguard Workerdefine <32 x i8> @constant_shift_v32i8(<32 x i8> %a) { 296*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'constant_shift_v32i8': 297*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 52 for instruction: %shift 298*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 52 for instruction: %shift 299*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 52 for instruction: %shift 300*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 11 for instruction: %shift 301*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction: %shift 302*9880d681SAndroid Build Coastguard Worker %shift = lshr <32 x i8> %a, <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 7, i8 6, i8 5, i8 4, i8 3, i8 2, i8 1, i8 0, i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 7, i8 6, i8 5, i8 4, i8 3, i8 2, i8 1, i8 0> 303*9880d681SAndroid Build Coastguard Worker ret <32 x i8> %shift 304*9880d681SAndroid Build Coastguard Worker} 305*9880d681SAndroid Build Coastguard Worker 306*9880d681SAndroid Build Coastguard Worker; 307*9880d681SAndroid Build Coastguard Worker; Uniform Constant Shifts 308*9880d681SAndroid Build Coastguard Worker; 309*9880d681SAndroid Build Coastguard Worker 310*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @splatconstant_shift_v2i64(<2 x i64> %a) { 311*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v2i64': 312*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 1 for instruction: %shift 313*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 1 for instruction: %shift 314*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 1 for instruction: %shift 315*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction: %shift 316*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 2 for instruction: %shift 317*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction: %shift 318*9880d681SAndroid Build Coastguard Worker %shift = lshr <2 x i64> %a, <i64 7, i64 7> 319*9880d681SAndroid Build Coastguard Worker ret <2 x i64> %shift 320*9880d681SAndroid Build Coastguard Worker} 321*9880d681SAndroid Build Coastguard Worker 322*9880d681SAndroid Build Coastguard Workerdefine <4 x i64> @splatconstant_shift_v4i64(<4 x i64> %a) { 323*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v4i64': 324*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 2 for instruction: %shift 325*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 2 for instruction: %shift 326*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 2 for instruction: %shift 327*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction: %shift 328*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 4 for instruction: %shift 329*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction: %shift 330*9880d681SAndroid Build Coastguard Worker %shift = lshr <4 x i64> %a, <i64 7, i64 7, i64 7, i64 7> 331*9880d681SAndroid Build Coastguard Worker ret <4 x i64> %shift 332*9880d681SAndroid Build Coastguard Worker} 333*9880d681SAndroid Build Coastguard Worker 334*9880d681SAndroid Build Coastguard Workerdefine <4 x i32> @splatconstant_shift_v4i32(<4 x i32> %a) { 335*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v4i32': 336*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 1 for instruction: %shift 337*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 1 for instruction: %shift 338*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 1 for instruction: %shift 339*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction: %shift 340*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 2 for instruction: %shift 341*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction: %shift 342*9880d681SAndroid Build Coastguard Worker %shift = lshr <4 x i32> %a, <i32 5, i32 5, i32 5, i32 5> 343*9880d681SAndroid Build Coastguard Worker ret <4 x i32> %shift 344*9880d681SAndroid Build Coastguard Worker} 345*9880d681SAndroid Build Coastguard Worker 346*9880d681SAndroid Build Coastguard Workerdefine <8 x i32> @splatconstant_shift_v8i32(<8 x i32> %a) { 347*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v8i32': 348*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 2 for instruction: %shift 349*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 2 for instruction: %shift 350*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 2 for instruction: %shift 351*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction: %shift 352*9880d681SAndroid Build Coastguard Worker; XOPAVX: Found an estimated cost of 4 for instruction: %shift 353*9880d681SAndroid Build Coastguard Worker; XOPAVX2: Found an estimated cost of 1 for instruction: %shift 354*9880d681SAndroid Build Coastguard Worker %shift = lshr <8 x i32> %a, <i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5> 355*9880d681SAndroid Build Coastguard Worker ret <8 x i32> %shift 356*9880d681SAndroid Build Coastguard Worker} 357*9880d681SAndroid Build Coastguard Worker 358*9880d681SAndroid Build Coastguard Workerdefine <8 x i16> @splatconstant_shift_v8i16(<8 x i16> %a) { 359*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v8i16': 360*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 1 for instruction: %shift 361*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 1 for instruction: %shift 362*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 1 for instruction: %shift 363*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction: %shift 364*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction: %shift 365*9880d681SAndroid Build Coastguard Worker %shift = lshr <8 x i16> %a, <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3> 366*9880d681SAndroid Build Coastguard Worker ret <8 x i16> %shift 367*9880d681SAndroid Build Coastguard Worker} 368*9880d681SAndroid Build Coastguard Worker 369*9880d681SAndroid Build Coastguard Workerdefine <16 x i16> @splatconstant_shift_v16i16(<16 x i16> %a) { 370*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v16i16': 371*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 2 for instruction: %shift 372*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 2 for instruction: %shift 373*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 2 for instruction: %shift 374*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 10 for instruction: %shift 375*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction: %shift 376*9880d681SAndroid Build Coastguard Worker %shift = lshr <16 x i16> %a, <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3> 377*9880d681SAndroid Build Coastguard Worker ret <16 x i16> %shift 378*9880d681SAndroid Build Coastguard Worker} 379*9880d681SAndroid Build Coastguard Worker 380*9880d681SAndroid Build Coastguard Workerdefine <16 x i8> @splatconstant_shift_v16i8(<16 x i8> %a) { 381*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v16i8': 382*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 1 for instruction: %shift 383*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 1 for instruction: %shift 384*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 1 for instruction: %shift 385*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 1 for instruction: %shift 386*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 2 for instruction: %shift 387*9880d681SAndroid Build Coastguard Worker %shift = lshr <16 x i8> %a, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3> 388*9880d681SAndroid Build Coastguard Worker ret <16 x i8> %shift 389*9880d681SAndroid Build Coastguard Worker} 390*9880d681SAndroid Build Coastguard Worker 391*9880d681SAndroid Build Coastguard Workerdefine <32 x i8> @splatconstant_shift_v32i8(<32 x i8> %a) { 392*9880d681SAndroid Build Coastguard Worker; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v32i8': 393*9880d681SAndroid Build Coastguard Worker; SSE2: Found an estimated cost of 2 for instruction: %shift 394*9880d681SAndroid Build Coastguard Worker; SSE41: Found an estimated cost of 2 for instruction: %shift 395*9880d681SAndroid Build Coastguard Worker; AVX: Found an estimated cost of 2 for instruction: %shift 396*9880d681SAndroid Build Coastguard Worker; AVX2: Found an estimated cost of 11 for instruction: %shift 397*9880d681SAndroid Build Coastguard Worker; XOP: Found an estimated cost of 4 for instruction: %shift 398*9880d681SAndroid Build Coastguard Worker %shift = lshr <32 x i8> %a, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3> 399*9880d681SAndroid Build Coastguard Worker ret <32 x i8> %shift 400*9880d681SAndroid Build Coastguard Worker} 401