1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
3 ; RUN: llc -verify-machineinstrs -csky-no-aliases < %s -mtriple=csky -float-abi=hard -mattr=+hard-float -mattr=+2e3 -mattr=+fpuv2_sf -mattr=+fpuv2_df | FileCheck %s --check-prefix=CHECK-DF
4 ; RUN: llc -verify-machineinstrs -csky-no-aliases < %s -mtriple=csky -float-abi=hard -mattr=+hard-float -mattr=+2e3 -mattr=+fpuv3_sf -mattr=+fpuv3_df | FileCheck %s --check-prefix=CHECK-DF2
6 define double @FADD_DOUBLE(double %x, double %y) {
7 ; CHECK-DF-LABEL: FADD_DOUBLE:
8 ; CHECK-DF: # %bb.0: # %entry
9 ; CHECK-DF-NEXT: faddd vr0, vr1, vr0
10 ; CHECK-DF-NEXT: rts16
12 ; CHECK-DF2-LABEL: FADD_DOUBLE:
13 ; CHECK-DF2: # %bb.0: # %entry
14 ; CHECK-DF2-NEXT: fadd.64 vr0, vr1, vr0
15 ; CHECK-DF2-NEXT: rts16
17 %fadd = fadd double %y, %x
21 define double @FADD_DOUBLE_I(double %x) {
22 ; CHECK-DF-LABEL: FADD_DOUBLE_I:
23 ; CHECK-DF: # %bb.0: # %entry
24 ; CHECK-DF-NEXT: grs32 a0, .LCPI1_0
25 ; CHECK-DF-NEXT: fldd vr1, (a0, 0)
26 ; CHECK-DF-NEXT: faddd vr0, vr0, vr1
27 ; CHECK-DF-NEXT: rts16
28 ; CHECK-DF-NEXT: .p2align 1
29 ; CHECK-DF-NEXT: # %bb.1:
30 ; CHECK-DF-NEXT: .p2align 2, 0x0
31 ; CHECK-DF-NEXT: .LCPI1_0:
32 ; CHECK-DF-NEXT: .quad 0xbff0000000000000 # double -1
34 ; CHECK-DF2-LABEL: FADD_DOUBLE_I:
35 ; CHECK-DF2: # %bb.0: # %entry
36 ; CHECK-DF2-NEXT: flrw.64 vr1, [.LCPI1_0]
37 ; CHECK-DF2-NEXT: fadd.64 vr0, vr0, vr1
38 ; CHECK-DF2-NEXT: rts16
39 ; CHECK-DF2-NEXT: .p2align 1
40 ; CHECK-DF2-NEXT: # %bb.1:
41 ; CHECK-DF2-NEXT: .p2align 2, 0x0
42 ; CHECK-DF2-NEXT: .LCPI1_0:
43 ; CHECK-DF2-NEXT: .quad 0xbff0000000000000 # double -1
45 %fadd = fadd double %x, -1.0
49 define double @FSUB_DOUBLE(double %x, double %y) {
50 ; CHECK-DF-LABEL: FSUB_DOUBLE:
51 ; CHECK-DF: # %bb.0: # %entry
52 ; CHECK-DF-NEXT: fsubd vr0, vr1, vr0
53 ; CHECK-DF-NEXT: rts16
55 ; CHECK-DF2-LABEL: FSUB_DOUBLE:
56 ; CHECK-DF2: # %bb.0: # %entry
57 ; CHECK-DF2-NEXT: fsub.64 vr0, vr1, vr0
58 ; CHECK-DF2-NEXT: rts16
61 %fsub = fsub double %y, %x
65 define double @FSUB_DOUBLE_I(double %x) {
67 ; CHECK-DF-LABEL: FSUB_DOUBLE_I:
68 ; CHECK-DF: # %bb.0: # %entry
69 ; CHECK-DF-NEXT: grs32 a0, .LCPI3_0
70 ; CHECK-DF-NEXT: fldd vr1, (a0, 0)
71 ; CHECK-DF-NEXT: faddd vr0, vr0, vr1
72 ; CHECK-DF-NEXT: rts16
73 ; CHECK-DF-NEXT: .p2align 1
74 ; CHECK-DF-NEXT: # %bb.1:
75 ; CHECK-DF-NEXT: .p2align 2, 0x0
76 ; CHECK-DF-NEXT: .LCPI3_0:
77 ; CHECK-DF-NEXT: .quad 0x3ff0000000000000 # double 1
79 ; CHECK-DF2-LABEL: FSUB_DOUBLE_I:
80 ; CHECK-DF2: # %bb.0: # %entry
81 ; CHECK-DF2-NEXT: flrw.64 vr1, [.LCPI3_0]
82 ; CHECK-DF2-NEXT: fadd.64 vr0, vr0, vr1
83 ; CHECK-DF2-NEXT: rts16
84 ; CHECK-DF2-NEXT: .p2align 1
85 ; CHECK-DF2-NEXT: # %bb.1:
86 ; CHECK-DF2-NEXT: .p2align 2, 0x0
87 ; CHECK-DF2-NEXT: .LCPI3_0:
88 ; CHECK-DF2-NEXT: .quad 0x3ff0000000000000 # double 1
91 %fsub = fsub double %x, -1.0
95 define double @FMUL_DOUBLE(double %x, double %y) {
97 ; CHECK-DF-LABEL: FMUL_DOUBLE:
98 ; CHECK-DF: # %bb.0: # %entry
99 ; CHECK-DF-NEXT: fmuld vr0, vr1, vr0
100 ; CHECK-DF-NEXT: rts16
102 ; CHECK-DF2-LABEL: FMUL_DOUBLE:
103 ; CHECK-DF2: # %bb.0: # %entry
104 ; CHECK-DF2-NEXT: fmul.64 vr0, vr1, vr0
105 ; CHECK-DF2-NEXT: rts16
107 %fmul = fmul double %y, %x
111 define double @FNMUL_DOUBLE_a(double %x, double %y) {
113 ; CHECK-DF-LABEL: FNMUL_DOUBLE_a:
114 ; CHECK-DF: # %bb.0: # %entry
115 ; CHECK-DF-NEXT: fnmuld vr0, vr1, vr0
116 ; CHECK-DF-NEXT: rts16
118 ; CHECK-DF2-LABEL: FNMUL_DOUBLE_a:
119 ; CHECK-DF2: # %bb.0: # %entry
120 ; CHECK-DF2-NEXT: fnmul.64 vr0, vr1, vr0
121 ; CHECK-DF2-NEXT: rts16
124 %fnmul = fmul double %z, %x
128 define double @FNMUL_DOUBLE_b(double %x, double %y) {
129 ; CHECK-DF-LABEL: FNMUL_DOUBLE_b:
130 ; CHECK-DF: # %bb.0: # %entry
131 ; CHECK-DF-NEXT: fnmuld vr0, vr0, vr1
132 ; CHECK-DF-NEXT: rts16
134 ; CHECK-DF2-LABEL: FNMUL_DOUBLE_b:
135 ; CHECK-DF2: # %bb.0: # %entry
136 ; CHECK-DF2-NEXT: fnmul.64 vr0, vr0, vr1
137 ; CHECK-DF2-NEXT: rts16
140 %fnmul = fmul double %y, %z
144 define double @FMUL_DOUBLE_I(double %x) {
146 ; CHECK-DF-LABEL: FMUL_DOUBLE_I:
147 ; CHECK-DF: # %bb.0: # %entry
148 ; CHECK-DF-NEXT: grs32 a0, .LCPI7_0
149 ; CHECK-DF-NEXT: fldd vr1, (a0, 0)
150 ; CHECK-DF-NEXT: fmuld vr0, vr0, vr1
151 ; CHECK-DF-NEXT: rts16
152 ; CHECK-DF-NEXT: .p2align 1
153 ; CHECK-DF-NEXT: # %bb.1:
154 ; CHECK-DF-NEXT: .p2align 2, 0x0
155 ; CHECK-DF-NEXT: .LCPI7_0:
156 ; CHECK-DF-NEXT: .quad 0xc01c000000000000 # double -7
158 ; CHECK-DF2-LABEL: FMUL_DOUBLE_I:
159 ; CHECK-DF2: # %bb.0: # %entry
160 ; CHECK-DF2-NEXT: flrw.64 vr1, [.LCPI7_0]
161 ; CHECK-DF2-NEXT: fmul.64 vr0, vr0, vr1
162 ; CHECK-DF2-NEXT: rts16
163 ; CHECK-DF2-NEXT: .p2align 1
164 ; CHECK-DF2-NEXT: # %bb.1:
165 ; CHECK-DF2-NEXT: .p2align 2, 0x0
166 ; CHECK-DF2-NEXT: .LCPI7_0:
167 ; CHECK-DF2-NEXT: .quad 0xc01c000000000000 # double -7
169 %fmul = fmul double %x, -7.0
173 define double @FDIV_DOUBLE(double %x, double %y) {
176 ; CHECK-DF-LABEL: FDIV_DOUBLE:
177 ; CHECK-DF: # %bb.0: # %entry
178 ; CHECK-DF-NEXT: fdivd vr0, vr1, vr0
179 ; CHECK-DF-NEXT: rts16
181 ; CHECK-DF2-LABEL: FDIV_DOUBLE:
182 ; CHECK-DF2: # %bb.0: # %entry
183 ; CHECK-DF2-NEXT: fdiv.64 vr0, vr1, vr0
184 ; CHECK-DF2-NEXT: rts16
187 %fdiv = fdiv double %y, %x
191 define double @FDIV_DOUBLE_I(double %x) {
193 ; CHECK-DF-LABEL: FDIV_DOUBLE_I:
194 ; CHECK-DF: # %bb.0: # %entry
195 ; CHECK-DF-NEXT: grs32 a0, .LCPI9_0
196 ; CHECK-DF-NEXT: fldd vr1, (a0, 0)
197 ; CHECK-DF-NEXT: fdivd vr0, vr0, vr1
198 ; CHECK-DF-NEXT: rts16
199 ; CHECK-DF-NEXT: .p2align 1
200 ; CHECK-DF-NEXT: # %bb.1:
201 ; CHECK-DF-NEXT: .p2align 2, 0x0
202 ; CHECK-DF-NEXT: .LCPI9_0:
203 ; CHECK-DF-NEXT: .quad 0xc01c000000000000 # double -7
205 ; CHECK-DF2-LABEL: FDIV_DOUBLE_I:
206 ; CHECK-DF2: # %bb.0: # %entry
207 ; CHECK-DF2-NEXT: flrw.64 vr1, [.LCPI9_0]
208 ; CHECK-DF2-NEXT: fdiv.64 vr0, vr0, vr1
209 ; CHECK-DF2-NEXT: rts16
210 ; CHECK-DF2-NEXT: .p2align 1
211 ; CHECK-DF2-NEXT: # %bb.1:
212 ; CHECK-DF2-NEXT: .p2align 2, 0x0
213 ; CHECK-DF2-NEXT: .LCPI9_0:
214 ; CHECK-DF2-NEXT: .quad 0xc01c000000000000 # double -7
216 %fdiv = fdiv double %x, -7.0
220 define double @FNEG_DOUBLE(double %x) {
222 ; CHECK-DF-LABEL: FNEG_DOUBLE:
223 ; CHECK-DF: # %bb.0: # %entry
224 ; CHECK-DF-NEXT: fnegd vr0, vr0
225 ; CHECK-DF-NEXT: rts16
227 ; CHECK-DF2-LABEL: FNEG_DOUBLE:
228 ; CHECK-DF2: # %bb.0: # %entry
229 ; CHECK-DF2-NEXT: fneg.64 vr0, vr0
230 ; CHECK-DF2-NEXT: rts16
232 %fneg = fneg double %x
237 define float @fptruncR_double_0(double %x) {
239 ; CHECK-DF-LABEL: fptruncR_double_0:
240 ; CHECK-DF: # %bb.0: # %entry
241 ; CHECK-DF-NEXT: fdtos vr0, vr0
242 ; CHECK-DF-NEXT: rts16
244 ; CHECK-DF2-LABEL: fptruncR_double_0:
245 ; CHECK-DF2: # %bb.0: # %entry
246 ; CHECK-DF2-NEXT: fdtos vr0, vr0
247 ; CHECK-DF2-NEXT: rts16
249 %fptrunc = fptrunc double %x to float
253 define double @fpextR_double_0(float %x) {
255 ; CHECK-DF-LABEL: fpextR_double_0:
256 ; CHECK-DF: # %bb.0: # %entry
257 ; CHECK-DF-NEXT: fstod vr0, vr0
258 ; CHECK-DF-NEXT: rts16
260 ; CHECK-DF2-LABEL: fpextR_double_0:
261 ; CHECK-DF2: # %bb.0: # %entry
262 ; CHECK-DF2-NEXT: fstod vr0, vr0
263 ; CHECK-DF2-NEXT: rts16
265 %fpext = fpext float %x to double