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

Side by Side Diff: tests_lit/llvm2ice_tests/nacl-other-intrinsics.ll

Issue 2368343003: Subzero, MIPS32: Intrinsic call Bswap for i16, i32 and i64 (Closed)
Patch Set: Created 4 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
OLDNEW
1 ; This tests the NaCl intrinsics not related to atomic operations. 1 ; This tests the NaCl intrinsics not related to atomic operations.
2 2
3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ 3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
4 ; RUN: --target x8632 --sandbox -i %s --args -O2 \ 4 ; RUN: --target x8632 --sandbox -i %s --args -O2 \
5 ; RUN: -allow-externally-defined-symbols \ 5 ; RUN: -allow-externally-defined-symbols \
6 ; RUN: | %if --need=target_X8632 --command FileCheck %s 6 ; RUN: | %if --need=target_X8632 --command FileCheck %s
7 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ 7 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
8 ; RUN: --target x8632 --sandbox -i %s --args -Om1 \ 8 ; RUN: --target x8632 --sandbox -i %s --args -Om1 \
9 ; RUN: -allow-externally-defined-symbols \ 9 ; RUN: -allow-externally-defined-symbols \
10 ; RUN: | %if --need=target_X8632 --command FileCheck %s 10 ; RUN: | %if --need=target_X8632 --command FileCheck %s
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 %r_zext = zext i16 %r to i32 346 %r_zext = zext i16 %r to i32
347 ret i32 %r_zext 347 ret i32 %r_zext
348 } 348 }
349 ; CHECK-LABEL: test_bswap_16 349 ; CHECK-LABEL: test_bswap_16
350 ; Make sure this is the right operand size so that the most significant bit 350 ; Make sure this is the right operand size so that the most significant bit
351 ; to least significant bit rotation happens at the right boundary. 351 ; to least significant bit rotation happens at the right boundary.
352 ; CHECK: rol {{[abcd]x|si|di|bp|word ptr}},0x8 352 ; CHECK: rol {{[abcd]x|si|di|bp|word ptr}},0x8
353 ; ARM32-LABEL: test_bswap_16 353 ; ARM32-LABEL: test_bswap_16
354 ; ARM32: rev 354 ; ARM32: rev
355 ; ARM32: lsr {{.*}} #16 355 ; ARM32: lsr {{.*}} #16
356 ; MIPS32-LABEL: test_bswap_16
357 ; MIPS32: sll {{.*}},0x8
358 ; MIPS32: lui {{.*}},0xff
359 ; MIPS32: and
360 ; MIPS32: sll {{.*}},0x18
361 ; MIPS32: or
362 ; MIPS32: srl {{.*}},0x10
363 ; MIPS32: andi {{.*}},0xffff
356 364
357 define internal i32 @test_bswap_32(i32 %x) { 365 define internal i32 @test_bswap_32(i32 %x) {
358 entry: 366 entry:
359 %r = call i32 @llvm.bswap.i32(i32 %x) 367 %r = call i32 @llvm.bswap.i32(i32 %x)
360 ret i32 %r 368 ret i32 %r
361 } 369 }
362 ; CHECK-LABEL: test_bswap_32 370 ; CHECK-LABEL: test_bswap_32
363 ; CHECK: bswap e{{.*}} 371 ; CHECK: bswap e{{.*}}
364 ; ARM32-LABEL: test_bswap_32 372 ; ARM32-LABEL: test_bswap_32
365 ; ARM32: rev 373 ; ARM32: rev
374 ; MIPS32-LABEL: test_bswap_32
375 ; MIPS32: srl {{.*}},0x18
376 ; MIPS32: srl {{.*}},0x8
377 ; MIPS32: andi {{.*}},0xff00
378 ; MIPS32: or
379 ; MIPS32: sll {{.*}},0x8
380 ; MIPS32: lui {{.*}},0xff
381 ; MIPS32: and
382 ; MIPS32: sll {{.*}},0x18
383 ; MIPS32: or
384 ; MIPS32: or
366 385
367 define internal i64 @test_bswap_64(i64 %x) { 386 define internal i64 @test_bswap_64(i64 %x) {
368 entry: 387 entry:
369 %r = call i64 @llvm.bswap.i64(i64 %x) 388 %r = call i64 @llvm.bswap.i64(i64 %x)
370 ret i64 %r 389 ret i64 %r
371 } 390 }
372 ; CHECK-LABEL: test_bswap_64 391 ; CHECK-LABEL: test_bswap_64
373 ; CHECK: bswap e{{.*}} 392 ; CHECK: bswap e{{.*}}
374 ; CHECK: bswap e{{.*}} 393 ; CHECK: bswap e{{.*}}
375 ; ARM32-LABEL: test_bswap_64 394 ; ARM32-LABEL: test_bswap_64
376 ; ARM32: rev 395 ; ARM32: rev
377 ; ARM32: rev 396 ; ARM32: rev
397 ; MIPS32-LABEL: test_bswap_64
398 ; MIPS32: sll {{.*}},0x8
399 ; MIPS32: srl {{.*}},0x18
400 ; MIPS32: srl {{.*}},0x8
401 ; MIPS32: andi {{.*}},0xff00
402 ; MIPS32: lui {{.*}},0xff
403 ; MIPS32: or
404 ; MIPS32: and
405 ; MIPS32: sll {{.*}},0x18
406 ; MIPS32: or
407 ; MIPS32: srl {{.*}},0x18
408 ; MIPS32: srl {{.*}},0x8
409 ; MIPS32: andi {{.*}},0xff00
410 ; MIPS32: or
411 ; MIPS32: or
412 ; MIPS32: sll {{.*}},0x8
413 ; MIPS32: and
414 ; MIPS32: sll {{.*}},0x18
415 ; MIPS32: or
416 ; MIPS32: or
378 417
379 define internal i64 @test_bswap_64_undef() { 418 define internal i64 @test_bswap_64_undef() {
380 entry: 419 entry:
381 %r = call i64 @llvm.bswap.i64(i64 undef) 420 %r = call i64 @llvm.bswap.i64(i64 undef)
382 ret i64 %r 421 ret i64 %r
383 } 422 }
384 ; CHECK-LABEL: test_bswap_64_undef 423 ; CHECK-LABEL: test_bswap_64_undef
385 ; CHECK: bswap e{{.*}} 424 ; CHECK: bswap e{{.*}}
386 ; CHECK: bswap e{{.*}} 425 ; CHECK: bswap e{{.*}}
387 ; ARM32-LABEL: test_bswap_64 426 ; ARM32-LABEL: test_bswap_64
388 ; ARM32: rev 427 ; ARM32: rev
389 ; ARM32: rev 428 ; ARM32: rev
429 ; MIPS32-LABEL: test_bswap_64_undef
430 ; MIPS32: sll {{.*}},0x8
431 ; MIPS32: srl {{.*}},0x18
432 ; MIPS32: srl {{.*}},0x8
433 ; MIPS32: andi {{.*}},0xff00
434 ; MIPS32: lui {{.*}},0xff
435 ; MIPS32: or
436 ; MIPS32: and
437 ; MIPS32: sll {{.*}},0x18
438 ; MIPS32: or
439 ; MIPS32: srl {{.*}},0x18
440 ; MIPS32: srl {{.*}},0x8
441 ; MIPS32: andi {{.*}},0xff00
442 ; MIPS32: or
443 ; MIPS32: or
444 ; MIPS32: sll {{.*}},0x8
445 ; MIPS32: and
446 ; MIPS32: sll {{.*}},0x18
447 ; MIPS32: or
448 ; MIPS32: or
390 449
391 define internal i32 @test_ctlz_32(i32 %x) { 450 define internal i32 @test_ctlz_32(i32 %x) {
392 entry: 451 entry:
393 %r = call i32 @llvm.ctlz.i32(i32 %x, i1 false) 452 %r = call i32 @llvm.ctlz.i32(i32 %x, i1 false)
394 ret i32 %r 453 ret i32 %r
395 } 454 }
396 ; CHECK-LABEL: test_ctlz_32 455 ; CHECK-LABEL: test_ctlz_32
397 ; TODO(jvoung): If we detect that LZCNT is supported, then use that 456 ; TODO(jvoung): If we detect that LZCNT is supported, then use that
398 ; and avoid the need to do the cmovne and xor stuff to guarantee that 457 ; and avoid the need to do the cmovne and xor stuff to guarantee that
399 ; the result is well-defined w/ input == 0. 458 ; the result is well-defined w/ input == 0.
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 ; CHECK: lea {{.*}},[esp+0x10] 668 ; CHECK: lea {{.*}},[esp+0x10]
610 ; CHECK: lea {{.*}},[esp+0x10] 669 ; CHECK: lea {{.*}},[esp+0x10]
611 ; CHECK: call 670 ; CHECK: call
612 ; CHECK: mov esp,{{.*}} 671 ; CHECK: mov esp,{{.*}}
613 ; CHECK: mov esp,ebp 672 ; CHECK: mov esp,ebp
614 ; ARM32-LABEL: test_stacksave_multiple 673 ; ARM32-LABEL: test_stacksave_multiple
615 ; ARM32: mov {{.*}}, sp 674 ; ARM32: mov {{.*}}, sp
616 ; ARM32: mov {{.*}}, sp 675 ; ARM32: mov {{.*}}, sp
617 ; ARM32: mov {{.*}}, sp 676 ; ARM32: mov {{.*}}, sp
618 ; ARM32: mov sp, {{.*}} 677 ; ARM32: mov sp, {{.*}}
OLDNEW
« src/IceTargetLoweringMIPS32.cpp ('K') | « tests_lit/assembler/mips32/encoding_intrinsics.ll ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698