1 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s
2 ; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 | %ptxas-verify %}
4 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64"
7 define void @one(i64 %a, i64 %b, ptr %p1, ptr %p2) {
11 %sext = shl i64 %a, 56
12 %conv1 = ashr exact i64 %sext, 56
13 %sext1 = shl i64 %b, 56
14 %conv4 = ashr exact i64 %sext1, 56
15 %shr = ashr i64 %a, 16
16 %shr9 = ashr i64 %b, 16
17 %add = add nsw i64 %conv4, %conv1
18 store i64 %add, ptr %p1, align 8
19 %add17 = add nsw i64 %shr9, %shr
20 store i64 %add17, ptr %p2, align 8
25 define void @two(i64 %a, i64 %b, ptr %p1, ptr %p2) {
29 %sext = shl i64 %a, 32
30 %conv1 = ashr exact i64 %sext, 32
31 %sext1 = shl i64 %b, 32
32 %conv4 = ashr exact i64 %sext1, 32
33 %shr = ashr i64 %a, 16
34 %shr9 = ashr i64 %b, 16
35 %add = add nsw i64 %conv4, %conv1
36 store i64 %add, ptr %p1, align 8
37 %add17 = add nsw i64 %shr9, %shr
38 store i64 %add17, ptr %p2, align 8
43 define void @three(i64 %a, i64 %b, ptr %p1, ptr %p2) {
47 %sext = shl i64 %a, 48
48 %conv1 = ashr exact i64 %sext, 48
49 %sext1 = shl i64 %b, 48
50 %conv4 = ashr exact i64 %sext1, 48
51 %shr = ashr i64 %a, 16
52 %shr9 = ashr i64 %b, 16
53 %add = add nsw i64 %conv4, %conv1
54 store i64 %add, ptr %p1, align 8
55 %add17 = add nsw i64 %shr9, %shr
56 store i64 %add17, ptr %p2, align 8
61 define void @four(i32 %a, i32 %b, ptr %p1, ptr %p2) {
65 %sext = shl i32 %a, 24
66 %conv1 = ashr exact i32 %sext, 24
67 %sext1 = shl i32 %b, 24
68 %conv4 = ashr exact i32 %sext1, 24
69 %shr = ashr i32 %a, 16
70 %shr9 = ashr i32 %b, 16
71 %add = add nsw i32 %conv4, %conv1
72 store i32 %add, ptr %p1, align 4
73 %add17 = add nsw i32 %shr9, %shr
74 store i32 %add17, ptr %p2, align 4
79 define void @five(i32 %a, i32 %b, ptr %p1, ptr %p2) {
83 %sext = shl i32 %a, 16
84 %conv1 = ashr exact i32 %sext, 16
85 %sext1 = shl i32 %b, 16
86 %conv4 = ashr exact i32 %sext1, 16
87 %shr = ashr i32 %a, 16
88 %shr9 = ashr i32 %b, 16
89 %add = add nsw i32 %conv4, %conv1
90 store i32 %add, ptr %p1, align 4
91 %add17 = add nsw i32 %shr9, %shr
92 store i32 %add17, ptr %p2, align 4
97 define void @six(i16 %a, i16 %b, ptr %p1, ptr %p2) {
101 %sext = shl i16 %a, 8
102 %conv1 = ashr exact i16 %sext, 8
103 %sext1 = shl i16 %b, 8
104 %conv4 = ashr exact i16 %sext1, 8
105 %shr = ashr i16 %a, 8
106 %shr9 = ashr i16 %b, 8
107 %add = add nsw i16 %conv4, %conv1
108 store i16 %add, ptr %p1, align 4
109 %add17 = add nsw i16 %shr9, %shr
110 store i16 %add17, ptr %p2, align 4