1 ; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s --check-prefix=PTX32
2 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s --check-prefix=PTX64
3 ; RUN: %if ptxas && !ptxas-12.0 %{ llc < %s -march=nvptx -mcpu=sm_20 | %ptxas-verify %}
4 ; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 | %ptxas-verify %}
8 define i8 @ld_global_i8(ptr addrspace(0) %ptr) {
9 ; PTX32: ld.u8 %r{{[0-9]+}}, [%r{{[0-9]+}}]
11 ; PTX64: ld.u8 %r{{[0-9]+}}, [%rd{{[0-9]+}}]
13 %a = load i8, ptr addrspace(0) %ptr
18 define i16 @ld_global_i16(ptr addrspace(0) %ptr) {
19 ; PTX32: ld.u16 %r{{[0-9]+}}, [%r{{[0-9]+}}]
21 ; PTX64: ld.u16 %r{{[0-9]+}}, [%rd{{[0-9]+}}]
23 %a = load i16, ptr addrspace(0) %ptr
28 define i32 @ld_global_i32(ptr addrspace(0) %ptr) {
29 ; PTX32: ld.u32 %r{{[0-9]+}}, [%r{{[0-9]+}}]
31 ; PTX64: ld.u32 %r{{[0-9]+}}, [%rd{{[0-9]+}}]
33 %a = load i32, ptr addrspace(0) %ptr
38 define i64 @ld_global_i64(ptr addrspace(0) %ptr) {
39 ; PTX32: ld.u64 %rd{{[0-9]+}}, [%r{{[0-9]+}}]
41 ; PTX64: ld.u64 %rd{{[0-9]+}}, [%rd{{[0-9]+}}]
43 %a = load i64, ptr addrspace(0) %ptr
48 define float @ld_global_f32(ptr addrspace(0) %ptr) {
49 ; PTX32: ld.f32 %f{{[0-9]+}}, [%r{{[0-9]+}}]
51 ; PTX64: ld.f32 %f{{[0-9]+}}, [%rd{{[0-9]+}}]
53 %a = load float, ptr addrspace(0) %ptr
58 define double @ld_global_f64(ptr addrspace(0) %ptr) {
59 ; PTX32: ld.f64 %fd{{[0-9]+}}, [%r{{[0-9]+}}]
61 ; PTX64: ld.f64 %fd{{[0-9]+}}, [%rd{{[0-9]+}}]
63 %a = load double, ptr addrspace(0) %ptr