brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 06e550a Raw
62 lines · plain
1; Test conversions between different-sized float elements.2;3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s4 5declare <2 x float> @llvm.experimental.constrained.fptrunc.v2f32.v2f64(<2 x double>, metadata, metadata)6declare float @llvm.experimental.constrained.fptrunc.f32.f64(double, metadata, metadata)7 8declare <2 x double> @llvm.experimental.constrained.fpext.v2f64.v2f32(<2 x float>, metadata)9declare double @llvm.experimental.constrained.fpext.f64.f32(float, metadata)10 11; Test cases where both elements of a v2f64 are converted to f32s.12define void @f1(<2 x double> %val, ptr %ptr) #0 {13; CHECK-LABEL: f1:14; CHECK: vledb {{%v[0-9]+}}, %v24, 0, 015; CHECK: br %r1416  %res = call <2 x float> @llvm.experimental.constrained.fptrunc.v2f32.v2f64(17                                               <2 x double> %val,18                                               metadata !"round.dynamic",19                                               metadata !"fpexcept.strict") #020  store <2 x float> %res, ptr %ptr21  ret void22}23 24; Test conversion of an f64 in a vector register to an f32.25define float @f2(<2 x double> %vec) #0 {26; CHECK-LABEL: f2:27; CHECK: wledb %f0, %v24, 0, 028; CHECK: br %r1429  %scalar = extractelement <2 x double> %vec, i32 030  %ret = call float @llvm.experimental.constrained.fptrunc.f32.f64(31                                               double %scalar,32                                               metadata !"round.dynamic",33                                               metadata !"fpexcept.strict") #034  ret float %ret35}36 37; Test cases where even elements of a v4f32 are converted to f64s.38define <2 x double> @f3(<4 x float> %vec) #0 {39; CHECK-LABEL: f3:40; CHECK: vldeb %v24, {{%v[0-9]+}}41; CHECK: br %r1442  %shuffle = shufflevector <4 x float> %vec, <4 x float> undef, <2 x i32> <i32 0, i32 2>43  %res = call <2 x double> @llvm.experimental.constrained.fpext.v2f64.v2f32(44                                               <2 x float> %shuffle,45                                               metadata !"fpexcept.strict") #046  ret <2 x double> %res47}48 49; Test conversion of an f32 in a vector register to an f64.50define double @f4(<4 x float> %vec) #0 {51; CHECK-LABEL: f4:52; CHECK: wldeb %f0, %v2453; CHECK: br %r1454  %scalar = extractelement <4 x float> %vec, i32 055  %ret = call double @llvm.experimental.constrained.fpext.f64.f32(56                                               float %scalar,57                                               metadata !"fpexcept.strict") #058  ret double %ret59}60 61attributes #0 = { strictfp }62