[LoongArch] Fix codegen for [su]itofp instructions
This patch fixes codegen for `[su]itofp` instructions. In LoongArch, a legal int-to-float conversion is done in two steps: 1. Move the data from `GPR` to `FPR`. (FRLen >= GRLen) 2. Conversion in `FPR`. (the data in `FPR` is treated as a signed value) Based on the above features, when the type's BitWidth meets the requirements, all `SINT_TO_FP` are legal, all `UINT_TO_FP` are expand and lowered to libcall when appropriate. The only special case is, LoongArch64 with `+f,-d` features. At this point, custom processing is required for `[SU]INT_TO_FP`. Of course, we can also ignore it and use libcall directly. Differential Revision: https://reviews.llvm.org/D136916
Loading
Please sign in to comment