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
7 declare float @llvm.fabs.f32(float)
8 declare double @llvm.fabs.f64(double)
10 define float @fabs_f32(float %a) nounwind {
11 ; LA32F-LABEL: fabs_f32:
13 ; LA32F-NEXT: fabs.s $fa0, $fa0
16 ; LA32D-LABEL: fabs_f32:
18 ; LA32D-NEXT: fabs.s $fa0, $fa0
21 ; LA64F-LABEL: fabs_f32:
23 ; LA64F-NEXT: fabs.s $fa0, $fa0
26 ; LA64D-LABEL: fabs_f32:
28 ; LA64D-NEXT: fabs.s $fa0, $fa0
30 %1 = call float @llvm.fabs.f32(float %a)
34 define double @fabs_f64(double %a) nounwind {
35 ; LA32F-LABEL: fabs_f64:
37 ; LA32F-NEXT: bstrpick.w $a1, $a1, 30, 0
40 ; LA32D-LABEL: fabs_f64:
42 ; LA32D-NEXT: fabs.d $fa0, $fa0
45 ; LA64F-LABEL: fabs_f64:
47 ; LA64F-NEXT: bstrpick.d $a0, $a0, 62, 0
50 ; LA64D-LABEL: fabs_f64:
52 ; LA64D-NEXT: fabs.d $fa0, $fa0
54 %1 = call double @llvm.fabs.f64(double %a)