[PATCH] Add missing builtins to the PPC back end for ABI compliance (vol. 2)

Nemanja Ivanovic nemanja.i.ibm at gmail.com
Wed Jul 1 14:06:57 PDT 2015


REPOSITORY
  rL LLVM

================
Comment at: test/CodeGen/PowerPC/vsx-elementary-arith.ll:121-136
@@ +120,18 @@
+; Function Attrs: nounwind
+define void @emit_xvrsqrte() #0 {
+entry:
+; CHECK-LABEL: @emit_xvrsqrte
+  %vf = alloca <4 x float>, align 16
+  %vfr = alloca <4 x float>, align 16
+  %vd = alloca <2 x double>, align 16
+  %vdr = alloca <2 x double>, align 16
+  %0 = load <4 x float>, <4 x float>* %vf, align 16
+  %1 = call <4 x float> @llvm.ppc.vsx.xvrsqrtesp(<4 x float> %0)
+; CHECK: xvrsqrtesp {{[0-9]+}}, {{[0-9]+}}
+  store <4 x float> %1, <4 x float>* %vfr, align 16
+  %2 = load <2 x double>, <2 x double>* %vd, align 16
+  %3 = call <2 x double> @llvm.ppc.vsx.xvrsqrtedp(<2 x double> %2)
+; CHECK: xvrsqrtedp {{[0-9]+}}, {{[0-9]+}}
+  store <2 x double> %3, <2 x double>* %vdr, align 16
+  ret void
+}
----------------
echristo wrote:
> Hrm. I'd suggest running this through the optimizer but since it's just using locals that don't have external visibility it might not work. Though if the instruction selector ever does any DCE on allocas then there's going to be a problem here. Might want to have it take arguments and return something?
OK, I'll split this up into two functions that return the result of the call to the builtin. Please let me know if you agree with that approach.

http://reviews.llvm.org/D10874

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list