1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv64 -mattr=+d -verify-machineinstrs < %s | FileCheck %s
5 define void @single_fdiv(double %a0, double %a1, ptr %res) {
6 ; CHECK-LABEL: single_fdiv:
7 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: fdiv.d fa5, fa1, fa0
9 ; CHECK-NEXT: fsd fa5, 0(a0)
12 %div = fdiv arcp double %a1, %a0
13 store double %div, ptr %res
17 define void @two_fdivs(double %a0, double %a1, double %a2, ptr %res) {
18 ; CHECK-LABEL: two_fdivs:
19 ; CHECK: # %bb.0: # %entry
20 ; CHECK-NEXT: lui a1, %hi(.LCPI1_0)
21 ; CHECK-NEXT: fld fa5, %lo(.LCPI1_0)(a1)
22 ; CHECK-NEXT: fdiv.d fa5, fa5, fa0
23 ; CHECK-NEXT: fmul.d fa4, fa1, fa5
24 ; CHECK-NEXT: fmul.d fa5, fa2, fa5
25 ; CHECK-NEXT: fsd fa4, 0(a0)
26 ; CHECK-NEXT: fsd fa5, 8(a0)
29 %div = fdiv arcp double %a1, %a0
30 %div1 = fdiv arcp double %a2, %a0
31 store double %div, ptr %res
32 %arrayidx2 = getelementptr inbounds double, ptr %res, i64 1
33 store double %div1, ptr %arrayidx2
38 define void @no_arcp(double %a0, double %a1, double %a2, ptr %res) {
39 ; CHECK-LABEL: no_arcp:
40 ; CHECK: # %bb.0: # %entry
41 ; CHECK-NEXT: fdiv.d fa5, fa1, fa0
42 ; CHECK-NEXT: fdiv.d fa4, fa2, fa0
43 ; CHECK-NEXT: fsd fa5, 0(a0)
44 ; CHECK-NEXT: fsd fa4, 8(a0)
47 %div = fdiv arcp double %a1, %a0
48 %div1 = fdiv double %a2, %a0
49 store double %div, ptr %res
50 %arrayidx2 = getelementptr inbounds double, ptr %res, i64 1
51 store double %div1, ptr %arrayidx2