1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc --mtriple=loongarch32 --mattr=+f,-d < %s | FileCheck %s --check-prefix=LA32F
3 ; RUN: llc --mtriple=loongarch32 --mattr=+d < %s | FileCheck %s --check-prefix=LA32D
4 ; RUN: llc --mtriple=loongarch64 --mattr=+f,-d < %s | FileCheck %s --check-prefix=LA64F
5 ; RUN: llc --mtriple=loongarch64 --mattr=+d < %s | FileCheck %s --check-prefix=LA64D
8 define float @f32_reciprocal(float %a) nounwind {
9 ; LA32F-LABEL: f32_reciprocal:
11 ; LA32F-NEXT: frecip.s $fa0, $fa0
14 ; LA32D-LABEL: f32_reciprocal:
16 ; LA32D-NEXT: frecip.s $fa0, $fa0
19 ; LA64F-LABEL: f32_reciprocal:
21 ; LA64F-NEXT: frecip.s $fa0, $fa0
24 ; LA64D-LABEL: f32_reciprocal:
26 ; LA64D-NEXT: frecip.s $fa0, $fa0
28 %1 = fdiv float 1.0, %a
32 define double @f64_reciprocal(double %a) nounwind {
33 ; LA32F-LABEL: f64_reciprocal:
35 ; LA32F-NEXT: addi.w $sp, $sp, -16
36 ; LA32F-NEXT: st.w $ra, $sp, 12 # 4-byte Folded Spill
37 ; LA32F-NEXT: move $a3, $a1
38 ; LA32F-NEXT: move $a2, $a0
39 ; LA32F-NEXT: lu12i.w $a1, 261888
40 ; LA32F-NEXT: move $a0, $zero
41 ; LA32F-NEXT: bl %plt(__divdf3)
42 ; LA32F-NEXT: ld.w $ra, $sp, 12 # 4-byte Folded Reload
43 ; LA32F-NEXT: addi.w $sp, $sp, 16
46 ; LA32D-LABEL: f64_reciprocal:
48 ; LA32D-NEXT: frecip.d $fa0, $fa0
51 ; LA64F-LABEL: f64_reciprocal:
53 ; LA64F-NEXT: addi.d $sp, $sp, -16
54 ; LA64F-NEXT: st.d $ra, $sp, 8 # 8-byte Folded Spill
55 ; LA64F-NEXT: move $a1, $a0
56 ; LA64F-NEXT: lu52i.d $a0, $zero, 1023
57 ; LA64F-NEXT: bl %plt(__divdf3)
58 ; LA64F-NEXT: ld.d $ra, $sp, 8 # 8-byte Folded Reload
59 ; LA64F-NEXT: addi.d $sp, $sp, 16
62 ; LA64D-LABEL: f64_reciprocal:
64 ; LA64D-NEXT: frecip.d $fa0, $fa0
66 %1 = fdiv double 1.0, %a