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

Side by Side Diff: test/NaCl/ARM/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: add tests for consts 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 | « no previous file | test/NaCl/X86/intrinsics_bitmanip.ll » ('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: llc -mtriple=armv7-unknown-nacl -filetype=asm %s -o - | FileCheck %s
Mark Seaborn 2013/05/08 21:39:53 Nit: other files in test/NaCl use "-" rather than
jvoung (off chromium) 2013/05/09 17:23:49 Ah right, renamed.
2 ; RUN: llc -mtriple=armv7-unknown-nacl -O0 -filetype=asm %s -o - | FileCheck %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 ; CHECK: rev [[REG1:r[0-9]+]], {{r[0-9]+}}
47 ; CHECK: rev {{r[0-9]+}}, {{r[0-9]+}}
48 ; CHECK: mov r0, {{.*}}[[REG1]]
49 define i64 @test_bswap_64(i64 %a) {
50 %b = call i64 @llvm.bswap.i64(i64 %a)
51 ret i64 %b
52 }
53
54 ; CHECK: test_bswap_const_64
55 ; 0x8967 4523 01ef cdab
56 ; Just checking movw, since O0 and O2 have different schedules for the
57 ; movw/movt of r0/r1.
58 ; CHECK: movw r0, #52651
59 ; CHECK: movw r1, #17699
60 define i64 @test_bswap_const_64() {
61 ; 0xabcdef01 23456789
62 %a = call i64 @llvm.bswap.i64(i64 12379813738877118345)
63 ret i64 %a
64 }
OLDNEW
« no previous file with comments | « no previous file | test/NaCl/X86/intrinsics_bitmanip.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698