Home | History | Annotate | Download | only in SystemZ
      1 ; Test incoming i128 arguments.
      2 ;
      3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
      4 
      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) {
      7 ; CHECK-LABEL: f1:
      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)
     14 ; CHECK:      br %r14
     15   %y = add i128 %r6, %r6
     16   store i128 %y, i128 *%r2
     17   ret void
     18 }
     19 
     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) {
     23 ; CHECK-LABEL: f2:
     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)
     31 ; CHECK:      br %r14
     32   %y = add i128 %s4, %s4
     33   store i128 %y, i128 *%r2
     34   ret void
     35 }
     36 
     37 ; Explicit i128 return values are likewise passed indirectly.
     38 define i128 @f14(i128 %r3) {
     39 ; CHECK-LABEL: f14:
     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)
     46 ; CHECK:      br %r14
     47   %y = add i128 %r3, %r3
     48   ret i128 %y
     49 }
     50 
     51