| 1 |
; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc64le-unknown-unknown -mcpu=pwr10 | FileCheck -check-prefixes=CHECK-PWR9 %s |
| 2 |
; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc64le-unknown-unknown -mcpu=pwr9 | FileCheck -check-prefixes=CHECK-PWR9 %s |
| 3 |
; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc64le-unknown-unknown -mcpu=pwr8 | FileCheck -check-prefixes=CHECK-PWR8 %s |
| 4 |
; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc-ibm-aix-xcoff -mcpu=pwr10 | FileCheck -check-prefixes=CHECK-PWR10 %s |
| 5 |
; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc-ibm-aix-xcoff -mcpu=pwr9 | FileCheck -check-prefixes=CHECK-PWR9 %s |
| 6 |
; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc-ibm-aix-xcoff -mcpu=pwr8 | FileCheck -check-prefixes=CHECK-PWR8 %s |
| 7 |
; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc-ibm-aix-xcoff -mcpu=pwr7 | FileCheck -check-prefixes=CHECK-PWR7 %s |
| 8 |
|
| 9 |
; Exponent is a variable |
| 10 |
define void @vpow_var(ptr nocapture %z, ptr nocapture readonly %y, ptr nocapture readonly %x) { |
| 11 |
; CHECK-LABEL: @vpow_var |
| 12 |
; CHECK-PWR10: __powd2_P10 |
| 13 |
; CHECK-PWR9: __powd2_P9 |
| 14 |
; CHECK-PWR8: __powd2_P8 |
| 15 |
; CHECK-PWR7: __powd2_P7 |
| 16 |
; CHECK: blr |
| 17 |
entry: |
| 18 |
br label %vector.body |
| 19 |
|
| 20 |
vector.body: |
| 21 |
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ] |
| 22 |
%next.gep = getelementptr double, ptr %z, i64 %index |
| 23 |
%next.gep31 = getelementptr double, ptr %y, i64 %index |
| 24 |
%next.gep32 = getelementptr double, ptr %x, i64 %index |
| 25 |
%wide.load = load <2 x double>, ptr %next.gep32, align 8 |
| 26 |
%wide.load33 = load <2 x double>, ptr %next.gep31, align 8 |
| 27 |
%0 = call ninf afn nsz <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> %wide.load33) |
| 28 |
store <2 x double> %0, ptr %next.gep, align 8 |
| 29 |
%index.next = add i64 %index, 2 |
| 30 |
%1 = icmp eq i64 %index.next, 1024 |
| 31 |
br i1 %1, label %for.end, label %vector.body |
| 32 |
|
| 33 |
for.end: |
| 34 |
ret void |
| 35 |
} |
| 36 |
|
| 37 |
; Exponent is a constant != 0.75 and !=0.25 |
| 38 |
define void @vpow_const(ptr nocapture %y, ptr nocapture readonly %x) { |
| 39 |
; CHECK-LABEL: @vpow_const |
| 40 |
; CHECK-PWR10: __powd2_P10 |
| 41 |
; CHECK-PWR9: __powd2_P9 |
| 42 |
; CHECK-PWR8: __powd2_P8 |
| 43 |
; CHECK-PWR7: __powd2_P7 |
| 44 |
; CHECK: blr |
| 45 |
entry: |
| 46 |
br label %vector.body |
| 47 |
|
| 48 |
vector.body: |
| 49 |
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ] |
| 50 |
%next.gep = getelementptr double, ptr %y, i64 %index |
| 51 |
%next.gep19 = getelementptr double, ptr %x, i64 %index |
| 52 |
%wide.load = load <2 x double>, ptr %next.gep19, align 8 |
| 53 |
%0 = call ninf afn nsz <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 7.600000e-01, double 7.600000e-01>) |
| 54 |
store <2 x double> %0, ptr %next.gep, align 8 |
| 55 |
%index.next = add i64 %index, 2 |
| 56 |
%1 = icmp eq i64 %index.next, 1024 |
| 57 |
br i1 %1, label %for.end, label %vector.body |
| 58 |
|
| 59 |
for.end: |
| 60 |
ret void |
| 61 |
} |
| 62 |
|
| 63 |
; Exponent is a constant != 0.75 and !=0.25 and they are different |
| 64 |
define void @vpow_noeq_const(ptr nocapture %y, ptr nocapture readonly %x) { |
| 65 |
; CHECK-LABEL: @vpow_noeq_const |
| 66 |
; CHECK-PWR10: __powd2_P10 |
| 67 |
; CHECK-PWR9: __powd2_P9 |
| 68 |
; CHECK-PWR8: __powd2_P8 |
| 69 |
; CHECK-PWR7: __powd2_P7 |
| 70 |
; CHECK: blr |
| 71 |
entry: |
| 72 |
br label %vector.body |
| 73 |
|
| 74 |
vector.body: |
| 75 |
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ] |
| 76 |
%next.gep = getelementptr double, ptr %y, i64 %index |
| 77 |
%next.gep19 = getelementptr double, ptr %x, i64 %index |
| 78 |
%wide.load = load <2 x double>, ptr %next.gep19, align 8 |
| 79 |
%0 = call ninf afn nsz <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 7.700000e-01, double 7.600000e-01>) |
| 80 |
store <2 x double> %0, ptr %next.gep, align 8 |
| 81 |
%index.next = add i64 %index, 2 |
| 82 |
%1 = icmp eq i64 %index.next, 1024 |
| 83 |
br i1 %1, label %for.end, label %vector.body |
| 84 |
|
| 85 |
for.end: |
| 86 |
ret void |
| 87 |
} |
| 88 |
|
| 89 |
; Exponent is a constant != 0.75 and !=0.25 and they are different |
| 90 |
define void @vpow_noeq075_const(ptr nocapture %y, ptr nocapture readonly %x) { |
| 91 |
; CHECK-LABEL: @vpow_noeq075_const |
| 92 |
; CHECK-PWR10: __powd2_P10 |
| 93 |
; CHECK-PWR9: __powd2_P9 |
| 94 |
; CHECK-PWR8: __powd2_P8 |
| 95 |
; CHECK-PWR7: __powd2_P7 |
| 96 |
; CHECK: blr |
| 97 |
entry: |
| 98 |
br label %vector.body |
| 99 |
|
| 100 |
vector.body: |
| 101 |
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ] |
| 102 |
%next.gep = getelementptr double, ptr %y, i64 %index |
| 103 |
%next.gep19 = getelementptr double, ptr %x, i64 %index |
| 104 |
%wide.load = load <2 x double>, ptr %next.gep19, align 8 |
| 105 |
%0 = call ninf afn nsz <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 7.700000e-01, double 7.500000e-01>) |
| 106 |
store <2 x double> %0, ptr %next.gep, align 8 |
| 107 |
%index.next = add i64 %index, 2 |
| 108 |
%1 = icmp eq i64 %index.next, 1024 |
| 109 |
br i1 %1, label %for.end, label %vector.body |
| 110 |
|
| 111 |
for.end: |
| 112 |
ret void |
| 113 |
} |
| 114 |
|
| 115 |
; Exponent is a constant != 0.75 and !=0.25 and they are different |
| 116 |
define void @vpow_noeq025_const(ptr nocapture %y, ptr nocapture readonly %x) { |
| 117 |
; CHECK-LABEL: @vpow_noeq025_const |
| 118 |
; CHECK-PWR10: __powd2_P10 |
| 119 |
; CHECK-PWR9: __powd2_P9 |
| 120 |
; CHECK-PWR8: __powd2_P8 |
| 121 |
; CHECK-PWR7: __powd2_P7 |
| 122 |
; CHECK: blr |
| 123 |
entry: |
| 124 |
br label %vector.body |
| 125 |
|
| 126 |
vector.body: |
| 127 |
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ] |
| 128 |
%next.gep = getelementptr double, ptr %y, i64 %index |
| 129 |
%next.gep19 = getelementptr double, ptr %x, i64 %index |
| 130 |
%wide.load = load <2 x double>, ptr %next.gep19, align 8 |
| 131 |
%0 = call ninf afn nsz <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 7.700000e-01, double 2.500000e-01>) |
| 132 |
store <2 x double> %0, ptr %next.gep, align 8 |
| 133 |
%index.next = add i64 %index, 2 |
| 134 |
%1 = icmp eq i64 %index.next, 1024 |
| 135 |
br i1 %1, label %for.end, label %vector.body |
| 136 |
|
| 137 |
for.end: |
| 138 |
ret void |
| 139 |
} |
| 140 |
|
| 141 |
; Exponent is 0.75 |
| 142 |
define void @vpow_075(ptr nocapture %y, ptr nocapture readonly %x) { |
| 143 |
; CHECK-LABEL: @vpow_075 |
| 144 |
; CHECK-NOT: __powd2_P{{[7,8,9,10]}} |
| 145 |
; CHECK: xvrsqrtesp |
| 146 |
; CHECK: blr |
| 147 |
entry: |
| 148 |
br label %vector.body |
| 149 |
|
| 150 |
vector.body: |
| 151 |
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ] |
| 152 |
%next.gep = getelementptr double, ptr %y, i64 %index |
| 153 |
%next.gep19 = getelementptr double, ptr %x, i64 %index |
| 154 |
%wide.load = load <2 x double>, ptr %next.gep19, align 8 |
| 155 |
%0 = call ninf afn <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 7.500000e-01, double 7.500000e-01>) |
| 156 |
store <2 x double> %0, ptr %next.gep, align 8 |
| 157 |
%index.next = add i64 %index, 2 |
| 158 |
%1 = icmp eq i64 %index.next, 1024 |
| 159 |
br i1 %1, label %for.end, label %vector.body |
| 160 |
|
| 161 |
for.end: |
| 162 |
ret void |
| 163 |
} |
| 164 |
|
| 165 |
; Exponent is 0.25 |
| 166 |
define void @vpow_025(ptr nocapture %y, ptr nocapture readonly %x) { |
| 167 |
; CHECK-LABEL: @vpow_025 |
| 168 |
; CHECK-NOT: __powd2_P{{[7,8,9,10]}} |
| 169 |
; CHECK: xvrsqrtesp |
| 170 |
; CHECK: blr |
| 171 |
entry: |
| 172 |
br label %vector.body |
| 173 |
|
| 174 |
vector.body: |
| 175 |
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ] |
| 176 |
%next.gep = getelementptr double, ptr %y, i64 %index |
| 177 |
%next.gep19 = getelementptr double, ptr %x, i64 %index |
| 178 |
%wide.load = load <2 x double>, ptr %next.gep19, align 8 |
| 179 |
%0 = call ninf afn nsz <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 2.500000e-01, double 2.500000e-01>) |
| 180 |
store <2 x double> %0, ptr %next.gep, align 8 |
| 181 |
%index.next = add i64 %index, 2 |
| 182 |
%1 = icmp eq i64 %index.next, 1024 |
| 183 |
br i1 %1, label %for.end, label %vector.body |
| 184 |
|
| 185 |
for.end: |
| 186 |
ret void |
| 187 |
} |
| 188 |
|
| 189 |
; Exponent is 0.75 but no proper fast-math flags |
| 190 |
define void @vpow_075_nofast(ptr nocapture %y, ptr nocapture readonly %x) { |
| 191 |
; CHECK-LABEL: @vpow_075_nofast |
| 192 |
; CHECK-PWR10: __powd2_P10 |
| 193 |
; CHECK-PWR9: __powd2_P9 |
| 194 |
; CHECK-PWR8: __powd2_P8 |
| 195 |
; CHECK-PWR7: __powd2_P7 |
| 196 |
; CHECK-NOT: xvrsqrtesp |
| 197 |
; CHECK: blr |
| 198 |
entry: |
| 199 |
br label %vector.body |
| 200 |
|
| 201 |
vector.body: |
| 202 |
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ] |
| 203 |
%next.gep = getelementptr double, ptr %y, i64 %index |
| 204 |
%next.gep19 = getelementptr double, ptr %x, i64 %index |
| 205 |
%wide.load = load <2 x double>, ptr %next.gep19, align 8 |
| 206 |
%0 = call <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 7.500000e-01, double 7.500000e-01>) |
| 207 |
store <2 x double> %0, ptr %next.gep, align 8 |
| 208 |
%index.next = add i64 %index, 2 |
| 209 |
%1 = icmp eq i64 %index.next, 1024 |
| 210 |
br i1 %1, label %for.end, label %vector.body |
| 211 |
|
| 212 |
for.end: |
| 213 |
ret void |
| 214 |
} |
| 215 |
|
| 216 |
; Exponent is 0.25 but no proper fast-math flags |
| 217 |
define void @vpow_025_nofast(ptr nocapture %y, ptr nocapture readonly %x) { |
| 218 |
; CHECK-LABEL: @vpow_025_nofast |
| 219 |
; CHECK-PWR10: __powd2_P10 |
| 220 |
; CHECK-PWR9: __powd2_P9 |
| 221 |
; CHECK-PWR8: __powd2_P8 |
| 222 |
; CHECK-PWR7: __powd2_P7 |
| 223 |
; CHECK-NOT: xvrsqrtesp |
| 224 |
; CHECK: blr |
| 225 |
entry: |
| 226 |
br label %vector.body |
| 227 |
|
| 228 |
vector.body: |
| 229 |
%index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ] |
| 230 |
%next.gep = getelementptr double, ptr %y, i64 %index |
| 231 |
%next.gep19 = getelementptr double, ptr %x, i64 %index |
| 232 |
%wide.load = load <2 x double>, ptr %next.gep19, align 8 |
| 233 |
%0 = call <2 x double> @__powd2(<2 x double> %wide.load, <2 x double> <double 2.500000e-01, double 2.500000e-01>) |
| 234 |
store <2 x double> %0, ptr %next.gep, align 8 |
| 235 |
%index.next = add i64 %index, 2 |
| 236 |
%1 = icmp eq i64 %index.next, 1024 |
| 237 |
br i1 %1, label %for.end, label %vector.body |
| 238 |
|
| 239 |
for.end: |
| 240 |
ret void |
| 241 |
} |
| 242 |
|
| 243 |
; Function Attrs: nounwind readnone speculatable willreturn |
| 244 |
declare <2 x double> @__powd2(<2 x double>, <2 x double>) #1 |