[llvm] [TargetLowering] Lower ldexp into target supported instructions (PR #67552)

David Green via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 7 08:22:33 PDT 2023


================
@@ -26360,3 +26367,39 @@ bool AArch64TargetLowering::preferScalarizeSplat(SDNode *N) const {
   }
   return true;
 }
+
+SDValue AArch64TargetLowering::LowerFLDEXP(SDValue Op,
+                                           SelectionDAG &DAG) const {
+  SDValue X = Op.getOperand(0);
+  EVT XScalarTy = X.getValueType();
+  SDValue Exp = Op.getOperand(1);
+
+  SDLoc DL(Op);
+  EVT XVT, ExpVT;
+  switch (Op.getValueSizeInBits()) {
+  default:
+    return SDValue();
+  case 32:
+    XVT = MVT::nxv4f32;
+    ExpVT = MVT::nxv4i32;
+    break;
+  case 64:
----------------
davemgreen wrote:

If might be worth adding a fp16 version for it too, as there should be an instruction available.

https://github.com/llvm/llvm-project/pull/67552


More information about the llvm-commits mailing list