1 ; Test f64 and v2f64 absolute.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
5 declare double @llvm.fabs.f64(double)
6 declare <2 x double> @llvm.fabs.v2f64(<2 x double>)
8 ; Test a plain absolute.
9 define <2 x double> @f1(<2 x double> %val) {
11 ; CHECK: vflpdb %v24, %v24
13 %ret = call <2 x double> @llvm.fabs.v2f64(<2 x double> %val)
17 ; Test a negative absolute.
18 define <2 x double> @f2(<2 x double> %val) {
20 ; CHECK: vflndb %v24, %v24
22 %abs = call <2 x double> @llvm.fabs.v2f64(<2 x double> %val)
23 %ret = fneg <2 x double> %abs
27 ; Test an f64 absolute that uses vector registers.
28 define double @f3(<2 x double> %val) {
30 ; CHECK: wflpdb %f0, %v24
32 %scalar = extractelement <2 x double> %val, i32 0
33 %ret = call double @llvm.fabs.f64(double %scalar)
37 ; Test an f64 negative absolute that uses vector registers.
38 define double @f4(<2 x double> %val) {
40 ; CHECK: wflndb %f0, %v24
42 %scalar = extractelement <2 x double> %val, i32 0
43 %abs = call double @llvm.fabs.f64(double %scalar)
44 %ret = fneg double %abs