1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --function foo --extra_scrub --default-march nvptx64 --filter-out ".*//.*" --filter-out "[\{\}\(\)]" --version 5
3 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_50 | FileCheck %s
4 ; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_50 | %ptxas-verify %}
6 target triple = "nvptx-nvidia-cuda"
8 define void @foo(ptr noalias readonly %ptr, ptr noalias %retval) {
10 ; CHECK: .reg .b16 %rs<2>;
11 ; CHECK: .reg .b32 %r<4>;
12 ; CHECK: .reg .b64 %rd<5>;
14 ; CHECK: ld.param.u64 %rd1, [foo_param_0];
15 ; CHECK: ld.param.u64 %rd2, [foo_param_1];
16 ; CHECK: cvta.to.global.u64 %rd3, %rd2;
17 ; CHECK: cvta.to.global.u64 %rd4, %rd1;
18 ; CHECK: ld.global.nc.u8 %rs1, [%rd4];
19 ; CHECK: cvt.u32.u8 %r1, %rs1;
20 ; CHECK: add.s32 %r2, %r1, 1;
21 ; CHECK: and.b32 %r3, %r2, 1;
22 ; CHECK: st.global.u32 [%rd3], %r3;
24 %ld = load i1, ptr %ptr, align 1
25 %zext = zext i1 %ld to i32
26 %add = add i32 %zext, 1
27 %and = and i32 %add, 1
28 store i32 %and, ptr %retval
32 !nvvm.annotations = !{!0}
34 !0 = !{ptr @foo, !"kernel", i32 1}