fp_sub.ll
1.96 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
; 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: fsub.s %s0, %s0, %s1
; CHECK-NEXT: or %s11, 0, %s9
%r = fsub float %a, %b
ret float %r
}
define double @func2(double %a, double %b) {
; CHECK-LABEL: func2:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: fsub.d %s0, %s0, %s1
; CHECK-NEXT: or %s11, 0, %s9
%r = fsub double %a, %b
ret double %r
}
define float @func4(float %a) {
; CHECK-LABEL: func4:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: lea.sl %s1, -1063256064
; CHECK-NEXT: fadd.s %s0, %s0, %s1
; CHECK-NEXT: or %s11, 0, %s9
%r = fadd 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, -1072431104
; CHECK-NEXT: fadd.d %s0, %s0, %s1
; CHECK-NEXT: or %s11, 0, %s9
%r = fadd double %a, -5.000000e+00
ret double %r
}
define float @func7(float %a) {
; CHECK-LABEL: func7:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: lea.sl %s1, -8388609
; CHECK-NEXT: fadd.s %s0, %s0, %s1
; CHECK-NEXT: or %s11, 0, %s9
%r = fadd float %a, 0xC7EFFFFFE0000000
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, -1048577(, %s1)
; CHECK-NEXT: fadd.d %s0, %s0, %s1
; CHECK-NEXT: or %s11, 0, %s9
%r = fadd double %a, 0xFFEFFFFFFFFFFFFF
ret double %r
}
define float @fsubs_ir(float %a) {
; CHECK-LABEL: fsubs_ir:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: fsub.s %s0, 0, %s0
; CHECK-NEXT: or %s11, 0, %s9
%r = fsub float 0.e+00, %a
ret float %r
}
define float @fsubs_ri(float %a) {
; CHECK-LABEL: fsubs_ri:
; CHECK: .LBB{{[0-9]+}}_2:
; CHECK-NEXT: fadd.s %s0, %s0, (2)1
; CHECK-NEXT: or %s11, 0, %s9
%r = fsub float %a, 2.0e+00
ret float %r
}