1 ; RUN: llc < %s -mtriple=ve-unknown-unknown | FileCheck %s
3 define float @func1(float %a, float %b) {
6 ; CHECK-NEXT: fmul.s %s0, %s0, %s1
7 ; CHECK-NEXT: b.l.t (, %s10)
12 define double @func2(double %a, double %b) {
15 ; CHECK-NEXT: fmul.d %s0, %s0, %s1
16 ; CHECK-NEXT: b.l.t (, %s10)
17 %r = fmul double %a, %b
21 define fp128 @func3(fp128 %a, fp128 %b) {
24 ; CHECK-NEXT: fmul.q %s0, %s0, %s2
25 ; CHECK-NEXT: b.l.t (, %s10)
26 %r = fmul fp128 %a, %b
30 define float @func4(float %a) {
33 ; CHECK-NEXT: lea.sl %s1, 1084227584
34 ; CHECK-NEXT: fmul.s %s0, %s0, %s1
35 ; CHECK-NEXT: b.l.t (, %s10)
36 %r = fmul float %a, 5.000000e+00
40 define double @func5(double %a) {
43 ; CHECK-NEXT: lea.sl %s1, 1075052544
44 ; CHECK-NEXT: fmul.d %s0, %s0, %s1
45 ; CHECK-NEXT: b.l.t (, %s10)
46 %r = fmul double %a, 5.000000e+00
50 define fp128 @func6(fp128 %a) {
53 ; CHECK-NEXT: lea %s2, .LCPI{{[0-9]+}}_0@lo
54 ; CHECK-NEXT: and %s2, %s2, (32)0
55 ; CHECK-NEXT: lea.sl %s2, .LCPI{{[0-9]+}}_0@hi(, %s2)
56 ; CHECK-NEXT: ld %s4, 8(, %s2)
57 ; CHECK-NEXT: ld %s5, (, %s2)
58 ; CHECK-NEXT: fmul.q %s0, %s0, %s4
59 ; CHECK-NEXT: b.l.t (, %s10)
60 %r = fmul fp128 %a, 0xL00000000000000004001400000000000
64 define float @func7(float %a) {
67 ; CHECK-NEXT: lea.sl %s1, 2139095039
68 ; CHECK-NEXT: fmul.s %s0, %s0, %s1
69 ; CHECK-NEXT: b.l.t (, %s10)
70 %r = fmul float %a, 0x47EFFFFFE0000000
74 define double @func8(double %a) {
77 ; CHECK-NEXT: lea %s1, -1
78 ; CHECK-NEXT: and %s1, %s1, (32)0
79 ; CHECK-NEXT: lea.sl %s1, 2146435071(, %s1)
80 ; CHECK-NEXT: fmul.d %s0, %s0, %s1
81 ; CHECK-NEXT: b.l.t (, %s10)
82 %r = fmul double %a, 0x7FEFFFFFFFFFFFFF
86 define fp128 @func9(fp128 %a) {
89 ; CHECK-NEXT: lea %s2, .LCPI{{[0-9]+}}_0@lo
90 ; CHECK-NEXT: and %s2, %s2, (32)0
91 ; CHECK-NEXT: lea.sl %s2, .LCPI{{[0-9]+}}_0@hi(, %s2)
92 ; CHECK-NEXT: ld %s4, 8(, %s2)
93 ; CHECK-NEXT: ld %s5, (, %s2)
94 ; CHECK-NEXT: fmul.q %s0, %s0, %s4
95 ; CHECK-NEXT: b.l.t (, %s10)
96 %r = fmul fp128 %a, 0xLFFFFFFFFFFFFFFFF7FFEFFFFFFFFFFFF
100 define float @fmuls_ir(float %a) {
101 ; CHECK-LABEL: fmuls_ir:
103 ; CHECK-NEXT: fmul.s %s0, %s0, (0)1
104 ; CHECK-NEXT: b.l.t (, %s10)
105 %r = fmul float 0.e+00, %a
109 define float @fmuls_ri(float %a) {
110 ; CHECK-LABEL: fmuls_ri:
112 ; CHECK-NEXT: fmul.s %s0, %s0, (2)1
113 ; CHECK-NEXT: b.l.t (, %s10)
114 %r = fmul float %a, -2.
118 define float @fmuls_ri2(float %a) {
119 ; CHECK-LABEL: fmuls_ri2:
121 ; CHECK-NEXT: fmul.s %s0, %s0, (3)1
122 ; CHECK-NEXT: b.l.t (, %s10)
123 %r = fmul float %a, -36893488147419103232.
127 define float @fmuls_ri3(float %a) {
128 ; CHECK-LABEL: fmuls_ri3:
130 ; CHECK-NEXT: fmul.s %s0, %s0, (9)0
131 ; CHECK-NEXT: b.l.t (, %s10)
132 %r = fmul float %a, 1.175494210692441075487029444849287348827052428745893333857174530571588870475618904265502351336181163787841796875E-38