blob: a2771fea4725ca3cf7b6cbb321d75d62947be571 [file] [log] [blame]
Tanya Lattner6263f942008-02-17 20:02:20 +00001; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 > %t
Reid Spencereb1d74e2007-04-16 17:36:08 +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 Cheng110cf482008-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
Rafael Espindola2dc0f2b2006-10-09 17:50:29 +000022
Tanya Lattner6263f942008-02-17 20:02:20 +000023define float @f1(double %x) {
Rafael Espindola2dc0f2b2006-10-09 17:50:29 +000024entry:
Tanya Lattner6263f942008-02-17 20:02:20 +000025 %tmp1 = fptrunc double %x to float ; <float> [#uses=1]
Rafael Espindola2dc0f2b2006-10-09 17:50:29 +000026 ret float %tmp1
27}
28
Tanya Lattner6263f942008-02-17 20:02:20 +000029define double @f2(float %x) {
Rafael Espindola2dc0f2b2006-10-09 17:50:29 +000030entry:
Tanya Lattner6263f942008-02-17 20:02:20 +000031 %tmp1 = fpext float %x to double ; <double> [#uses=1]
Rafael Espindola2dc0f2b2006-10-09 17:50:29 +000032 ret double %tmp1
33}
Rafael Espindolab47e1d02006-10-10 18:55:14 +000034
Tanya Lattner6263f942008-02-17 20:02:20 +000035define i32 @f3(float %x) {
Rafael Espindolab47e1d02006-10-10 18:55:14 +000036entry:
Tanya Lattner6263f942008-02-17 20:02:20 +000037 %tmp = fptosi float %x to i32 ; <i32> [#uses=1]
38 ret i32 %tmp
Rafael Espindolab47e1d02006-10-10 18:55:14 +000039}
40
Tanya Lattner6263f942008-02-17 20:02:20 +000041define i32 @f4(float %x) {
Rafael Espindola493a7fc2006-10-10 20:38:57 +000042entry:
Tanya Lattner6263f942008-02-17 20:02:20 +000043 %tmp = fptoui float %x to i32 ; <i32> [#uses=1]
44 ret i32 %tmp
Rafael Espindola493a7fc2006-10-10 20:38:57 +000045}
46
Tanya Lattner6263f942008-02-17 20:02:20 +000047define i32 @f5(double %x) {
Rafael Espindola278dbaa2006-10-17 20:20:07 +000048entry:
Tanya Lattner6263f942008-02-17 20:02:20 +000049 %tmp = fptosi double %x to i32 ; <i32> [#uses=1]
50 ret i32 %tmp
Rafael Espindola278dbaa2006-10-17 20:20:07 +000051}
52
Tanya Lattner6263f942008-02-17 20:02:20 +000053define i32 @f6(double %x) {
Rafael Espindola493a7fc2006-10-10 20:38:57 +000054entry:
Tanya Lattner6263f942008-02-17 20:02:20 +000055 %tmp = fptoui double %x to i32 ; <i32> [#uses=1]
56 ret i32 %tmp
Rafael Espindola493a7fc2006-10-10 20:38:57 +000057}
Rafael Espindola278dbaa2006-10-17 20:20:07 +000058
Tanya Lattner6263f942008-02-17 20:02:20 +000059define float @f7(i32 %a) {
Rafael Espindola278dbaa2006-10-17 20:20:07 +000060entry:
Tanya Lattner6263f942008-02-17 20:02:20 +000061 %tmp = sitofp i32 %a to float ; <float> [#uses=1]
Rafael Espindola278dbaa2006-10-17 20:20:07 +000062 ret float %tmp
63}
64
Tanya Lattner6263f942008-02-17 20:02:20 +000065define double @f8(i32 %a) {
Rafael Espindola278dbaa2006-10-17 20:20:07 +000066entry:
Tanya Lattner6263f942008-02-17 20:02:20 +000067 %tmp = sitofp i32 %a to double ; <double> [#uses=1]
68 ret double %tmp
Rafael Espindola278dbaa2006-10-17 20:20:07 +000069}
70
Tanya Lattner6263f942008-02-17 20:02:20 +000071define float @f9(i32 %a) {
Rafael Espindola278dbaa2006-10-17 20:20:07 +000072entry:
Tanya Lattner6263f942008-02-17 20:02:20 +000073 %tmp = uitofp i32 %a to float ; <float> [#uses=1]
Rafael Espindola278dbaa2006-10-17 20:20:07 +000074 ret float %tmp
75}
76
Tanya Lattner6263f942008-02-17 20:02:20 +000077define double @f10(i32 %a) {
Rafael Espindola278dbaa2006-10-17 20:20:07 +000078entry:
Tanya Lattner6263f942008-02-17 20:02:20 +000079 %tmp = uitofp i32 %a to double ; <double> [#uses=1]
Rafael Espindola278dbaa2006-10-17 20:20:07 +000080 ret double %tmp
81}