1 ; RUN: llc -mtriple=x86_64-apple-darwin -mattr=+sse2 < %s | FileCheck --check-prefix=SSE2-CODEGEN %s
2 ; RUN: opt -mtriple=x86_64-apple-darwin -mattr=+sse2 -passes="print<cost-model>" 2>&1 -disable-output < %s | FileCheck --check-prefix=SSE2 %s
4 define <4 x i32> @shl(<4 x i32> %vector, i32 %scalar) {
7 ; SSE2: cost of 2 {{.*}} shl
8 ; SSE2-CODEGEN: movd %edi, %xmm1
9 ; SSE2-CODEGEN: pslld %xmm1, %xmm0
10 %insert = insertelement <4 x i32> undef, i32 %scalar, i32 0
11 %splat = shufflevector <4 x i32> %insert, <4 x i32> undef, <4 x i32> zeroinitializer
12 %ret = shl <4 x i32> %vector , %splat
16 define <4 x i32> @ashr(<4 x i32> %vector, i32 %scalar) {
19 ; SSE2: cost of 2 {{.*}} ashr
20 ; SSE2-CODEGEN: movd %edi, %xmm1
21 ; SSE2-CODEGEN: psrad %xmm1, %xmm0
22 %insert = insertelement <4 x i32> undef, i32 %scalar, i32 0
23 %splat = shufflevector <4 x i32> %insert, <4 x i32> undef, <4 x i32> zeroinitializer
24 %ret = ashr <4 x i32> %vector , %splat
28 define <4 x i32> @lshr(<4 x i32> %vector, i32 %scalar) {
31 ; SSE2: cost of 2 {{.*}} lshr
32 ; SSE2-CODEGEN: movd %edi, %xmm1
33 ; SSE2-CODEGEN: psrld %xmm1, %xmm0
34 %insert = insertelement <4 x i32> undef, i32 %scalar, i32 0
35 %splat = shufflevector <4 x i32> %insert, <4 x i32> undef, <4 x i32> zeroinitializer
36 %ret = lshr <4 x i32> %vector , %splat