1 ; RUN: llc < %s -mtriple=ve-unknown-unknown | FileCheck %s
3 define float @func1(float %a, float %b) {
6 ; CHECK-NEXT: fsub.s %s0, %s0, %s1
7 ; CHECK-NEXT: b.l.t (, %s10)
12 define double @func2(double %a, double %b) {
15 ; CHECK-NEXT: fsub.d %s0, %s0, %s1
16 ; CHECK-NEXT: b.l.t (, %s10)
17 %r = fsub double %a, %b
21 define fp128 @func3(fp128 %a, fp128 %b) {
24 ; CHECK-NEXT: fsub.q %s0, %s0, %s2
25 ; CHECK-NEXT: b.l.t (, %s10)
26 %r = fsub fp128 %a, %b
30 define float @func4(float %a) {
33 ; CHECK-NEXT: lea.sl %s1, -1063256064
34 ; CHECK-NEXT: fadd.s %s0, %s0, %s1
35 ; CHECK-NEXT: b.l.t (, %s10)
36 %r = fadd float %a, -5.000000e+00
40 define double @func5(double %a) {
43 ; CHECK-NEXT: lea.sl %s1, -1072431104
44 ; CHECK-NEXT: fadd.d %s0, %s0, %s1
45 ; CHECK-NEXT: b.l.t (, %s10)
46 %r = fadd 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: fadd.q %s0, %s0, %s4
59 ; CHECK-NEXT: b.l.t (, %s10)
60 %r = fadd fp128 %a, 0xL0000000000000000C001400000000000
64 define float @func7(float %a) {
67 ; CHECK-NEXT: lea.sl %s1, -8388609
68 ; CHECK-NEXT: fadd.s %s0, %s0, %s1
69 ; CHECK-NEXT: b.l.t (, %s10)
70 %r = fadd float %a, 0xC7EFFFFFE0000000
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, -1048577(, %s1)
80 ; CHECK-NEXT: fadd.d %s0, %s0, %s1
81 ; CHECK-NEXT: b.l.t (, %s10)
82 %r = fadd double %a, 0xFFEFFFFFFFFFFFFF
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: fadd.q %s0, %s0, %s4
95 ; CHECK-NEXT: b.l.t (, %s10)
96 %r = fadd fp128 %a, 0xLFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFF
100 define float @fsubs_ir(float %a) {
101 ; CHECK-LABEL: fsubs_ir:
103 ; CHECK-NEXT: fsub.s %s0, 0, %s0
104 ; CHECK-NEXT: b.l.t (, %s10)
105 %r = fsub float 0.e+00, %a
109 define float @fsubs_ri(float %a) {
110 ; CHECK-LABEL: fsubs_ri:
112 ; CHECK-NEXT: fadd.s %s0, %s0, (2)1
113 ; CHECK-NEXT: b.l.t (, %s10)
114 %r = fsub float %a, 2.0e+00