1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; Test calling functions with multiple return values (LLVM ABI extension)
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
5 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 -mattr=soft-float \
6 ; RUN: | FileCheck %s --check-prefix=SOFT-FLOAT
8 ; Up to eight vector return values fit into VRs.
9 declare { <2 x double>, <2 x double>, <2 x double>, <2 x double>,
10 <2 x double>, <2 x double>, <2 x double>, <2 x double> } @bar1()
12 define <2 x double> @f1() {
15 ; CHECK-NEXT: stmg %r14, %r15, 112(%r15)
16 ; CHECK-NEXT: .cfi_offset %r14, -48
17 ; CHECK-NEXT: .cfi_offset %r15, -40
18 ; CHECK-NEXT: aghi %r15, -160
19 ; CHECK-NEXT: .cfi_def_cfa_offset 320
20 ; CHECK-NEXT: brasl %r14, bar1@PLT
21 ; CHECK-NEXT: vlr %v24, %v31
22 ; CHECK-NEXT: lmg %r14, %r15, 272(%r15)
25 ; SOFT-FLOAT-LABEL: f1:
26 ; SOFT-FLOAT: # %bb.0:
27 ; SOFT-FLOAT-NEXT: stmg %r14, %r15, 112(%r15)
28 ; SOFT-FLOAT-NEXT: .cfi_offset %r14, -48
29 ; SOFT-FLOAT-NEXT: .cfi_offset %r15, -40
30 ; SOFT-FLOAT-NEXT: aghi %r15, -288
31 ; SOFT-FLOAT-NEXT: .cfi_def_cfa_offset 448
32 ; SOFT-FLOAT-NEXT: la %r2, 160(%r15)
33 ; SOFT-FLOAT-NEXT: brasl %r14, bar1@PLT
34 ; SOFT-FLOAT-NEXT: lg %r3, 280(%r15)
35 ; SOFT-FLOAT-NEXT: lg %r2, 272(%r15)
36 ; SOFT-FLOAT-NEXT: lmg %r14, %r15, 400(%r15)
37 ; SOFT-FLOAT-NEXT: br %r14
39 %mret = call { <2 x double>, <2 x double>,
40 <2 x double>, <2 x double>,
41 <2 x double>, <2 x double>,
42 <2 x double>, <2 x double> } @bar1()
43 %ret = extractvalue { <2 x double>, <2 x double>,
44 <2 x double>, <2 x double>,
45 <2 x double>, <2 x double>,
46 <2 x double>, <2 x double> } %mret, 7
50 ; More than eight vector return values use sret.
51 declare { <2 x double>, <2 x double>, <2 x double>, <2 x double>,
52 <2 x double>, <2 x double>, <2 x double>, <2 x double>,
53 <2 x double> } @bar2()
55 define <2 x double> @f2() {
58 ; CHECK-NEXT: stmg %r14, %r15, 112(%r15)
59 ; CHECK-NEXT: .cfi_offset %r14, -48
60 ; CHECK-NEXT: .cfi_offset %r15, -40
61 ; CHECK-NEXT: aghi %r15, -304
62 ; CHECK-NEXT: .cfi_def_cfa_offset 464
63 ; CHECK-NEXT: la %r2, 160(%r15)
64 ; CHECK-NEXT: brasl %r14, bar2@PLT
65 ; CHECK-NEXT: vl %v24, 288(%r15), 3
66 ; CHECK-NEXT: lmg %r14, %r15, 416(%r15)
69 ; SOFT-FLOAT-LABEL: f2:
70 ; SOFT-FLOAT: # %bb.0:
71 ; SOFT-FLOAT-NEXT: stmg %r14, %r15, 112(%r15)
72 ; SOFT-FLOAT-NEXT: .cfi_offset %r14, -48
73 ; SOFT-FLOAT-NEXT: .cfi_offset %r15, -40
74 ; SOFT-FLOAT-NEXT: aghi %r15, -304
75 ; SOFT-FLOAT-NEXT: .cfi_def_cfa_offset 464
76 ; SOFT-FLOAT-NEXT: la %r2, 160(%r15)
77 ; SOFT-FLOAT-NEXT: brasl %r14, bar2@PLT
78 ; SOFT-FLOAT-NEXT: lg %r3, 296(%r15)
79 ; SOFT-FLOAT-NEXT: lg %r2, 288(%r15)
80 ; SOFT-FLOAT-NEXT: lmg %r14, %r15, 416(%r15)
81 ; SOFT-FLOAT-NEXT: br %r14
83 %mret = call { <2 x double>, <2 x double>,
84 <2 x double>, <2 x double>,
85 <2 x double>, <2 x double>,
86 <2 x double>, <2 x double>,
87 <2 x double> } @bar2()
88 %ret = extractvalue { <2 x double>, <2 x double>,
89 <2 x double>, <2 x double>,
90 <2 x double>, <2 x double>,
91 <2 x double>, <2 x double>,
92 <2 x double> } %mret, 8