• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc %s -O0 -march=sparc -mcpu=leon3 -mattr=+fixallfdivsqrt -o - | FileCheck %s
2; RUN: llc %s -O0 -march=sparc -mcpu=ut699 -o - | FileCheck %s
3
4; CHECK-LABEL: test_1
5; CHECK:  nop
6; CHECK:  nop
7; CHECK:  fdivd
8; CHECK-NEXT:  nop
9; CHECK-NEXT:  nop
10; CHECK-NEXT:  nop
11; CHECK-NEXT:  nop
12; CHECK-NEXT:  nop
13; CHECK-NEXT:  nop
14; CHECK-NEXT:  nop
15; CHECK-NEXT:  nop
16; CHECK-NEXT:  nop
17; CHECK-NEXT:  nop
18; CHECK-NEXT:  nop
19; CHECK-NEXT:  nop
20; CHECK-NEXT:  nop
21; CHECK-NEXT:  nop
22define double @test_1(double* byval %a, double* byval %b) {
23entry:
24    %0 = load double, double* %a, align 8
25    %1 = load double, double* %b, align 8
26    %res = fdiv double %0, %1
27    ret double %res
28}
29
30declare double @llvm.sqrt.f64(double) nounwind readonly
31
32; CHECK-LABEL: test_2
33; CHECK:  nop
34; CHECK:  nop
35; CHECK:  nop
36; CHECK:  nop
37; CHECK:  nop
38; CHECK:  fsqrtd
39; CHECK-NEXT:  nop
40; CHECK-NEXT:  nop
41; CHECK-NEXT:  nop
42; CHECK-NEXT:  nop
43; CHECK-NEXT:  nop
44; CHECK-NEXT:  nop
45; CHECK-NEXT:  nop
46; CHECK-NEXT:  nop
47; CHECK-NEXT:  nop
48; CHECK-NEXT:  nop
49; CHECK-NEXT:  nop
50; CHECK-NEXT:  nop
51; CHECK-NEXT:  nop
52; CHECK-NEXT:  nop
53define double @test_2(double* byval %a) {
54entry:
55    %0 = load double, double* %a, align 8
56    %1 = call double @llvm.sqrt.f64(double %0) nounwind
57    ret double %1
58}
59
60