1 ; RUN: llc < %s -march=x86 -mcpu=core2 | FileCheck %s 2 3 define <4 x i16> @a(i32* %x1) nounwind { 4 ; CHECK-LABEL: a: 5 ; CHECK: shrl %[[R:[^,]+]] 6 ; CHECK-NEXT: movd %[[R]], %xmm0 7 ; CHECK-NEXT: retl 8 9 %x2 = load i32, i32* %x1 10 %x3 = lshr i32 %x2, 1 11 %x = trunc i32 %x3 to i16 12 %r = insertelement <4 x i16> zeroinitializer, i16 %x, i32 0 13 ret <4 x i16> %r 14 } 15 16 define <8 x i16> @b(i32* %x1) nounwind { 17 ; CHECK-LABEL: b: 18 ; CHECK: shrl %e[[R:.]]x 19 ; CHECK-NEXT: movzwl %[[R]]x, %e[[R]]x 20 ; CHECK-NEXT: movd %e[[R]]x, %xmm0 21 ; CHECK-NEXT: retl 22 23 %x2 = load i32, i32* %x1 24 %x3 = lshr i32 %x2, 1 25 %x = trunc i32 %x3 to i16 26 %r = insertelement <8 x i16> zeroinitializer, i16 %x, i32 0 27 ret <8 x i16> %r 28 } 29 30 define <8 x i8> @c(i32* %x1) nounwind { 31 ; CHECK-LABEL: c: 32 ; CHECK: shrl %e[[R:.]]x 33 ; CHECK-NEXT: movzwl %[[R]]x, %e[[R]]x 34 ; CHECK-NEXT: movd %e[[R]]x, %xmm0 35 ; CHECK-NEXT: retl 36 37 %x2 = load i32, i32* %x1 38 %x3 = lshr i32 %x2, 1 39 %x = trunc i32 %x3 to i8 40 %r = insertelement <8 x i8> zeroinitializer, i8 %x, i32 0 41 ret <8 x i8> %r 42 } 43 44 define <16 x i8> @d(i32* %x1) nounwind { 45 ; CHECK-LABEL: d: 46 ; CHECK: shrl %e[[R:.]]x 47 ; CHECK-NEXT: movzbl %[[R]]l, %e[[R]]x 48 ; CHECK-NEXT: movd %e[[R]]x, %xmm0 49 ; CHECK-NEXT: retl 50 51 %x2 = load i32, i32* %x1 52 %x3 = lshr i32 %x2, 1 53 %x = trunc i32 %x3 to i8 54 %r = insertelement <16 x i8> zeroinitializer, i8 %x, i32 0 55 ret <16 x i8> %r 56 } 57 58