Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: tests_lit/llvm2ice_tests/fp.pnacl.ll

Issue 961413002: Subzero: Clean up the runtime implementation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Change static helper strings to be char* instead of IceString Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | tests_lit/llvm2ice_tests/vector-bitcast.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ; This tries to be a comprehensive test of f32 and f64 operations. 1 ; This tries to be a comprehensive test of f32 and f64 operations.
2 ; The CHECK lines are only checking for basic instruction patterns 2 ; The CHECK lines are only checking for basic instruction patterns
3 ; that should be present regardless of the optimization level, so 3 ; that should be present regardless of the optimization level, so
4 ; there are no special OPTM1 match lines. 4 ; there are no special OPTM1 match lines.
5 5
6 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 | FileCheck %s 6 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 | FileCheck %s
7 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 | FileCheck %s 7 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 | FileCheck %s
8 8
9 @__init_array_start = internal constant [0 x i8] zeroinitializer, align 4 9 @__init_array_start = internal constant [0 x i8] zeroinitializer, align 4
10 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4 10 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 ; CHECK-LABEL: fpext 200 ; CHECK-LABEL: fpext
201 ; CHECK: cvtss2sd 201 ; CHECK: cvtss2sd
202 ; CHECK: fld 202 ; CHECK: fld
203 203
204 define internal i64 @doubleToSigned64(double %a) { 204 define internal i64 @doubleToSigned64(double %a) {
205 entry: 205 entry:
206 %conv = fptosi double %a to i64 206 %conv = fptosi double %a to i64
207 ret i64 %conv 207 ret i64 %conv
208 } 208 }
209 ; CHECK-LABEL: doubleToSigned64 209 ; CHECK-LABEL: doubleToSigned64
210 ; CHECK: call {{.*}} R_{{.*}} cvtdtosi64 210 ; CHECK: call {{.*}} R_{{.*}} __Sz_fptosi_f64_i64
211 211
212 define internal i64 @floatToSigned64(float %a) { 212 define internal i64 @floatToSigned64(float %a) {
213 entry: 213 entry:
214 %conv = fptosi float %a to i64 214 %conv = fptosi float %a to i64
215 ret i64 %conv 215 ret i64 %conv
216 } 216 }
217 ; CHECK-LABEL: floatToSigned64 217 ; CHECK-LABEL: floatToSigned64
218 ; CHECK: call {{.*}} R_{{.*}} cvtftosi64 218 ; CHECK: call {{.*}} R_{{.*}} __Sz_fptosi_f32_i64
219 219
220 define internal i64 @doubleToUnsigned64(double %a) { 220 define internal i64 @doubleToUnsigned64(double %a) {
221 entry: 221 entry:
222 %conv = fptoui double %a to i64 222 %conv = fptoui double %a to i64
223 ret i64 %conv 223 ret i64 %conv
224 } 224 }
225 ; CHECK-LABEL: doubleToUnsigned64 225 ; CHECK-LABEL: doubleToUnsigned64
226 ; CHECK: call {{.*}} R_{{.*}} cvtdtoui64 226 ; CHECK: call {{.*}} R_{{.*}} __Sz_fptoui_f64_i64
227 227
228 define internal i64 @floatToUnsigned64(float %a) { 228 define internal i64 @floatToUnsigned64(float %a) {
229 entry: 229 entry:
230 %conv = fptoui float %a to i64 230 %conv = fptoui float %a to i64
231 ret i64 %conv 231 ret i64 %conv
232 } 232 }
233 ; CHECK-LABEL: floatToUnsigned64 233 ; CHECK-LABEL: floatToUnsigned64
234 ; CHECK: call {{.*}} R_{{.*}} cvtftoui64 234 ; CHECK: call {{.*}} R_{{.*}} __Sz_fptoui_f32_i64
235 235
236 define internal i32 @doubleToSigned32(double %a) { 236 define internal i32 @doubleToSigned32(double %a) {
237 entry: 237 entry:
238 %conv = fptosi double %a to i32 238 %conv = fptosi double %a to i32
239 ret i32 %conv 239 ret i32 %conv
240 } 240 }
241 ; CHECK-LABEL: doubleToSigned32 241 ; CHECK-LABEL: doubleToSigned32
242 ; CHECK: cvttsd2si 242 ; CHECK: cvttsd2si
243 243
244 define internal i32 @doubleToSigned32Const() { 244 define internal i32 @doubleToSigned32Const() {
(...skipping 11 matching lines...) Expand all
256 } 256 }
257 ; CHECK-LABEL: floatToSigned32 257 ; CHECK-LABEL: floatToSigned32
258 ; CHECK: cvttss2si 258 ; CHECK: cvttss2si
259 259
260 define internal i32 @doubleToUnsigned32(double %a) { 260 define internal i32 @doubleToUnsigned32(double %a) {
261 entry: 261 entry:
262 %conv = fptoui double %a to i32 262 %conv = fptoui double %a to i32
263 ret i32 %conv 263 ret i32 %conv
264 } 264 }
265 ; CHECK-LABEL: doubleToUnsigned32 265 ; CHECK-LABEL: doubleToUnsigned32
266 ; CHECK: call {{.*}} R_{{.*}} cvtdtoui32 266 ; CHECK: call {{.*}} R_{{.*}} __Sz_fptoui_f64_i32
267 267
268 define internal i32 @floatToUnsigned32(float %a) { 268 define internal i32 @floatToUnsigned32(float %a) {
269 entry: 269 entry:
270 %conv = fptoui float %a to i32 270 %conv = fptoui float %a to i32
271 ret i32 %conv 271 ret i32 %conv
272 } 272 }
273 ; CHECK-LABEL: floatToUnsigned32 273 ; CHECK-LABEL: floatToUnsigned32
274 ; CHECK: call {{.*}} R_{{.*}} cvtftoui32 274 ; CHECK: call {{.*}} R_{{.*}} __Sz_fptoui_f32_i32
275 275
276 define internal i32 @doubleToSigned16(double %a) { 276 define internal i32 @doubleToSigned16(double %a) {
277 entry: 277 entry:
278 %conv = fptosi double %a to i16 278 %conv = fptosi double %a to i16
279 %conv.ret_ext = sext i16 %conv to i32 279 %conv.ret_ext = sext i16 %conv to i32
280 ret i32 %conv.ret_ext 280 ret i32 %conv.ret_ext
281 } 281 }
282 ; CHECK-LABEL: doubleToSigned16 282 ; CHECK-LABEL: doubleToSigned16
283 ; CHECK: cvttsd2si 283 ; CHECK: cvttsd2si
284 ; CHECK: movsx 284 ; CHECK: movsx
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 ; CHECK-LABEL: floatToUnsigned1 372 ; CHECK-LABEL: floatToUnsigned1
373 ; CHECK: cvttss2si 373 ; CHECK: cvttss2si
374 ; CHECK: and eax,0x1 374 ; CHECK: and eax,0x1
375 375
376 define internal double @signed64ToDouble(i64 %a) { 376 define internal double @signed64ToDouble(i64 %a) {
377 entry: 377 entry:
378 %conv = sitofp i64 %a to double 378 %conv = sitofp i64 %a to double
379 ret double %conv 379 ret double %conv
380 } 380 }
381 ; CHECK-LABEL: signed64ToDouble 381 ; CHECK-LABEL: signed64ToDouble
382 ; CHECK: call {{.*}} R_{{.*}} cvtsi64tod 382 ; CHECK: call {{.*}} R_{{.*}} __Sz_sitofp_i64_f64
383 ; CHECK: fstp QWORD 383 ; CHECK: fstp QWORD
384 384
385 define internal float @signed64ToFloat(i64 %a) { 385 define internal float @signed64ToFloat(i64 %a) {
386 entry: 386 entry:
387 %conv = sitofp i64 %a to float 387 %conv = sitofp i64 %a to float
388 ret float %conv 388 ret float %conv
389 } 389 }
390 ; CHECK-LABEL: signed64ToFloat 390 ; CHECK-LABEL: signed64ToFloat
391 ; CHECK: call {{.*}} R_{{.*}} cvtsi64tof 391 ; CHECK: call {{.*}} R_{{.*}} __Sz_sitofp_i64_f32
392 ; CHECK: fstp DWORD 392 ; CHECK: fstp DWORD
393 393
394 define internal double @unsigned64ToDouble(i64 %a) { 394 define internal double @unsigned64ToDouble(i64 %a) {
395 entry: 395 entry:
396 %conv = uitofp i64 %a to double 396 %conv = uitofp i64 %a to double
397 ret double %conv 397 ret double %conv
398 } 398 }
399 ; CHECK-LABEL: unsigned64ToDouble 399 ; CHECK-LABEL: unsigned64ToDouble
400 ; CHECK: call {{.*}} R_{{.*}} cvtui64tod 400 ; CHECK: call {{.*}} R_{{.*}} __Sz_uitofp_i64_f64
401 ; CHECK: fstp 401 ; CHECK: fstp
402 402
403 define internal float @unsigned64ToFloat(i64 %a) { 403 define internal float @unsigned64ToFloat(i64 %a) {
404 entry: 404 entry:
405 %conv = uitofp i64 %a to float 405 %conv = uitofp i64 %a to float
406 ret float %conv 406 ret float %conv
407 } 407 }
408 ; CHECK-LABEL: unsigned64ToFloat 408 ; CHECK-LABEL: unsigned64ToFloat
409 ; CHECK: call {{.*}} R_{{.*}} cvtui64tof 409 ; CHECK: call {{.*}} R_{{.*}} __Sz_uitofp_i64_f32
410 ; CHECK: fstp 410 ; CHECK: fstp
411 411
412 define internal double @unsigned64ToDoubleConst() { 412 define internal double @unsigned64ToDoubleConst() {
413 entry: 413 entry:
414 %conv = uitofp i64 12345678901234 to double 414 %conv = uitofp i64 12345678901234 to double
415 ret double %conv 415 ret double %conv
416 } 416 }
417 ; CHECK-LABEL: unsigned64ToDouble 417 ; CHECK-LABEL: unsigned64ToDouble
418 ; CHECK: mov DWORD PTR [esp+0x4],0xb3a 418 ; CHECK: mov DWORD PTR [esp+0x4],0xb3a
419 ; CHECK: mov DWORD PTR [esp],0x73ce2ff2 419 ; CHECK: mov DWORD PTR [esp],0x73ce2ff2
420 ; CHECK: call {{.*}} R_{{.*}} cvtui64tod 420 ; CHECK: call {{.*}} R_{{.*}} __Sz_uitofp_i64_f64
421 ; CHECK: fstp 421 ; CHECK: fstp
422 422
423 define internal double @signed32ToDouble(i32 %a) { 423 define internal double @signed32ToDouble(i32 %a) {
424 entry: 424 entry:
425 %conv = sitofp i32 %a to double 425 %conv = sitofp i32 %a to double
426 ret double %conv 426 ret double %conv
427 } 427 }
428 ; CHECK-LABEL: signed32ToDouble 428 ; CHECK-LABEL: signed32ToDouble
429 ; CHECK: cvtsi2sd 429 ; CHECK: cvtsi2sd
430 ; CHECK: fld 430 ; CHECK: fld
(...skipping 15 matching lines...) Expand all
446 ; CHECK-LABEL: signed32ToFloat 446 ; CHECK-LABEL: signed32ToFloat
447 ; CHECK: cvtsi2ss 447 ; CHECK: cvtsi2ss
448 ; CHECK: fld 448 ; CHECK: fld
449 449
450 define internal double @unsigned32ToDouble(i32 %a) { 450 define internal double @unsigned32ToDouble(i32 %a) {
451 entry: 451 entry:
452 %conv = uitofp i32 %a to double 452 %conv = uitofp i32 %a to double
453 ret double %conv 453 ret double %conv
454 } 454 }
455 ; CHECK-LABEL: unsigned32ToDouble 455 ; CHECK-LABEL: unsigned32ToDouble
456 ; CHECK: call {{.*}} R_{{.*}} cvtui32tod 456 ; CHECK: call {{.*}} R_{{.*}} __Sz_uitofp_i32_f64
457 ; CHECK: fstp QWORD 457 ; CHECK: fstp QWORD
458 458
459 define internal float @unsigned32ToFloat(i32 %a) { 459 define internal float @unsigned32ToFloat(i32 %a) {
460 entry: 460 entry:
461 %conv = uitofp i32 %a to float 461 %conv = uitofp i32 %a to float
462 ret float %conv 462 ret float %conv
463 } 463 }
464 ; CHECK-LABEL: unsigned32ToFloat 464 ; CHECK-LABEL: unsigned32ToFloat
465 ; CHECK: call {{.*}} R_{{.*}} cvtui32tof 465 ; CHECK: call {{.*}} R_{{.*}} __Sz_uitofp_i32_f32
466 ; CHECK: fstp DWORD 466 ; CHECK: fstp DWORD
467 467
468 define internal double @signed16ToDouble(i32 %a) { 468 define internal double @signed16ToDouble(i32 %a) {
469 entry: 469 entry:
470 %a.arg_trunc = trunc i32 %a to i16 470 %a.arg_trunc = trunc i32 %a to i16
471 %conv = sitofp i16 %a.arg_trunc to double 471 %conv = sitofp i16 %a.arg_trunc to double
472 ret double %conv 472 ret double %conv
473 } 473 }
474 ; CHECK-LABEL: signed16ToDouble 474 ; CHECK-LABEL: signed16ToDouble
475 ; CHECK: cvtsi2sd 475 ; CHECK: cvtsi2sd
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 define internal double @selectDoubleVarVar(double %a, double %b) { 1174 define internal double @selectDoubleVarVar(double %a, double %b) {
1175 entry: 1175 entry:
1176 %cmp = fcmp olt double %a, %b 1176 %cmp = fcmp olt double %a, %b
1177 %cond = select i1 %cmp, double %a, double %b 1177 %cond = select i1 %cmp, double %a, double %b
1178 ret double %cond 1178 ret double %cond
1179 } 1179 }
1180 ; CHECK-LABEL: selectDoubleVarVar 1180 ; CHECK-LABEL: selectDoubleVarVar
1181 ; CHECK: ucomisd 1181 ; CHECK: ucomisd
1182 ; CHECK: ja 1182 ; CHECK: ja
1183 ; CHECK: fld 1183 ; CHECK: fld
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | tests_lit/llvm2ice_tests/vector-bitcast.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698