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

Side by Side Diff: test/NaCl/X86/intrinsics-bitmanip.ll

Issue 14971004: Add a llvm lit test for NaCl ARM/X86 support for bswap i16, i32, i64. (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: rename Created 7 years, 7 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 | « test/NaCl/ARM/intrinsics-bitmanip.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
(Empty)
1 ; RUN: llc -mtriple=i686-unknown-nacl -O0 -filetype=asm %s -o - | FileCheck %s \
2 ; RUN: --check-prefix=NACL32
3 ; RUN: llc -mtriple=i686-unknown-nacl -filetype=asm %s -o - | FileCheck %s \
4 ; RUN: --check-prefix=NACL32
5 ; RUN: llc -mtriple=x86_64-unknown-nacl -O0 -filetype=asm %s -o - | \
6 ; RUN: FileCheck %s --check-prefix=NACL64
7 ; RUN: llc -mtriple=x86_64-unknown-nacl -filetype=asm %s -o - | \
8 ; RUN: FileCheck %s --check-prefix=NACL64
9
10 ; Test that various bit manipulation intrinsics are supported by the
11 ; NaCl X86-32 and X86-64 backends.
12
13 declare i16 @llvm.bswap.i16(i16)
14 declare i32 @llvm.bswap.i32(i32)
15 declare i64 @llvm.bswap.i64(i64)
16
17 ; NACL32: test_bswap_16
18 ; NACL32: rolw $8, %{{.*}}
19 ; NACL64: test_bswap_16
20 ; NACL64: rolw $8, %{{.*}}
21 define i16 @test_bswap_16(i16 %a) {
22 %b = call i16 @llvm.bswap.i16(i16 %a)
23 ret i16 %b
24 }
25
26 ; NACL32: test_bswap_const_16
27 ; NACL32: movw $-12885, %ax # imm = 0xFFFFFFFFFFFFCDAB
28 ; NACL64: test_bswap_const_16
29 ; NACL64: movw $-12885, %ax # imm = 0xFFFFFFFFFFFFCDAB
30 define i16 @test_bswap_const_16() {
31 ; 0xabcd
32 %a = call i16 @llvm.bswap.i16(i16 43981)
33 ret i16 %a
34 }
35
36 ; NACL32: test_bswap_32
37 ; NACL32: bswapl %eax
38 ; NACL64: test_bswap_32
39 ; NACL64: bswapl %edi
40 define i32 @test_bswap_32(i32 %a) {
41 %b = call i32 @llvm.bswap.i32(i32 %a)
42 ret i32 %b
43 }
44
45 ; NACL32: test_bswap_const_32
46 ; NACL32: movl $32492971, %eax # imm = 0x1EFCDAB
47 ; NACL64: test_bswap_const_32
48 ; NACL64: movl $32492971, %eax # imm = 0x1EFCDAB
49 define i32 @test_bswap_const_32() {
50 ; 0xabcdef01
51 %a = call i32 @llvm.bswap.i32(i32 2882400001)
52 ret i32 %a
53 }
54
55 ; NACL32: test_bswap_64
56 ; NACL32: bswapl %e{{.*}}
57 ; NACL32: bswapl %e{{.*}}
58 ; NACL64: test_bswap_64
59 ; NACL64: bswapq %rdi
60 define i64 @test_bswap_64(i64 %a) {
61 %b = call i64 @llvm.bswap.i64(i64 %a)
62 ret i64 %b
63 }
64
65 ; NACL32: test_bswap_const_64
66 ; NACL32: movl $32492971, %eax # imm = 0x1EFCDAB
67 ; NACL32: movl $-1989720797, %edx # imm = 0xFFFFFFFF89674523
68 ; NACL64: test_bswap_const_64
69 ; NACL64: movabsq $-8545785751253561941, %rax # imm = 0x8967452301EFCDAB
70 define i64 @test_bswap_const_64(i64 %a) {
71 ; 0xabcdef01 23456789
72 %b = call i64 @llvm.bswap.i64(i64 12379813738877118345)
73 ret i64 %b
74 }
OLDNEW
« no previous file with comments | « test/NaCl/ARM/intrinsics-bitmanip.ll ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698