• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -march=x86 -mattr=+sse42 < %s | FileCheck %s
2; CHECK: paddw
3; CHECK: pextrd
4; CHECK: movd
5
6; bitcast a v4i16 to v2i32
7
8define void @convert(<2 x i32>* %dst, <4 x i16>* %src) nounwind {
9entry:
10	%dst.addr = alloca <2 x i32>*		; <<2 x i32>**> [#uses=2]
11	%src.addr = alloca <4 x i16>*		; <<4 x i16>**> [#uses=2]
12	%i = alloca i32, align 4		; <i32*> [#uses=6]
13	store <2 x i32>* %dst, <2 x i32>** %dst.addr
14	store <4 x i16>* %src, <4 x i16>** %src.addr
15	store i32 0, i32* %i
16	br label %forcond
17
18forcond:		; preds = %forinc, %entry
19	%tmp = load i32* %i		; <i32> [#uses=1]
20	%cmp = icmp slt i32 %tmp, 4		; <i1> [#uses=1]
21	br i1 %cmp, label %forbody, label %afterfor
22
23forbody:		; preds = %forcond
24	%tmp1 = load i32* %i		; <i32> [#uses=1]
25	%tmp2 = load <2 x i32>** %dst.addr		; <<2 x i32>*> [#uses=1]
26	%arrayidx = getelementptr <2 x i32>* %tmp2, i32 %tmp1		; <<2 x i32>*> [#uses=1]
27	%tmp3 = load i32* %i		; <i32> [#uses=1]
28	%tmp4 = load <4 x i16>** %src.addr		; <<4 x i16>*> [#uses=1]
29	%arrayidx5 = getelementptr <4 x i16>* %tmp4, i32 %tmp3		; <<4 x i16>*> [#uses=1]
30	%tmp6 = load <4 x i16>* %arrayidx5		; <<4 x i16>> [#uses=1]
31	%add = add <4 x i16> %tmp6, < i16 1, i16 1, i16 1, i16 1 >		; <<4 x i16>> [#uses=1]
32	%conv = bitcast <4 x i16> %add to <2 x i32>		; <<2 x i32>> [#uses=1]
33	store <2 x i32> %conv, <2 x i32>* %arrayidx
34	br label %forinc
35
36forinc:		; preds = %forbody
37	%tmp7 = load i32* %i		; <i32> [#uses=1]
38	%inc = add i32 %tmp7, 1		; <i32> [#uses=1]
39	store i32 %inc, i32* %i
40	br label %forcond
41
42afterfor:		; preds = %forcond
43	ret void
44}
45