1 ; Test f32 and v4f32 absolute on z14.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
5 declare float @llvm.fabs.f32(float)
6 declare <4 x float> @llvm.fabs.v4f32(<4 x float>)
8 ; Test a plain absolute.
9 define <4 x float> @f1(<4 x float> %val) {
11 ; CHECK: vflpsb %v24, %v24
13 %ret = call <4 x float> @llvm.fabs.v4f32(<4 x float> %val)
17 ; Test a negative absolute.
18 define <4 x float> @f2(<4 x float> %val) {
20 ; CHECK: vflnsb %v24, %v24
22 %abs = call <4 x float> @llvm.fabs.v4f32(<4 x float> %val)
23 %ret = fsub <4 x float> <float -0.0, float -0.0,
24 float -0.0, float -0.0>, %abs
28 ; Test an f32 absolute that uses vector registers.
29 define float @f3(<4 x float> %val) {
31 ; CHECK: wflpsb %f0, %v24
33 %scalar = extractelement <4 x float> %val, i32 0
34 %ret = call float @llvm.fabs.f32(float %scalar)
38 ; Test an f32 negative absolute that uses vector registers.
39 define float @f4(<4 x float> %val) {
41 ; CHECK: wflnsb %f0, %v24
43 %scalar = extractelement <4 x float> %val, i32 0
44 %abs = call float @llvm.fabs.f32(float %scalar)
45 %ret = fsub float -0.0, %abs