1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc < %s -mtriple=nvptx64 -mcpu=sm_50 | FileCheck %s
3 ; RUN: %if ptxas %{ llc < %s -mtriple=nvptx64 -mcpu=sm_50 | %ptxas-verify %}
5 define i16 @test_sad_i16(i16 %x, i16 %y, i16 %z) {
6 ; CHECK-LABEL: test_sad_i16(
8 ; CHECK-NEXT: .reg .b16 %rs<5>;
9 ; CHECK-NEXT: .reg .b32 %r<2>;
11 ; CHECK-NEXT: // %bb.0:
12 ; CHECK-NEXT: ld.param.u16 %rs1, [test_sad_i16_param_0];
13 ; CHECK-NEXT: ld.param.u16 %rs2, [test_sad_i16_param_1];
14 ; CHECK-NEXT: ld.param.u16 %rs3, [test_sad_i16_param_2];
15 ; CHECK-NEXT: sad.s16 %rs4, %rs1, %rs2, %rs3;
16 ; CHECK-NEXT: cvt.u32.u16 %r1, %rs4;
17 ; CHECK-NEXT: st.param.b32 [func_retval0+0], %r1;
19 %1 = call i16 @llvm.nvvm.sad.s(i16 %x, i16 %y, i16 %z)
23 define i16 @test_sad_u16(i16 %x, i16 %y, i16 %z) {
24 ; CHECK-LABEL: test_sad_u16(
26 ; CHECK-NEXT: .reg .b16 %rs<5>;
27 ; CHECK-NEXT: .reg .b32 %r<2>;
29 ; CHECK-NEXT: // %bb.0:
30 ; CHECK-NEXT: ld.param.u16 %rs1, [test_sad_u16_param_0];
31 ; CHECK-NEXT: ld.param.u16 %rs2, [test_sad_u16_param_1];
32 ; CHECK-NEXT: ld.param.u16 %rs3, [test_sad_u16_param_2];
33 ; CHECK-NEXT: sad.u16 %rs4, %rs1, %rs2, %rs3;
34 ; CHECK-NEXT: cvt.u32.u16 %r1, %rs4;
35 ; CHECK-NEXT: st.param.b32 [func_retval0+0], %r1;
37 %1 = call i16 @llvm.nvvm.sad.us(i16 %x, i16 %y, i16 %z)
41 define i32 @test_sad_i32(i32 %x, i32 %y, i32 %z) {
42 ; CHECK-LABEL: test_sad_i32(
44 ; CHECK-NEXT: .reg .b32 %r<5>;
46 ; CHECK-NEXT: // %bb.0:
47 ; CHECK-NEXT: ld.param.u32 %r1, [test_sad_i32_param_0];
48 ; CHECK-NEXT: ld.param.u32 %r2, [test_sad_i32_param_1];
49 ; CHECK-NEXT: ld.param.u32 %r3, [test_sad_i32_param_2];
50 ; CHECK-NEXT: sad.s32 %r4, %r1, %r2, %r3;
51 ; CHECK-NEXT: st.param.b32 [func_retval0+0], %r4;
53 %1 = call i32 @llvm.nvvm.sad.i(i32 %x, i32 %y, i32 %z)
57 define i32 @test_sad_u32(i32 %x, i32 %y, i32 %z) {
58 ; CHECK-LABEL: test_sad_u32(
60 ; CHECK-NEXT: .reg .b32 %r<5>;
62 ; CHECK-NEXT: // %bb.0:
63 ; CHECK-NEXT: ld.param.u32 %r1, [test_sad_u32_param_0];
64 ; CHECK-NEXT: ld.param.u32 %r2, [test_sad_u32_param_1];
65 ; CHECK-NEXT: ld.param.u32 %r3, [test_sad_u32_param_2];
66 ; CHECK-NEXT: sad.u32 %r4, %r1, %r2, %r3;
67 ; CHECK-NEXT: st.param.b32 [func_retval0+0], %r4;
69 %1 = call i32 @llvm.nvvm.sad.ui(i32 %x, i32 %y, i32 %z)
73 define i64 @test_sad_i64(i64 %x, i64 %y, i64 %z) {
74 ; CHECK-LABEL: test_sad_i64(
76 ; CHECK-NEXT: .reg .b64 %rd<5>;
78 ; CHECK-NEXT: // %bb.0:
79 ; CHECK-NEXT: ld.param.u64 %rd1, [test_sad_i64_param_0];
80 ; CHECK-NEXT: ld.param.u64 %rd2, [test_sad_i64_param_1];
81 ; CHECK-NEXT: ld.param.u64 %rd3, [test_sad_i64_param_2];
82 ; CHECK-NEXT: sad.s64 %rd4, %rd1, %rd2, %rd3;
83 ; CHECK-NEXT: st.param.b64 [func_retval0+0], %rd4;
85 %1 = call i64 @llvm.nvvm.sad.ll(i64 %x, i64 %y, i64 %z)
89 define i64 @test_sad_u64(i64 %x, i64 %y, i64 %z) {
90 ; CHECK-LABEL: test_sad_u64(
92 ; CHECK-NEXT: .reg .b64 %rd<5>;
94 ; CHECK-NEXT: // %bb.0:
95 ; CHECK-NEXT: ld.param.u64 %rd1, [test_sad_u64_param_0];
96 ; CHECK-NEXT: ld.param.u64 %rd2, [test_sad_u64_param_1];
97 ; CHECK-NEXT: ld.param.u64 %rd3, [test_sad_u64_param_2];
98 ; CHECK-NEXT: sad.u64 %rd4, %rd1, %rd2, %rd3;
99 ; CHECK-NEXT: st.param.b64 [func_retval0+0], %rd4;
101 %1 = call i64 @llvm.nvvm.sad.ull(i64 %x, i64 %y, i64 %z)
105 declare i16 @llvm.nvvm.sad.s(i16, i16, i16)
106 declare i16 @llvm.nvvm.sad.us(i16, i16, i16)
107 declare i32 @llvm.nvvm.sad.i(i32, i32, i32)
108 declare i32 @llvm.nvvm.sad.ui(i32, i32, i32)
109 declare i64 @llvm.nvvm.sad.ll(i64, i64, i64)
110 declare i64 @llvm.nvvm.sad.ull(i64, i64, i64)