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: vldi $vr1, -1168
22 ; LP64D-NEXT: fadd.s $fa0, $fa0, $fa1
24 %1 = fadd float %a, 1.0
28 define double @g(double %a) {
31 ; ILP32D-NEXT: addi.w $a0, $zero, 1
32 ; ILP32D-NEXT: movgr2fr.w $fa1, $a0
33 ; ILP32D-NEXT: ffint.s.w $fa1, $fa1
34 ; ILP32D-NEXT: fcvt.d.s $fa1, $fa1
35 ; ILP32D-NEXT: fadd.d $fa0, $fa0, $fa1
40 ; LP64D-NEXT: vldi $vr1, -912
41 ; LP64D-NEXT: fadd.d $fa0, $fa0, $fa1
43 %1 = fadd double %a, 1.0