[llvm] [AArch64] Lower to FRINT*Z instructions (PR #198477)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Wed May 20 10:01:16 PDT 2026


================
@@ -5969,6 +5969,21 @@ let Predicates = [HasFRInt3264] in {
   defm FRINT64X : FRIntNNTVector<1, 1, "frint64x", int_aarch64_neon_frint64x>;
 } // HasFRInt3264
 
+let Predicates = [HasFRInt3264] in {
+  def : Pat<(v2f32 (sint_to_fp (v2i32 (fp_to_sint v2f32:$Rn)))),
+                      (FRINT32Zv2f32 V64:$Rn)>;
+  def : Pat<(v4f32 (sint_to_fp (v4i32 (fp_to_sint v4f32:$Rn)))),
+                      (FRINT32Zv4f32 V128:$Rn)>;
+  def : Pat<(v2f32 (sint_to_fp (v2i64 (fp_to_sint v2f32:$Rn)))),
+                      (FRINT64Zv2f32 V64:$Rn)>;
+  def : Pat<(v4f32 (sint_to_fp (v4i64 (fp_to_sint v4f32:$Rn)))),
+                      (FRINT64Zv4f32 V128:$Rn)>;
+  def : Pat<(v2f64 (sint_to_fp (v2i32 (fp_to_sint v2f64:$Rn)))),
+                      (FRINT32Zv2f64 V128:$Rn)>;
+  def : Pat<(v2f64 (sint_to_fp (v2i64 (fp_to_sint v2f64:$Rn)))),
+                      (FRINT64Zv2f64 V128:$Rn)>;
+}
+
----------------
MacDue wrote:

Untested/unneeded? No tests fail when this is removed (your combines seem to go directly to the intrinsics). 

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


More information about the llvm-commits mailing list