[llvm] [AArch64] Lower mathlib call ldexp into fscale when sve is enabled (PR #67552)

David Green via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 20 07:22:18 PDT 2023


================
@@ -26414,3 +26422,46 @@ 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.getSimpleValueType().SimpleTy) {
+  default:
+    return SDValue();
+  case MVT::f16:
+    X = DAG.getNode(ISD::FP_EXTEND, DL, MVT::f32, X);
----------------
davemgreen wrote:

Is this intended to fallthrough? I think the idea of extending f16 to f32 sounds good.

Can you add a [[fallthrough]] attribute to make it explicit

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


More information about the llvm-commits mailing list