[llvm] [AArch64][GlobalISel] Add better basic legalization for llround. (PR #168427)

David Green via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 12:54:51 PST 2025


================
@@ -449,10 +449,12 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST)
       .minScalar(0, s32)
       .libcallFor({{s32, s32}, {s64, s32}, {s128, s32}});
 
-  // TODO: Libcall support for s128.
-  // TODO: s16 should be legal with full FP16 support.
   getActionDefinitionsBuilder({G_LROUND, G_LLROUND})
-      .legalFor({{s64, s32}, {s64, s64}});
+      .legalFor({{s64, s32}, {s64, s64}})
+      .legalFor(HasFP16, {{s64, s16}})
----------------
davemgreen wrote:

Are you meaning the windows variants? The l and ll in lround/llround stand for long and long-long AFAIU. (You could argue that info shouldn't be present in IR intrinsics). So on linux where long is 64bit you would only expect a i64, on windows i32 would be used for lround. We haven't tried to support windows for them yet, there is a separate test case. If we can generate instructions for them then hopefully we can just always support them, irrespective of whether it is windows or not, providing we do not need to generate a libcall.

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


More information about the llvm-commits mailing list