1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc --mtriple=loongarch64 --target-abi=lp64s --mattr=-f < %s | FileCheck %s
4 define signext i32 @convert_float_to_i32(i32 %tmp, float %a) nounwind {
5 ; CHECK-LABEL: convert_float_to_i32:
7 ; CHECK-NEXT: addi.d $sp, $sp, -16
8 ; CHECK-NEXT: st.d $ra, $sp, 8 # 8-byte Folded Spill
9 ; CHECK-NEXT: move $a0, $a1
10 ; CHECK-NEXT: bl %plt(__fixsfsi)
11 ; CHECK-NEXT: ld.d $ra, $sp, 8 # 8-byte Folded Reload
12 ; CHECK-NEXT: addi.d $sp, $sp, 16
14 %1 = fptosi float %a to i32
18 define signext i32 @convert_double_to_i32(i32 %tmp, double %a) nounwind {
19 ; CHECK-LABEL: convert_double_to_i32:
21 ; CHECK-NEXT: addi.d $sp, $sp, -16
22 ; CHECK-NEXT: st.d $ra, $sp, 8 # 8-byte Folded Spill
23 ; CHECK-NEXT: move $a0, $a1
24 ; CHECK-NEXT: bl %plt(__fixdfsi)
25 ; CHECK-NEXT: ld.d $ra, $sp, 8 # 8-byte Folded Reload
26 ; CHECK-NEXT: addi.d $sp, $sp, 16
28 %1 = fptosi double %a to i32
32 define signext i32 @convert_fp128_to_i32(i32 %tmp, fp128 %a) nounwind {
33 ; CHECK-LABEL: convert_fp128_to_i32:
35 ; CHECK-NEXT: addi.d $sp, $sp, -16
36 ; CHECK-NEXT: st.d $ra, $sp, 8 # 8-byte Folded Spill
37 ; CHECK-NEXT: move $a0, $a1
38 ; CHECK-NEXT: move $a1, $a2
39 ; CHECK-NEXT: bl %plt(__fixtfsi)
40 ; CHECK-NEXT: ld.d $ra, $sp, 8 # 8-byte Folded Reload
41 ; CHECK-NEXT: addi.d $sp, $sp, 16
43 %1 = fptosi fp128 %a to i32