[InstCombine] Signed saturation tests. NFC
[llvm-complete.git] / test / Transforms / LoopVectorize / PowerPC / massv-altivec.ll
blobc63db5b0b663633682b366e380c995b9560d794f
1 ; RUN: opt -vector-library=MASSV -loop-vectorize -force-vector-interleave=1 -mattr=-altivec -S < %s | FileCheck %s
3 target datalayout = "e-m:e-i64:64-n32:64" 
4 target triple = "powerpc64le-unknown-linux-gnu"
6 declare double @cbrt(double) #0
7 declare float @cbrtf(float) #0
9 declare double @atanh(double) #0
10 declare float @atanhf(float) #0
12 ; MASSV is unsupported for AltiVec.
13 ; Check that massv entries are not generated.
14 define void @cbrt_f64(double* nocapture %varray) {
15 ; CHECK-LABEL: @cbrt_f64(
16 ; CHECK-NOT: __cbrtd2_massv{{.*}}<2 x double>
17 ; CHECK: ret void
19 entry:
20   br label %for.body
22 for.body:
23   %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
24   %tmp = trunc i64 %iv to i32
25   %conv = sitofp i32 %tmp to double
26   %call = tail call double @cbrt(double %conv)
27   %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv
28   store double %call, double* %arrayidx, align 4
29   %iv.next = add nuw nsw i64 %iv, 1
30   %exitcond = icmp eq i64 %iv.next, 1000
31   br i1 %exitcond, label %for.end, label %for.body
33 for.end:
34   ret void
37 define void @cbrt_f32(float* nocapture %varray) {
38 ; CHECK-LABEL: @cbrt_f32(
39 ; CHECK-NOT: __cbrtf4_massv{{.*}}<4 x float>
40 ; CHECK: ret void
42 entry:
43   br label %for.body
45 for.body:
46   %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
47   %tmp = trunc i64 %iv to i32
48   %conv = sitofp i32 %tmp to float
49   %call = tail call float @cbrtf(float %conv)
50   %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv
51   store float %call, float* %arrayidx, align 4
52   %iv.next = add nuw nsw i64 %iv, 1
53   %exitcond = icmp eq i64 %iv.next, 1000
54   br i1 %exitcond, label %for.end, label %for.body
56 for.end:
57   ret void
60 define void @atanh_f64(double* nocapture %varray) {
61 ; CHECK-LABEL: @atanh_f64(
62 ; CHECK-NOT: __atanhd2_massv{{.*}}<2 x double>
63 ; CHECK: ret void
65 entry:
66   br label %for.body
68 for.body:
69   %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
70   %tmp = trunc i64 %iv to i32
71   %conv = sitofp i32 %tmp to double
72   %call = tail call double @atanh(double %conv)
73   %arrayidx = getelementptr inbounds double, double* %varray, i64 %iv
74   store double %call, double* %arrayidx, align 4
75   %iv.next = add nuw nsw i64 %iv, 1
76   %exitcond = icmp eq i64 %iv.next, 1000
77   br i1 %exitcond, label %for.end, label %for.body
79 for.end:
80   ret void
83 define void @atanh_f32(float* nocapture %varray) {
84 ; CHECK-LABEL: @atanh_f32(
85 ; CHECK-NOT: __atanhf4_massv{{.*}}<2 x double>
86 ; CHECK: ret void
88 entry:
89   br label %for.body
91 for.body:
92   %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
93   %tmp = trunc i64 %iv to i32
94   %conv = sitofp i32 %tmp to float
95   %call = tail call float @atanhf(float %conv)
96   %arrayidx = getelementptr inbounds float, float* %varray, i64 %iv
97   store float %call, float* %arrayidx, align 4
98   %iv.next = add nuw nsw i64 %iv, 1
99   %exitcond = icmp eq i64 %iv.next, 1000
100   br i1 %exitcond, label %for.end, label %for.body
102 for.end:
103   ret void
106 attributes #0 = { nounwind }