blob: a2771fea4725ca3cf7b6cbb321d75d62947be571 [file] [log] [blame]
Tanya Lattner246a1372008-02-17 20:02:20 +00001; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 > %t
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002; RUN: grep fcvtsd %t
3; RUN: grep fcvtds %t
4; RUN: grep ftosizs %t
5; RUN: grep ftouizs %t
6; RUN: grep ftosizd %t
7; RUN: grep ftouizd %t
8; RUN: grep fsitos %t
9; RUN: grep fsitod %t
10; RUN: grep fuitos %t
11; RUN: grep fuitod %t
Evan Chenga8740032008-04-01 01:50:16 +000012; RUN: llvm-as < %s | llc -march=arm > %t
13; RUN: grep truncdfsf2 %t
14; RUN: grep extendsfdf2 %t
15; RUN: grep fixsfsi %t
16; RUN: grep fixunssfsi %t
17; RUN: grep fixdfsi %t
18; RUN: grep fixunsdfsi %t
19; RUN: grep floatdisf %t
20; RUN: grep floatsidf %t
21; RUN: llvm-as < %s | llc -march=thumb
Dan Gohmanf17a25c2007-07-18 16:29:46 +000022
Tanya Lattner246a1372008-02-17 20:02:20 +000023define float @f1(double %x) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000024entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000025 %tmp1 = fptrunc double %x to float ; <float> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000026 ret float %tmp1
27}
28
Tanya Lattner246a1372008-02-17 20:02:20 +000029define double @f2(float %x) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000030entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000031 %tmp1 = fpext float %x to double ; <double> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000032 ret double %tmp1
33}
34
Tanya Lattner246a1372008-02-17 20:02:20 +000035define i32 @f3(float %x) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000036entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000037 %tmp = fptosi float %x to i32 ; <i32> [#uses=1]
38 ret i32 %tmp
Dan Gohmanf17a25c2007-07-18 16:29:46 +000039}
40
Tanya Lattner246a1372008-02-17 20:02:20 +000041define i32 @f4(float %x) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000042entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000043 %tmp = fptoui float %x to i32 ; <i32> [#uses=1]
44 ret i32 %tmp
Dan Gohmanf17a25c2007-07-18 16:29:46 +000045}
46
Tanya Lattner246a1372008-02-17 20:02:20 +000047define i32 @f5(double %x) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000048entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000049 %tmp = fptosi double %x to i32 ; <i32> [#uses=1]
50 ret i32 %tmp
Dan Gohmanf17a25c2007-07-18 16:29:46 +000051}
52
Tanya Lattner246a1372008-02-17 20:02:20 +000053define i32 @f6(double %x) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000054entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000055 %tmp = fptoui double %x to i32 ; <i32> [#uses=1]
56 ret i32 %tmp
Dan Gohmanf17a25c2007-07-18 16:29:46 +000057}
58
Tanya Lattner246a1372008-02-17 20:02:20 +000059define float @f7(i32 %a) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000060entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000061 %tmp = sitofp i32 %a to float ; <float> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000062 ret float %tmp
63}
64
Tanya Lattner246a1372008-02-17 20:02:20 +000065define double @f8(i32 %a) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000066entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000067 %tmp = sitofp i32 %a to double ; <double> [#uses=1]
68 ret double %tmp
Dan Gohmanf17a25c2007-07-18 16:29:46 +000069}
70
Tanya Lattner246a1372008-02-17 20:02:20 +000071define float @f9(i32 %a) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000072entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000073 %tmp = uitofp i32 %a to float ; <float> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000074 ret float %tmp
75}
76
Tanya Lattner246a1372008-02-17 20:02:20 +000077define double @f10(i32 %a) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000078entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000079 %tmp = uitofp i32 %a to double ; <double> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000080 ret double %tmp
81}