1 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s
4 define void @plain(i8* %a, i16* %b, i32* %c, i64* %d) local_unnamed_addr {
5 ; CHECK: ld.u8 %rs{{[0-9]+}}, [%rd{{[0-9]+}}]
6 %a.load = load i8, i8* %a
7 %a.add = add i8 %a.load, 1
8 ; CHECK: st.u8 [%rd{{[0-9]+}}], %rs{{[0-9]+}}
9 store i8 %a.add, i8* %a
11 ; CHECK: ld.u16 %rs{{[0-9]+}}, [%rd{{[0-9]+}}]
12 %b.load = load i16, i16* %b
13 %b.add = add i16 %b.load, 1
14 ; CHECK: st.u16 [%rd{{[0-9]+}}], %rs{{[0-9]+}}
15 store i16 %b.add, i16* %b
17 ; CHECK: ld.u32 %r{{[0-9]+}}, [%rd{{[0-9]+}}]
18 %c.load = load i32, i32* %c
19 %c.add = add i32 %c.load, 1
20 ; CHECK: st.u32 [%rd{{[0-9]+}}], %r{{[0-9]+}}
21 store i32 %c.add, i32* %c
23 ; CHECK: ld.u64 %rd{{[0-9]+}}, [%rd{{[0-9]+}}]
24 %d.load = load i64, i64* %d
25 %d.add = add i64 %d.load, 1
26 ; CHECK: st.u64 [%rd{{[0-9]+}}], %rd{{[0-9]+}}
27 store i64 %d.add, i64* %d
32 ; CHECK-LABEL: volatile
33 define void @volatile(i8* %a, i16* %b, i32* %c, i64* %d) local_unnamed_addr {
34 ; CHECK: ld.volatile.u8 %rs{{[0-9]+}}, [%rd{{[0-9]+}}]
35 %a.load = load volatile i8, i8* %a
36 %a.add = add i8 %a.load, 1
37 ; CHECK: st.volatile.u8 [%rd{{[0-9]+}}], %rs{{[0-9]+}}
38 store volatile i8 %a.add, i8* %a
40 ; CHECK: ld.volatile.u16 %rs{{[0-9]+}}, [%rd{{[0-9]+}}]
41 %b.load = load volatile i16, i16* %b
42 %b.add = add i16 %b.load, 1
43 ; CHECK: st.volatile.u16 [%rd{{[0-9]+}}], %rs{{[0-9]+}}
44 store volatile i16 %b.add, i16* %b
46 ; CHECK: ld.volatile.u32 %r{{[0-9]+}}, [%rd{{[0-9]+}}]
47 %c.load = load volatile i32, i32* %c
48 %c.add = add i32 %c.load, 1
49 ; CHECK: st.volatile.u32 [%rd{{[0-9]+}}], %r{{[0-9]+}}
50 store volatile i32 %c.add, i32* %c
52 ; CHECK: ld.volatile.u64 %rd{{[0-9]+}}, [%rd{{[0-9]+}}]
53 %d.load = load volatile i64, i64* %d
54 %d.add = add i64 %d.load, 1
55 ; CHECK: st.volatile.u64 [%rd{{[0-9]+}}], %rd{{[0-9]+}}
56 store volatile i64 %d.add, i64* %d
61 ; CHECK-LABEL: monotonic
62 define void @monotonic(i8* %a, i16* %b, i32* %c, i64* %d, float* %e) local_unnamed_addr {
63 ; CHECK: ld.volatile.u8 %rs{{[0-9]+}}, [%rd{{[0-9]+}}]
64 %a.load = load atomic i8, i8* %a monotonic, align 1
65 %a.add = add i8 %a.load, 1
66 ; CHECK: st.volatile.u8 [%rd{{[0-9]+}}], %rs{{[0-9]+}}
67 store atomic i8 %a.add, i8* %a monotonic, align 1
69 ; CHECK: ld.volatile.u16 %rs{{[0-9]+}}, [%rd{{[0-9]+}}]
70 %b.load = load atomic i16, i16* %b monotonic, align 2
71 %b.add = add i16 %b.load, 1
72 ; CHECK: st.volatile.u16 [%rd{{[0-9]+}}], %rs{{[0-9]+}}
73 store atomic i16 %b.add, i16* %b monotonic, align 2
75 ; CHECK: ld.volatile.u32 %r{{[0-9]+}}, [%rd{{[0-9]+}}]
76 %c.load = load atomic i32, i32* %c monotonic, align 4
77 %c.add = add i32 %c.load, 1
78 ; CHECK: st.volatile.u32 [%rd{{[0-9]+}}], %r{{[0-9]+}}
79 store atomic i32 %c.add, i32* %c monotonic, align 4
81 ; CHECK: ld.volatile.u64 %rd{{[0-9]+}}, [%rd{{[0-9]+}}]
82 %d.load = load atomic i64, i64* %d monotonic, align 8
83 %d.add = add i64 %d.load, 1
84 ; CHECK: st.volatile.u64 [%rd{{[0-9]+}}], %rd{{[0-9]+}}
85 store atomic i64 %d.add, i64* %d monotonic, align 8
87 ; CHECK: ld.volatile.f32 %f{{[0-9]+}}, [%rd{{[0-9]+}}]
88 %e.load = load atomic float, float* %e monotonic, align 4
89 %e.add = fadd float %e.load, 1.0
90 ; CHECK: st.volatile.f32 [%rd{{[0-9]+}}], %f{{[0-9]+}}
91 store atomic float %e.add, float* %e monotonic, align 4