brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.8 KiB · 2e22c73 Raw
131 lines · plain
1; Test strict conversions between integer and float elements.2;3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s4 5declare <2 x i64> @llvm.experimental.constrained.fptoui.v2i64.v2f64(<2 x double>, metadata)6declare <2 x i64> @llvm.experimental.constrained.fptosi.v2i64.v2f64(<2 x double>, metadata)7declare <2 x double> @llvm.experimental.constrained.uitofp.v2f64.v2i64(<2 x i64>, metadata, metadata)8declare <2 x double> @llvm.experimental.constrained.sitofp.v2f64.v2i64(<2 x i64>, metadata, metadata)9 10declare <2 x i32> @llvm.experimental.constrained.fptoui.v2i32.v2f64(<2 x double>, metadata)11declare <2 x i32> @llvm.experimental.constrained.fptosi.v2i32.v2f64(<2 x double>, metadata)12declare <2 x double> @llvm.experimental.constrained.uitofp.v2f64.v2i32(<2 x i32>, metadata, metadata)13declare <2 x double> @llvm.experimental.constrained.sitofp.v2f64.v2i32(<2 x i32>, metadata, metadata)14 15declare <2 x i64> @llvm.experimental.constrained.fptoui.v2i64.v2f32(<2 x float>, metadata)16declare <2 x i64> @llvm.experimental.constrained.fptosi.v2i64.v2f32(<2 x float>, metadata)17declare <2 x float> @llvm.experimental.constrained.uitofp.v2f32.v2i64(<2 x i64>, metadata, metadata)18declare <2 x float> @llvm.experimental.constrained.sitofp.v2f32.v2i64(<2 x i64>, metadata, metadata)19 20; Test conversion of f64s to signed i64s.21define <2 x i64> @f1(<2 x double> %doubles) #0 {22; CHECK-LABEL: f1:23; CHECK: vcgdb %v24, %v24, 0, 524; CHECK: br %r1425  %dwords = call <2 x i64> @llvm.experimental.constrained.fptosi.v2i64.v2f64(<2 x double> %doubles,26                                               metadata !"fpexcept.strict") #027  ret <2 x i64> %dwords28}29 30; Test conversion of f64s to unsigned i64s.31define <2 x i64> @f2(<2 x double> %doubles) #0 {32; CHECK-LABEL: f2:33; CHECK: vclgdb %v24, %v24, 0, 534; CHECK: br %r1435  %dwords = call <2 x i64> @llvm.experimental.constrained.fptoui.v2i64.v2f64(<2 x double> %doubles,36                                               metadata !"fpexcept.strict") #037  ret <2 x i64> %dwords38}39 40; Test conversion of signed i64s to f64s.41define <2 x double> @f3(<2 x i64> %dwords) #0 {42; CHECK-LABEL: f3:43; CHECK: vcdgb %v24, %v24, 0, 044; CHECK: br %r1445  %doubles = call <2 x double> @llvm.experimental.constrained.sitofp.v2f64.v2i64(<2 x i64> %dwords,46                                               metadata !"round.dynamic",47                                               metadata !"fpexcept.strict") #048  ret <2 x double> %doubles49}50 51; Test conversion of unsigned i64s to f64s.52define <2 x double> @f4(<2 x i64> %dwords) #0 {53; CHECK-LABEL: f4:54; CHECK: vcdlgb %v24, %v24, 0, 055; CHECK: br %r1456  %doubles = call <2 x double> @llvm.experimental.constrained.uitofp.v2f64.v2i64(<2 x i64> %dwords,57                                               metadata !"round.dynamic",58                                               metadata !"fpexcept.strict") #059  ret <2 x double> %doubles60}61 62; Test conversion of f64s to signed i32s, which must compile.63define void @f5(<2 x double> %doubles, ptr %ptr) #0 {64  %words = call <2 x i32> @llvm.experimental.constrained.fptosi.v2i32.v2f64(<2 x double> %doubles,65                                               metadata !"fpexcept.strict") #066  store <2 x i32> %words, ptr %ptr67  ret void68}69 70; Test conversion of f64s to unsigned i32s, which must compile.71define void @f6(<2 x double> %doubles, ptr %ptr) #0 {72  %words = call <2 x i32> @llvm.experimental.constrained.fptoui.v2i32.v2f64(<2 x double> %doubles,73                                               metadata !"fpexcept.strict") #074  store <2 x i32> %words, ptr %ptr75  ret void76}77 78; Test conversion of signed i32s to f64s, which must compile.79define <2 x double> @f7(ptr %ptr) #0 {80  %words = load <2 x i32>, ptr %ptr81  %doubles = call <2 x double> @llvm.experimental.constrained.sitofp.v2f64.v2i32(<2 x i32> %words,82                                               metadata !"round.dynamic",83                                               metadata !"fpexcept.strict") #084  ret <2 x double> %doubles85}86 87; Test conversion of unsigned i32s to f64s, which must compile.88define <2 x double> @f8(ptr %ptr) #0 {89  %words = load <2 x i32>, ptr %ptr90  %doubles = call <2 x double> @llvm.experimental.constrained.uitofp.v2f64.v2i32(<2 x i32> %words,91                                               metadata !"round.dynamic",92                                               metadata !"fpexcept.strict") #093  ret <2 x double> %doubles94}95 96; Test conversion of f32s to signed i64s, which must compile.97define <2 x i64> @f9(ptr %ptr) #0 {98  %floats = load <2 x float>, ptr %ptr99  %dwords = call <2 x i64> @llvm.experimental.constrained.fptosi.v2i64.v2f32(<2 x float> %floats,100                                               metadata !"fpexcept.strict") #0101  ret <2 x i64> %dwords102}103 104; Test conversion of f32s to unsigned i64s, which must compile.105define <2 x i64> @f10(ptr %ptr) #0 {106  %floats = load <2 x float>, ptr %ptr107  %dwords = call <2 x i64> @llvm.experimental.constrained.fptoui.v2i64.v2f32(<2 x float> %floats,108                                               metadata !"fpexcept.strict") #0109  ret <2 x i64> %dwords110}111 112; Test conversion of signed i64s to f32, which must compile.113define void @f11(<2 x i64> %dwords, ptr %ptr) #0 {114  %floats = call <2 x float> @llvm.experimental.constrained.sitofp.v2f32.v2i64(<2 x i64> %dwords,115                                               metadata !"round.dynamic",116                                               metadata !"fpexcept.strict") #0117  store <2 x float> %floats, ptr %ptr118  ret void119}120 121; Test conversion of unsigned i64s to f32, which must compile.122define void @f12(<2 x i64> %dwords, ptr %ptr) #0 {123  %floats = call <2 x float> @llvm.experimental.constrained.uitofp.v2f32.v2i64(<2 x i64> %dwords,124                                               metadata !"round.dynamic",125                                               metadata !"fpexcept.strict") #0126  store <2 x float> %floats, ptr %ptr127  ret void128}129 130attributes #0 = { strictfp }131