fp_mul.ll
3.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
; RUN: llc < %s -mtriple=ve-unknown-unknown | FileCheck %s
define float @func1(float %a, float %b) {
; CHECK-LABEL: func1:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: fmul.s %s0, %s0, %s1
; CHECK-NEXT: or %s11, 0, %s9
%r = fmul float %a, %b
ret float %r
}
define double @func2(double %a, double %b) {
; CHECK-LABEL: func2:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: fmul.d %s0, %s0, %s1
; CHECK-NEXT: or %s11, 0, %s9
%r = fmul double %a, %b
ret double %r
}
define fp128 @func3(fp128 %a, fp128 %b) {
; CHECK-LABEL: func3:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: fmul.q %s0, %s0, %s2
; CHECK-NEXT: or %s11, 0, %s9
%r = fmul fp128 %a, %b
ret fp128 %r
}
define float @func4(float %a) {
; CHECK-LABEL: func4:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: lea.sl %s1, 1084227584
; CHECK-NEXT: fmul.s %s0, %s0, %s1
; CHECK-NEXT: or %s11, 0, %s9
%r = fmul float %a, 5.000000e+00
ret float %r
}
define double @func5(double %a) {
; CHECK-LABEL: func5:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: lea.sl %s1, 1075052544
; CHECK-NEXT: fmul.d %s0, %s0, %s1
; CHECK-NEXT: or %s11, 0, %s9
%r = fmul double %a, 5.000000e+00
ret double %r
}
define fp128 @func6(fp128 %a) {
; CHECK-LABEL: func6:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: lea %s2, .LCPI{{[0-9]+}}_0@lo
; CHECK-NEXT: and %s2, %s2, (32)0
; CHECK-NEXT: lea.sl %s2, .LCPI{{[0-9]+}}_0@hi(, %s2)
; CHECK-NEXT: ld %s4, 8(, %s2)
; CHECK-NEXT: ld %s5, (, %s2)
; CHECK-NEXT: fmul.q %s0, %s0, %s4
; CHECK-NEXT: or %s11, 0, %s9
%r = fmul fp128 %a, 0xL00000000000000004001400000000000
ret fp128 %r
}
define float @func7(float %a) {
; CHECK-LABEL: func7:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: lea.sl %s1, 2139095039
; CHECK-NEXT: fmul.s %s0, %s0, %s1
; CHECK-NEXT: or %s11, 0, %s9
%r = fmul float %a, 0x47EFFFFFE0000000
ret float %r
}
define double @func8(double %a) {
; CHECK-LABEL: func8:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: lea %s1, -1
; CHECK-NEXT: and %s1, %s1, (32)0
; CHECK-NEXT: lea.sl %s1, 2146435071(, %s1)
; CHECK-NEXT: fmul.d %s0, %s0, %s1
; CHECK-NEXT: or %s11, 0, %s9
%r = fmul double %a, 0x7FEFFFFFFFFFFFFF
ret double %r
}
define fp128 @func9(fp128 %a) {
; CHECK-LABEL: func9:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: lea %s2, .LCPI{{[0-9]+}}_0@lo
; CHECK-NEXT: and %s2, %s2, (32)0
; CHECK-NEXT: lea.sl %s2, .LCPI{{[0-9]+}}_0@hi(, %s2)
; CHECK-NEXT: ld %s4, 8(, %s2)
; CHECK-NEXT: ld %s5, (, %s2)
; CHECK-NEXT: fmul.q %s0, %s0, %s4
; CHECK-NEXT: or %s11, 0, %s9
%r = fmul fp128 %a, 0xLFFFFFFFFFFFFFFFF7FFEFFFFFFFFFFFF
ret fp128 %r
}
define float @fmuls_ir(float %a) {
; CHECK-LABEL: fmuls_ir:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: fmul.s %s0, %s0, (0)1
; CHECK-NEXT: or %s11, 0, %s9
%r = fmul float 0.e+00, %a
ret float %r
}
define float @fmuls_ri(float %a) {
; CHECK-LABEL: fmuls_ri:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: fmul.s %s0, %s0, (2)1
; CHECK-NEXT: or %s11, 0, %s9
%r = fmul float %a, -2.
ret float %r
}
define float @fmuls_ri2(float %a) {
; CHECK-LABEL: fmuls_ri2:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: fmul.s %s0, %s0, (3)1
; CHECK-NEXT: or %s11, 0, %s9
%r = fmul float %a, -36893488147419103232.
ret float %r
}
define float @fmuls_ri3(float %a) {
; CHECK-LABEL: fmuls_ri3:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: fmul.s %s0, %s0, (9)0
; CHECK-NEXT: or %s11, 0, %s9
%r = fmul float %a, 1.175494210692441075487029444849287348827052428745893333857174530571588870475618904265502351336181163787841796875E-38
ret float %r
}