1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py 2; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,SSE2 3; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+sse4.2 | FileCheck %s --check-prefixes=CHECK,SSE42 4; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+avx | FileCheck %s --check-prefixes=CHECK,AVX,AVX1 5; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+avx2 | FileCheck %s --check-prefixes=CHECK,AVX,AVX2 6; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+xop,+avx | FileCheck %s --check-prefixes=CHECK,XOP,XOPAVX1 7; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+xop,+avx2 | FileCheck %s --check-prefixes=CHECK,XOP,XOPAVX2 8; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512F 9; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512F 10; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512BW 11; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+avx512f,+avx512vl | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512F 12; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512F 13; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+avx512f,+avx512bw,+avx512vl | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512BW 14; 15; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mcpu=slm | FileCheck %s --check-prefixes=CHECK,SSE42 16; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mcpu=goldmont | FileCheck %s --check-prefixes=CHECK,SSE42 17; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mcpu=btver2 | FileCheck %s --check-prefixes=CHECK,AVX,AVX1 18; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mcpu=tigerlake | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512GFNI 19 20; Verify the cost of vector logical shift right instructions. 21 22; 23; Variable Shifts 24; 25 26define <2 x i64> @var_shift_v2i64(<2 x i64> %a, <2 x i64> %b) { 27; SSE2-LABEL: 'var_shift_v2i64' 28; SSE2-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <2 x i64> %a, %b 29; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %shift 30; 31; SSE42-LABEL: 'var_shift_v2i64' 32; SSE42-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <2 x i64> %a, %b 33; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %shift 34; 35; AVX1-LABEL: 'var_shift_v2i64' 36; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <2 x i64> %a, %b 37; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %shift 38; 39; AVX2-LABEL: 'var_shift_v2i64' 40; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <2 x i64> %a, %b 41; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %shift 42; 43; XOP-LABEL: 'var_shift_v2i64' 44; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <2 x i64> %a, %b 45; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %shift 46; 47; AVX512-LABEL: 'var_shift_v2i64' 48; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <2 x i64> %a, %b 49; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %shift 50; 51 %shift = lshr <2 x i64> %a, %b 52 ret <2 x i64> %shift 53} 54 55define <4 x i64> @var_shift_v4i64(<4 x i64> %a, <4 x i64> %b) { 56; SSE2-LABEL: 'var_shift_v4i64' 57; SSE2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <4 x i64> %a, %b 58; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 59; 60; SSE42-LABEL: 'var_shift_v4i64' 61; SSE42-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <4 x i64> %a, %b 62; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 63; 64; AVX1-LABEL: 'var_shift_v4i64' 65; AVX1-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <4 x i64> %a, %b 66; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 67; 68; AVX2-LABEL: 'var_shift_v4i64' 69; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, %b 70; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 71; 72; XOPAVX1-LABEL: 'var_shift_v4i64' 73; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <4 x i64> %a, %b 74; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 75; 76; XOPAVX2-LABEL: 'var_shift_v4i64' 77; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, %b 78; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 79; 80; AVX512-LABEL: 'var_shift_v4i64' 81; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, %b 82; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 83; 84 %shift = lshr <4 x i64> %a, %b 85 ret <4 x i64> %shift 86} 87 88define <8 x i64> @var_shift_v8i64(<8 x i64> %a, <8 x i64> %b) { 89; SSE2-LABEL: 'var_shift_v8i64' 90; SSE2-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = lshr <8 x i64> %a, %b 91; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 92; 93; SSE42-LABEL: 'var_shift_v8i64' 94; SSE42-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = lshr <8 x i64> %a, %b 95; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 96; 97; AVX1-LABEL: 'var_shift_v8i64' 98; AVX1-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = lshr <8 x i64> %a, %b 99; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 100; 101; AVX2-LABEL: 'var_shift_v8i64' 102; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i64> %a, %b 103; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 104; 105; XOPAVX1-LABEL: 'var_shift_v8i64' 106; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <8 x i64> %a, %b 107; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 108; 109; XOPAVX2-LABEL: 'var_shift_v8i64' 110; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i64> %a, %b 111; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 112; 113; AVX512-LABEL: 'var_shift_v8i64' 114; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i64> %a, %b 115; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 116; 117 %shift = lshr <8 x i64> %a, %b 118 ret <8 x i64> %shift 119} 120 121define <4 x i32> @var_shift_v4i32(<4 x i32> %a, <4 x i32> %b) { 122; SSE2-LABEL: 'var_shift_v4i32' 123; SSE2-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %shift = lshr <4 x i32> %a, %b 124; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %shift 125; 126; SSE42-LABEL: 'var_shift_v4i32' 127; SSE42-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %shift = lshr <4 x i32> %a, %b 128; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %shift 129; 130; AVX1-LABEL: 'var_shift_v4i32' 131; AVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <4 x i32> %a, %b 132; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %shift 133; 134; AVX2-LABEL: 'var_shift_v4i32' 135; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i32> %a, %b 136; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %shift 137; 138; XOP-LABEL: 'var_shift_v4i32' 139; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i32> %a, %b 140; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %shift 141; 142; AVX512-LABEL: 'var_shift_v4i32' 143; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i32> %a, %b 144; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %shift 145; 146 %shift = lshr <4 x i32> %a, %b 147 ret <4 x i32> %shift 148} 149 150define <8 x i32> @var_shift_v8i32(<8 x i32> %a, <8 x i32> %b) { 151; SSE2-LABEL: 'var_shift_v8i32' 152; SSE2-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %shift = lshr <8 x i32> %a, %b 153; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 154; 155; SSE42-LABEL: 'var_shift_v8i32' 156; SSE42-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %shift = lshr <8 x i32> %a, %b 157; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 158; 159; AVX1-LABEL: 'var_shift_v8i32' 160; AVX1-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %shift = lshr <8 x i32> %a, %b 161; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 162; 163; AVX2-LABEL: 'var_shift_v8i32' 164; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, %b 165; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 166; 167; XOPAVX1-LABEL: 'var_shift_v8i32' 168; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <8 x i32> %a, %b 169; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 170; 171; XOPAVX2-LABEL: 'var_shift_v8i32' 172; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, %b 173; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 174; 175; AVX512-LABEL: 'var_shift_v8i32' 176; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, %b 177; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 178; 179 %shift = lshr <8 x i32> %a, %b 180 ret <8 x i32> %shift 181} 182 183define <16 x i32> @var_shift_v16i32(<16 x i32> %a, <16 x i32> %b) { 184; SSE2-LABEL: 'var_shift_v16i32' 185; SSE2-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %shift = lshr <16 x i32> %a, %b 186; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 187; 188; SSE42-LABEL: 'var_shift_v16i32' 189; SSE42-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %shift = lshr <16 x i32> %a, %b 190; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 191; 192; AVX1-LABEL: 'var_shift_v16i32' 193; AVX1-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %shift = lshr <16 x i32> %a, %b 194; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 195; 196; AVX2-LABEL: 'var_shift_v16i32' 197; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i32> %a, %b 198; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 199; 200; XOPAVX1-LABEL: 'var_shift_v16i32' 201; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <16 x i32> %a, %b 202; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 203; 204; XOPAVX2-LABEL: 'var_shift_v16i32' 205; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i32> %a, %b 206; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 207; 208; AVX512-LABEL: 'var_shift_v16i32' 209; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i32> %a, %b 210; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 211; 212 %shift = lshr <16 x i32> %a, %b 213 ret <16 x i32> %shift 214} 215 216define <8 x i16> @var_shift_v8i16(<8 x i16> %a, <8 x i16> %b) { 217; SSE2-LABEL: 'var_shift_v8i16' 218; SSE2-NEXT: Cost Model: Found an estimated cost of 31 for instruction: %shift = lshr <8 x i16> %a, %b 219; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 220; 221; SSE42-LABEL: 'var_shift_v8i16' 222; SSE42-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %shift = lshr <8 x i16> %a, %b 223; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 224; 225; AVX1-LABEL: 'var_shift_v8i16' 226; AVX1-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = lshr <8 x i16> %a, %b 227; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 228; 229; AVX2-LABEL: 'var_shift_v8i16' 230; AVX2-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <8 x i16> %a, %b 231; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 232; 233; XOP-LABEL: 'var_shift_v8i16' 234; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, %b 235; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 236; 237; AVX512F-LABEL: 'var_shift_v8i16' 238; AVX512F-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <8 x i16> %a, %b 239; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 240; 241; AVX512BW-LABEL: 'var_shift_v8i16' 242; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, %b 243; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 244; 245; AVX512GFNI-LABEL: 'var_shift_v8i16' 246; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, %b 247; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 248; 249 %shift = lshr <8 x i16> %a, %b 250 ret <8 x i16> %shift 251} 252 253define <16 x i16> @var_shift_v16i16(<16 x i16> %a, <16 x i16> %b) { 254; SSE2-LABEL: 'var_shift_v16i16' 255; SSE2-NEXT: Cost Model: Found an estimated cost of 62 for instruction: %shift = lshr <16 x i16> %a, %b 256; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 257; 258; SSE42-LABEL: 'var_shift_v16i16' 259; SSE42-NEXT: Cost Model: Found an estimated cost of 46 for instruction: %shift = lshr <16 x i16> %a, %b 260; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 261; 262; AVX1-LABEL: 'var_shift_v16i16' 263; AVX1-NEXT: Cost Model: Found an estimated cost of 31 for instruction: %shift = lshr <16 x i16> %a, %b 264; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 265; 266; AVX2-LABEL: 'var_shift_v16i16' 267; AVX2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <16 x i16> %a, %b 268; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 269; 270; XOP-LABEL: 'var_shift_v16i16' 271; XOP-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <16 x i16> %a, %b 272; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 273; 274; AVX512F-LABEL: 'var_shift_v16i16' 275; AVX512F-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <16 x i16> %a, %b 276; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 277; 278; AVX512BW-LABEL: 'var_shift_v16i16' 279; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i16> %a, %b 280; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 281; 282; AVX512GFNI-LABEL: 'var_shift_v16i16' 283; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i16> %a, %b 284; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 285; 286 %shift = lshr <16 x i16> %a, %b 287 ret <16 x i16> %shift 288} 289 290define <32 x i16> @var_shift_v32i16(<32 x i16> %a, <32 x i16> %b) { 291; SSE2-LABEL: 'var_shift_v32i16' 292; SSE2-NEXT: Cost Model: Found an estimated cost of 124 for instruction: %shift = lshr <32 x i16> %a, %b 293; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 294; 295; SSE42-LABEL: 'var_shift_v32i16' 296; SSE42-NEXT: Cost Model: Found an estimated cost of 92 for instruction: %shift = lshr <32 x i16> %a, %b 297; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 298; 299; AVX1-LABEL: 'var_shift_v32i16' 300; AVX1-NEXT: Cost Model: Found an estimated cost of 62 for instruction: %shift = lshr <32 x i16> %a, %b 301; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 302; 303; AVX2-LABEL: 'var_shift_v32i16' 304; AVX2-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = lshr <32 x i16> %a, %b 305; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 306; 307; XOP-LABEL: 'var_shift_v32i16' 308; XOP-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <32 x i16> %a, %b 309; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 310; 311; AVX512F-LABEL: 'var_shift_v32i16' 312; AVX512F-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <32 x i16> %a, %b 313; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 314; 315; AVX512BW-LABEL: 'var_shift_v32i16' 316; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <32 x i16> %a, %b 317; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 318; 319; AVX512GFNI-LABEL: 'var_shift_v32i16' 320; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <32 x i16> %a, %b 321; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 322; 323 %shift = lshr <32 x i16> %a, %b 324 ret <32 x i16> %shift 325} 326 327define <16 x i8> @var_shift_v16i8(<16 x i8> %a, <16 x i8> %b) { 328; SSE2-LABEL: 'var_shift_v16i8' 329; SSE2-NEXT: Cost Model: Found an estimated cost of 27 for instruction: %shift = lshr <16 x i8> %a, %b 330; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 331; 332; SSE42-LABEL: 'var_shift_v16i8' 333; SSE42-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %shift = lshr <16 x i8> %a, %b 334; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 335; 336; AVX-LABEL: 'var_shift_v16i8' 337; AVX-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <16 x i8> %a, %b 338; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 339; 340; XOP-LABEL: 'var_shift_v16i8' 341; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i8> %a, %b 342; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 343; 344; AVX512F-LABEL: 'var_shift_v16i8' 345; AVX512F-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <16 x i8> %a, %b 346; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 347; 348; AVX512BW-LABEL: 'var_shift_v16i8' 349; AVX512BW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <16 x i8> %a, %b 350; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 351; 352; AVX512GFNI-LABEL: 'var_shift_v16i8' 353; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <16 x i8> %a, %b 354; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 355; 356 %shift = lshr <16 x i8> %a, %b 357 ret <16 x i8> %shift 358} 359 360define <32 x i8> @var_shift_v32i8(<32 x i8> %a, <32 x i8> %b) { 361; SSE2-LABEL: 'var_shift_v32i8' 362; SSE2-NEXT: Cost Model: Found an estimated cost of 54 for instruction: %shift = lshr <32 x i8> %a, %b 363; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 364; 365; SSE42-LABEL: 'var_shift_v32i8' 366; SSE42-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %shift = lshr <32 x i8> %a, %b 367; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 368; 369; AVX1-LABEL: 'var_shift_v32i8' 370; AVX1-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %shift = lshr <32 x i8> %a, %b 371; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 372; 373; AVX2-LABEL: 'var_shift_v32i8' 374; AVX2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <32 x i8> %a, %b 375; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 376; 377; XOP-LABEL: 'var_shift_v32i8' 378; XOP-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <32 x i8> %a, %b 379; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 380; 381; AVX512-LABEL: 'var_shift_v32i8' 382; AVX512-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <32 x i8> %a, %b 383; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 384; 385 %shift = lshr <32 x i8> %a, %b 386 ret <32 x i8> %shift 387} 388 389define <64 x i8> @var_shift_v64i8(<64 x i8> %a, <64 x i8> %b) { 390; SSE2-LABEL: 'var_shift_v64i8' 391; SSE2-NEXT: Cost Model: Found an estimated cost of 108 for instruction: %shift = lshr <64 x i8> %a, %b 392; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 393; 394; SSE42-LABEL: 'var_shift_v64i8' 395; SSE42-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %shift = lshr <64 x i8> %a, %b 396; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 397; 398; AVX1-LABEL: 'var_shift_v64i8' 399; AVX1-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %shift = lshr <64 x i8> %a, %b 400; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 401; 402; AVX2-LABEL: 'var_shift_v64i8' 403; AVX2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = lshr <64 x i8> %a, %b 404; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 405; 406; XOP-LABEL: 'var_shift_v64i8' 407; XOP-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <64 x i8> %a, %b 408; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 409; 410; AVX512F-LABEL: 'var_shift_v64i8' 411; AVX512F-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %shift = lshr <64 x i8> %a, %b 412; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 413; 414; AVX512BW-LABEL: 'var_shift_v64i8' 415; AVX512BW-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %shift = lshr <64 x i8> %a, %b 416; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 417; 418; AVX512GFNI-LABEL: 'var_shift_v64i8' 419; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %shift = lshr <64 x i8> %a, %b 420; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 421; 422 %shift = lshr <64 x i8> %a, %b 423 ret <64 x i8> %shift 424} 425 426; 427; Uniform Variable Shifts 428; 429 430define <2 x i64> @splatvar_shift_v2i64(<2 x i64> %a, i64 %b) { 431; CHECK-LABEL: 'splatvar_shift_v2i64' 432; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <2 x i64> undef, i64 %b, i32 0 433; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <2 x i64> %insert, <2 x i64> undef, <2 x i32> zeroinitializer 434; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <2 x i64> %a, %splat 435; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %shift 436; 437 %insert = insertelement <2 x i64> undef, i64 %b, i32 0 438 %splat = shufflevector <2 x i64> %insert, <2 x i64> undef, <2 x i32> zeroinitializer 439 %shift = lshr <2 x i64> %a, %splat 440 ret <2 x i64> %shift 441} 442 443define <4 x i64> @splatvar_shift_v4i64(<4 x i64> %a, i64 %b) { 444; SSE2-LABEL: 'splatvar_shift_v4i64' 445; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 446; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer 447; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <4 x i64> %a, %splat 448; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 449; 450; SSE42-LABEL: 'splatvar_shift_v4i64' 451; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 452; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer 453; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <4 x i64> %a, %splat 454; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 455; 456; AVX1-LABEL: 'splatvar_shift_v4i64' 457; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 458; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer 459; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <4 x i64> %a, %splat 460; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 461; 462; AVX2-LABEL: 'splatvar_shift_v4i64' 463; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 464; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer 465; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, %splat 466; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 467; 468; XOPAVX1-LABEL: 'splatvar_shift_v4i64' 469; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 470; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer 471; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <4 x i64> %a, %splat 472; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 473; 474; XOPAVX2-LABEL: 'splatvar_shift_v4i64' 475; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 476; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer 477; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, %splat 478; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 479; 480; AVX512-LABEL: 'splatvar_shift_v4i64' 481; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 482; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer 483; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, %splat 484; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 485; 486 %insert = insertelement <4 x i64> undef, i64 %b, i32 0 487 %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer 488 %shift = lshr <4 x i64> %a, %splat 489 ret <4 x i64> %shift 490} 491 492define <8 x i64> @splatvar_shift_v8i64(<8 x i64> %a, i64 %b) { 493; SSE2-LABEL: 'splatvar_shift_v8i64' 494; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 495; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer 496; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <8 x i64> %a, %splat 497; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 498; 499; SSE42-LABEL: 'splatvar_shift_v8i64' 500; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 501; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer 502; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <8 x i64> %a, %splat 503; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 504; 505; AVX1-LABEL: 'splatvar_shift_v8i64' 506; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 507; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer 508; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <8 x i64> %a, %splat 509; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 510; 511; AVX2-LABEL: 'splatvar_shift_v8i64' 512; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 513; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer 514; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i64> %a, %splat 515; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 516; 517; XOPAVX1-LABEL: 'splatvar_shift_v8i64' 518; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 519; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer 520; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <8 x i64> %a, %splat 521; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 522; 523; XOPAVX2-LABEL: 'splatvar_shift_v8i64' 524; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 525; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer 526; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i64> %a, %splat 527; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 528; 529; AVX512-LABEL: 'splatvar_shift_v8i64' 530; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 531; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer 532; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i64> %a, %splat 533; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 534; 535 %insert = insertelement <8 x i64> undef, i64 %b, i32 0 536 %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer 537 %shift = lshr <8 x i64> %a, %splat 538 ret <8 x i64> %shift 539} 540 541define <4 x i32> @splatvar_shift_v4i32(<4 x i32> %a, i32 %b) { 542; CHECK-LABEL: 'splatvar_shift_v4i32' 543; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i32> undef, i32 %b, i32 0 544; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i32> %insert, <4 x i32> undef, <4 x i32> zeroinitializer 545; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i32> %a, %splat 546; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %shift 547; 548 %insert = insertelement <4 x i32> undef, i32 %b, i32 0 549 %splat = shufflevector <4 x i32> %insert, <4 x i32> undef, <4 x i32> zeroinitializer 550 %shift = lshr <4 x i32> %a, %splat 551 ret <4 x i32> %shift 552} 553 554define <8 x i32> @splatvar_shift_v8i32(<8 x i32> %a, i32 %b) { 555; SSE2-LABEL: 'splatvar_shift_v8i32' 556; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 557; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer 558; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i32> %a, %splat 559; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 560; 561; SSE42-LABEL: 'splatvar_shift_v8i32' 562; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 563; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer 564; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i32> %a, %splat 565; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 566; 567; AVX1-LABEL: 'splatvar_shift_v8i32' 568; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 569; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer 570; AVX1-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <8 x i32> %a, %splat 571; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 572; 573; AVX2-LABEL: 'splatvar_shift_v8i32' 574; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 575; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer 576; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i32> %a, %splat 577; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 578; 579; XOPAVX1-LABEL: 'splatvar_shift_v8i32' 580; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 581; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer 582; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <8 x i32> %a, %splat 583; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 584; 585; XOPAVX2-LABEL: 'splatvar_shift_v8i32' 586; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 587; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer 588; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i32> %a, %splat 589; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 590; 591; AVX512-LABEL: 'splatvar_shift_v8i32' 592; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 593; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer 594; AVX512-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i32> %a, %splat 595; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 596; 597 %insert = insertelement <8 x i32> undef, i32 %b, i32 0 598 %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer 599 %shift = lshr <8 x i32> %a, %splat 600 ret <8 x i32> %shift 601} 602 603define <16 x i32> @splatvar_shift_v16i32(<16 x i32> %a, i32 %b) { 604; SSE2-LABEL: 'splatvar_shift_v16i32' 605; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 606; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer 607; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <16 x i32> %a, %splat 608; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 609; 610; SSE42-LABEL: 'splatvar_shift_v16i32' 611; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 612; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer 613; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <16 x i32> %a, %splat 614; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 615; 616; AVX1-LABEL: 'splatvar_shift_v16i32' 617; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 618; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer 619; AVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <16 x i32> %a, %splat 620; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 621; 622; AVX2-LABEL: 'splatvar_shift_v16i32' 623; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 624; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer 625; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <16 x i32> %a, %splat 626; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 627; 628; XOPAVX1-LABEL: 'splatvar_shift_v16i32' 629; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 630; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer 631; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <16 x i32> %a, %splat 632; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 633; 634; XOPAVX2-LABEL: 'splatvar_shift_v16i32' 635; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 636; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer 637; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <16 x i32> %a, %splat 638; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 639; 640; AVX512-LABEL: 'splatvar_shift_v16i32' 641; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 642; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer 643; AVX512-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i32> %a, %splat 644; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 645; 646 %insert = insertelement <16 x i32> undef, i32 %b, i32 0 647 %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer 648 %shift = lshr <16 x i32> %a, %splat 649 ret <16 x i32> %shift 650} 651 652define <8 x i16> @splatvar_shift_v8i16(<8 x i16> %a, i16 %b) { 653; SSE2-LABEL: 'splatvar_shift_v8i16' 654; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 655; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer 656; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, %splat 657; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 658; 659; SSE42-LABEL: 'splatvar_shift_v8i16' 660; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 661; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer 662; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, %splat 663; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 664; 665; AVX-LABEL: 'splatvar_shift_v8i16' 666; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 667; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer 668; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, %splat 669; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 670; 671; XOP-LABEL: 'splatvar_shift_v8i16' 672; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 673; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer 674; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, %splat 675; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 676; 677; AVX512-LABEL: 'splatvar_shift_v8i16' 678; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 679; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer 680; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, %splat 681; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 682; 683 %insert = insertelement <8 x i16> undef, i16 %b, i32 0 684 %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer 685 %shift = lshr <8 x i16> %a, %splat 686 ret <8 x i16> %shift 687} 688 689define <16 x i16> @splatvar_shift_v16i16(<16 x i16> %a, i16 %b) { 690; SSE2-LABEL: 'splatvar_shift_v16i16' 691; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 692; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer 693; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i16> %a, %splat 694; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 695; 696; SSE42-LABEL: 'splatvar_shift_v16i16' 697; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 698; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer 699; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i16> %a, %splat 700; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 701; 702; AVX1-LABEL: 'splatvar_shift_v16i16' 703; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 704; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer 705; AVX1-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <16 x i16> %a, %splat 706; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 707; 708; AVX2-LABEL: 'splatvar_shift_v16i16' 709; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 710; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer 711; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i16> %a, %splat 712; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 713; 714; XOPAVX1-LABEL: 'splatvar_shift_v16i16' 715; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 716; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer 717; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <16 x i16> %a, %splat 718; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 719; 720; XOPAVX2-LABEL: 'splatvar_shift_v16i16' 721; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 722; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer 723; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i16> %a, %splat 724; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 725; 726; AVX512-LABEL: 'splatvar_shift_v16i16' 727; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 728; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer 729; AVX512-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i16> %a, %splat 730; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 731; 732 %insert = insertelement <16 x i16> undef, i16 %b, i32 0 733 %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer 734 %shift = lshr <16 x i16> %a, %splat 735 ret <16 x i16> %shift 736} 737 738define <32 x i16> @splatvar_shift_v32i16(<32 x i16> %a, i16 %b) { 739; SSE2-LABEL: 'splatvar_shift_v32i16' 740; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 741; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer 742; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <32 x i16> %a, %splat 743; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 744; 745; SSE42-LABEL: 'splatvar_shift_v32i16' 746; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 747; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer 748; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <32 x i16> %a, %splat 749; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 750; 751; AVX1-LABEL: 'splatvar_shift_v32i16' 752; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 753; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer 754; AVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <32 x i16> %a, %splat 755; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 756; 757; AVX2-LABEL: 'splatvar_shift_v32i16' 758; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 759; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer 760; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <32 x i16> %a, %splat 761; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 762; 763; XOPAVX1-LABEL: 'splatvar_shift_v32i16' 764; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 765; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer 766; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <32 x i16> %a, %splat 767; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 768; 769; XOPAVX2-LABEL: 'splatvar_shift_v32i16' 770; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 771; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer 772; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <32 x i16> %a, %splat 773; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 774; 775; AVX512F-LABEL: 'splatvar_shift_v32i16' 776; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 777; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer 778; AVX512F-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <32 x i16> %a, %splat 779; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 780; 781; AVX512BW-LABEL: 'splatvar_shift_v32i16' 782; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 783; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer 784; AVX512BW-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i16> %a, %splat 785; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 786; 787; AVX512GFNI-LABEL: 'splatvar_shift_v32i16' 788; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 789; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer 790; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i16> %a, %splat 791; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 792; 793 %insert = insertelement <32 x i16> undef, i16 %b, i32 0 794 %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer 795 %shift = lshr <32 x i16> %a, %splat 796 ret <32 x i16> %shift 797} 798 799define <16 x i8> @splatvar_shift_v16i8(<16 x i8> %a, i8 %b) { 800; SSE2-LABEL: 'splatvar_shift_v16i8' 801; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 802; SSE2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer 803; SSE2-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <16 x i8> %a, %splat 804; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 805; 806; SSE42-LABEL: 'splatvar_shift_v16i8' 807; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 808; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer 809; SSE42-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <16 x i8> %a, %splat 810; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 811; 812; AVX-LABEL: 'splatvar_shift_v16i8' 813; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 814; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer 815; AVX-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <16 x i8> %a, %splat 816; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 817; 818; XOPAVX1-LABEL: 'splatvar_shift_v16i8' 819; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 820; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer 821; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i8> %a, %splat 822; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 823; 824; XOPAVX2-LABEL: 'splatvar_shift_v16i8' 825; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 826; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer 827; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <16 x i8> %a, %splat 828; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 829; 830; AVX512-LABEL: 'splatvar_shift_v16i8' 831; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 832; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer 833; AVX512-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <16 x i8> %a, %splat 834; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 835; 836 %insert = insertelement <16 x i8> undef, i8 %b, i32 0 837 %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer 838 %shift = lshr <16 x i8> %a, %splat 839 ret <16 x i8> %shift 840} 841 842define <32 x i8> @splatvar_shift_v32i8(<32 x i8> %a, i8 %b) { 843; SSE2-LABEL: 'splatvar_shift_v32i8' 844; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 845; SSE2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer 846; SSE2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <32 x i8> %a, %splat 847; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 848; 849; SSE42-LABEL: 'splatvar_shift_v32i8' 850; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 851; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer 852; SSE42-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <32 x i8> %a, %splat 853; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 854; 855; AVX1-LABEL: 'splatvar_shift_v32i8' 856; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 857; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer 858; AVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <32 x i8> %a, %splat 859; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 860; 861; AVX2-LABEL: 'splatvar_shift_v32i8' 862; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 863; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer 864; AVX2-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %shift = lshr <32 x i8> %a, %splat 865; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 866; 867; XOPAVX1-LABEL: 'splatvar_shift_v32i8' 868; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 869; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer 870; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <32 x i8> %a, %splat 871; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 872; 873; XOPAVX2-LABEL: 'splatvar_shift_v32i8' 874; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 875; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer 876; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %shift = lshr <32 x i8> %a, %splat 877; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 878; 879; AVX512-LABEL: 'splatvar_shift_v32i8' 880; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 881; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer 882; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %shift = lshr <32 x i8> %a, %splat 883; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 884; 885 %insert = insertelement <32 x i8> undef, i8 %b, i32 0 886 %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer 887 %shift = lshr <32 x i8> %a, %splat 888 ret <32 x i8> %shift 889} 890 891define <64 x i8> @splatvar_shift_v64i8(<64 x i8> %a, i8 %b) { 892; SSE2-LABEL: 'splatvar_shift_v64i8' 893; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 894; SSE2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer 895; SSE2-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = lshr <64 x i8> %a, %splat 896; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 897; 898; SSE42-LABEL: 'splatvar_shift_v64i8' 899; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 900; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer 901; SSE42-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = lshr <64 x i8> %a, %splat 902; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 903; 904; AVX1-LABEL: 'splatvar_shift_v64i8' 905; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 906; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer 907; AVX1-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = lshr <64 x i8> %a, %splat 908; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 909; 910; AVX2-LABEL: 'splatvar_shift_v64i8' 911; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 912; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer 913; AVX2-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = lshr <64 x i8> %a, %splat 914; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 915; 916; XOPAVX1-LABEL: 'splatvar_shift_v64i8' 917; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 918; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer 919; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <64 x i8> %a, %splat 920; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 921; 922; XOPAVX2-LABEL: 'splatvar_shift_v64i8' 923; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 924; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer 925; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = lshr <64 x i8> %a, %splat 926; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 927; 928; AVX512F-LABEL: 'splatvar_shift_v64i8' 929; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 930; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer 931; AVX512F-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %shift = lshr <64 x i8> %a, %splat 932; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 933; 934; AVX512BW-LABEL: 'splatvar_shift_v64i8' 935; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 936; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer 937; AVX512BW-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %shift = lshr <64 x i8> %a, %splat 938; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 939; 940; AVX512GFNI-LABEL: 'splatvar_shift_v64i8' 941; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 942; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer 943; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %shift = lshr <64 x i8> %a, %splat 944; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 945; 946 %insert = insertelement <64 x i8> undef, i8 %b, i32 0 947 %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer 948 %shift = lshr <64 x i8> %a, %splat 949 ret <64 x i8> %shift 950} 951 952; 953; Constant Shifts 954; 955 956define <2 x i64> @constant_shift_v2i64(<2 x i64> %a) { 957; SSE2-LABEL: 'constant_shift_v2i64' 958; SSE2-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <2 x i64> %a, <i64 1, i64 7> 959; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %shift 960; 961; SSE42-LABEL: 'constant_shift_v2i64' 962; SSE42-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <2 x i64> %a, <i64 1, i64 7> 963; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %shift 964; 965; AVX1-LABEL: 'constant_shift_v2i64' 966; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <2 x i64> %a, <i64 1, i64 7> 967; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %shift 968; 969; AVX2-LABEL: 'constant_shift_v2i64' 970; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <2 x i64> %a, <i64 1, i64 7> 971; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %shift 972; 973; XOP-LABEL: 'constant_shift_v2i64' 974; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <2 x i64> %a, <i64 1, i64 7> 975; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %shift 976; 977; AVX512-LABEL: 'constant_shift_v2i64' 978; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <2 x i64> %a, <i64 1, i64 7> 979; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %shift 980; 981 %shift = lshr <2 x i64> %a, <i64 1, i64 7> 982 ret <2 x i64> %shift 983} 984 985define <4 x i64> @constant_shift_v4i64(<4 x i64> %a) { 986; SSE2-LABEL: 'constant_shift_v4i64' 987; SSE2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <4 x i64> %a, <i64 1, i64 7, i64 15, i64 31> 988; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 989; 990; SSE42-LABEL: 'constant_shift_v4i64' 991; SSE42-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <4 x i64> %a, <i64 1, i64 7, i64 15, i64 31> 992; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 993; 994; AVX1-LABEL: 'constant_shift_v4i64' 995; AVX1-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <4 x i64> %a, <i64 1, i64 7, i64 15, i64 31> 996; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 997; 998; AVX2-LABEL: 'constant_shift_v4i64' 999; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, <i64 1, i64 7, i64 15, i64 31> 1000; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 1001; 1002; XOPAVX1-LABEL: 'constant_shift_v4i64' 1003; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <4 x i64> %a, <i64 1, i64 7, i64 15, i64 31> 1004; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 1005; 1006; XOPAVX2-LABEL: 'constant_shift_v4i64' 1007; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, <i64 1, i64 7, i64 15, i64 31> 1008; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 1009; 1010; AVX512-LABEL: 'constant_shift_v4i64' 1011; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, <i64 1, i64 7, i64 15, i64 31> 1012; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 1013; 1014 %shift = lshr <4 x i64> %a, <i64 1, i64 7, i64 15, i64 31> 1015 ret <4 x i64> %shift 1016} 1017 1018define <8 x i64> @constant_shift_v8i64(<8 x i64> %a) { 1019; SSE2-LABEL: 'constant_shift_v8i64' 1020; SSE2-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = lshr <8 x i64> %a, <i64 1, i64 7, i64 15, i64 31, i64 1, i64 7, i64 15, i64 31> 1021; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 1022; 1023; SSE42-LABEL: 'constant_shift_v8i64' 1024; SSE42-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = lshr <8 x i64> %a, <i64 1, i64 7, i64 15, i64 31, i64 1, i64 7, i64 15, i64 31> 1025; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 1026; 1027; AVX1-LABEL: 'constant_shift_v8i64' 1028; AVX1-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = lshr <8 x i64> %a, <i64 1, i64 7, i64 15, i64 31, i64 1, i64 7, i64 15, i64 31> 1029; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 1030; 1031; AVX2-LABEL: 'constant_shift_v8i64' 1032; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i64> %a, <i64 1, i64 7, i64 15, i64 31, i64 1, i64 7, i64 15, i64 31> 1033; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 1034; 1035; XOPAVX1-LABEL: 'constant_shift_v8i64' 1036; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <8 x i64> %a, <i64 1, i64 7, i64 15, i64 31, i64 1, i64 7, i64 15, i64 31> 1037; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 1038; 1039; XOPAVX2-LABEL: 'constant_shift_v8i64' 1040; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i64> %a, <i64 1, i64 7, i64 15, i64 31, i64 1, i64 7, i64 15, i64 31> 1041; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 1042; 1043; AVX512-LABEL: 'constant_shift_v8i64' 1044; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i64> %a, <i64 1, i64 7, i64 15, i64 31, i64 1, i64 7, i64 15, i64 31> 1045; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 1046; 1047 %shift = lshr <8 x i64> %a, <i64 1, i64 7, i64 15, i64 31, i64 1, i64 7, i64 15, i64 31> 1048 ret <8 x i64> %shift 1049} 1050 1051define <4 x i32> @constant_shift_v4i32(<4 x i32> %a) { 1052; SSE2-LABEL: 'constant_shift_v4i32' 1053; SSE2-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %shift = lshr <4 x i32> %a, <i32 4, i32 5, i32 6, i32 7> 1054; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %shift 1055; 1056; SSE42-LABEL: 'constant_shift_v4i32' 1057; SSE42-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %shift = lshr <4 x i32> %a, <i32 4, i32 5, i32 6, i32 7> 1058; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %shift 1059; 1060; AVX1-LABEL: 'constant_shift_v4i32' 1061; AVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <4 x i32> %a, <i32 4, i32 5, i32 6, i32 7> 1062; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %shift 1063; 1064; AVX2-LABEL: 'constant_shift_v4i32' 1065; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i32> %a, <i32 4, i32 5, i32 6, i32 7> 1066; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %shift 1067; 1068; XOP-LABEL: 'constant_shift_v4i32' 1069; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i32> %a, <i32 4, i32 5, i32 6, i32 7> 1070; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %shift 1071; 1072; AVX512-LABEL: 'constant_shift_v4i32' 1073; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i32> %a, <i32 4, i32 5, i32 6, i32 7> 1074; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %shift 1075; 1076 %shift = lshr <4 x i32> %a, <i32 4, i32 5, i32 6, i32 7> 1077 ret <4 x i32> %shift 1078} 1079 1080define <8 x i32> @constant_shift_v8i32(<8 x i32> %a) { 1081; SSE2-LABEL: 'constant_shift_v8i32' 1082; SSE2-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %shift = lshr <8 x i32> %a, <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3> 1083; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 1084; 1085; SSE42-LABEL: 'constant_shift_v8i32' 1086; SSE42-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %shift = lshr <8 x i32> %a, <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3> 1087; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 1088; 1089; AVX1-LABEL: 'constant_shift_v8i32' 1090; AVX1-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %shift = lshr <8 x i32> %a, <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3> 1091; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 1092; 1093; AVX2-LABEL: 'constant_shift_v8i32' 1094; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3> 1095; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 1096; 1097; XOPAVX1-LABEL: 'constant_shift_v8i32' 1098; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <8 x i32> %a, <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3> 1099; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 1100; 1101; XOPAVX2-LABEL: 'constant_shift_v8i32' 1102; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3> 1103; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 1104; 1105; AVX512-LABEL: 'constant_shift_v8i32' 1106; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3> 1107; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 1108; 1109 %shift = lshr <8 x i32> %a, <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3> 1110 ret <8 x i32> %shift 1111} 1112 1113define <16 x i32> @constant_shift_v16i32(<16 x i32> %a) { 1114; SSE2-LABEL: 'constant_shift_v16i32' 1115; SSE2-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %shift = lshr <16 x i32> %a, <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3> 1116; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 1117; 1118; SSE42-LABEL: 'constant_shift_v16i32' 1119; SSE42-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %shift = lshr <16 x i32> %a, <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3> 1120; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 1121; 1122; AVX1-LABEL: 'constant_shift_v16i32' 1123; AVX1-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %shift = lshr <16 x i32> %a, <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3> 1124; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 1125; 1126; AVX2-LABEL: 'constant_shift_v16i32' 1127; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i32> %a, <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3> 1128; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 1129; 1130; XOPAVX1-LABEL: 'constant_shift_v16i32' 1131; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <16 x i32> %a, <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3> 1132; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 1133; 1134; XOPAVX2-LABEL: 'constant_shift_v16i32' 1135; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i32> %a, <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3> 1136; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 1137; 1138; AVX512-LABEL: 'constant_shift_v16i32' 1139; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i32> %a, <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3> 1140; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 1141; 1142 %shift = lshr <16 x i32> %a, <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3> 1143 ret <16 x i32> %shift 1144} 1145 1146define <8 x i16> @constant_shift_v8i16(<8 x i16> %a) { 1147; SSE2-LABEL: 'constant_shift_v8i16' 1148; SSE2-NEXT: Cost Model: Found an estimated cost of 31 for instruction: %shift = lshr <8 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7> 1149; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 1150; 1151; SSE42-LABEL: 'constant_shift_v8i16' 1152; SSE42-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %shift = lshr <8 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7> 1153; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 1154; 1155; AVX1-LABEL: 'constant_shift_v8i16' 1156; AVX1-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = lshr <8 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7> 1157; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 1158; 1159; AVX2-LABEL: 'constant_shift_v8i16' 1160; AVX2-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <8 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7> 1161; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 1162; 1163; XOP-LABEL: 'constant_shift_v8i16' 1164; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7> 1165; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 1166; 1167; AVX512F-LABEL: 'constant_shift_v8i16' 1168; AVX512F-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <8 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7> 1169; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 1170; 1171; AVX512BW-LABEL: 'constant_shift_v8i16' 1172; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7> 1173; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 1174; 1175; AVX512GFNI-LABEL: 'constant_shift_v8i16' 1176; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7> 1177; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 1178; 1179 %shift = lshr <8 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7> 1180 ret <8 x i16> %shift 1181} 1182 1183define <16 x i16> @constant_shift_v16i16(<16 x i16> %a) { 1184; SSE2-LABEL: 'constant_shift_v16i16' 1185; SSE2-NEXT: Cost Model: Found an estimated cost of 62 for instruction: %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> 1186; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 1187; 1188; SSE42-LABEL: 'constant_shift_v16i16' 1189; SSE42-NEXT: Cost Model: Found an estimated cost of 46 for instruction: %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> 1190; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 1191; 1192; AVX1-LABEL: 'constant_shift_v16i16' 1193; AVX1-NEXT: Cost Model: Found an estimated cost of 31 for instruction: %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> 1194; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 1195; 1196; AVX2-LABEL: 'constant_shift_v16i16' 1197; AVX2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %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> 1198; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 1199; 1200; XOP-LABEL: 'constant_shift_v16i16' 1201; XOP-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %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> 1202; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 1203; 1204; AVX512F-LABEL: 'constant_shift_v16i16' 1205; AVX512F-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %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> 1206; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 1207; 1208; AVX512BW-LABEL: 'constant_shift_v16i16' 1209; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %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> 1210; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 1211; 1212; AVX512GFNI-LABEL: 'constant_shift_v16i16' 1213; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %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> 1214; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 1215; 1216 %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> 1217 ret <16 x i16> %shift 1218} 1219 1220define <32 x i16> @constant_shift_v32i16(<32 x i16> %a) { 1221; SSE2-LABEL: 'constant_shift_v32i16' 1222; SSE2-NEXT: Cost Model: Found an estimated cost of 124 for instruction: %shift = lshr <32 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, 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> 1223; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 1224; 1225; SSE42-LABEL: 'constant_shift_v32i16' 1226; SSE42-NEXT: Cost Model: Found an estimated cost of 92 for instruction: %shift = lshr <32 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, 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> 1227; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 1228; 1229; AVX1-LABEL: 'constant_shift_v32i16' 1230; AVX1-NEXT: Cost Model: Found an estimated cost of 62 for instruction: %shift = lshr <32 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, 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> 1231; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 1232; 1233; AVX2-LABEL: 'constant_shift_v32i16' 1234; AVX2-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = lshr <32 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, 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> 1235; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 1236; 1237; XOP-LABEL: 'constant_shift_v32i16' 1238; XOP-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <32 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, 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> 1239; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 1240; 1241; AVX512F-LABEL: 'constant_shift_v32i16' 1242; AVX512F-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <32 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, 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> 1243; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 1244; 1245; AVX512BW-LABEL: 'constant_shift_v32i16' 1246; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <32 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, 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> 1247; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 1248; 1249; AVX512GFNI-LABEL: 'constant_shift_v32i16' 1250; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <32 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, 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> 1251; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 1252; 1253 %shift = lshr <32 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, 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> 1254 ret <32 x i16> %shift 1255} 1256 1257define <16 x i8> @constant_shift_v16i8(<16 x i8> %a) { 1258; SSE2-LABEL: 'constant_shift_v16i8' 1259; SSE2-NEXT: Cost Model: Found an estimated cost of 27 for instruction: %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> 1260; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 1261; 1262; SSE42-LABEL: 'constant_shift_v16i8' 1263; SSE42-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %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> 1264; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 1265; 1266; AVX-LABEL: 'constant_shift_v16i8' 1267; AVX-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %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> 1268; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 1269; 1270; XOP-LABEL: 'constant_shift_v16i8' 1271; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %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> 1272; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 1273; 1274; AVX512F-LABEL: 'constant_shift_v16i8' 1275; AVX512F-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %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> 1276; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 1277; 1278; AVX512BW-LABEL: 'constant_shift_v16i8' 1279; AVX512BW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %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> 1280; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 1281; 1282; AVX512GFNI-LABEL: 'constant_shift_v16i8' 1283; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %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> 1284; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 1285; 1286 %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> 1287 ret <16 x i8> %shift 1288} 1289 1290define <32 x i8> @constant_shift_v32i8(<32 x i8> %a) { 1291; SSE2-LABEL: 'constant_shift_v32i8' 1292; SSE2-NEXT: Cost Model: Found an estimated cost of 54 for instruction: %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> 1293; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 1294; 1295; SSE42-LABEL: 'constant_shift_v32i8' 1296; SSE42-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %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> 1297; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 1298; 1299; AVX1-LABEL: 'constant_shift_v32i8' 1300; AVX1-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %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> 1301; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 1302; 1303; AVX2-LABEL: 'constant_shift_v32i8' 1304; AVX2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %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> 1305; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 1306; 1307; XOP-LABEL: 'constant_shift_v32i8' 1308; XOP-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %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> 1309; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 1310; 1311; AVX512-LABEL: 'constant_shift_v32i8' 1312; AVX512-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %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> 1313; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 1314; 1315 %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> 1316 ret <32 x i8> %shift 1317} 1318 1319define <64 x i8> @constant_shift_v64i8(<64 x i8> %a) { 1320; SSE2-LABEL: 'constant_shift_v64i8' 1321; SSE2-NEXT: Cost Model: Found an estimated cost of 108 for instruction: %shift = lshr <64 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, 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> 1322; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 1323; 1324; SSE42-LABEL: 'constant_shift_v64i8' 1325; SSE42-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %shift = lshr <64 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, 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> 1326; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 1327; 1328; AVX1-LABEL: 'constant_shift_v64i8' 1329; AVX1-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %shift = lshr <64 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, 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> 1330; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 1331; 1332; AVX2-LABEL: 'constant_shift_v64i8' 1333; AVX2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = lshr <64 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, 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> 1334; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 1335; 1336; XOP-LABEL: 'constant_shift_v64i8' 1337; XOP-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <64 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, 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> 1338; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 1339; 1340; AVX512F-LABEL: 'constant_shift_v64i8' 1341; AVX512F-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %shift = lshr <64 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, 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> 1342; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 1343; 1344; AVX512BW-LABEL: 'constant_shift_v64i8' 1345; AVX512BW-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %shift = lshr <64 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, 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> 1346; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 1347; 1348; AVX512GFNI-LABEL: 'constant_shift_v64i8' 1349; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %shift = lshr <64 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, 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> 1350; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 1351; 1352 %shift = lshr <64 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, 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> 1353 ret <64 x i8> %shift 1354} 1355 1356; 1357; Uniform Constant Shifts 1358; 1359 1360define <2 x i64> @splatconstant_shift_v2i64(<2 x i64> %a) { 1361; CHECK-LABEL: 'splatconstant_shift_v2i64' 1362; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <2 x i64> %a, splat (i64 7) 1363; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %shift 1364; 1365 %shift = lshr <2 x i64> %a, <i64 7, i64 7> 1366 ret <2 x i64> %shift 1367} 1368 1369define <4 x i64> @splatconstant_shift_v4i64(<4 x i64> %a) { 1370; SSE2-LABEL: 'splatconstant_shift_v4i64' 1371; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <4 x i64> %a, splat (i64 7) 1372; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 1373; 1374; SSE42-LABEL: 'splatconstant_shift_v4i64' 1375; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <4 x i64> %a, splat (i64 7) 1376; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 1377; 1378; AVX1-LABEL: 'splatconstant_shift_v4i64' 1379; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <4 x i64> %a, splat (i64 7) 1380; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 1381; 1382; AVX2-LABEL: 'splatconstant_shift_v4i64' 1383; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, splat (i64 7) 1384; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 1385; 1386; XOPAVX1-LABEL: 'splatconstant_shift_v4i64' 1387; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <4 x i64> %a, splat (i64 7) 1388; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 1389; 1390; XOPAVX2-LABEL: 'splatconstant_shift_v4i64' 1391; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, splat (i64 7) 1392; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 1393; 1394; AVX512-LABEL: 'splatconstant_shift_v4i64' 1395; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, splat (i64 7) 1396; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %shift 1397; 1398 %shift = lshr <4 x i64> %a, <i64 7, i64 7, i64 7, i64 7> 1399 ret <4 x i64> %shift 1400} 1401 1402define <8 x i64> @splatconstant_shift_v8i64(<8 x i64> %a) { 1403; SSE2-LABEL: 'splatconstant_shift_v8i64' 1404; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <8 x i64> %a, splat (i64 7) 1405; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 1406; 1407; SSE42-LABEL: 'splatconstant_shift_v8i64' 1408; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <8 x i64> %a, splat (i64 7) 1409; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 1410; 1411; AVX1-LABEL: 'splatconstant_shift_v8i64' 1412; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <8 x i64> %a, splat (i64 7) 1413; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 1414; 1415; AVX2-LABEL: 'splatconstant_shift_v8i64' 1416; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i64> %a, splat (i64 7) 1417; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 1418; 1419; XOPAVX1-LABEL: 'splatconstant_shift_v8i64' 1420; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <8 x i64> %a, splat (i64 7) 1421; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 1422; 1423; XOPAVX2-LABEL: 'splatconstant_shift_v8i64' 1424; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i64> %a, splat (i64 7) 1425; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 1426; 1427; AVX512-LABEL: 'splatconstant_shift_v8i64' 1428; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i64> %a, splat (i64 7) 1429; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %shift 1430; 1431 %shift = lshr <8 x i64> %a, <i64 7, i64 7, i64 7, i64 7, i64 7, i64 7, i64 7, i64 7> 1432 ret <8 x i64> %shift 1433} 1434 1435define <4 x i32> @splatconstant_shift_v4i32(<4 x i32> %a) { 1436; CHECK-LABEL: 'splatconstant_shift_v4i32' 1437; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i32> %a, splat (i32 5) 1438; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %shift 1439; 1440 %shift = lshr <4 x i32> %a, <i32 5, i32 5, i32 5, i32 5> 1441 ret <4 x i32> %shift 1442} 1443 1444define <8 x i32> @splatconstant_shift_v8i32(<8 x i32> %a) { 1445; SSE2-LABEL: 'splatconstant_shift_v8i32' 1446; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i32> %a, splat (i32 5) 1447; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 1448; 1449; SSE42-LABEL: 'splatconstant_shift_v8i32' 1450; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i32> %a, splat (i32 5) 1451; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 1452; 1453; AVX1-LABEL: 'splatconstant_shift_v8i32' 1454; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <8 x i32> %a, splat (i32 5) 1455; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 1456; 1457; AVX2-LABEL: 'splatconstant_shift_v8i32' 1458; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, splat (i32 5) 1459; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 1460; 1461; XOPAVX1-LABEL: 'splatconstant_shift_v8i32' 1462; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <8 x i32> %a, splat (i32 5) 1463; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 1464; 1465; XOPAVX2-LABEL: 'splatconstant_shift_v8i32' 1466; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, splat (i32 5) 1467; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 1468; 1469; AVX512-LABEL: 'splatconstant_shift_v8i32' 1470; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, splat (i32 5) 1471; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %shift 1472; 1473 %shift = lshr <8 x i32> %a, <i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5> 1474 ret <8 x i32> %shift 1475} 1476 1477define <16 x i32> @splatconstant_shift_v16i32(<16 x i32> %a) { 1478; SSE2-LABEL: 'splatconstant_shift_v16i32' 1479; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <16 x i32> %a, splat (i32 5) 1480; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 1481; 1482; SSE42-LABEL: 'splatconstant_shift_v16i32' 1483; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <16 x i32> %a, splat (i32 5) 1484; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 1485; 1486; AVX1-LABEL: 'splatconstant_shift_v16i32' 1487; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <16 x i32> %a, splat (i32 5) 1488; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 1489; 1490; AVX2-LABEL: 'splatconstant_shift_v16i32' 1491; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i32> %a, splat (i32 5) 1492; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 1493; 1494; XOPAVX1-LABEL: 'splatconstant_shift_v16i32' 1495; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <16 x i32> %a, splat (i32 5) 1496; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 1497; 1498; XOPAVX2-LABEL: 'splatconstant_shift_v16i32' 1499; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i32> %a, splat (i32 5) 1500; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 1501; 1502; AVX512-LABEL: 'splatconstant_shift_v16i32' 1503; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i32> %a, splat (i32 5) 1504; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %shift 1505; 1506 %shift = lshr <16 x i32> %a, <i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5> 1507 ret <16 x i32> %shift 1508} 1509 1510define <8 x i16> @splatconstant_shift_v8i16(<8 x i16> %a) { 1511; CHECK-LABEL: 'splatconstant_shift_v8i16' 1512; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, splat (i16 3) 1513; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %shift 1514; 1515 %shift = lshr <8 x i16> %a, <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3> 1516 ret <8 x i16> %shift 1517} 1518 1519define <16 x i16> @splatconstant_shift_v16i16(<16 x i16> %a) { 1520; SSE2-LABEL: 'splatconstant_shift_v16i16' 1521; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i16> %a, splat (i16 3) 1522; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 1523; 1524; SSE42-LABEL: 'splatconstant_shift_v16i16' 1525; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i16> %a, splat (i16 3) 1526; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 1527; 1528; AVX1-LABEL: 'splatconstant_shift_v16i16' 1529; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <16 x i16> %a, splat (i16 3) 1530; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 1531; 1532; AVX2-LABEL: 'splatconstant_shift_v16i16' 1533; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i16> %a, splat (i16 3) 1534; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 1535; 1536; XOPAVX1-LABEL: 'splatconstant_shift_v16i16' 1537; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <16 x i16> %a, splat (i16 3) 1538; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 1539; 1540; XOPAVX2-LABEL: 'splatconstant_shift_v16i16' 1541; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i16> %a, splat (i16 3) 1542; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 1543; 1544; AVX512F-LABEL: 'splatconstant_shift_v16i16' 1545; AVX512F-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <16 x i16> %a, splat (i16 3) 1546; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 1547; 1548; AVX512BW-LABEL: 'splatconstant_shift_v16i16' 1549; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i16> %a, splat (i16 3) 1550; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 1551; 1552; AVX512GFNI-LABEL: 'splatconstant_shift_v16i16' 1553; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i16> %a, splat (i16 3) 1554; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %shift 1555; 1556 %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> 1557 ret <16 x i16> %shift 1558} 1559 1560define <32 x i16> @splatconstant_shift_v32i16(<32 x i16> %a) { 1561; SSE2-LABEL: 'splatconstant_shift_v32i16' 1562; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <32 x i16> %a, splat (i16 3) 1563; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 1564; 1565; SSE42-LABEL: 'splatconstant_shift_v32i16' 1566; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <32 x i16> %a, splat (i16 3) 1567; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 1568; 1569; AVX1-LABEL: 'splatconstant_shift_v32i16' 1570; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <32 x i16> %a, splat (i16 3) 1571; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 1572; 1573; AVX2-LABEL: 'splatconstant_shift_v32i16' 1574; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i16> %a, splat (i16 3) 1575; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 1576; 1577; XOPAVX1-LABEL: 'splatconstant_shift_v32i16' 1578; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <32 x i16> %a, splat (i16 3) 1579; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 1580; 1581; XOPAVX2-LABEL: 'splatconstant_shift_v32i16' 1582; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i16> %a, splat (i16 3) 1583; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 1584; 1585; AVX512F-LABEL: 'splatconstant_shift_v32i16' 1586; AVX512F-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <32 x i16> %a, splat (i16 3) 1587; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 1588; 1589; AVX512BW-LABEL: 'splatconstant_shift_v32i16' 1590; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <32 x i16> %a, splat (i16 3) 1591; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 1592; 1593; AVX512GFNI-LABEL: 'splatconstant_shift_v32i16' 1594; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <32 x i16> %a, splat (i16 3) 1595; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %shift 1596; 1597 %shift = lshr <32 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, 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> 1598 ret <32 x i16> %shift 1599} 1600 1601define <16 x i8> @splatconstant_shift_v16i8(<16 x i8> %a) { 1602; SSE2-LABEL: 'splatconstant_shift_v16i8' 1603; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i8> %a, splat (i8 3) 1604; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 1605; 1606; SSE42-LABEL: 'splatconstant_shift_v16i8' 1607; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i8> %a, splat (i8 3) 1608; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 1609; 1610; AVX-LABEL: 'splatconstant_shift_v16i8' 1611; AVX-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i8> %a, splat (i8 3) 1612; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 1613; 1614; XOPAVX1-LABEL: 'splatconstant_shift_v16i8' 1615; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i8> %a, splat (i8 3) 1616; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 1617; 1618; XOPAVX2-LABEL: 'splatconstant_shift_v16i8' 1619; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i8> %a, splat (i8 3) 1620; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 1621; 1622; AVX512F-LABEL: 'splatconstant_shift_v16i8' 1623; AVX512F-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i8> %a, splat (i8 3) 1624; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 1625; 1626; AVX512BW-LABEL: 'splatconstant_shift_v16i8' 1627; AVX512BW-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i8> %a, splat (i8 3) 1628; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 1629; 1630; AVX512GFNI-LABEL: 'splatconstant_shift_v16i8' 1631; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i8> %a, splat (i8 3) 1632; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %shift 1633; 1634 %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> 1635 ret <16 x i8> %shift 1636} 1637 1638define <32 x i8> @splatconstant_shift_v32i8(<32 x i8> %a) { 1639; SSE2-LABEL: 'splatconstant_shift_v32i8' 1640; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <32 x i8> %a, splat (i8 3) 1641; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 1642; 1643; SSE42-LABEL: 'splatconstant_shift_v32i8' 1644; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <32 x i8> %a, splat (i8 3) 1645; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 1646; 1647; AVX1-LABEL: 'splatconstant_shift_v32i8' 1648; AVX1-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %shift = lshr <32 x i8> %a, splat (i8 3) 1649; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 1650; 1651; AVX2-LABEL: 'splatconstant_shift_v32i8' 1652; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i8> %a, splat (i8 3) 1653; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 1654; 1655; XOPAVX1-LABEL: 'splatconstant_shift_v32i8' 1656; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <32 x i8> %a, splat (i8 3) 1657; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 1658; 1659; XOPAVX2-LABEL: 'splatconstant_shift_v32i8' 1660; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i8> %a, splat (i8 3) 1661; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 1662; 1663; AVX512F-LABEL: 'splatconstant_shift_v32i8' 1664; AVX512F-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i8> %a, splat (i8 3) 1665; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 1666; 1667; AVX512BW-LABEL: 'splatconstant_shift_v32i8' 1668; AVX512BW-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i8> %a, splat (i8 3) 1669; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 1670; 1671; AVX512GFNI-LABEL: 'splatconstant_shift_v32i8' 1672; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <32 x i8> %a, splat (i8 3) 1673; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %shift 1674; 1675 %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> 1676 ret <32 x i8> %shift 1677} 1678 1679define <64 x i8> @splatconstant_shift_v64i8(<64 x i8> %a) { 1680; SSE2-LABEL: 'splatconstant_shift_v64i8' 1681; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <64 x i8> %a, splat (i8 3) 1682; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 1683; 1684; SSE42-LABEL: 'splatconstant_shift_v64i8' 1685; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <64 x i8> %a, splat (i8 3) 1686; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 1687; 1688; AVX1-LABEL: 'splatconstant_shift_v64i8' 1689; AVX1-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = lshr <64 x i8> %a, splat (i8 3) 1690; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 1691; 1692; AVX2-LABEL: 'splatconstant_shift_v64i8' 1693; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <64 x i8> %a, splat (i8 3) 1694; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 1695; 1696; XOPAVX1-LABEL: 'splatconstant_shift_v64i8' 1697; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <64 x i8> %a, splat (i8 3) 1698; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 1699; 1700; XOPAVX2-LABEL: 'splatconstant_shift_v64i8' 1701; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <64 x i8> %a, splat (i8 3) 1702; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 1703; 1704; AVX512F-LABEL: 'splatconstant_shift_v64i8' 1705; AVX512F-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %shift = lshr <64 x i8> %a, splat (i8 3) 1706; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 1707; 1708; AVX512BW-LABEL: 'splatconstant_shift_v64i8' 1709; AVX512BW-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <64 x i8> %a, splat (i8 3) 1710; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 1711; 1712; AVX512GFNI-LABEL: 'splatconstant_shift_v64i8' 1713; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <64 x i8> %a, splat (i8 3) 1714; AVX512GFNI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %shift 1715; 1716 %shift = lshr <64 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, 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> 1717 ret <64 x i8> %shift 1718} 1719