1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64 -o - %s -mattr=+neon,+fullfp16 | FileCheck %s
4 define double @t1(double %x) {
6 ; CHECK: // %bb.0: // %entry
7 ; CHECK-NEXT: fcvtzs d0, d0
8 ; CHECK-NEXT: scvtf d0, d0
11 %conv = fptosi double %x to i64
12 %conv1 = sitofp i64 %conv to double
16 define float @t2(float %x) {
18 ; CHECK: // %bb.0: // %entry
19 ; CHECK-NEXT: fcvtzs s0, s0
20 ; CHECK-NEXT: scvtf s0, s0
23 %conv = fptosi float %x to i32
24 %conv1 = sitofp i32 %conv to float
28 define half @t3(half %x) {
30 ; CHECK: // %bb.0: // %entry
31 ; CHECK-NEXT: fcvtzs h0, h0
32 ; CHECK-NEXT: scvtf h0, h0
35 %conv = fptosi half %x to i32
36 %conv1 = sitofp i32 %conv to half
40 define double @t4(double %x) {
42 ; CHECK: // %bb.0: // %entry
43 ; CHECK-NEXT: fcvtzu d0, d0
44 ; CHECK-NEXT: ucvtf d0, d0
47 %conv = fptoui double %x to i64
48 %conv1 = uitofp i64 %conv to double
52 define float @t5(float %x) {
54 ; CHECK: // %bb.0: // %entry
55 ; CHECK-NEXT: fcvtzu s0, s0
56 ; CHECK-NEXT: ucvtf s0, s0
59 %conv = fptoui float %x to i32
60 %conv1 = uitofp i32 %conv to float
64 define half @t6(half %x) {
66 ; CHECK: // %bb.0: // %entry
67 ; CHECK-NEXT: fcvtzu h0, h0
68 ; CHECK-NEXT: ucvtf h0, h0
71 %conv = fptoui half %x to i32
72 %conv1 = uitofp i32 %conv to half
76 define double @t1_strict(double %x) #0 {
77 ; CHECK-LABEL: t1_strict:
78 ; CHECK: // %bb.0: // %entry
79 ; CHECK-NEXT: fcvtzs d0, d0
80 ; CHECK-NEXT: scvtf d0, d0
83 %conv = call i64 @llvm.experimental.constrained.fptosi.i64.f64(double %x, metadata !"fpexcept.strict") #0
84 %conv1 = call double @llvm.experimental.constrained.sitofp.i64.f64(i64 %conv, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
88 define float @t2_strict(float %x) #0 {
89 ; CHECK-LABEL: t2_strict:
90 ; CHECK: // %bb.0: // %entry
91 ; CHECK-NEXT: fcvtzs s0, s0
92 ; CHECK-NEXT: scvtf s0, s0
95 %conv = call i32 @llvm.experimental.constrained.fptosi.i32.f32(float %x, metadata !"fpexcept.strict") #0
96 %conv1 = call float @llvm.experimental.constrained.sitofp.i32.f32(i32 %conv, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
100 define half @t3_strict(half %x) #0 {
101 ; CHECK-LABEL: t3_strict:
102 ; CHECK: // %bb.0: // %entry
103 ; CHECK-NEXT: fcvtzs h0, h0
104 ; CHECK-NEXT: scvtf h0, h0
107 %conv = call i32 @llvm.experimental.constrained.fptosi.i32.f16(half %x, metadata !"fpexcept.strict") #0
108 %conv1 = call half @llvm.experimental.constrained.sitofp.i32.f16(i32 %conv, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
112 define double @t4_strict(double %x) #0 {
113 ; CHECK-LABEL: t4_strict:
114 ; CHECK: // %bb.0: // %entry
115 ; CHECK-NEXT: fcvtzu d0, d0
116 ; CHECK-NEXT: ucvtf d0, d0
119 %conv = call i64 @llvm.experimental.constrained.fptoui.i64.f64(double %x, metadata !"fpexcept.strict") #0
120 %conv1 = call double @llvm.experimental.constrained.uitofp.i64.f64(i64 %conv, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
124 define float @t5_strict(float %x) #0 {
125 ; CHECK-LABEL: t5_strict:
126 ; CHECK: // %bb.0: // %entry
127 ; CHECK-NEXT: fcvtzu s0, s0
128 ; CHECK-NEXT: ucvtf s0, s0
131 %conv = call i32 @llvm.experimental.constrained.fptoui.i32.f32(float %x, metadata !"fpexcept.strict") #0
132 %conv1 = call float @llvm.experimental.constrained.uitofp.i32.f32(i32 %conv, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
136 define half @t6_strict(half %x) #0 {
137 ; CHECK-LABEL: t6_strict:
138 ; CHECK: // %bb.0: // %entry
139 ; CHECK-NEXT: fcvtzu h0, h0
140 ; CHECK-NEXT: ucvtf h0, h0
143 %conv = call i32 @llvm.experimental.constrained.fptoui.i32.f16(half %x, metadata !"fpexcept.strict") #0
144 %conv1 = call half @llvm.experimental.constrained.uitofp.i32.f16(i32 %conv, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
148 attributes #0 = { strictfp }
150 declare i32 @llvm.experimental.constrained.fptosi.i32.f16(half, metadata)
151 declare i32 @llvm.experimental.constrained.fptoui.i32.f16(half, metadata)
152 declare i32 @llvm.experimental.constrained.fptosi.i32.f32(float, metadata)
153 declare i32 @llvm.experimental.constrained.fptoui.i32.f32(float, metadata)
154 declare i64 @llvm.experimental.constrained.fptosi.i64.f64(double, metadata)
155 declare i64 @llvm.experimental.constrained.fptoui.i64.f64(double, metadata)
156 declare half @llvm.experimental.constrained.sitofp.i32.f16(i32, metadata, metadata)
157 declare half @llvm.experimental.constrained.uitofp.i32.f16(i32, metadata, metadata)
158 declare float @llvm.experimental.constrained.sitofp.i32.f32(i32, metadata, metadata)
159 declare float @llvm.experimental.constrained.uitofp.i32.f32(i32, metadata, metadata)
160 declare double @llvm.experimental.constrained.sitofp.i64.f64(i64, metadata, metadata)
161 declare double @llvm.experimental.constrained.uitofp.i64.f64(i64, metadata, metadata)