1; RUN: llc < %s -O0 -march=nvptx -mcpu=sm_20 | FileCheck %s
2
3; CHECK-LABEL: .visible .func callee(
4; CHECK-NEXT: .param .align 16 .b8 callee_param_0[16],
5; CHECK-NEXT: .param .align 16 .b8 callee_param_1[16],
6define void @callee(i128, i128, i128*) {
7  ; CHECK-DAG: ld.param.v2.u64 {%[[REG0:rd[0-9]+]], %[[REG1:rd[0-9]+]]}, [callee_param_0];
8  ; CHECK-DAG: ld.param.v2.u64 {%[[REG2:rd[0-9]+]], %[[REG3:rd[0-9]+]]}, [callee_param_1];
9
10  ; CHECK:      mul.lo.s64 %[[REG4:rd[0-9]+]], %[[REG0]], %[[REG3]];
11	; CHECK-NEXT: mul.hi.u64 %[[REG5:rd[0-9]+]], %[[REG0]], %[[REG2]];
12	; CHECK-NEXT: add.s64    %[[REG6:rd[0-9]+]], %[[REG5]], %[[REG4]];
13	; CHECK-NEXT: mul.lo.s64 %[[REG7:rd[0-9]+]], %[[REG1]], %[[REG2]];
14	; CHECK-NEXT: add.s64    %[[REG8:rd[0-9]+]], %[[REG6]], %[[REG7]];
15	; CHECK-NEXT: mul.lo.s64 %[[REG9:rd[0-9]+]], %[[REG0]], %[[REG2]];
16  %a = mul i128 %0, %1
17
18  store i128 %a, i128* %2
19  ret void
20}
21
22; CHECK-LABEL: .visible .entry caller_kernel(
23; CHECK-NEXT: .param .align 16 .b8 caller_kernel_param_0[16],
24; CHECK-NEXT: .param .align 16 .b8 caller_kernel_param_1[16],
25define ptx_kernel void @caller_kernel(i128, i128, i128*) {
26start:
27  ; CHECK-DAG: ld.param.v2.u64 {%[[REG0:rd[0-9]+]], %[[REG1:rd[0-9]+]]}, [caller_kernel_param_0];
28  ; CHECK-DAG: ld.param.v2.u64 {%[[REG2:rd[0-9]+]], %[[REG3:rd[0-9]+]]}, [caller_kernel_param_1];
29
30  ; CHECK:      { // callseq [[CALLSEQ_ID:[0-9]]], 0
31	; CHECK:      .param .align 16 .b8 param0[16];
32	; CHECK-NEXT: st.param.v2.b64 	[param0+0], {%[[REG0]], %[[REG1]]}
33	; CHECK:      .param .align 16 .b8 param1[16];
34	; CHECK-NEXT: st.param.v2.b64 	[param1+0], {%[[REG2]], %[[REG3]]}
35	; CHECK:      } // callseq [[CALLSEQ_ID]]
36  call void @callee(i128 %0, i128 %1, i128* %2)
37
38  ret void
39}
40
41; CHECK-LABEL: .visible .func caller_func(
42; CHECK-NEXT: .param .align 16 .b8 caller_func_param_0[16],
43; CHECK-NEXT: .param .align 16 .b8 caller_func_param_1[16],
44define void @caller_func(i128, i128, i128*) {
45start:
46  ; CHECK-DAG: ld.param.v2.u64 {%[[REG0:rd[0-9]+]], %[[REG1:rd[0-9]+]]}, [caller_func_param_0]
47  ; CHECK-DAG: ld.param.v2.u64 {%[[REG2:rd[0-9]+]], %[[REG3:rd[0-9]+]]}, [caller_func_param_1]
48
49  ; CHECK: { // callseq [[CALLSEQ_ID:[0-9]]], 0
50	; CHECK: .param .align 16 .b8 param0[16];
51	; CHECK: st.param.v2.b64 	[param0+0], {%[[REG0]], %[[REG1]]}
52	; CHECK: .param .align 16 .b8 param1[16];
53  ; CHECK: st.param.v2.b64 	[param1+0], {%[[REG2]], %[[REG3]]}
54	; CHECK: } // callseq [[CALLSEQ_ID]]
55  call void @callee(i128 %0, i128 %1, i128* %2)
56
57  ret void
58}
59