diff options
| author | Justin Holewinski <justin.holewinski@gmail.com> | 2011-09-27 01:04:47 +0000 |
|---|---|---|
| committer | Justin Holewinski <justin.holewinski@gmail.com> | 2011-09-27 01:04:47 +0000 |
| commit | 9f01f893860d38a6b7ea8bfabe8aa45a60e5d032 (patch) | |
| tree | c2676a73ce8e7218e40426bbcda5fe2be3c60654 /llvm/test/CodeGen/PTX/cvt.ll | |
| parent | 90f90da156a56ce2a1b1b55c0a6daf2941275592 (diff) | |
| download | bcm5719-llvm-9f01f893860d38a6b7ea8bfabe8aa45a60e5d032.tar.gz bcm5719-llvm-9f01f893860d38a6b7ea8bfabe8aa45a60e5d032.zip | |
PTX: Add support for sitofp in backend
llvm-svn: 140593
Diffstat (limited to 'llvm/test/CodeGen/PTX/cvt.ll')
| -rw-r--r-- | llvm/test/CodeGen/PTX/cvt.ll | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/PTX/cvt.ll b/llvm/test/CodeGen/PTX/cvt.ll index 943712ff735..abab40edd93 100644 --- a/llvm/test/CodeGen/PTX/cvt.ll +++ b/llvm/test/CodeGen/PTX/cvt.ll @@ -206,6 +206,27 @@ define ptx_device float @cvt_f32_f64(double %x) { ret float %a } +define ptx_device float @cvt_f32_s16(i16 %x) { +; CHECK: cvt.rn.f32.s16 %ret{{[0-9]+}}, %rh{{[0-9]+}} +; CHECK: ret + %a = sitofp i16 %x to float + ret float %a +} + +define ptx_device float @cvt_f32_s32(i32 %x) { +; CHECK: cvt.rn.f32.s32 %ret{{[0-9]+}}, %r{{[0-9]+}} +; CHECK: ret + %a = sitofp i32 %x to float + ret float %a +} + +define ptx_device float @cvt_f32_s64(i64 %x) { +; CHECK: cvt.rn.f32.s64 %ret{{[0-9]+}}, %rd{{[0-9]+}} +; CHECK: ret + %a = sitofp i64 %x to float + ret float %a +} + ; f64 define ptx_device double @cvt_f64_preds(i1 %x) { @@ -242,3 +263,24 @@ define ptx_device double @cvt_f64_f32(float %x) { %a = fpext float %x to double ret double %a } + +define ptx_device double @cvt_f64_s16(i16 %x) { +; CHECK: cvt.rn.f64.s16 %ret{{[0-9]+}}, %rh{{[0-9]+}} +; CHECK: ret + %a = sitofp i16 %x to double + ret double %a +} + +define ptx_device double @cvt_f64_s32(i32 %x) { +; CHECK: cvt.rn.f64.s32 %ret{{[0-9]+}}, %r{{[0-9]+}} +; CHECK: ret + %a = sitofp i32 %x to double + ret double %a +} + +define ptx_device double @cvt_f64_s64(i64 %x) { +; CHECK: cvt.rn.f64.s64 %ret{{[0-9]+}}, %rd{{[0-9]+}} +; CHECK: ret + %a = sitofp i64 %x to double + ret double %a +} |

