1 ; Test conversions between different-sized float elements.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
5 declare <2 x float> @llvm.experimental.constrained.fptrunc.v2f32.v2f64(<2 x double>, metadata, metadata)
6 declare float @llvm.experimental.constrained.fptrunc.f32.f64(double, metadata, metadata)
8 declare <2 x double> @llvm.experimental.constrained.fpext.v2f64.v2f32(<2 x float>, metadata)
9 declare double @llvm.experimental.constrained.fpext.f64.f32(float, metadata)
11 ; Test cases where both elements of a v2f64 are converted to f32s.
12 define void @f1(<2 x double> %val, <2 x float> *%ptr) #0 {
14 ; CHECK: vledb {{%v[0-9]+}}, %v24, 0, 0
16 %res = call <2 x float> @llvm.experimental.constrained.fptrunc.v2f32.v2f64(
18 metadata !"round.dynamic",
19 metadata !"fpexcept.strict") #0
20 store <2 x float> %res, <2 x float> *%ptr
24 ; Test conversion of an f64 in a vector register to an f32.
25 define float @f2(<2 x double> %vec) #0 {
27 ; CHECK: wledb %f0, %v24, 0, 0
29 %scalar = extractelement <2 x double> %vec, i32 0
30 %ret = call float @llvm.experimental.constrained.fptrunc.f32.f64(
32 metadata !"round.dynamic",
33 metadata !"fpexcept.strict") #0
37 ; Test cases where even elements of a v4f32 are converted to f64s.
38 define <2 x double> @f3(<4 x float> %vec) #0 {
40 ; CHECK: vldeb %v24, {{%v[0-9]+}}
42 %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(
45 metadata !"fpexcept.strict") #0
49 ; Test conversion of an f32 in a vector register to an f64.
50 define double @f4(<4 x float> %vec) #0 {
52 ; CHECK: wldeb %f0, %v24
54 %scalar = extractelement <4 x float> %vec, i32 0
55 %ret = call double @llvm.experimental.constrained.fpext.f64.f32(
57 metadata !"fpexcept.strict") #0
61 attributes #0 = { strictfp }