1; RUN: llc < %s -mtriple=ve-unknown-unknown | FileCheck %s 2 3define float @func1(float %a, float %b) { 4; CHECK-LABEL: func1: 5; CHECK: # %bb.0: 6; CHECK-NEXT: fdiv.s %s0, %s0, %s1 7; CHECK-NEXT: b.l.t (, %s10) 8 %r = fdiv float %a, %b 9 ret float %r 10} 11 12define double @func2(double %a, double %b) { 13; CHECK-LABEL: func2: 14; CHECK: # %bb.0: 15; CHECK-NEXT: fdiv.d %s0, %s0, %s1 16; CHECK-NEXT: b.l.t (, %s10) 17 %r = fdiv double %a, %b 18 ret double %r 19} 20 21define fp128 @func3(fp128 %a, fp128 %b) { 22; CHECK-LABEL: func3: 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 30 ret fp128 %r 31} 32 33define float @func4(float %a) { 34; CHECK-LABEL: func4: 35; CHECK: # %bb.0: 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 40 ret float %r 41} 42 43define double @func5(double %a) { 44; CHECK-LABEL: func5: 45; CHECK: # %bb.0: 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 50 ret double %r 51} 52 53define fp128 @func6(fp128 %a) { 54; CHECK-LABEL: func6: 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 67 ret fp128 %r 68} 69 70define float @func7(float %a) { 71; CHECK-LABEL: func7: 72; CHECK: # %bb.0: 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 77 ret float %r 78} 79 80define double @func8(double %a) { 81; CHECK-LABEL: func8: 82; CHECK: # %bb.0: 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 89 ret double %r 90} 91 92; Function Attrs: norecurse nounwind readnone 93define fp128 @func9(fp128 %a) { 94; CHECK-LABEL: func9: 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 107 ret fp128 %r 108} 109