1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-windows-msvc < %s -mattr=-sse | FileCheck %s
3 ; RUN: llc -mtriple=x86_64-windows-gnu < %s -mattr=-sse | FileCheck %s
5 define void @recv_double(double %v, ptr %p) {
6 ; CHECK-LABEL: recv_double:
8 ; CHECK-NEXT: movq %rcx, (%rdx)
10 store double %v, ptr %p
14 define void @recv_float(float %v, ptr %p) {
15 ; CHECK-LABEL: recv_float:
17 ; CHECK-NEXT: movl %ecx, (%rdx)
19 store float %v, ptr %p
23 define dso_local double @ret_double(ptr %p) {
24 ; CHECK-LABEL: ret_double:
25 ; CHECK: # %bb.0: # %entry
26 ; CHECK-NEXT: movq (%rcx), %rax
29 %v = load double, ptr %p
33 define dso_local float @ret_float(ptr %p) {
34 ; CHECK-LABEL: ret_float:
35 ; CHECK: # %bb.0: # %entry
36 ; CHECK-NEXT: movl (%rcx), %eax
39 %v = load float, ptr %p
43 declare void @take_double(double)
44 declare void @take_float(float)
46 define void @pass_double(ptr %p) {
47 ; CHECK-LABEL: pass_double:
49 ; CHECK-NEXT: subq $40, %rsp
50 ; CHECK-NEXT: .seh_stackalloc 40
51 ; CHECK-NEXT: .seh_endprologue
52 ; CHECK-NEXT: movq (%rcx), %rcx
53 ; CHECK-NEXT: callq take_double
55 ; CHECK-NEXT: addq $40, %rsp
57 ; CHECK-NEXT: .seh_endproc
58 %v = load double, ptr %p
59 call void @take_double(double %v)
63 define void @pass_float(ptr %p) {
64 ; CHECK-LABEL: pass_float:
66 ; CHECK-NEXT: subq $40, %rsp
67 ; CHECK-NEXT: .seh_stackalloc 40
68 ; CHECK-NEXT: .seh_endprologue
69 ; CHECK-NEXT: movl (%rcx), %ecx
70 ; CHECK-NEXT: callq take_float
72 ; CHECK-NEXT: addq $40, %rsp
74 ; CHECK-NEXT: .seh_endproc
75 %v = load float, ptr %p
76 call void @take_float(float %v)
80 declare double @produce_double()
81 declare float @produce_float()
83 define void @call_double(ptr %p) {
84 ; CHECK-LABEL: call_double:
86 ; CHECK-NEXT: pushq %rsi
87 ; CHECK-NEXT: .seh_pushreg %rsi
88 ; CHECK-NEXT: subq $32, %rsp
89 ; CHECK-NEXT: .seh_stackalloc 32
90 ; CHECK-NEXT: .seh_endprologue
91 ; CHECK-NEXT: movq %rcx, %rsi
92 ; CHECK-NEXT: callq produce_double
93 ; CHECK-NEXT: movq %rax, (%rsi)
94 ; CHECK-NEXT: addq $32, %rsp
95 ; CHECK-NEXT: popq %rsi
97 ; CHECK-NEXT: .seh_endproc
98 %v = call double @produce_double()
99 store double %v, ptr %p
103 define void @call_float(ptr %p) {
104 ; CHECK-LABEL: call_float:
106 ; CHECK-NEXT: pushq %rsi
107 ; CHECK-NEXT: .seh_pushreg %rsi
108 ; CHECK-NEXT: subq $32, %rsp
109 ; CHECK-NEXT: .seh_stackalloc 32
110 ; CHECK-NEXT: .seh_endprologue
111 ; CHECK-NEXT: movq %rcx, %rsi
112 ; CHECK-NEXT: callq produce_float
113 ; CHECK-NEXT: movl %eax, (%rsi)
114 ; CHECK-NEXT: addq $32, %rsp
115 ; CHECK-NEXT: popq %rsi
117 ; CHECK-NEXT: .seh_endproc
118 %v = call float @produce_float()
119 store float %v, ptr %p