blob: c2baf442f4ae1441a7feb2a28b2f8d34b4f9b658 [file] [log] [blame]
Akira Hatanaka02e16802013-05-16 19:57:23 +00001; RUN: llc -march=mipsel < %s | FileCheck %s -check-prefix=32
2; RUN: llc -march=mips64el -mcpu=mips64 < %s | FileCheck %s -check-prefix=64
3
4@i1 = global [3 x i32] [i32 1, i32 2, i32 3], align 4
5@i3 = common global i32* null, align 4
6
Stephen Linb4dc0232013-07-13 20:38:47 +00007; 32-LABEL: test_float_int_:
Akira Hatanaka02e16802013-05-16 19:57:23 +00008; 32: mtc1 ${{[0-9]+}}, $f[[R0:[0-9]+]]
9; 32: cvt.s.w $f{{[0-9]+}}, $f[[R0]]
10
11define float @test_float_int_(i32 %a) {
12entry:
13 %conv = sitofp i32 %a to float
14 ret float %conv
15}
16
Stephen Linb4dc0232013-07-13 20:38:47 +000017; 32-LABEL: test_double_int_:
Akira Hatanaka02e16802013-05-16 19:57:23 +000018; 32: mtc1 ${{[0-9]+}}, $f[[R0:[0-9]+]]
19; 32: cvt.d.w $f{{[0-9]+}}, $f[[R0]]
Stephen Linb4dc0232013-07-13 20:38:47 +000020; 64-LABEL: test_double_int_:
Akira Hatanaka02e16802013-05-16 19:57:23 +000021; 64: mtc1 ${{[0-9]+}}, $f[[R0:[0-9]+]]
22; 64: cvt.d.w $f{{[0-9]+}}, $f[[R0]]
23
24define double @test_double_int_(i32 %a) {
25entry:
26 %conv = sitofp i32 %a to double
27 ret double %conv
28}
29
Stephen Linb4dc0232013-07-13 20:38:47 +000030; 64-LABEL: test_float_LL_:
Akira Hatanaka02e16802013-05-16 19:57:23 +000031; 64: dmtc1 ${{[0-9]+}}, $f[[R0:[0-9]+]]
32; 64: cvt.s.l $f{{[0-9]+}}, $f[[R0]]
33
34define float @test_float_LL_(i64 %a) {
35entry:
36 %conv = sitofp i64 %a to float
37 ret float %conv
38}
39
Stephen Linb4dc0232013-07-13 20:38:47 +000040; 64-LABEL: test_double_LL_:
Akira Hatanaka02e16802013-05-16 19:57:23 +000041; 64: dmtc1 ${{[0-9]+}}, $f[[R0:[0-9]+]]
42; 64: cvt.d.l $f{{[0-9]+}}, $f[[R0]]
43
44define double @test_double_LL_(i64 %a) {
45entry:
46 %conv = sitofp i64 %a to double
47 ret double %conv
48}