• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple=armv7 < %s | FileCheck %s --check-prefix=CHECK-ARM --check-prefix=CHECK
2; RUN: llc -mtriple=thumbv7 < %s | FileCheck %s --check-prefix=CHECK-THUMB --check-prefix=CHECK
3
4target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
5target triple = "armv7--"
6
7define double @f(double %a) {
8  ; CHECK-LABEL: f:
9  ; CHECK: bfc r1, #31, #1
10  ; CHECK-NEXT: bx lr
11  %x = call double @llvm.fabs.f64(double %a) readnone
12  ret double %x
13}
14
15define float @g(float %a) {
16  ; CHECK-LABEL: g:
17  ; CHECK: bic r0, r0, #-2147483648
18  ; CHECK-NEXT: bx lr
19  %x = call float @llvm.fabs.f32(float %a) readnone
20  ret float %x
21}
22
23define double @h(double %a) {
24  ; CHECK-LABEL: h:
25  ; CHECK: eor r1, r1, #-2147483648
26  ; CHECK-NEXT: bx lr
27  %x = fsub nsz double -0.0, %a
28  ret double %x
29}
30
31define float @i(float %a) {
32  ; CHECK-LABEL: i:
33  ; CHECK: eor r0, r0, #-2147483648
34  ; CHECK-NEXT: bx lr
35  %x = fsub nsz float -0.0, %a
36  ret float %x
37}
38
39declare double @llvm.fabs.f64(double) readnone
40declare float @llvm.fabs.f32(float) readnone
41