[llvm] [LoongArch] Fix fp_to_uint/fp_to_sint conversion errors for lasx (PR #137129)

via llvm-commits llvm-commits at lists.llvm.org
Mon May 5 23:54:18 PDT 2025


================
@@ -31,9 +31,9 @@ define void @fptosi_v4f64_v4i32(ptr %res, ptr %in){
 ; CHECK-LABEL: fptosi_v4f64_v4i32:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    xvld $xr0, $a1, 0
+; CHECK-NEXT:    xvftintrz.l.d $xr0, $xr0
 ; CHECK-NEXT:    xvpermi.d $xr1, $xr0, 238
-; CHECK-NEXT:    xvfcvt.s.d $xr0, $xr1, $xr0
-; CHECK-NEXT:    xvftintrz.w.s $xr0, $xr0
+; CHECK-NEXT:    xvpickev.w $xr0, $xr1, $xr0
 ; CHECK-NEXT:    vst $vr0, $a0, 0
----------------
heiher wrote:

Ref: https://reviews.llvm.org/D128900#3630052 LGTM.

Just a note: On the LoongArch target, `-ftrapping-math` and `-fno-trapping-math` currently produce identical LLVM IR. This implies that floating-point exception behavior is not yet supported, which is a separate issue worth addressing.

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


More information about the llvm-commits mailing list