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

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

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod 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 | « test/NaCl/ARM/divrem-guards-complex.ll ('k') | test/NaCl/ARM/lit.local.cfg » ('j') | 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: pnacl-llc -mtriple=armv7-unknown-nacl -filetype=asm %s -o - | FileCheck % s
2 ; RUN: pnacl-llc -mtriple=armv7-unknown-nacl -O0 -filetype=asm %s -o - | FileChe ck %s
3
4 ; Test that various bit manipulation intrinsics are supported by the
5 ; NaCl ARM backend.
6
7 declare i16 @llvm.bswap.i16(i16)
8 declare i32 @llvm.bswap.i32(i32)
9 declare i64 @llvm.bswap.i64(i64)
10
11 ; CHECK: test_bswap_16
12 ; CHECK: rev [[REG:r[0-9]+]], {{r[0-9]+}}
13 ; CHECK-NEXT: lsr {{.*}}[[REG]], {{.*}}[[REG]], #16
14 define i16 @test_bswap_16(i16 %a) {
15 %b = call i16 @llvm.bswap.i16(i16 %a)
16 ret i16 %b
17 }
18
19 ; CHECK: test_bswap_const_16
20 ; 0xcdab
21 ; CHECK: movw r0, #52651
22 define i16 @test_bswap_const_16() {
23 ; 0xabcd
24 %a = call i16 @llvm.bswap.i16(i16 43981)
25 ret i16 %a
26 }
27
28 ; CHECK: test_bswap_32
29 ; CHECK: rev [[REG:r[0-9]+]], {{r[0-9]+}}
30 define i32 @test_bswap_32(i32 %a) {
31 %b = call i32 @llvm.bswap.i32(i32 %a)
32 ret i32 %b
33 }
34
35 ; CHECK: test_bswap_const_32
36 ; 0x01ef cdab
37 ; CHECK: movw r0, #52651
38 ; CHECK: movt r0, #495
39 define i32 @test_bswap_const_32() {
40 ; 0xabcdef01
41 %a = call i32 @llvm.bswap.i32(i32 2882400001)
42 ret i32 %a
43 }
44
45 ; CHECK: test_bswap_64
46 ; O0 spills when swapping r0/r1, whereas O2 uses r2 as a temporary.
47 ; CHECK: rev {{r[0-9]+}}, {{r[0-9]+}}
48 ; CHECK: rev r1, {{r[0-9]+}}
49 ; CHECK: mov r0, {{r[0-9]+}}
50 define i64 @test_bswap_64(i64 %a) {
51 %b = call i64 @llvm.bswap.i64(i64 %a)
52 ret i64 %b
53 }
54
55 ; CHECK: test_bswap_const_64
56 ; 0x8967 4523 01ef cdab
57 ; Just checking movw, since O0 and O2 have different schedules for the
58 ; movw/movt of r0/r1.
59 ; CHECK: movw r0, #52651
60 ; CHECK: movw r1, #17699
61 define i64 @test_bswap_const_64() {
62 ; 0xabcdef01 23456789
63 %a = call i64 @llvm.bswap.i64(i64 12379813738877118345)
64 ret i64 %a
65 }
OLDNEW
« no previous file with comments | « test/NaCl/ARM/divrem-guards-complex.ll ('k') | test/NaCl/ARM/lit.local.cfg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698