aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/builtins-nvptx.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/builtins-nvptx.c')
-rw-r--r--test/CodeGen/builtins-nvptx.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/test/CodeGen/builtins-nvptx.c b/test/CodeGen/builtins-nvptx.c
index ebf20673ddb4..745e74f0ca64 100644
--- a/test/CodeGen/builtins-nvptx.c
+++ b/test/CodeGen/builtins-nvptx.c
@@ -109,16 +109,15 @@ __device__ int read_lanemasks() {
}
-__device__ long read_clocks() {
+__device__ long long read_clocks() {
// CHECK: call i32 @llvm.ptx.read.clock()
// CHECK: call i64 @llvm.ptx.read.clock64()
int a = __builtin_ptx_read_clock();
- long b = __builtin_ptx_read_clock64();
-
- return (long)a + b;
+ long long b = __builtin_ptx_read_clock64();
+ return a + b;
}
__device__ int read_pms() {
@@ -234,37 +233,40 @@ __device__ void nvvm_atom(float *fp, float f, int *ip, int i, long *lp, long l,
// CHECK: atomicrmw xchg
__nvvm_atom_xchg_gen_ll(&sll, ll);
- // CHECK: atomicrmw max
+ // CHECK: atomicrmw max i32*
__nvvm_atom_max_gen_i(ip, i);
- // CHECK: atomicrmw max
+ // CHECK: atomicrmw umax i32*
__nvvm_atom_max_gen_ui((unsigned int *)ip, i);
// CHECK: atomicrmw max
__nvvm_atom_max_gen_l(&dl, l);
- // CHECK: atomicrmw max
+ // CHECK: atomicrmw umax
__nvvm_atom_max_gen_ul((unsigned long *)&dl, l);
- // CHECK: atomicrmw max
+ // CHECK: atomicrmw max i64*
__nvvm_atom_max_gen_ll(&sll, ll);
- // CHECK: atomicrmw max
+ // CHECK: atomicrmw umax i64*
__nvvm_atom_max_gen_ull((unsigned long long *)&sll, ll);
- // CHECK: atomicrmw min
+ // CHECK: atomicrmw min i32*
__nvvm_atom_min_gen_i(ip, i);
- // CHECK: atomicrmw min
+ // CHECK: atomicrmw umin i32*
__nvvm_atom_min_gen_ui((unsigned int *)ip, i);
// CHECK: atomicrmw min
__nvvm_atom_min_gen_l(&dl, l);
- // CHECK: atomicrmw min
+ // CHECK: atomicrmw umin
__nvvm_atom_min_gen_ul((unsigned long *)&dl, l);
- // CHECK: atomicrmw min
+ // CHECK: atomicrmw min i64*
__nvvm_atom_min_gen_ll(&sll, ll);
- // CHECK: atomicrmw min
+ // CHECK: atomicrmw umin i64*
__nvvm_atom_min_gen_ull((unsigned long long *)&sll, ll);
// CHECK: cmpxchg
+ // CHECK-NEXT: extractvalue { i32, i1 } {{%[0-9]+}}, 0
__nvvm_atom_cas_gen_i(ip, 0, i);
// CHECK: cmpxchg
+ // CHECK-NEXT: extractvalue { {{i32|i64}}, i1 } {{%[0-9]+}}, 0
__nvvm_atom_cas_gen_l(&dl, 0, l);
// CHECK: cmpxchg
+ // CHECK-NEXT: extractvalue { i64, i1 } {{%[0-9]+}}, 0
__nvvm_atom_cas_gen_ll(&sll, 0, ll);
// CHECK: call float @llvm.nvvm.atomic.load.add.f32.p0f32