Massive rewrite of MMX:
[oota-llvm.git] / test / CodeGen / X86 / mmx-punpckhdq.ll
1 ; RUN: llc < %s -march=x86 -mattr=+mmx | grep pextrd
2 ; RUN: llc < %s -march=x86 -mattr=+mmx | grep punpckhdq | count 1
3 ; There are no MMX operations in bork; promoted to XMM.
4
5 define void @bork(<1 x i64>* %x) {
6 entry:
7         %tmp2 = load <1 x i64>* %x              ; <<1 x i64>> [#uses=1]
8         %tmp6 = bitcast <1 x i64> %tmp2 to <2 x i32>            ; <<2 x i32>> [#uses=1]
9         %tmp9 = shufflevector <2 x i32> %tmp6, <2 x i32> undef, <2 x i32> < i32 1, i32 1 >              ; <<2 x i32>> [#uses=1]
10         %tmp10 = bitcast <2 x i32> %tmp9 to <1 x i64>           ; <<1 x i64>> [#uses=1]
11         store <1 x i64> %tmp10, <1 x i64>* %x
12         tail call void @llvm.x86.mmx.emms( )
13         ret void
14 }
15
16 ; pork uses MMX.
17
18 define void @pork(x86_mmx* %x) {
19 entry:
20         %tmp2 = load x86_mmx* %x                ; <x86_mmx> [#uses=1]
21         %tmp9 = tail call x86_mmx @llvm.x86.mmx.punpckhdq (x86_mmx %tmp2, x86_mmx %tmp2)
22         store x86_mmx %tmp9, x86_mmx* %x
23         tail call void @llvm.x86.mmx.emms( )
24         ret void
25 }
26
27 declare x86_mmx @llvm.x86.mmx.punpckhdq(x86_mmx, x86_mmx)
28 declare void @llvm.x86.mmx.emms()