1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
3 ;; Check that the correct ABI is chosen based on the triple given.
4 ;; TODO: enable the S and F ABIs once support is wired up.
5 ; RUN: llc --mtriple=loongarch32-linux-gnuf64 --mattr=+d < %s \
6 ; RUN: | FileCheck %s --check-prefix=ILP32D
7 ; RUN: llc --mtriple=loongarch64-linux-gnuf64 --mattr=+d < %s \
8 ; RUN: | FileCheck %s --check-prefix=LP64D
10 define float @f(float %a) {
13 ; ILP32D-NEXT: addi.w $a0, $zero, 1
14 ; ILP32D-NEXT: movgr2fr.w $fa1, $a0
15 ; ILP32D-NEXT: ffint.s.w $fa1, $fa1
16 ; ILP32D-NEXT: fadd.s $fa0, $fa0, $fa1
21 ; LP64D-NEXT: addi.w $a0, $zero, 1
22 ; LP64D-NEXT: movgr2fr.w $fa1, $a0
23 ; LP64D-NEXT: ffint.s.w $fa1, $fa1
24 ; LP64D-NEXT: fadd.s $fa0, $fa0, $fa1
26 %1 = fadd float %a, 1.0
30 define double @g(double %a) {
33 ; ILP32D-NEXT: addi.w $a0, $zero, 1
34 ; ILP32D-NEXT: movgr2fr.w $fa1, $a0
35 ; ILP32D-NEXT: ffint.s.w $fa1, $fa1
36 ; ILP32D-NEXT: fcvt.d.s $fa1, $fa1
37 ; ILP32D-NEXT: fadd.d $fa0, $fa0, $fa1
42 ; LP64D-NEXT: addi.d $a0, $zero, 1
43 ; LP64D-NEXT: movgr2fr.d $fa1, $a0
44 ; LP64D-NEXT: ffint.d.l $fa1, $fa1
45 ; LP64D-NEXT: fadd.d $fa0, $fa0, $fa1
47 %1 = fadd double %a, 1.0