1 ; RUN: sed -e "s/RETTYPE/void/;s/RETVAL//" %s | llc -mtriple=x86_64-win32 -mcpu=corei7 | FileCheck --check-prefixes=ALL,VOID %s
2 ; RUN: sed -e "s/RETTYPE/i32/;s/RETVAL/undef/" %s | llc -mtriple=x86_64-win32 -mcpu=corei7 | FileCheck --check-prefixes=ALL,INT %s
3 ; RUN: sed -e "s/RETTYPE/\{i64\,i64\}/;s/RETVAL/undef/" %s | llc -mtriple=x86_64-win32 -mcpu=corei7 | FileCheck --check-prefixes=ALL,INT128 %s
5 ; Every GPR should be saved, except r11 and return registers.
6 ; XMM registers 6-15 should also be saved.
7 define preserve_mostcc RETTYPE @preserve_mostcc1(i64, i64, double, double) nounwind {
9 ;ALL-LABEL: preserve_mostcc1
15 ;VOID-NEXT: pushq %rdx
17 ;INT128-NOT: pushq %rdx
19 ;VOID-NEXT: pushq %rax
21 ;INT128-NOT: pushq %rax
29 ;ALL-NEXT: movaps %xmm14
30 ;ALL-NEXT: movaps %xmm13
31 ;ALL-NEXT: movaps %xmm12
32 ;ALL-NEXT: movaps %xmm11
33 ;ALL-NEXT: movaps %xmm10
34 ;ALL-NEXT: movaps %xmm9
35 ;ALL-NEXT: movaps %xmm8
36 ;ALL-NEXT: movaps %xmm7
37 ;ALL-NEXT: movaps %xmm6
38 ;ALL-NOT: movaps %xmm5
39 ;ALL-NOT: movaps %xmm4
40 ;ALL-NOT: movaps %xmm3
41 ;ALL-NOT: movaps %xmm2
42 ;ALL-NOT: movaps %xmm1
43 ;ALL-NOT: movaps %xmm0
44 ;ALL-NOT: movaps {{.*}} %xmm0
45 ;ALL-NOT: movaps {{.*}} %xmm1
46 ;ALL-NOT: movaps {{.*}} %xmm2
47 ;ALL-NOT: movaps {{.*}} %xmm3
48 ;ALL-NOT: movaps {{.*}} %xmm4
49 ;ALL-NOT: movaps {{.*}} %xmm5
50 ;ALL: movaps {{.*}} %xmm6
51 ;ALL-NEXT: movaps {{.*}} %xmm7
52 ;ALL-NEXT: movaps {{.*}} %xmm8
53 ;ALL-NEXT: movaps {{.*}} %xmm9
54 ;ALL-NEXT: movaps {{.*}} %xmm10
55 ;ALL-NEXT: movaps {{.*}} %xmm11
56 ;ALL-NEXT: movaps {{.*}} %xmm12
57 ;ALL-NEXT: movaps {{.*}} %xmm13
58 ;ALL-NEXT: movaps {{.*}} %xmm14
59 ;ALL-NEXT: movaps {{.*}} %xmm15
68 ;INT128-NOT: popq %rax
72 ;INT128-NOT: popq %rdx
78 call void asm sideeffect "", "~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{rbp},~{xmm0},~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15}"()
82 ; Make sure XMMs are not saved before the call
83 declare preserve_mostcc RETTYPE @foo(i64, i64, double, double)
84 define void @preserve_mostcc2() nounwind {
86 ;ALL-LABEL: preserve_mostcc2
88 ;ALL-NOT: {{.*xmm[0-1,4-9].*}}
89 call preserve_mostcc RETTYPE @foo(i64 1, i64 2, double 3.0, double 4.0)