1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+mmx,+3dnowa -post-RA-scheduler=false | FileCheck %s --check-prefix=NO-POSTRA
3 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+mmx,+3dnowa -post-RA-scheduler=true | FileCheck %s --check-prefix=POSTRA
5 define float @PR35982_emms(<1 x i64>) nounwind {
6 ; NO-POSTRA-LABEL: PR35982_emms:
8 ; NO-POSTRA-NEXT: subl $8, %esp
9 ; NO-POSTRA-NEXT: movl {{[0-9]+}}(%esp), %eax
10 ; NO-POSTRA-NEXT: movq {{[0-9]+}}(%esp), %mm0
11 ; NO-POSTRA-NEXT: punpckhdq %mm0, %mm0 # mm0 = mm0[1,1]
12 ; NO-POSTRA-NEXT: movd %mm0, %ecx
13 ; NO-POSTRA-NEXT: emms
14 ; NO-POSTRA-NEXT: movl %eax, (%esp)
15 ; NO-POSTRA-NEXT: fildl (%esp)
16 ; NO-POSTRA-NEXT: movl %ecx, {{[0-9]+}}(%esp)
17 ; NO-POSTRA-NEXT: fiaddl {{[0-9]+}}(%esp)
18 ; NO-POSTRA-NEXT: addl $8, %esp
19 ; NO-POSTRA-NEXT: retl
21 ; POSTRA-LABEL: PR35982_emms:
23 ; POSTRA-NEXT: subl $8, %esp
24 ; POSTRA-NEXT: movq {{[0-9]+}}(%esp), %mm0
25 ; POSTRA-NEXT: movl {{[0-9]+}}(%esp), %eax
26 ; POSTRA-NEXT: punpckhdq %mm0, %mm0 # mm0 = mm0[1,1]
27 ; POSTRA-NEXT: movd %mm0, %ecx
29 ; POSTRA-NEXT: movl %eax, (%esp)
30 ; POSTRA-NEXT: fildl (%esp)
31 ; POSTRA-NEXT: movl %ecx, {{[0-9]+}}(%esp)
32 ; POSTRA-NEXT: fiaddl {{[0-9]+}}(%esp)
33 ; POSTRA-NEXT: addl $8, %esp
35 %2 = bitcast <1 x i64> %0 to <2 x i32>
36 %3 = extractelement <2 x i32> %2, i32 0
37 %4 = extractelement <1 x i64> %0, i32 0
38 %5 = bitcast i64 %4 to x86_mmx
39 %6 = tail call x86_mmx @llvm.x86.mmx.punpckhdq(x86_mmx %5, x86_mmx %5)
40 %7 = bitcast x86_mmx %6 to <2 x i32>
41 %8 = extractelement <2 x i32> %7, i32 0
42 tail call void @llvm.x86.mmx.emms()
43 %9 = sitofp i32 %3 to float
44 %10 = sitofp i32 %8 to float
45 %11 = fadd float %9, %10
49 define float @PR35982_femms(<1 x i64>) nounwind {
50 ; NO-POSTRA-LABEL: PR35982_femms:
52 ; NO-POSTRA-NEXT: subl $8, %esp
53 ; NO-POSTRA-NEXT: movl {{[0-9]+}}(%esp), %eax
54 ; NO-POSTRA-NEXT: movq {{[0-9]+}}(%esp), %mm0
55 ; NO-POSTRA-NEXT: punpckhdq %mm0, %mm0 # mm0 = mm0[1,1]
56 ; NO-POSTRA-NEXT: movd %mm0, %ecx
57 ; NO-POSTRA-NEXT: femms
58 ; NO-POSTRA-NEXT: movl %eax, (%esp)
59 ; NO-POSTRA-NEXT: fildl (%esp)
60 ; NO-POSTRA-NEXT: movl %ecx, {{[0-9]+}}(%esp)
61 ; NO-POSTRA-NEXT: fiaddl {{[0-9]+}}(%esp)
62 ; NO-POSTRA-NEXT: addl $8, %esp
63 ; NO-POSTRA-NEXT: retl
65 ; POSTRA-LABEL: PR35982_femms:
67 ; POSTRA-NEXT: subl $8, %esp
68 ; POSTRA-NEXT: movq {{[0-9]+}}(%esp), %mm0
69 ; POSTRA-NEXT: movl {{[0-9]+}}(%esp), %eax
70 ; POSTRA-NEXT: punpckhdq %mm0, %mm0 # mm0 = mm0[1,1]
71 ; POSTRA-NEXT: movd %mm0, %ecx
73 ; POSTRA-NEXT: movl %eax, (%esp)
74 ; POSTRA-NEXT: fildl (%esp)
75 ; POSTRA-NEXT: movl %ecx, {{[0-9]+}}(%esp)
76 ; POSTRA-NEXT: fiaddl {{[0-9]+}}(%esp)
77 ; POSTRA-NEXT: addl $8, %esp
79 %2 = bitcast <1 x i64> %0 to <2 x i32>
80 %3 = extractelement <2 x i32> %2, i32 0
81 %4 = extractelement <1 x i64> %0, i32 0
82 %5 = bitcast i64 %4 to x86_mmx
83 %6 = tail call x86_mmx @llvm.x86.mmx.punpckhdq(x86_mmx %5, x86_mmx %5)
84 %7 = bitcast x86_mmx %6 to <2 x i32>
85 %8 = extractelement <2 x i32> %7, i32 0
86 tail call void @llvm.x86.mmx.femms()
87 %9 = sitofp i32 %3 to float
88 %10 = sitofp i32 %8 to float
89 %11 = fadd float %9, %10
93 declare x86_mmx @llvm.x86.mmx.punpckhdq(x86_mmx, x86_mmx)
94 declare void @llvm.x86.mmx.femms()
95 declare void @llvm.x86.mmx.emms()