[llvm] [AArch64][SVE] Avoid transfer to GPRs for fp -> int -> fp conversions (PR #112564)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 18 09:24:15 PDT 2024


================
@@ -2421,6 +2421,42 @@ let Predicates = [HasSVEorSME] in {
   defm FSQRT_ZPmZ  : sve_fp_2op_p_zd_HSD<0b01101, "fsqrt",  AArch64fsqrt_mt>;
 } // End HasSVEorSME
 
+// Helper for creating scalar fp -> int -> fp conversions using SVE.
----------------
MacDue wrote:

So, I can reuse `LowerFixedLengthFPToIntToSVE()` and `LowerFixedLengthIntToFPToSVE()` by promoting the scalar conversions to legal fixed vector types in `LowerFP_TO_INT/INT_TO_FP()` + some inserts/extracts. The extracts/inserts do fold away, but you do get the side-effect that the predicate is for the full vector type (e.g. `ptrue p0.d, vl4`) for f32 (rather than `vl1`). I guess that should be fine though. 

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


More information about the llvm-commits mailing list