• 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-THUMB: bic r0, r0, #-2147483648
18  ; CHECK-ARM: bfc r0, #31, #1
19  ; CHECK-NEXT: bx lr
20  %x = call float @llvm.fabs.f32(float %a) readnone
21  ret float %x
22}
23
24define double @h(double %a) {
25  ; CHECK-LABEL: h:
26  ; CHECK: eor r1, r1, #-2147483648
27  ; CHECK-NEXT: bx lr
28  %x = fsub nsz double -0.0, %a
29  ret double %x
30}
31
32define float @i(float %a) {
33  ; CHECK-LABEL: i:
34  ; CHECK: eor r0, r0, #-2147483648
35  ; CHECK-NEXT: bx lr
36  %x = fsub nsz float -0.0, %a
37  ret float %x
38}
39
40declare double @llvm.fabs.f64(double) readnone
41declare float @llvm.fabs.f32(float) readnone
42