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 = fneg <4 x float> %abs
27 ; Test an f32 absolute that uses vector registers.
28 define float @f3(<4 x float> %val) {
30 ; CHECK: wflpsb %f0, %v24
32 %scalar = extractelement <4 x float> %val, i32 0
33 %ret = call float @llvm.fabs.f32(float %scalar)
37 ; Test an f32 negative absolute that uses vector registers.
38 define float @f4(<4 x float> %val) {
40 ; CHECK: wflnsb %f0, %v24
42 %scalar = extractelement <4 x float> %val, i32 0
43 %abs = call float @llvm.fabs.f32(float %scalar)
44 %ret = fneg float %abs