[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / SystemZ / builtins-systemz-vector2-constrained.c
blob735b6a0249ab6251f172e2eed348a5d80f171f6b
1 // REQUIRES: systemz-registered-target
2 // RUN: %clang_cc1 -target-cpu z14 -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))) double vec_double;
6 typedef __attribute__((vector_size(16))) float vec_float;
8 volatile vec_double vd;
9 volatile vec_float vf;
11 void test_float(void) {
12 vd = __builtin_s390_vfmaxdb(vd, vd, 4);
13 // CHECK: call <2 x double> @llvm.experimental.constrained.maxnum.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}})
15 vd = __builtin_s390_vfmindb(vd, vd, 4);
16 // CHECK: call <2 x double> @llvm.experimental.constrained.minnum.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}})
17 vd = __builtin_s390_vfmindb(vd, vd, 0);
19 vd = __builtin_s390_vfnmadb(vd, vd, vd);
20 // CHECK: [[RES:%[^ ]+]] = call <2 x double> @llvm.experimental.constrained.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
21 // CHECK: fneg <2 x double> [[RES]]
23 vd = __builtin_s390_vfnmsdb(vd, vd, vd);
24 // CHECK: [[NEG:%[^ ]+]] = fneg <2 x double> {{.*}}
25 // CHECK: [[RES:%[^ ]+]] = call <2 x double> @llvm.experimental.constrained.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[NEG]], metadata !{{.*}})
26 // CHECK: fneg <2 x double> [[RES]]
28 vf = __builtin_s390_vfmaxsb(vf, vf, 4);
29 // CHECK: call <4 x float> @llvm.experimental.constrained.maxnum.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, metadata !{{.*}})
31 vf = __builtin_s390_vfminsb(vf, vf, 4);
32 // CHECK: call <4 x float> @llvm.experimental.constrained.minnum.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, metadata !{{.*}})
34 vf = __builtin_s390_vfsqsb(vf);
35 // CHECK: call <4 x float> @llvm.experimental.constrained.sqrt.v4f32(<4 x float> %{{.*}}, metadata !{{.*}})
37 vf = __builtin_s390_vfmasb(vf, vf, vf);
38 // CHECK: call <4 x float> @llvm.experimental.constrained.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}, metadata !{{.*}})
39 vf = __builtin_s390_vfmssb(vf, vf, vf);
40 // CHECK: [[NEG:%[^ ]+]] = fneg <4 x float> %{{.*}}
41 // CHECK: call <4 x float> @llvm.experimental.constrained.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> [[NEG]], metadata !{{.*}})
42 vf = __builtin_s390_vfnmasb(vf, vf, vf);
43 // CHECK: [[RES:%[^ ]+]] = call <4 x float> @llvm.experimental.constrained.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}, metadata !{{.*}})
44 // CHECK: fneg <4 x float> [[RES]]
45 vf = __builtin_s390_vfnmssb(vf, vf, vf);
46 // CHECK: [[NEG:%[^ ]+]] = fneg <4 x float> %{{.*}}
47 // CHECK: [[RES:%[^ ]+]] = call <4 x float> @llvm.experimental.constrained.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> [[NEG]], metadata !{{.*}})
48 // CHECK: fneg <4 x float> [[RES]]
50 vf = __builtin_s390_vflpsb(vf);
51 // CHECK: call <4 x float> @llvm.fabs.v4f32(<4 x float> %{{.*}})
52 vf = __builtin_s390_vflnsb(vf);
53 // CHECK: [[ABS:%[^ ]+]] = call <4 x float> @llvm.fabs.v4f32(<4 x float> %{{.*}})
54 // CHECK: fneg <4 x float> [[ABS]]
56 vf = __builtin_s390_vfisb(vf, 0, 0);
57 // CHECK: call <4 x float> @llvm.experimental.constrained.rint.v4f32(<4 x float> %{{.*}}, metadata !{{.*}})
58 vf = __builtin_s390_vfisb(vf, 4, 0);
59 // CHECK: call <4 x float> @llvm.experimental.constrained.nearbyint.v4f32(<4 x float> %{{.*}}, metadata !{{.*}})
60 vf = __builtin_s390_vfisb(vf, 4, 1);
61 // CHECK: call <4 x float> @llvm.experimental.constrained.round.v4f32(<4 x float> %{{.*}}, metadata !{{.*}})
62 vf = __builtin_s390_vfisb(vf, 4, 5);
63 // CHECK: call <4 x float> @llvm.experimental.constrained.trunc.v4f32(<4 x float> %{{.*}}, metadata !{{.*}})
64 vf = __builtin_s390_vfisb(vf, 4, 6);
65 // CHECK: call <4 x float> @llvm.experimental.constrained.ceil.v4f32(<4 x float> %{{.*}}, metadata !{{.*}})
66 vf = __builtin_s390_vfisb(vf, 4, 7);
67 // CHECK: call <4 x float> @llvm.experimental.constrained.floor.v4f32(<4 x float> %{{.*}}, metadata !{{.*}})