[RISCV] Improve support for vector fp_to_sint_sat/uint_sat.
The default fixed vector legalization is to unroll. The default scalable vector legalization is to clamp in the FP domain. The RVV vfcvt instructions have saturating behavior so we can use them directly. The only difference is that RVV instruction turn nan into the max value, but the _SAT intrinsics want 0. I'm only supporting 1 step of narrowing for now. I think we can support more steps by using VNCLIP to saturate and narrower. The only case that needs 2 steps of widening is f16->i64 which we can do as f16->f32->i64. Reviewed By: frasercrmck Differential Revision: https://reviews.llvm.org/D134400
Loading
Please sign in to comment