1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-linux -mattr=-avx | FileCheck %s -check-prefix=X64
3 ; Win64 has not supported byval yet.
4 ; RUN: llc < %s -mtriple=i686-- -mattr=-avx | FileCheck %s -check-prefix=X32
6 %struct.s = type { i16, i16, i16, i16, i16, i16, i16, i16,
7 i16, i16, i16, i16, i16, i16, i16, i16,
8 i16, i16, i16, i16, i16, i16, i16, i16,
9 i16, i16, i16, i16, i16, i16, i16, i16,
10 i16, i16, i16, i16, i16, i16, i16, i16,
11 i16, i16, i16, i16, i16, i16, i16, i16,
12 i16, i16, i16, i16, i16, i16, i16, i16,
13 i16, i16, i16, i16, i16, i16, i16, i16,
17 define void @g(i16 signext %a1, i16 signext %a2, i16 signext %a3,
19 ; X64: # %bb.0: # %entry
20 ; X64-NEXT: pushq %rbx
21 ; X64-NEXT: subq $288, %rsp # imm = 0x120
22 ; X64-NEXT: movw %di, {{[0-9]+}}(%rsp)
23 ; X64-NEXT: movw %si, {{[0-9]+}}(%rsp)
24 ; X64-NEXT: movw %dx, {{[0-9]+}}(%rsp)
25 ; X64-NEXT: movw %cx, {{[0-9]+}}(%rsp)
26 ; X64-NEXT: movw %r8w, {{[0-9]+}}(%rsp)
27 ; X64-NEXT: movw %r9w, {{[0-9]+}}(%rsp)
28 ; X64-NEXT: leaq {{[0-9]+}}(%rsp), %rbx
29 ; X64-NEXT: movl $16, %ecx
30 ; X64-NEXT: movq %rsp, %rdi
31 ; X64-NEXT: movq %rbx, %rsi
32 ; X64-NEXT: rep;movsq (%rsi), %es:(%rdi)
33 ; X64-NEXT: movzwl {{[0-9]+}}(%rsp), %eax
34 ; X64-NEXT: movw %ax, {{[0-9]+}}(%rsp)
36 ; X64-NEXT: movl $16, %ecx
37 ; X64-NEXT: movq %rsp, %rdi
38 ; X64-NEXT: movq %rbx, %rsi
39 ; X64-NEXT: rep;movsq (%rsi), %es:(%rdi)
40 ; X64-NEXT: movzwl {{[0-9]+}}(%rsp), %eax
41 ; X64-NEXT: movw %ax, {{[0-9]+}}(%rsp)
43 ; X64-NEXT: addq $288, %rsp # imm = 0x120
48 ; X32: # %bb.0: # %entry
49 ; X32-NEXT: pushl %ebp
50 ; X32-NEXT: movl %esp, %ebp
51 ; X32-NEXT: pushl %ebx
52 ; X32-NEXT: pushl %edi
53 ; X32-NEXT: pushl %esi
54 ; X32-NEXT: andl $-16, %esp
55 ; X32-NEXT: subl $288, %esp # imm = 0x120
56 ; X32-NEXT: movzwl 8(%ebp), %eax
57 ; X32-NEXT: movw %ax, {{[0-9]+}}(%esp)
58 ; X32-NEXT: movzwl 12(%ebp), %eax
59 ; X32-NEXT: movw %ax, {{[0-9]+}}(%esp)
60 ; X32-NEXT: movzwl 16(%ebp), %eax
61 ; X32-NEXT: movw %ax, {{[0-9]+}}(%esp)
62 ; X32-NEXT: movzwl 20(%ebp), %eax
63 ; X32-NEXT: movw %ax, {{[0-9]+}}(%esp)
64 ; X32-NEXT: movzwl 24(%ebp), %eax
65 ; X32-NEXT: movw %ax, {{[0-9]+}}(%esp)
66 ; X32-NEXT: movzwl 28(%ebp), %eax
67 ; X32-NEXT: movw %ax, {{[0-9]+}}(%esp)
68 ; X32-NEXT: leal {{[0-9]+}}(%esp), %ebx
69 ; X32-NEXT: movl $32, %ecx
70 ; X32-NEXT: movl %esp, %edi
71 ; X32-NEXT: movl %ebx, %esi
72 ; X32-NEXT: rep;movsl (%esi), %es:(%edi)
73 ; X32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
74 ; X32-NEXT: movw %ax, {{[0-9]+}}(%esp)
76 ; X32-NEXT: movl $32, %ecx
77 ; X32-NEXT: movl %esp, %edi
78 ; X32-NEXT: movl %ebx, %esi
79 ; X32-NEXT: rep;movsl (%esi), %es:(%edi)
80 ; X32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
81 ; X32-NEXT: movw %ax, {{[0-9]+}}(%esp)
83 ; X32-NEXT: leal -12(%ebp), %esp
89 i16 signext %a4, i16 signext %a5, i16 signext %a6) nounwind {
91 %a = alloca %struct.s, align 16
92 %tmp = getelementptr %struct.s, %struct.s* %a, i32 0, i32 0
93 store i16 %a1, i16* %tmp, align 16
94 %tmp2 = getelementptr %struct.s, %struct.s* %a, i32 0, i32 1
95 store i16 %a2, i16* %tmp2, align 16
96 %tmp4 = getelementptr %struct.s, %struct.s* %a, i32 0, i32 2
97 store i16 %a3, i16* %tmp4, align 16
98 %tmp6 = getelementptr %struct.s, %struct.s* %a, i32 0, i32 3
99 store i16 %a4, i16* %tmp6, align 16
100 %tmp8 = getelementptr %struct.s, %struct.s* %a, i32 0, i32 4
101 store i16 %a5, i16* %tmp8, align 16
102 %tmp10 = getelementptr %struct.s, %struct.s* %a, i32 0, i32 5
103 store i16 %a6, i16* %tmp10, align 16
104 call void @f( %struct.s* byval %a )
105 call void @f( %struct.s* byval %a )
109 declare void @f(%struct.s* byval)