245 lines · plain
1; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc64le-unknown-unknown -mcpu=pwr10 | FileCheck -check-prefixes=CHECK-PWR9 %s2; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc64le-unknown-unknown -mcpu=pwr9 | FileCheck -check-prefixes=CHECK-PWR9 %s3; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc64le-unknown-unknown -mcpu=pwr8 | FileCheck -check-prefixes=CHECK-PWR8 %s4; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc-ibm-aix-xcoff -mcpu=pwr10 | FileCheck -check-prefixes=CHECK-PWR10 %s5; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc-ibm-aix-xcoff -mcpu=pwr9 | FileCheck -check-prefixes=CHECK-PWR9 %s6; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc-ibm-aix-xcoff -mcpu=pwr8 | FileCheck -check-prefixes=CHECK-PWR8 %s7; RUN: llc -vector-library=MASSV < %s -mtriple=powerpc-ibm-aix-xcoff -mcpu=pwr7 | FileCheck -check-prefixes=CHECK-PWR7 %s8 9; Exponent is a variable10define void @vspow_var(ptr nocapture %z, ptr nocapture readonly %y, ptr nocapture readonly %x) {11; CHECK-LABEL: @vspow_var12; CHECK-PWR10: __powf4_P1013; CHECK-PWR9: __powf4_P914; CHECK-PWR8: __powf4_P815; CHECK-PWR7: __powf4_P716; CHECK: blr17entry:18 br label %vector.body19 20vector.body:21 %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]22 %next.gep = getelementptr float, ptr %z, i64 %index23 %next.gep31 = getelementptr float, ptr %y, i64 %index24 %next.gep32 = getelementptr float, ptr %x, i64 %index25 %wide.load = load <4 x float>, ptr %next.gep32, align 426 %wide.load33 = load <4 x float>, ptr %next.gep31, align 427 %0 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> %wide.load33)28 store <4 x float> %0, ptr %next.gep, align 429 %index.next = add i64 %index, 430 %1 = icmp eq i64 %index.next, 102431 br i1 %1, label %for.end, label %vector.body32 33for.end:34 ret void35}36 37; Exponent is a constant != 0.75 and !=0.2538define void @vspow_const(ptr nocapture %y, ptr nocapture readonly %x) {39; CHECK-LABEL: @vspow_const40; CHECK-PWR10: __powf4_P1041; CHECK-PWR9: __powf4_P942; CHECK-PWR8: __powf4_P843; CHECK-PWR7: __powf4_P744; CHECK: blr45entry:46 br label %vector.body47 48vector.body:49 %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]50 %next.gep = getelementptr float, ptr %y, i64 %index51 %next.gep19 = getelementptr float, ptr %x, i64 %index52 %wide.load = load <4 x float>, ptr %next.gep19, align 453 %0 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 0x3FE851EB80000000, float 0x3FE851EB80000000, float 0x3FE851EB80000000, float 0x3FE851EB80000000>)54 store <4 x float> %0, ptr %next.gep, align 455 %index.next = add i64 %index, 456 %1 = icmp eq i64 %index.next, 102457 br i1 %1, label %for.end, label %vector.body58 59for.end:60 ret void61}62 63; Exponent is a constant != 0.75 and !=0.25 and they are different 64define void @vspow_neq_const(ptr nocapture %y, ptr nocapture readonly %x) {65; CHECK-LABEL: @vspow_neq_const66; CHECK-PWR10: __powf4_P1067; CHECK-PWR9: __powf4_P968; CHECK-PWR8: __powf4_P869; CHECK-PWR7: __powf4_P770; CHECK: blr71entry:72 br label %vector.body73 74vector.body:75 %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]76 %next.gep = getelementptr float, ptr %y, i64 %index77 %next.gep19 = getelementptr float, ptr %x, i64 %index78 %wide.load = load <4 x float>, ptr %next.gep19, align 479 %0 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 0x3FE861EB80000000, float 0x3FE871EB80000000, float 0x3FE851EB80000000, float 0x3FE851EB80000000>)80 store <4 x float> %0, ptr %next.gep, align 481 %index.next = add i64 %index, 482 %1 = icmp eq i64 %index.next, 102483 br i1 %1, label %for.end, label %vector.body84 85for.end:86 ret void87}88 89; Exponent is a constant != 0.75 and !=0.2590define void @vspow_neq075_const(ptr nocapture %y, ptr nocapture readonly %x) {91; CHECK-LABEL: @vspow_neq075_const92; CHECK-PWR10: __powf4_P1093; CHECK-PWR9: __powf4_P994; CHECK-PWR8: __powf4_P895; CHECK-PWR7: __powf4_P796; CHECK: blr97entry:98 br label %vector.body99 100vector.body:101 %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]102 %next.gep = getelementptr float, ptr %y, i64 %index103 %next.gep19 = getelementptr float, ptr %x, i64 %index104 %wide.load = load <4 x float>, ptr %next.gep19, align 4105 %0 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 7.500000e-01, float 7.500000e-01, float 7.500000e-01, float 0x3FE851EB80000000>)106 store <4 x float> %0, ptr %next.gep, align 4107 %index.next = add i64 %index, 4108 %1 = icmp eq i64 %index.next, 1024109 br i1 %1, label %for.end, label %vector.body110 111for.end:112 ret void113}114 115; Exponent is a constant != 0.75 and !=0.25116define void @vspow_neq025_const(ptr nocapture %y, ptr nocapture readonly %x) {117; CHECK-LABEL: @vspow_neq025_const118; CHECK-PWR10: __powf4_P10119; CHECK-PWR9: __powf4_P9120; CHECK-PWR8: __powf4_P8121; CHECK-PWR7: __powf4_P7122; CHECK: blr123entry:124 br label %vector.body125 126vector.body:127 %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]128 %next.gep = getelementptr float, ptr %y, i64 %index129 %next.gep19 = getelementptr float, ptr %x, i64 %index130 %wide.load = load <4 x float>, ptr %next.gep19, align 4131 %0 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 0x3FE851EB80000000, float 2.500000e-01, float 0x3FE851EB80000000, float 2.500000e-01>)132 store <4 x float> %0, ptr %next.gep, align 4133 %index.next = add i64 %index, 4134 %1 = icmp eq i64 %index.next, 1024135 br i1 %1, label %for.end, label %vector.body136 137for.end:138 ret void139}140 141; Exponent is 0.75142define void @vspow_075(ptr nocapture %y, ptr nocapture readonly %x) {143; CHECK-LABEL: @vspow_075144; CHECK-NOT: __powf4_P{{[7,8,9,10]}}145; CHECK: xvrsqrtesp146; CHECK: blr147entry:148 br label %vector.body149 150vector.body:151 %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]152 %next.gep = getelementptr float, ptr %y, i64 %index153 %next.gep19 = getelementptr float, ptr %x, i64 %index154 %wide.load = load <4 x float>, ptr %next.gep19, align 4155 %0 = call ninf afn <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 7.500000e-01, float 7.500000e-01, float 7.500000e-01, float 7.500000e-01>)156 store <4 x float> %0, ptr %next.gep, align 4157 %index.next = add i64 %index, 4158 %1 = icmp eq i64 %index.next, 1024159 br i1 %1, label %for.end, label %vector.body160 161for.end:162 ret void163}164 165; Exponent is 0.25166define void @vspow_025(ptr nocapture %y, ptr nocapture readonly %x) {167; CHECK-LABEL: @vspow_025168; CHECK-NOT: __powf4_P{{[7,8,9,10]}}169; CHECK: xvrsqrtesp170; CHECK: blr171entry:172 br label %vector.body173 174vector.body:175 %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]176 %next.gep = getelementptr float, ptr %y, i64 %index177 %next.gep19 = getelementptr float, ptr %x, i64 %index178 %wide.load = load <4 x float>, ptr %next.gep19, align 4179 %0 = call ninf afn nsz <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 2.500000e-01, float 2.500000e-01, float 2.500000e-01, float 2.500000e-01>)180 store <4 x float> %0, ptr %next.gep, align 4181 %index.next = add i64 %index, 4182 %1 = icmp eq i64 %index.next, 1024183 br i1 %1, label %for.end, label %vector.body184 185for.end:186 ret void187}188 189; Exponent is 0.75 but no proper fast-math flags190define void @vspow_075_nofast(ptr nocapture %y, ptr nocapture readonly %x) {191; CHECK-LABEL: @vspow_075_nofast192; CHECK-PWR10: __powf4_P10193; CHECK-PWR9: __powf4_P9194; CHECK-PWR8: __powf4_P8195; CHECK-PWR7: __powf4_P7196; CHECK-NOT: xvrsqrtesp197; CHECK: blr198entry:199 br label %vector.body200 201vector.body:202 %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]203 %next.gep = getelementptr float, ptr %y, i64 %index204 %next.gep19 = getelementptr float, ptr %x, i64 %index205 %wide.load = load <4 x float>, ptr %next.gep19, align 4206 %0 = call <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 7.500000e-01, float 7.500000e-01, float 7.500000e-01, float 7.500000e-01>)207 store <4 x float> %0, ptr %next.gep, align 4208 %index.next = add i64 %index, 4209 %1 = icmp eq i64 %index.next, 1024210 br i1 %1, label %for.end, label %vector.body211 212for.end:213 ret void214}215 216; Exponent is 0.25 but no proper fast-math flags217define void @vspow_025_nofast(ptr nocapture %y, ptr nocapture readonly %x) {218; CHECK-LABEL: @vspow_025_nofast219; CHECK-PWR10: __powf4_P10220; CHECK-PWR9: __powf4_P9221; CHECK-PWR8: __powf4_P8222; CHECK-PWR7: __powf4_P7223; CHECK-NOT: xvrsqrtesp224; CHECK: blr225entry:226 br label %vector.body227 228vector.body:229 %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ]230 %next.gep = getelementptr float, ptr %y, i64 %index231 %next.gep19 = getelementptr float, ptr %x, i64 %index232 %wide.load = load <4 x float>, ptr %next.gep19, align 4233 %0 = call <4 x float> @__powf4(<4 x float> %wide.load, <4 x float> <float 2.500000e-01, float 2.500000e-01, float 2.500000e-01, float 2.500000e-01>)234 store <4 x float> %0, ptr %next.gep, align 4235 %index.next = add i64 %index, 4236 %1 = icmp eq i64 %index.next, 1024237 br i1 %1, label %for.end, label %vector.body238 239for.end:240 ret void241}242 243; Function Attrs: nounwind readnone speculatable willreturn244declare <4 x float> @__powf4(<4 x float>, <4 x float>)245