1 ; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
2 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s
5 ;; Integer conversions happen inplicitly by loading/storing the proper types
10 define i16 @cvt_i16_i32(i32 %x) {
11 ; CHECK: ld.param.u16 %r[[R0:[0-9]+]], [cvt_i16_i32_param_{{[0-9]+}}]
12 ; CHECK: st.param.b32 [func_retval{{[0-9]+}}+0], %r[[R0]]
14 %a = trunc i32 %x to i16
18 define i16 @cvt_i16_i64(i64 %x) {
19 ; CHECK: ld.param.u16 %r[[R0:[0-9]+]], [cvt_i16_i64_param_{{[0-9]+}}]
20 ; CHECK: st.param.b32 [func_retval{{[0-9]+}}+0], %r[[R0]]
22 %a = trunc i64 %x to i16
30 define i32 @cvt_i32_i16(i16 %x) {
31 ; CHECK: ld.param.u16 %r[[R0:[0-9]+]], [cvt_i32_i16_param_{{[0-9]+}}]
32 ; CHECK: st.param.b32 [func_retval{{[0-9]+}}+0], %r[[R0]]
34 %a = zext i16 %x to i32
38 define i32 @cvt_i32_i64(i64 %x) {
39 ; CHECK: ld.param.u32 %r[[R0:[0-9]+]], [cvt_i32_i64_param_{{[0-9]+}}]
40 ; CHECK: st.param.b32 [func_retval{{[0-9]+}}+0], %r[[R0]]
42 %a = trunc i64 %x to i32
50 define i64 @cvt_i64_i16(i16 %x) {
51 ; CHECK: ld.param.u16 %rd[[R0:[0-9]+]], [cvt_i64_i16_param_{{[0-9]+}}]
52 ; CHECK: st.param.b64 [func_retval{{[0-9]+}}+0], %rd[[R0]]
54 %a = zext i16 %x to i64
58 define i64 @cvt_i64_i32(i32 %x) {
59 ; CHECK: ld.param.u32 %rd[[R0:[0-9]+]], [cvt_i64_i32_param_{{[0-9]+}}]
60 ; CHECK: st.param.b64 [func_retval{{[0-9]+}}+0], %rd[[R0]]
62 %a = zext i32 %x to i64