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

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

Issue 639543002: Add cross test for vector itofp and fptoi casts. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: stuff Created 6 years, 2 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
« pydir/szbuild.py ('K') | « runtime/szrt_i686.ll ('k') | no next file » | 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 ; TODO(jvoung): fix extra "CALLTARGETS" run. The llvm-objdump symbolizer 6 ; TODO(jvoung): fix extra "CALLTARGETS" run. The llvm-objdump symbolizer
7 ; doesn't know how to symbolize non-section-local functions. 7 ; doesn't know how to symbolize non-section-local functions.
8 ; The newer LLVM 3.6 one does work, but watch out for other bugs. 8 ; The newer LLVM 3.6 one does work, but watch out for other bugs.
9 9
10 ; RUN: %p2i -i %s --args -O2 --verbose none \ 10 ; RUN: %p2i -i %s --args -O2 --verbose none \
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 ; CALLTARGETS: call cvtftoui64 263 ; CALLTARGETS: call cvtftoui64
264 264
265 define internal i32 @doubleToSigned32(double %a) { 265 define internal i32 @doubleToSigned32(double %a) {
266 entry: 266 entry:
267 %conv = fptosi double %a to i32 267 %conv = fptosi double %a to i32
268 ret i32 %conv 268 ret i32 %conv
269 } 269 }
270 ; CHECK-LABEL: doubleToSigned32 270 ; CHECK-LABEL: doubleToSigned32
271 ; CHECK: cvttsd2si 271 ; CHECK: cvttsd2si
272 272
273 define internal i32 @doubleToSigned32Const() {
274 entry:
275 %conv = fptosi double 867.5309 to i32
276 ret i32 %conv
277 }
278 ; CHECK-LABEL: doubleToSigned32Const
279 ; CHECK: cvttsd2si
280
273 define internal i32 @floatToSigned32(float %a) { 281 define internal i32 @floatToSigned32(float %a) {
274 entry: 282 entry:
275 %conv = fptosi float %a to i32 283 %conv = fptosi float %a to i32
276 ret i32 %conv 284 ret i32 %conv
277 } 285 }
278 ; CHECK-LABEL: floatToSigned32 286 ; CHECK-LABEL: floatToSigned32
279 ; CHECK: cvttss2si 287 ; CHECK: cvttss2si
280 288
281 define internal i32 @doubleToUnsigned32(double %a) { 289 define internal i32 @doubleToUnsigned32(double %a) {
282 entry: 290 entry:
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 466
459 define internal double @signed32ToDouble(i32 %a) { 467 define internal double @signed32ToDouble(i32 %a) {
460 entry: 468 entry:
461 %conv = sitofp i32 %a to double 469 %conv = sitofp i32 %a to double
462 ret double %conv 470 ret double %conv
463 } 471 }
464 ; CHECK-LABEL: signed32ToDouble 472 ; CHECK-LABEL: signed32ToDouble
465 ; CHECK: cvtsi2sd 473 ; CHECK: cvtsi2sd
466 ; CHECK: fld 474 ; CHECK: fld
467 475
476 define internal double @signed32ToDoubleConst() {
477 entry:
478 %conv = sitofp i32 123 to double
479 ret double %conv
480 }
481 ; CHECK-LABEL: signed32ToDoubleConst
482 ; CHECK: cvtsi2sd {{.*[^1]}}
483 ; CHECK: fld
484
468 define internal float @signed32ToFloat(i32 %a) { 485 define internal float @signed32ToFloat(i32 %a) {
469 entry: 486 entry:
470 %conv = sitofp i32 %a to float 487 %conv = sitofp i32 %a to float
471 ret float %conv 488 ret float %conv
472 } 489 }
473 ; CHECK-LABEL: signed32ToFloat 490 ; CHECK-LABEL: signed32ToFloat
474 ; CHECK: cvtsi2ss 491 ; CHECK: cvtsi2ss
475 ; CHECK: fld 492 ; CHECK: fld
476 493
477 define internal double @unsigned32ToDouble(i32 %a) { 494 define internal double @unsigned32ToDouble(i32 %a) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 define internal double @unsigned16ToDouble(i32 %a) { 536 define internal double @unsigned16ToDouble(i32 %a) {
520 entry: 537 entry:
521 %a.arg_trunc = trunc i32 %a to i16 538 %a.arg_trunc = trunc i32 %a to i16
522 %conv = uitofp i16 %a.arg_trunc to double 539 %conv = uitofp i16 %a.arg_trunc to double
523 ret double %conv 540 ret double %conv
524 } 541 }
525 ; CHECK-LABEL: unsigned16ToDouble 542 ; CHECK-LABEL: unsigned16ToDouble
526 ; CHECK: cvtsi2sd 543 ; CHECK: cvtsi2sd
527 ; CHECK: fld 544 ; CHECK: fld
528 545
546 define internal double @unsigned16ToDoubleConst() {
547 entry:
548 %conv = uitofp i16 12345 to double
549 ret double %conv
550 }
551 ; CHECK-LABEL: unsigned16ToDoubleConst
552 ; CHECK: cvtsi2sd
553 ; CHECK: fld
554
529 define internal float @unsigned16ToFloat(i32 %a) { 555 define internal float @unsigned16ToFloat(i32 %a) {
530 entry: 556 entry:
531 %a.arg_trunc = trunc i32 %a to i16 557 %a.arg_trunc = trunc i32 %a to i16
532 %conv = uitofp i16 %a.arg_trunc to float 558 %conv = uitofp i16 %a.arg_trunc to float
533 ret float %conv 559 ret float %conv
534 } 560 }
535 ; CHECK-LABEL: unsigned16ToFloat 561 ; CHECK-LABEL: unsigned16ToFloat
536 ; CHECK: cvtsi2ss 562 ; CHECK: cvtsi2ss
537 ; CHECK: fld 563 ; CHECK: fld
538 564
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 define internal float @unsigned1ToFloat(i32 %a) { 615 define internal float @unsigned1ToFloat(i32 %a) {
590 entry: 616 entry:
591 %a.arg_trunc = trunc i32 %a to i1 617 %a.arg_trunc = trunc i32 %a to i1
592 %conv = uitofp i1 %a.arg_trunc to float 618 %conv = uitofp i1 %a.arg_trunc to float
593 ret float %conv 619 ret float %conv
594 } 620 }
595 ; CHECK-LABEL: unsigned1ToFloat 621 ; CHECK-LABEL: unsigned1ToFloat
596 ; CHECK: cvtsi2ss 622 ; CHECK: cvtsi2ss
597 ; CHECK: fld 623 ; CHECK: fld
598 624
625 define internal float @int32BitcastToFloat(i32 %a) {
626 entry:
627 %conv = bitcast i32 %a to float
628 ret float %conv
629 }
630 ; CHECK-LABEL: int32BitcastToFloat
631 ; CHECK: mov
632
633 define internal float @int32BitcastToFloatConst() {
634 entry:
635 %conv = bitcast i32 8675309 to float
636 ret float %conv
637 }
638 ; CHECK-LABEL: int32BitcastToFloatConst
639 ; CHECK: mov
640
641 define internal double @int64BitcastToDouble(i64 %a) {
642 entry:
643 %conv = bitcast i64 %a to double
644 ret double %conv
645 }
646 ; CHECK-LABEL: int64BitcastToDouble
647 ; CHECK: mov
648
649 define internal double @int64BitcastToDoubleConst() {
650 entry:
651 %conv = bitcast i64 9035768 to double
652 ret double %conv
653 }
654 ; CHECK-LABEL: int64BitcastToDoubleConst
655 ; CHECK: mov
656
599 define internal void @fcmpEq(float %a, float %b, double %c, double %d) { 657 define internal void @fcmpEq(float %a, float %b, double %c, double %d) {
600 entry: 658 entry:
601 %cmp = fcmp oeq float %a, %b 659 %cmp = fcmp oeq float %a, %b
602 br i1 %cmp, label %if.then, label %if.end 660 br i1 %cmp, label %if.then, label %if.end
603 661
604 if.then: ; preds = %entry 662 if.then: ; preds = %entry
605 call void @func() 663 call void @func()
606 br label %if.end 664 br label %if.end
607 665
608 if.end: ; preds = %if.then, %entry 666 if.end: ; preds = %if.then, %entry
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 %cmp = fcmp olt double %a, %b 1227 %cmp = fcmp olt double %a, %b
1170 %cond = select i1 %cmp, double %a, double %b 1228 %cond = select i1 %cmp, double %a, double %b
1171 ret double %cond 1229 ret double %cond
1172 } 1230 }
1173 ; CHECK-LABEL: selectDoubleVarVar 1231 ; CHECK-LABEL: selectDoubleVarVar
1174 ; CHECK: ucomisd 1232 ; CHECK: ucomisd
1175 ; CHECK: ja {{[0-9]}} 1233 ; CHECK: ja {{[0-9]}}
1176 ; CHECK: fld 1234 ; CHECK: fld
1177 1235
1178 ; ERRORS-NOT: ICE translation error 1236 ; ERRORS-NOT: ICE translation error
OLDNEW
« pydir/szbuild.py ('K') | « runtime/szrt_i686.ll ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698