[llvm] [AArch64][GlobalISel] Improve lowering of vector fp16 fptrunc (PR #163398)

Ryan Cowan via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 29 04:02:35 PDT 2025


================
@@ -817,10 +818,24 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST)
       .legalFor(
           {{s16, s32}, {s16, s64}, {s32, s64}, {v4s16, v4s32}, {v2s32, v2s64}})
       .libcallFor({{s16, s128}, {s32, s128}, {s64, s128}})
-      .clampNumElements(0, v4s16, v4s16)
-      .clampNumElements(0, v2s32, v2s32)
+      .moreElementsToNextPow2(1)
+      .customIf([](const LegalityQuery &Q) {
----------------
HolyMolyCowMan wrote:

We can but I feel like we are mixing two mostly separate lowering functions into one. The currently existing one does a `round-to-nearest-even` and seems to be rather specific whereas the new one is more general & for `round-to-odd`.

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


More information about the llvm-commits mailing list