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

Side by Side Diff: tests_lit/llvm2ice_tests/64bit.pnacl.ll

Issue 2317653004: Subzero, MIPS32: Introduction of genTargetHelperCallFor (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: FREM resolved Created 4 years, 3 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/IceTargetLoweringMIPS32.cpp ('k') | tests_lit/llvm2ice_tests/arith.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 i64 operations, in 1 ; This tries to be a comprehensive test of i64 operations, in
2 ; particular the patterns for lowering i64 operations into constituent 2 ; particular the patterns for lowering i64 operations into constituent
3 ; i32 operations on x86-32. 3 ; i32 operations on x86-32.
4 4
5 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ 5 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
6 ; RUN: --target x8632 -i %s --args -O2 -allow-externally-defined-symbols \ 6 ; RUN: --target x8632 -i %s --args -O2 -allow-externally-defined-symbols \
7 ; RUN: | %if --need=target_X8632 --command FileCheck %s 7 ; RUN: | %if --need=target_X8632 --command FileCheck %s
8 8
9 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ 9 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
10 ; RUN: --target x8632 -i %s --args -Om1 -allow-externally-defined-symbols \ 10 ; RUN: --target x8632 -i %s --args -Om1 -allow-externally-defined-symbols \
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 ; CHECK: call {{.*}} R_{{.*}} __divdi3 401 ; CHECK: call {{.*}} R_{{.*}} __divdi3
402 402
403 ; OPTM1-LABEL: div64BitSigned 403 ; OPTM1-LABEL: div64BitSigned
404 ; OPTM1: call {{.*}} R_{{.*}} __divdi3 404 ; OPTM1: call {{.*}} R_{{.*}} __divdi3
405 ; 405 ;
406 ; ARM32-LABEL: div64BitSigned 406 ; ARM32-LABEL: div64BitSigned
407 ; ARM32: orrs {{r.*}}, {{r.*}} 407 ; ARM32: orrs {{r.*}}, {{r.*}}
408 ; ARM32: bne 408 ; ARM32: bne
409 ; ARM32: bl {{.*}} __divdi3 409 ; ARM32: bl {{.*}} __divdi3
410 410
411 ; MIPS32-LABEL: div64BitSigned
412 ; MIPS32: jal {{.*}} __divdi3
413
411 define internal i64 @div64BitSignedConst(i64 %a) { 414 define internal i64 @div64BitSignedConst(i64 %a) {
412 entry: 415 entry:
413 %div = sdiv i64 %a, 12345678901234 416 %div = sdiv i64 %a, 12345678901234
414 ret i64 %div 417 ret i64 %div
415 } 418 }
416 ; CHECK-LABEL: div64BitSignedConst 419 ; CHECK-LABEL: div64BitSignedConst
417 ; CHECK: mov DWORD PTR [esp+0xc],0xb3a 420 ; CHECK: mov DWORD PTR [esp+0xc],0xb3a
418 ; CHECK: mov DWORD PTR [esp+0x8],0x73ce2ff2 421 ; CHECK: mov DWORD PTR [esp+0x8],0x73ce2ff2
419 ; CHECK: call {{.*}} R_{{.*}} __divdi3 422 ; CHECK: call {{.*}} R_{{.*}} __divdi3
420 ; 423 ;
421 ; OPTM1-LABEL: div64BitSignedConst 424 ; OPTM1-LABEL: div64BitSignedConst
422 ; OPTM1: mov DWORD PTR [esp+0xc],0xb3a 425 ; OPTM1: mov DWORD PTR [esp+0xc],0xb3a
423 ; OPTM1: mov DWORD PTR [esp+0x8],0x73ce2ff2 426 ; OPTM1: mov DWORD PTR [esp+0x8],0x73ce2ff2
424 ; OPTM1: call {{.*}} R_{{.*}} __divdi3 427 ; OPTM1: call {{.*}} R_{{.*}} __divdi3
425 ; 428 ;
426 ; ARM32-LABEL: div64BitSignedConst 429 ; ARM32-LABEL: div64BitSignedConst
427 ; For a constant, we should be able to optimize-out the divide by zero check. 430 ; For a constant, we should be able to optimize-out the divide by zero check.
428 ; ARM32-NOT: orrs 431 ; ARM32-NOT: orrs
429 ; ARM32: movw {{.*}} ; 0x2ff2 432 ; ARM32: movw {{.*}} ; 0x2ff2
430 ; ARM32: movt {{.*}} ; 0x73ce 433 ; ARM32: movt {{.*}} ; 0x73ce
431 ; ARM32: movw {{.*}} ; 0xb3a 434 ; ARM32: movw {{.*}} ; 0xb3a
432 ; ARM32: bl {{.*}} __divdi3 435 ; ARM32: bl {{.*}} __divdi3
433 436
437 ; MIPS32-LABEL: div64BitSignedConst
438 ; MIPS32: jal {{.*}} __divdi3
439
434 define internal i64 @div64BitUnsigned(i64 %a, i64 %b) { 440 define internal i64 @div64BitUnsigned(i64 %a, i64 %b) {
435 entry: 441 entry:
436 %div = udiv i64 %a, %b 442 %div = udiv i64 %a, %b
437 ret i64 %div 443 ret i64 %div
438 } 444 }
439 ; CHECK-LABEL: div64BitUnsigned 445 ; CHECK-LABEL: div64BitUnsigned
440 ; CHECK: call {{.*}} R_{{.*}} __udivdi3 446 ; CHECK: call {{.*}} R_{{.*}} __udivdi3
441 ; 447 ;
442 ; OPTM1-LABEL: div64BitUnsigned 448 ; OPTM1-LABEL: div64BitUnsigned
443 ; OPTM1: call {{.*}} R_{{.*}} __udivdi3 449 ; OPTM1: call {{.*}} R_{{.*}} __udivdi3
444 ; 450 ;
445 ; ARM32-LABEL: div64BitUnsigned 451 ; ARM32-LABEL: div64BitUnsigned
446 ; ARM32: orrs {{r.*}}, {{r.*}} 452 ; ARM32: orrs {{r.*}}, {{r.*}}
447 ; ARM32: bne 453 ; ARM32: bne
448 ; ARM32: bl {{.*}} __udivdi3 454 ; ARM32: bl {{.*}} __udivdi3
449 455
456 ; MIPS32-LABEL: div64BitUnsigned
457 ; MIPS32: jal {{.*}} __udivdi3
458
450 define internal i64 @rem64BitSigned(i64 %a, i64 %b) { 459 define internal i64 @rem64BitSigned(i64 %a, i64 %b) {
451 entry: 460 entry:
452 %rem = srem i64 %a, %b 461 %rem = srem i64 %a, %b
453 ret i64 %rem 462 ret i64 %rem
454 } 463 }
455 ; CHECK-LABEL: rem64BitSigned 464 ; CHECK-LABEL: rem64BitSigned
456 ; CHECK: call {{.*}} R_{{.*}} __moddi3 465 ; CHECK: call {{.*}} R_{{.*}} __moddi3
457 ; 466 ;
458 ; OPTM1-LABEL: rem64BitSigned 467 ; OPTM1-LABEL: rem64BitSigned
459 ; OPTM1: call {{.*}} R_{{.*}} __moddi3 468 ; OPTM1: call {{.*}} R_{{.*}} __moddi3
460 ; 469 ;
461 ; ARM32-LABEL: rem64BitSigned 470 ; ARM32-LABEL: rem64BitSigned
462 ; ARM32: orrs {{r.*}}, {{r.*}} 471 ; ARM32: orrs {{r.*}}, {{r.*}}
463 ; ARM32: bne 472 ; ARM32: bne
464 ; ARM32: bl {{.*}} __moddi3 473 ; ARM32: bl {{.*}} __moddi3
465 474
475 ; MIPS32-LABEL: rem64BitSigned
476 ; MIPS32: jal {{.*}} __moddi3
477
466 define internal i64 @rem64BitUnsigned(i64 %a, i64 %b) { 478 define internal i64 @rem64BitUnsigned(i64 %a, i64 %b) {
467 entry: 479 entry:
468 %rem = urem i64 %a, %b 480 %rem = urem i64 %a, %b
469 ret i64 %rem 481 ret i64 %rem
470 } 482 }
471 ; CHECK-LABEL: rem64BitUnsigned 483 ; CHECK-LABEL: rem64BitUnsigned
472 ; CHECK: call {{.*}} R_{{.*}} __umoddi3 484 ; CHECK: call {{.*}} R_{{.*}} __umoddi3
473 ; 485 ;
474 ; OPTM1-LABEL: rem64BitUnsigned 486 ; OPTM1-LABEL: rem64BitUnsigned
475 ; OPTM1: call {{.*}} R_{{.*}} __umoddi3 487 ; OPTM1: call {{.*}} R_{{.*}} __umoddi3
476 ; 488 ;
477 ; ARM32-LABEL: rem64BitUnsigned 489 ; ARM32-LABEL: rem64BitUnsigned
478 ; ARM32: orrs {{r.*}}, {{r.*}} 490 ; ARM32: orrs {{r.*}}, {{r.*}}
479 ; ARM32: bne 491 ; ARM32: bne
480 ; ARM32: bl {{.*}} __umoddi3 492 ; ARM32: bl {{.*}} __umoddi3
481 493
494 ; MIPS32-LABEL: rem64BitUnsigned
495 ; MIPS32: jal {{.*}} __umoddi3
496
482 define internal i64 @shl64BitSigned(i64 %a, i64 %b) { 497 define internal i64 @shl64BitSigned(i64 %a, i64 %b) {
483 entry: 498 entry:
484 %shl = shl i64 %a, %b 499 %shl = shl i64 %a, %b
485 ret i64 %shl 500 ret i64 %shl
486 } 501 }
487 ; CHECK-LABEL: shl64BitSigned 502 ; CHECK-LABEL: shl64BitSigned
488 ; CHECK: shld 503 ; CHECK: shld
489 ; CHECK: shl e 504 ; CHECK: shl e
490 ; CHECK: test {{.*}},0x20 505 ; CHECK: test {{.*}},0x20
491 ; CHECK: je 506 ; CHECK: je
(...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after
2059 %s = lshr i64 %a, 40 2074 %s = lshr i64 %a, 40
2060 %t = trunc i64 %s to i32 2075 %t = trunc i64 %s to i32
2061 %r = sub i32 %t, 1 2076 %r = sub i32 %t, 1
2062 ret i32 %r 2077 ret i32 %r
2063 ; ARM32-LABEL: subOneToUpperAfterShift 2078 ; ARM32-LABEL: subOneToUpperAfterShift
2064 ; ARM32: subs 2079 ; ARM32: subs
2065 ; ARM32: sbc 2080 ; ARM32: sbc
2066 ; ARM32: lsr 2081 ; ARM32: lsr
2067 ; ARM32: sub 2082 ; ARM32: sub
2068 } 2083 }
OLDNEW
« no previous file with comments | « src/IceTargetLoweringMIPS32.cpp ('k') | tests_lit/llvm2ice_tests/arith.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698