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

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 17 00:56:24 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.
----------------
sdesmalen-arm wrote:

When the streaming instructions are executed on a dedicated PE, then there is likely to be a significant cost for moving data between GPR and FPR/ZPR register files, keeping data in the same register file avoids that. Also, when a function is in streaming mode then there is the expectation that most operations will be SME or SVE instructions, so I'd expect this case (where the result is required in a GPR) to be rare. If this does happen then the cost of the extra `fmov` is probably not significant.

The specification for fcvtzs (scalar, integer) says:
> If FEAT_SME is implemented and the PE is in Streaming SVE mode, then any subsequent instruction which is dependent on the general-purpose register written by this instruction might be significantly delayed.



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


More information about the llvm-commits mailing list