1 ; Test incoming GPR, FPR and stack arguments when no extension type is given.
2 ; This type of argument is used for passing structures, etc.
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -verify-machineinstrs | FileCheck %s
6 ; Do some arithmetic so that we can see the register being used.
7 define i8 @f1(i8 %r2) {
15 define i16 @f2(i8 %r2, i16 %r3) {
17 ; CHECK: {{lr|lgr}} %r2, %r3
22 define i32 @f3(i8 %r2, i16 %r3, i32 %r4) {
24 ; CHECK: {{lr|lgr}} %r2, %r4
29 define i64 @f4(i8 %r2, i16 %r3, i32 %r4, i64 %r5) {
31 ; CHECK: {{lr|lgr}} %r2, %r5
36 ; Do some arithmetic so that we can see the register being used.
37 define float @f5(i8 %r2, i16 %r3, i32 %r4, i64 %r5, float %f0) {
39 ; CHECK: aebr %f0, %f0
41 %y = fadd float %f0, %f0
45 define double @f6(i8 %r2, i16 %r3, i32 %r4, i64 %r5, float %f0, double %f2) {
52 ; fp128s are passed indirectly. Do some arithmetic so that the value
53 ; must be interpreted as a float, rather than as a block of memory to
55 define void @f7(ptr %r2, i16 %r3, i32 %r4, i64 %r5, float %f0, double %f2,
58 ; CHECK: ld %f0, 0(%r6)
59 ; CHECK: ld %f2, 8(%r6)
60 ; CHECK: axbr %f0, %f0
61 ; CHECK: std %f0, 0(%r2)
62 ; CHECK: std %f2, 8(%r2)
64 %y = fadd fp128 %r6, %r6
65 store fp128 %y, ptr %r2
69 define i64 @f8(i8 %r2, i16 %r3, i32 %r4, i64 %r5, float %f0, double %f2,
72 ; CHECK: lg %r2, 160(%r15)
77 define float @f9(i8 %r2, i16 %r3, i32 %r4, i64 %r5, float %f0, double %f2,
78 fp128 %r6, i64 %s1, float %f4) {
85 define double @f10(i8 %r2, i16 %r3, i32 %r4, i64 %r5, float %f0, double %f2,
86 fp128 %r6, i64 %s1, float %f4, double %f6) {
93 define i64 @f11(i8 %r2, i16 %r3, i32 %r4, i64 %r5, float %f0, double %f2,
94 fp128 %r6, i64 %s1, float %f4, double %f6, i64 %s2) {
96 ; CHECK: lg %r2, 168(%r15)
101 ; Floats are passed right-justified.
102 define float @f12(i8 %r2, i16 %r3, i32 %r4, i64 %r5, float %f0, double %f2,
103 fp128 %r6, i64 %s1, float %f4, double %f6, i64 %s2,
106 ; CHECK: le %f0, 180(%r15)
111 ; Test a case where the fp128 address is passed on the stack.
112 define void @f13(ptr %r2, i16 %r3, i32 %r4, i64 %r5, float %f0, double %f2,
113 fp128 %r6, i64 %s1, float %f4, double %f6, i64 %s2,
114 float %s3, fp128 %s4) {
116 ; CHECK: lg [[REGISTER:%r[1-5]+]], 184(%r15)
117 ; CHECK: ld %f0, 0([[REGISTER]])
118 ; CHECK: ld %f2, 8([[REGISTER]])
119 ; CHECK: axbr %f0, %f0
120 ; CHECK: std %f0, 0(%r2)
121 ; CHECK: std %f2, 8(%r2)
123 %y = fadd fp128 %s4, %s4
124 store fp128 %y, ptr %r2
128 ; Explicit fp128 return values are likewise passed indirectly.
129 define fp128 @f14(fp128 %r3) {
131 ; CHECK: ld %f0, 0(%r3)
132 ; CHECK: ld %f2, 8(%r3)
133 ; CHECK: axbr %f0, %f0
134 ; CHECK: std %f0, 0(%r2)
135 ; CHECK: std %f2, 8(%r2)
137 %y = fadd fp128 %r3, %r3