1 ; RUN: llc < %s -mtriple=ve-unknown-unknown | FileCheck %s
3 define float @func1(float %a, float %b) {
6 ; CHECK-NEXT: fdiv.s %s0, %s0, %s1
7 ; CHECK-NEXT: b.l.t (, %s10)
12 define double @func2(double %a, double %b) {
15 ; CHECK-NEXT: fdiv.d %s0, %s0, %s1
16 ; CHECK-NEXT: b.l.t (, %s10)
17 %r = fdiv double %a, %b
21 define fp128 @func3(fp128 %a, fp128 %b) {
23 ; CHECK: .LBB{{[0-9]+}}_2:
24 ; CHECK-NEXT: lea %s4, __divtf3@lo
25 ; CHECK-NEXT: and %s4, %s4, (32)0
26 ; CHECK-NEXT: lea.sl %s12, __divtf3@hi(, %s4)
27 ; CHECK-NEXT: bsic %s10, (, %s12)
28 ; CHECK-NEXT: or %s11, 0, %s9
29 %r = fdiv fp128 %a, %b
33 define float @func4(float %a) {
36 ; CHECK-NEXT: lea.sl %s1, 1084227584
37 ; CHECK-NEXT: fdiv.s %s0, %s0, %s1
38 ; CHECK-NEXT: b.l.t (, %s10)
39 %r = fdiv float %a, 5.000000e+00
43 define double @func5(double %a) {
46 ; CHECK-NEXT: lea.sl %s1, 1075052544
47 ; CHECK-NEXT: fdiv.d %s0, %s0, %s1
48 ; CHECK-NEXT: b.l.t (, %s10)
49 %r = fdiv double %a, 5.000000e+00
53 define fp128 @func6(fp128 %a) {
55 ; CHECK: .LBB{{[0-9]+}}_2:
56 ; CHECK-NEXT: lea %s2, .LCPI{{[0-9]+}}_0@lo
57 ; CHECK-NEXT: and %s2, %s2, (32)0
58 ; CHECK-NEXT: lea.sl %s4, .LCPI{{[0-9]+}}_0@hi(, %s2)
59 ; CHECK-NEXT: ld %s2, 8(, %s4)
60 ; CHECK-NEXT: ld %s3, (, %s4)
61 ; CHECK-NEXT: lea %s4, __divtf3@lo
62 ; CHECK-NEXT: and %s4, %s4, (32)0
63 ; CHECK-NEXT: lea.sl %s12, __divtf3@hi(, %s4)
64 ; CHECK-NEXT: bsic %s10, (, %s12)
65 ; CHECK-NEXT: or %s11, 0, %s9
66 %r = fdiv fp128 %a, 0xL00000000000000004001400000000000
70 define float @func7(float %a) {
73 ; CHECK-NEXT: lea.sl %s1, 2139095039
74 ; CHECK-NEXT: fdiv.s %s0, %s0, %s1
75 ; CHECK-NEXT: b.l.t (, %s10)
76 %r = fdiv float %a, 0x47EFFFFFE0000000
80 define double @func8(double %a) {
83 ; CHECK-NEXT: lea %s1, -1
84 ; CHECK-NEXT: and %s1, %s1, (32)0
85 ; CHECK-NEXT: lea.sl %s1, 2146435071(, %s1)
86 ; CHECK-NEXT: fdiv.d %s0, %s0, %s1
87 ; CHECK-NEXT: b.l.t (, %s10)
88 %r = fdiv double %a, 0x7FEFFFFFFFFFFFFF
92 ; Function Attrs: norecurse nounwind readnone
93 define fp128 @func9(fp128 %a) {
95 ; CHECK: .LBB{{[0-9]+}}_2:
96 ; CHECK-NEXT: lea %s2, .LCPI{{[0-9]+}}_0@lo
97 ; CHECK-NEXT: and %s2, %s2, (32)0
98 ; CHECK-NEXT: lea.sl %s4, .LCPI{{[0-9]+}}_0@hi(, %s2)
99 ; CHECK-NEXT: ld %s2, 8(, %s4)
100 ; CHECK-NEXT: ld %s3, (, %s4)
101 ; CHECK-NEXT: lea %s4, __divtf3@lo
102 ; CHECK-NEXT: and %s4, %s4, (32)0
103 ; CHECK-NEXT: lea.sl %s12, __divtf3@hi(, %s4)
104 ; CHECK-NEXT: bsic %s10, (, %s12)
105 ; CHECK-NEXT: or %s11, 0, %s9
106 %r = fdiv fp128 %a, 0xLFFFFFFFFFFFFFFFF7FFEFFFFFFFFFFFF