1 ; Test incoming i128 arguments.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5 ; Do some arithmetic so that we can see the register being used.
6 define void @f1(i128 *%r2, i16 %r3, i32 %r4, i64 %r5, i128 %r6) {
8 ; CHECK-DAG: lg [[REGL:%r[0-5]+]], 8(%r6)
9 ; CHECK-DAG: lg [[REGH:%r[0-5]+]], 0(%r6)
10 ; CHECK: algr [[REGL]], [[REGL]]
11 ; CHECK-NEXT: alcgr [[REGH]], [[REGH]]
12 ; CHECK-DAG: stg [[REGL]], 8(%r2)
13 ; CHECK-DAG: stg [[REGH]], 0(%r2)
15 %y = add i128 %r6, %r6
16 store i128 %y, i128 *%r2
20 ; Test a case where the i128 address is passed on the stack.
21 define void @f2(i128 *%r2, i16 %r3, i32 %r4, i64 %r5,
22 i128 %r6, i64 %s1, i64 %s2, i128 %s4) {
24 ; CHECK: lg [[ADDR:%r[1-5]+]], 176(%r15)
25 ; CHECK-DAG: lg [[REGL:%r[0-5]+]], 8([[ADDR]])
26 ; CHECK-DAG: lg [[REGH:%r[0-5]+]], 0([[ADDR]])
27 ; CHECK: algr [[REGL]], [[REGL]]
28 ; CHECK-NEXT: alcgr [[REGH]], [[REGH]]
29 ; CHECK-DAG: stg [[REGL]], 8(%r2)
30 ; CHECK-DAG: stg [[REGH]], 0(%r2)
32 %y = add i128 %s4, %s4
33 store i128 %y, i128 *%r2
37 ; Explicit i128 return values are likewise passed indirectly.
38 define i128 @f14(i128 %r3) {
40 ; CHECK-DAG: lg [[REGL:%r[0-5]+]], 8(%r3)
41 ; CHECK-DAG: lg [[REGH:%r[0-5]+]], 0(%r3)
42 ; CHECK: algr [[REGL]], [[REGL]]
43 ; CHECK-NEXT: alcgr [[REGH]], [[REGH]]
44 ; CHECK-DAG: stg [[REGL]], 8(%r2)
45 ; CHECK-DAG: stg [[REGH]], 0(%r2)
47 %y = add i128 %r3, %r3