1 // REQUIRES: systemz-registered-target
2 // RUN: %clang_cc1 -target-cpu z13 -triple s390x-ibm-linux -flax-vector-conversions=none \
3 // RUN: -ffp-exception-behavior=strict -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s
5 typedef __attribute__((vector_size(16))) signed long long vec_slong
;
6 typedef __attribute__((vector_size(16))) double vec_double
;
8 volatile vec_slong vsl
;
9 volatile vec_double vd
;
13 void test_float(void) {
14 vsl
= __builtin_s390_vfcedbs(vd
, vd
, &cc
);
15 // CHECK: call { <2 x i64>, i32 } @llvm.s390.vfcedbs(<2 x double> %{{.*}}, <2 x double> %{{.*}})
16 vsl
= __builtin_s390_vfchdbs(vd
, vd
, &cc
);
17 // CHECK: call { <2 x i64>, i32 } @llvm.s390.vfchdbs(<2 x double> %{{.*}}, <2 x double> %{{.*}})
18 vsl
= __builtin_s390_vfchedbs(vd
, vd
, &cc
);
19 // CHECK: call { <2 x i64>, i32 } @llvm.s390.vfchedbs(<2 x double> %{{.*}}, <2 x double> %{{.*}})
21 vsl
= __builtin_s390_vftcidb(vd
, 0, &cc
);
22 // CHECK: call { <2 x i64>, i32 } @llvm.s390.vftcidb(<2 x double> %{{.*}}, i32 0)
23 vsl
= __builtin_s390_vftcidb(vd
, 4095, &cc
);
24 // CHECK: call { <2 x i64>, i32 } @llvm.s390.vftcidb(<2 x double> %{{.*}}, i32 4095)
26 vd
= __builtin_s390_vfsqdb(vd
);
27 // CHECK: call <2 x double> @llvm.experimental.constrained.sqrt.v2f64(<2 x double> %{{.*}})
29 vd
= __builtin_s390_vfmadb(vd
, vd
, vd
);
30 // CHECK: call <2 x double> @llvm.experimental.constrained.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
31 vd
= __builtin_s390_vfmsdb(vd
, vd
, vd
);
32 // CHECK: [[NEG:%[^ ]+]] = fneg <2 x double> {{.*}}
33 // CHECK: call <2 x double> @llvm.experimental.constrained.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[NEG]], {{.*}})
35 vd
= __builtin_s390_vflpdb(vd
);
36 // CHECK: call <2 x double> @llvm.fabs.v2f64(<2 x double> %{{.*}})
37 vd
= __builtin_s390_vflndb(vd
);
38 // CHECK: [[ABS:%[^ ]+]] = call <2 x double> @llvm.fabs.v2f64(<2 x double> %{{.*}})
39 // CHECK: fneg <2 x double> [[ABS]]
41 vd
= __builtin_s390_vfidb(vd
, 0, 0);
42 // CHECK: call <2 x double> @llvm.experimental.constrained.rint.v2f64(<2 x double> %{{.*}})
43 vd
= __builtin_s390_vfidb(vd
, 4, 0);
44 // CHECK: call <2 x double> @llvm.experimental.constrained.nearbyint.v2f64(<2 x double> %{{.*}})
45 vd
= __builtin_s390_vfidb(vd
, 4, 1);
46 // CHECK: call <2 x double> @llvm.experimental.constrained.round.v2f64(<2 x double> %{{.*}})
47 vd
= __builtin_s390_vfidb(vd
, 4, 5);
48 // CHECK: call <2 x double> @llvm.experimental.constrained.trunc.v2f64(<2 x double> %{{.*}})
49 vd
= __builtin_s390_vfidb(vd
, 4, 6);
50 // CHECK: call <2 x double> @llvm.experimental.constrained.ceil.v2f64(<2 x double> %{{.*}})
51 vd
= __builtin_s390_vfidb(vd
, 4, 7);
52 // CHECK: call <2 x double> @llvm.experimental.constrained.floor.v2f64(<2 x double> %{{.*}})
53 vd
= __builtin_s390_vfidb(vd
, 4, 4);
54 // CHECK: call <2 x double> @llvm.s390.vfidb(<2 x double> %{{.*}}, i32 4, i32 4)