blob: 54201068f95be9b28ea9f1748473669a3fc5c350 [file] [log] [blame]
Dan Gohmanda594cf2009-09-09 00:09:15 +00001; RUN: llc < %s -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
Dan Gohmanda594cf2009-09-09 00:09:15 +000012; RUN: llc < %s -march=arm > %t
Evan Chenga8740032008-04-01 01:50:16 +000013; 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
Evan Chengf99a7752008-04-01 02:18:22 +000019; RUN: grep floatsisf %t
Evan Chenga8740032008-04-01 01:50:16 +000020; RUN: grep floatsidf %t
Evan Chengf99a7752008-04-01 02:18:22 +000021; RUN: grep floatunsisf %t
22; RUN: grep floatunsidf %t
Dan Gohmanf17a25c2007-07-18 16:29:46 +000023
Tanya Lattner246a1372008-02-17 20:02:20 +000024define float @f1(double %x) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000025entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000026 %tmp1 = fptrunc double %x to float ; <float> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000027 ret float %tmp1
28}
29
Tanya Lattner246a1372008-02-17 20:02:20 +000030define double @f2(float %x) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000031entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000032 %tmp1 = fpext float %x to double ; <double> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000033 ret double %tmp1
34}
35
Tanya Lattner246a1372008-02-17 20:02:20 +000036define i32 @f3(float %x) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000037entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000038 %tmp = fptosi float %x to i32 ; <i32> [#uses=1]
39 ret i32 %tmp
Dan Gohmanf17a25c2007-07-18 16:29:46 +000040}
41
Tanya Lattner246a1372008-02-17 20:02:20 +000042define i32 @f4(float %x) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000043entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000044 %tmp = fptoui float %x to i32 ; <i32> [#uses=1]
45 ret i32 %tmp
Dan Gohmanf17a25c2007-07-18 16:29:46 +000046}
47
Tanya Lattner246a1372008-02-17 20:02:20 +000048define i32 @f5(double %x) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000049entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000050 %tmp = fptosi double %x to i32 ; <i32> [#uses=1]
51 ret i32 %tmp
Dan Gohmanf17a25c2007-07-18 16:29:46 +000052}
53
Tanya Lattner246a1372008-02-17 20:02:20 +000054define i32 @f6(double %x) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000055entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000056 %tmp = fptoui double %x to i32 ; <i32> [#uses=1]
57 ret i32 %tmp
Dan Gohmanf17a25c2007-07-18 16:29:46 +000058}
59
Tanya Lattner246a1372008-02-17 20:02:20 +000060define float @f7(i32 %a) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000061entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000062 %tmp = sitofp i32 %a to float ; <float> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000063 ret float %tmp
64}
65
Tanya Lattner246a1372008-02-17 20:02:20 +000066define double @f8(i32 %a) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000067entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000068 %tmp = sitofp i32 %a to double ; <double> [#uses=1]
69 ret double %tmp
Dan Gohmanf17a25c2007-07-18 16:29:46 +000070}
71
Tanya Lattner246a1372008-02-17 20:02:20 +000072define float @f9(i32 %a) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000073entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000074 %tmp = uitofp i32 %a to float ; <float> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000075 ret float %tmp
76}
77
Tanya Lattner246a1372008-02-17 20:02:20 +000078define double @f10(i32 %a) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000079entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000080 %tmp = uitofp i32 %a to double ; <double> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000081 ret double %tmp
82}