1 ; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
2 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s
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 %}
7 ;; Integer conversions happen inplicitly by loading/storing the proper types
12 define i16 @cvt_i16_i32(i32 %x) {
13 ; CHECK: ld.param.u16 %r[[R0:[0-9]+]], [cvt_i16_i32_param_{{[0-9]+}}]
14 ; CHECK: st.param.b32 [func_retval{{[0-9]+}}+0], %r[[R0]]
16 %a = trunc i32 %x to i16
20 define i16 @cvt_i16_i64(i64 %x) {
21 ; CHECK: ld.param.u16 %r[[R0:[0-9]+]], [cvt_i16_i64_param_{{[0-9]+}}]
22 ; CHECK: st.param.b32 [func_retval{{[0-9]+}}+0], %r[[R0]]
24 %a = trunc i64 %x to i16
32 define i32 @cvt_i32_i16(i16 %x) {
33 ; CHECK: ld.param.u16 %r[[R0:[0-9]+]], [cvt_i32_i16_param_{{[0-9]+}}]
34 ; CHECK: st.param.b32 [func_retval{{[0-9]+}}+0], %r[[R0]]
36 %a = zext i16 %x to i32
40 define i32 @cvt_i32_i64(i64 %x) {
41 ; CHECK: ld.param.u32 %r[[R0:[0-9]+]], [cvt_i32_i64_param_{{[0-9]+}}]
42 ; CHECK: st.param.b32 [func_retval{{[0-9]+}}+0], %r[[R0]]
44 %a = trunc i64 %x to i32
52 define i64 @cvt_i64_i16(i16 %x) {
53 ; CHECK: ld.param.u16 %rd[[R0:[0-9]+]], [cvt_i64_i16_param_{{[0-9]+}}]
54 ; CHECK: st.param.b64 [func_retval{{[0-9]+}}+0], %rd[[R0]]
56 %a = zext i16 %x to i64
60 define i64 @cvt_i64_i32(i32 %x) {
61 ; CHECK: ld.param.u32 %rd[[R0:[0-9]+]], [cvt_i64_i32_param_{{[0-9]+}}]
62 ; CHECK: st.param.b64 [func_retval{{[0-9]+}}+0], %rd[[R0]]
64 %a = zext i32 %x to i64