1 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
3 ; Test the packed stack layout.
5 ; Test spill/restore of an FPR and a GPR.
8 ; CHECK: stmg %r12, %r15, 128(%r15)
9 ; CHECK-NEXT: .cfi_offset %r12, -32
10 ; CHECK-NEXT: .cfi_offset %r15, -8
11 ; CHECK-NEXT: std %f8, 120(%r15) # 8-byte Folded Spill
12 ; CHECK-NEXT: .cfi_offset %f8, -40
15 ; CHECK-NEXT: ld %f8, 120(%r15) # 8-byte Folded Reload
16 ; CHECK-NEXT: lmg %r12, %r15, 128(%r15)
18 call void asm sideeffect "", "~{f8},~{r12}"() nounwind
22 ; Test spill/restore with anyregcc, including an FP argument register.
23 define anyregcc void @f2() #0 {
25 ; CHECK: stmg %r3, %r15, 56(%r15)
26 ; CHECK-NEXT: .cfi_offset %r3, -104
27 ; CHECK-NEXT: .cfi_offset %r15, -8
28 ; CHECK-NEXT: std %f0, 48(%r15) # 8-byte Folded Spill
29 ; CHECK-NEXT: std %f1, 40(%r15) # 8-byte Folded Spill
30 ; CHECK-NEXT: .cfi_offset %f0, -112
31 ; CHECK-NEXT: .cfi_offset %f1, -120
34 ; CHECK-NEXT: ld %f0, 48(%r15) # 8-byte Folded Reload
35 ; CHECK-NEXT: ld %f1, 40(%r15) # 8-byte Folded Reload
36 ; CHECK-NEXT: lmg %r3, %r15, 56(%r15)
38 call void asm sideeffect "", "~{f0},~{f1},~{r3}"() nounwind
42 ; Test spill/restore in local area with incoming stack arguments.
43 define i64 @f3(i64 %a, i64 %b, i64 %c, i64 %d, i64 %e, i64 %f,
44 double %A, double %B, double %C, double %D, double %E) #0 {
46 ; CHECK: std %f8, 152(%r15) # 8-byte Folded Spill
47 ; CHECK-NEXT: .cfi_offset %f8, -8
48 ; CHECK-NEXT: ld %f0, 168(%r15)
49 ; CHECK-NEXT: cgdbr %r2, 5, %f0
50 ; CHECK-NEXT: ag %r2, 160(%r15)
53 ; CHECK-NEXT: ld %f8, 152(%r15) # 8-byte Folded Reload
55 call void asm sideeffect "", "~{f8}"() nounwind
56 %Ei = fptosi double %E to i64
61 ; Test spill/restore in local area with outgoing stack arguments.
64 ; CHECK: stmg %r6, %r15, 80(%r15)
65 ; CHECK-NEXT: .cfi_offset %r6, -80
66 ; CHECK-NEXT: .cfi_offset %r14, -16
67 ; CHECK-NEXT: .cfi_offset %r15, -8
68 ; CHECK-NEXT: aghi %r15, -104
69 ; CHECK-NEXT: .cfi_def_cfa_offset 264
70 ; CHECK-NEXT: std %f8, 176(%r15) # 8-byte Folded Spill
71 ; CHECK-NEXT: .cfi_offset %f8, -88
74 ; CHECK-NEXT: llihh %r0, 16404
75 ; CHECK-NEXT: stg %r0, 168(%r15)
76 ; CHECK: mvghi 160(%r15), 6
77 ; CHECK-NEXT: brasl %r14, f3@PLT
78 ; CHECK-NEXT: ld %f8, 176(%r15) # 8-byte Folded Reload
79 ; CHECK-NEXT: lmg %r6, %r15, 184(%r15)
81 call void asm sideeffect "", "~{f8}"() nounwind
82 %C = call i64 @f3 (i64 1, i64 2, i64 3, i64 4, i64 5, i64 6,
83 double 1.0, double 2.0, double 3.0, double 4.0, double 5.0)
87 attributes #0 = { "packed-stack"="true" }